var Bb=Object.defineProperty;var Sb=(n,r,a)=>r in n?Bb(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Ir=(n,r,a)=>Sb(n,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();try{}catch(n){console.error("[wxt] Failed to initialize plugins",n)}function xi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Nb(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var r=n.default;if(typeof r=="function"){var a=function s(){return this instanceof s?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};a.prototype=r.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var o=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(a,s,o.get?o:{enumerable:!0,get:function(){return n[s]}})}),a}var xf={exports:{}},Ol={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Y0;function Tb(){if(Y0)return Ol;Y0=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(s,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var d in o)d!=="key"&&(u[d]=o[d])}else u=o;return o=u.ref,{$$typeof:n,type:s,key:c,ref:o!==void 0?o:null,props:u}}return Ol.Fragment=r,Ol.jsx=a,Ol.jsxs=a,Ol}var P0;function Qb(){return P0||(P0=1,xf.exports=Tb()),xf.exports}var p=Qb(),Cf={exports:{}},Fl={},wf={exports:{}},If={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var K0;function Db(){return K0||(K0=1,function(n){function r(P,ae){var Ne=P.length;P.push(ae);e:for(;0<Ne;){var _e=Ne-1>>>1,G=P[_e];if(0<o(G,ae))P[_e]=ae,P[Ne]=G,Ne=_e;else break e}}function a(P){return P.length===0?null:P[0]}function s(P){if(P.length===0)return null;var ae=P[0],Ne=P.pop();if(Ne!==ae){P[0]=Ne;e:for(var _e=0,G=P.length,ne=G>>>1;_e<ne;){var Ee=2*(_e+1)-1,ke=P[Ee],He=Ee+1,Ke=P[He];if(0>o(ke,Ne))He<G&&0>o(Ke,ke)?(P[_e]=Ke,P[He]=Ne,_e=He):(P[_e]=ke,P[Ee]=Ne,_e=Ee);else if(He<G&&0>o(Ke,Ne))P[_e]=Ke,P[He]=Ne,_e=He;else break e}}return ae}function o(P,ae){var Ne=P.sortIndex-ae.sortIndex;return Ne!==0?Ne:P.id-ae.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();n.unstable_now=function(){return c.now()-d}}var m=[],A=[],b=1,v=null,B=3,T=!1,Q=!1,k=!1,R=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function q(P){for(var ae=a(A);ae!==null;){if(ae.callback===null)s(A);else if(ae.startTime<=P)s(A),ae.sortIndex=ae.expirationTime,r(m,ae);else break;ae=a(A)}}function V(P){if(k=!1,q(P),!Q)if(a(m)!==null)Q=!0,ge||(ge=!0,me());else{var ae=a(A);ae!==null&&pe(V,ae.startTime-P)}}var ge=!1,ce=-1,te=5,J=-1;function K(){return R?!0:!(n.unstable_now()-J<te)}function $(){if(R=!1,ge){var P=n.unstable_now();J=P;var ae=!0;try{e:{Q=!1,k&&(k=!1,O(ce),ce=-1),T=!0;var Ne=B;try{t:{for(q(P),v=a(m);v!==null&&!(v.expirationTime>P&&K());){var _e=v.callback;if(typeof _e=="function"){v.callback=null,B=v.priorityLevel;var G=_e(v.expirationTime<=P);if(P=n.unstable_now(),typeof G=="function"){v.callback=G,q(P),ae=!0;break t}v===a(m)&&s(m),q(P)}else s(m);v=a(m)}if(v!==null)ae=!0;else{var ne=a(A);ne!==null&&pe(V,ne.startTime-P),ae=!1}}break e}finally{v=null,B=Ne,T=!1}ae=void 0}}finally{ae?me():ge=!1}}}var me;if(typeof _=="function")me=function(){_($)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,we=he.port2;he.port1.onmessage=$,me=function(){we.postMessage(null)}}else me=function(){N($,0)};function pe(P,ae){ce=N(function(){P(n.unstable_now())},ae)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(P){P.callback=null},n.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<P?Math.floor(1e3/P):5},n.unstable_getCurrentPriorityLevel=function(){return B},n.unstable_next=function(P){switch(B){case 1:case 2:case 3:var ae=3;break;default:ae=B}var Ne=B;B=ae;try{return P()}finally{B=Ne}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(P,ae){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var Ne=B;B=P;try{return ae()}finally{B=Ne}},n.unstable_scheduleCallback=function(P,ae,Ne){var _e=n.unstable_now();switch(typeof Ne=="object"&&Ne!==null?(Ne=Ne.delay,Ne=typeof Ne=="number"&&0<Ne?_e+Ne:_e):Ne=_e,P){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=Ne+G,P={id:b++,callback:ae,priorityLevel:P,startTime:Ne,expirationTime:G,sortIndex:-1},Ne>_e?(P.sortIndex=Ne,r(A,P),a(m)===null&&P===a(A)&&(k?(O(ce),ce=-1):k=!0,pe(V,Ne-_e))):(P.sortIndex=G,r(m,P),Q||T||(Q=!0,ge||(ge=!0,me()))),P},n.unstable_shouldYield=K,n.unstable_wrapCallback=function(P){var ae=B;return function(){var Ne=B;B=ae;try{return P.apply(this,arguments)}finally{B=Ne}}}}(If)),If}var J0;function Rb(){return J0||(J0=1,wf.exports=Db()),wf.exports}var Bf={exports:{}},ct={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var X0;function kb(){if(X0)return ct;X0=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.iterator;function B(G){return G===null||typeof G!="object"?null:(G=v&&G[v]||G["@@iterator"],typeof G=="function"?G:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,k={};function R(G,ne,Ee){this.props=G,this.context=ne,this.refs=k,this.updater=Ee||T}R.prototype.isReactComponent={},R.prototype.setState=function(G,ne){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,ne,"setState")},R.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function N(){}N.prototype=R.prototype;function O(G,ne,Ee){this.props=G,this.context=ne,this.refs=k,this.updater=Ee||T}var _=O.prototype=new N;_.constructor=O,Q(_,R.prototype),_.isPureReactComponent=!0;var q=Array.isArray,V={H:null,A:null,T:null,S:null,V:null},ge=Object.prototype.hasOwnProperty;function ce(G,ne,Ee,ke,He,Ke){return Ee=Ke.ref,{$$typeof:n,type:G,key:ne,ref:Ee!==void 0?Ee:null,props:Ke}}function te(G,ne){return ce(G.type,ne,void 0,void 0,void 0,G.props)}function J(G){return typeof G=="object"&&G!==null&&G.$$typeof===n}function K(G){var ne={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(Ee){return ne[Ee]})}var $=/\/+/g;function me(G,ne){return typeof G=="object"&&G!==null&&G.key!=null?K(""+G.key):ne.toString(36)}function he(){}function we(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(he,he):(G.status="pending",G.then(function(ne){G.status==="pending"&&(G.status="fulfilled",G.value=ne)},function(ne){G.status==="pending"&&(G.status="rejected",G.reason=ne)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function pe(G,ne,Ee,ke,He){var Ke=typeof G;(Ke==="undefined"||Ke==="boolean")&&(G=null);var Ge=!1;if(G===null)Ge=!0;else switch(Ke){case"bigint":case"string":case"number":Ge=!0;break;case"object":switch(G.$$typeof){case n:case r:Ge=!0;break;case b:return Ge=G._init,pe(Ge(G._payload),ne,Ee,ke,He)}}if(Ge)return He=He(G),Ge=ke===""?"."+me(G,0):ke,q(He)?(Ee="",Ge!=null&&(Ee=Ge.replace($,"$&/")+"/"),pe(He,ne,Ee,"",function(Et){return Et})):He!=null&&(J(He)&&(He=te(He,Ee+(He.key==null||G&&G.key===He.key?"":(""+He.key).replace($,"$&/")+"/")+Ge)),ne.push(He)),1;Ge=0;var yt=ke===""?".":ke+":";if(q(G))for(var We=0;We<G.length;We++)ke=G[We],Ke=yt+me(ke,We),Ge+=pe(ke,ne,Ee,Ke,He);else if(We=B(G),typeof We=="function")for(G=We.call(G),We=0;!(ke=G.next()).done;)ke=ke.value,Ke=yt+me(ke,We++),Ge+=pe(ke,ne,Ee,Ke,He);else if(Ke==="object"){if(typeof G.then=="function")return pe(we(G),ne,Ee,ke,He);throw ne=String(G),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Ge}function P(G,ne,Ee){if(G==null)return G;var ke=[],He=0;return pe(G,ke,"","",function(Ke){return ne.call(Ee,Ke,He++)}),ke}function ae(G){if(G._status===-1){var ne=G._result;ne=ne(),ne.then(function(Ee){(G._status===0||G._status===-1)&&(G._status=1,G._result=Ee)},function(Ee){(G._status===0||G._status===-1)&&(G._status=2,G._result=Ee)}),G._status===-1&&(G._status=0,G._result=ne)}if(G._status===1)return G._result.default;throw G._result}var Ne=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)};function _e(){}return ct.Children={map:P,forEach:function(G,ne,Ee){P(G,function(){ne.apply(this,arguments)},Ee)},count:function(G){var ne=0;return P(G,function(){ne++}),ne},toArray:function(G){return P(G,function(ne){return ne})||[]},only:function(G){if(!J(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},ct.Component=R,ct.Fragment=a,ct.Profiler=o,ct.PureComponent=O,ct.StrictMode=s,ct.Suspense=m,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,ct.__COMPILER_RUNTIME={__proto__:null,c:function(G){return V.H.useMemoCache(G)}},ct.cache=function(G){return function(){return G.apply(null,arguments)}},ct.cloneElement=function(G,ne,Ee){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var ke=Q({},G.props),He=G.key,Ke=void 0;if(ne!=null)for(Ge in ne.ref!==void 0&&(Ke=void 0),ne.key!==void 0&&(He=""+ne.key),ne)!ge.call(ne,Ge)||Ge==="key"||Ge==="__self"||Ge==="__source"||Ge==="ref"&&ne.ref===void 0||(ke[Ge]=ne[Ge]);var Ge=arguments.length-2;if(Ge===1)ke.children=Ee;else if(1<Ge){for(var yt=Array(Ge),We=0;We<Ge;We++)yt[We]=arguments[We+2];ke.children=yt}return ce(G.type,He,void 0,void 0,Ke,ke)},ct.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:u,_context:G},G},ct.createElement=function(G,ne,Ee){var ke,He={},Ke=null;if(ne!=null)for(ke in ne.key!==void 0&&(Ke=""+ne.key),ne)ge.call(ne,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(He[ke]=ne[ke]);var Ge=arguments.length-2;if(Ge===1)He.children=Ee;else if(1<Ge){for(var yt=Array(Ge),We=0;We<Ge;We++)yt[We]=arguments[We+2];He.children=yt}if(G&&G.defaultProps)for(ke in Ge=G.defaultProps,Ge)He[ke]===void 0&&(He[ke]=Ge[ke]);return ce(G,Ke,void 0,void 0,null,He)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(G){return{$$typeof:d,render:G}},ct.isValidElement=J,ct.lazy=function(G){return{$$typeof:b,_payload:{_status:-1,_result:G},_init:ae}},ct.memo=function(G,ne){return{$$typeof:A,type:G,compare:ne===void 0?null:ne}},ct.startTransition=function(G){var ne=V.T,Ee={};V.T=Ee;try{var ke=G(),He=V.S;He!==null&&He(Ee,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(_e,Ne)}catch(Ke){Ne(Ke)}finally{V.T=ne}},ct.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},ct.use=function(G){return V.H.use(G)},ct.useActionState=function(G,ne,Ee){return V.H.useActionState(G,ne,Ee)},ct.useCallback=function(G,ne){return V.H.useCallback(G,ne)},ct.useContext=function(G){return V.H.useContext(G)},ct.useDebugValue=function(){},ct.useDeferredValue=function(G,ne){return V.H.useDeferredValue(G,ne)},ct.useEffect=function(G,ne,Ee){var ke=V.H;if(typeof Ee=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ke.useEffect(G,ne)},ct.useId=function(){return V.H.useId()},ct.useImperativeHandle=function(G,ne,Ee){return V.H.useImperativeHandle(G,ne,Ee)},ct.useInsertionEffect=function(G,ne){return V.H.useInsertionEffect(G,ne)},ct.useLayoutEffect=function(G,ne){return V.H.useLayoutEffect(G,ne)},ct.useMemo=function(G,ne){return V.H.useMemo(G,ne)},ct.useOptimistic=function(G,ne){return V.H.useOptimistic(G,ne)},ct.useReducer=function(G,ne,Ee){return V.H.useReducer(G,ne,Ee)},ct.useRef=function(G){return V.H.useRef(G)},ct.useState=function(G){return V.H.useState(G)},ct.useSyncExternalStore=function(G,ne,Ee){return V.H.useSyncExternalStore(G,ne,Ee)},ct.useTransition=function(){return V.H.useTransition()},ct.version="19.1.0",ct}var $0;function hA(){return $0||($0=1,Bf.exports=kb()),Bf.exports}var Sf={exports:{}},Or={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var W0;function Lb(){if(W0)return Or;W0=1;var n=hA();function r(m){var A="https://react.dev/errors/"+m;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)A+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,A,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:A,implementation:b}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,A){if(m==="font")return"";if(typeof A=="string")return A==="use-credentials"?A:""}return Or.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Or.createPortal=function(m,A){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)throw Error(r(299));return u(m,A,null,b)},Or.flushSync=function(m){var A=c.T,b=s.p;try{if(c.T=null,s.p=2,m)return m()}finally{c.T=A,s.p=b,s.d.f()}},Or.preconnect=function(m,A){typeof m=="string"&&(A?(A=A.crossOrigin,A=typeof A=="string"?A==="use-credentials"?A:"":void 0):A=null,s.d.C(m,A))},Or.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Or.preinit=function(m,A){if(typeof m=="string"&&A&&typeof A.as=="string"){var b=A.as,v=d(b,A.crossOrigin),B=typeof A.integrity=="string"?A.integrity:void 0,T=typeof A.fetchPriority=="string"?A.fetchPriority:void 0;b==="style"?s.d.S(m,typeof A.precedence=="string"?A.precedence:void 0,{crossOrigin:v,integrity:B,fetchPriority:T}):b==="script"&&s.d.X(m,{crossOrigin:v,integrity:B,fetchPriority:T,nonce:typeof A.nonce=="string"?A.nonce:void 0})}},Or.preinitModule=function(m,A){if(typeof m=="string")if(typeof A=="object"&&A!==null){if(A.as==null||A.as==="script"){var b=d(A.as,A.crossOrigin);s.d.M(m,{crossOrigin:b,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0})}}else A==null&&s.d.M(m)},Or.preload=function(m,A){if(typeof m=="string"&&typeof A=="object"&&A!==null&&typeof A.as=="string"){var b=A.as,v=d(b,A.crossOrigin);s.d.L(m,b,{crossOrigin:v,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0,type:typeof A.type=="string"?A.type:void 0,fetchPriority:typeof A.fetchPriority=="string"?A.fetchPriority:void 0,referrerPolicy:typeof A.referrerPolicy=="string"?A.referrerPolicy:void 0,imageSrcSet:typeof A.imageSrcSet=="string"?A.imageSrcSet:void 0,imageSizes:typeof A.imageSizes=="string"?A.imageSizes:void 0,media:typeof A.media=="string"?A.media:void 0})}},Or.preloadModule=function(m,A){if(typeof m=="string")if(A){var b=d(A.as,A.crossOrigin);s.d.m(m,{as:typeof A.as=="string"&&A.as!=="script"?A.as:void 0,crossOrigin:b,integrity:typeof A.integrity=="string"?A.integrity:void 0})}else s.d.m(m)},Or.requestFormReset=function(m){s.d.r(m)},Or.unstable_batchedUpdates=function(m,A){return m(A)},Or.useFormState=function(m,A,b){return c.H.useFormState(m,A,b)},Or.useFormStatus=function(){return c.H.useHostTransitionStatus()},Or.version="19.1.0",Or}var Z0;function Ub(){if(Z0)return Sf.exports;Z0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Sf.exports=Lb(),Sf.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var em;function Mb(){if(em)return Fl;em=1;var n=Rb(),r=hA(),a=Ub();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function c(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 d(e){if(u(e)!==e)throw Error(s(188))}function m(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var f=i.return;if(f===null)break;var g=f.alternate;if(g===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===i)return d(f),e;if(g===l)return d(f),t;g=g.sibling}throw Error(s(188))}if(i.return!==l.return)i=f,l=g;else{for(var C=!1,L=f.child;L;){if(L===i){C=!0,i=f,l=g;break}if(L===l){C=!0,l=f,i=g;break}L=L.sibling}if(!C){for(L=g.child;L;){if(L===i){C=!0,i=g,l=f;break}if(L===l){C=!0,l=g,i=f;break}L=L.sibling}if(!C)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),B=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Q:return"Fragment";case R:return"Profiler";case k:return"StrictMode";case V:return"Suspense";case ge:return"SuspenseList";case J:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case _:return(e.displayName||"Context")+".Provider";case O:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var pe=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},_e=[],G=-1;function ne(e){return{current:e}}function Ee(e){0>G||(e.current=_e[G],_e[G]=null,G--)}function ke(e,t){G++,_e[G]=e.current,e.current=t}var He=ne(null),Ke=ne(null),Ge=ne(null),yt=ne(null);function We(e,t){switch(ke(Ge,t),ke(Ke,e),ke(He,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?b0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=b0(t),e=v0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ee(He),ke(He,e)}function Et(){Ee(He),Ee(Ke),Ee(Ge)}function Kt(e){e.memoizedState!==null&&ke(yt,e);var t=He.current,i=v0(t,e.type);t!==i&&(ke(Ke,e),ke(He,i))}function Sr(e){Ke.current===e&&(Ee(He),Ee(Ke)),yt.current===e&&(Ee(yt),kl._currentValue=Ne)}var Lt=Object.prototype.hasOwnProperty,Ht=n.unstable_scheduleCallback,jt=n.unstable_cancelCallback,Er=n.unstable_shouldYield,Qe=n.unstable_requestPaint,Fe=n.unstable_now,nt=n.unstable_getCurrentPriorityLevel,lt=n.unstable_ImmediatePriority,j=n.unstable_UserBlockingPriority,X=n.unstable_NormalPriority,se=n.unstable_LowPriority,Te=n.unstable_IdlePriority,Re=n.log,xe=n.unstable_setDisableYieldValue,Ve=null,S=null;function E(e){if(typeof Re=="function"&&xe(e),S&&typeof S.setStrictMode=="function")try{S.setStrictMode(Ve,e)}catch{}}var x=Math.clz32?Math.clz32:fe,H=Math.log,W=Math.LN2;function fe(e){return e>>>=0,e===0?32:31-(H(e)/W|0)|0}var be=256,Le=4194304;function gt(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:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;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 ft(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var f=0,g=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var L=l&134217727;return L!==0?(l=L&~g,l!==0?f=gt(l):(C&=L,C!==0?f=gt(C):i||(i=L&~e,i!==0&&(f=gt(i))))):(L=l&~g,L!==0?f=gt(L):C!==0?f=gt(C):i||(i=l&~e,i!==0&&(f=gt(i)))),f===0?0:t!==0&&t!==f&&(t&g)===0&&(g=f&-f,i=t&-t,g>=i||g===32&&(i&4194048)!==0)?t:f}function bt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(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 es(){var e=be;return be<<=1,(be&4194048)===0&&(be=256),e}function sn(){var e=Le;return Le<<=1,(Le&62914560)===0&&(Le=4194304),e}function Ma(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Pn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ts(e,t,i,l,f,g){var C=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var L=e.entanglements,z=e.expirationTimes,ue=e.hiddenUpdates;for(i=C&~i;0<i;){var ve=31-x(i),Se=1<<ve;L[ve]=0,z[ve]=-1;var de=ue[ve];if(de!==null)for(ue[ve]=null,ve=0;ve<de.length;ve++){var Ae=de[ve];Ae!==null&&(Ae.lane&=-536870913)}i&=~Se}l!==0&&Me(e,l,0),g!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=g&~(C&~t))}function Me(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-x(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&4194090}function rs(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-x(i),f=1<<l;f&t|e[l]&t&&(e[l]|=t),i&=~f}}function Ci(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 br(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _a(){var e=ae.p;return e!==0?e:(e=window.event,e===void 0?32:j0(e.type))}function wi(e,t){var i=ae.p;try{return ae.p=e,t()}finally{ae.p=i}}var Jr=Math.random().toString(36).slice(2),_t="__reactFiber$"+Jr,dr="__reactProps$"+Jr,Jt="__reactContainer$"+Jr,Oa="__reactEvents$"+Jr,Kn="__reactListeners$"+Jr,ns="__reactHandles$"+Jr,Ii="__reactResources$"+Jr,En="__reactMarker$"+Jr;function tr(e){delete e[_t],delete e[dr],delete e[Oa],delete e[Kn],delete e[ns]}function kn(e){var t=e[_t];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Jt]||i[_t]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=I0(e);e!==null;){if(i=e[_t])return i;e=I0(e)}return t}e=i,i=e.parentNode}return null}function Jn(e){if(e=e[_t]||e[Jt]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Gr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Ln(e){var t=e[Ii];return t||(t=e[Ii]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gt(e){e[En]=!0}var Bi=new Set,fa={};function Un(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(fa[e]=t,e=0;e<t.length;e++)Bi.add(t[e])}var Xr=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]*$"),Fa={},Si={};function as(e){return Lt.call(Si,e)?!0:Lt.call(Fa,e)?!1:Xr.test(e)?Si[e]=!0:(Fa[e]=!0,!1)}function bn(e,t,i){if(as(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Aa(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Lr(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}var ja,Mn;function vn(e){if(ja===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ja=t&&t[1]||"",Mn=-1<i.stack.indexOf(`
    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ja+e+Mn}var $t=!1;function Ha(e,t){if(!e||$t)return"";$t=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(Ae){var de=Ae}Reflect.construct(e,[],Se)}else{try{Se.call()}catch(Ae){de=Ae}e.call(Se.prototype)}}else{try{throw Error()}catch(Ae){de=Ae}(Se=e())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(Ae){if(Ae&&de&&typeof Ae.stack=="string")return[Ae.stack,de.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),C=g[0],L=g[1];if(C&&L){var z=C.split(`
`),ue=L.split(`
`);for(f=l=0;l<z.length&&!z[l].includes("DetermineComponentFrameRoot");)l++;for(;f<ue.length&&!ue[f].includes("DetermineComponentFrameRoot");)f++;if(l===z.length||f===ue.length)for(l=z.length-1,f=ue.length-1;1<=l&&0<=f&&z[l]!==ue[f];)f--;for(;1<=l&&0<=f;l--,f--)if(z[l]!==ue[f]){if(l!==1||f!==1)do if(l--,f--,0>f||z[l]!==ue[f]){var ve=`
`+z[l].replace(" at new "," at ");return e.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",e.displayName)),ve}while(1<=l&&0<=f);break}}}finally{$t=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?vn(i):""}function is(e){switch(e.tag){case 26:case 27:case 5:return vn(e.type);case 16:return vn("Lazy");case 13:return vn("Suspense");case 19:return vn("SuspenseList");case 0:case 15:return Ha(e.type,!1);case 11:return Ha(e.type.render,!1);case 1:return Ha(e.type,!0);case 31:return vn("Activity");default:return""}}function ss(e){try{var t="";do t+=is(e),e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}function Ot(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tt(e){var t=ut(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,g=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(C){l=""+C,g.call(this,C)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(C){l=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _n(e){e._valueTracker||(e._valueTracker=Tt(e))}function Xn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=ut(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function rr(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}}var Ga=/[\n"\\]/g;function Nr(e){return e.replace(Ga,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ni(e,t,i,l,f,g,C,L){e.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.type=C:e.removeAttribute("type"),t!=null?C==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ot(t)):e.value!==""+Ot(t)&&(e.value=""+Ot(t)):C!=="submit"&&C!=="reset"||e.removeAttribute("value"),t!=null?ha(e,C,Ot(t)):i!=null?ha(e,C,Ot(i)):l!=null&&e.removeAttribute("value"),f==null&&g!=null&&(e.defaultChecked=!!g),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.name=""+Ot(L):e.removeAttribute("name")}function $n(e,t,i,l,f,g,C,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),t!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||t!=null))return;i=i!=null?""+Ot(i):"",t=t!=null?""+Ot(t):i,L||t===e.value||(e.value=t),e.defaultValue=t}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=L?e.checked:!!l,e.defaultChecked=!!l,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.name=C)}function ha(e,t,i){t==="number"&&rr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function xn(e,t,i,l){if(e=e.options,t){t={};for(var f=0;f<i.length;f++)t["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=t.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Ot(i),t=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function Va(e,t,i){if(t!=null&&(t=""+Ot(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ot(i):""}function Ti(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(s(92));if(pe(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=Ot(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l)}function Cn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ga=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 I(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||ga.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function D(e,t,i){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in t)l=t[f],t.hasOwnProperty(f)&&i[f]!==l&&I(e,f,l)}else for(var g in t)t.hasOwnProperty(g)&&I(e,g,t[g])}function F(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 ee=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"],["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"]]),Ie=/^[\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 Be(e){return Ie.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ue=null;function je(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vt=null,Oe=null;function Ar(e){var t=Jn(e);if(t&&(e=t.stateNode)){var i=e[dr]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ni(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Nr(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var f=l[dr]||null;if(!f)throw Error(s(90));Ni(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&Xn(l)}break e;case"textarea":Va(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&xn(e,!!i.multiple,t,!1)}}}var Wt=!1;function Vr(e,t,i){if(Wt)return e(t,i);Wt=!0;try{var l=e(t);return l}finally{if(Wt=!1,(vt!==null||Oe!==null)&&(Po(),vt&&(t=vt,e=Oe,Oe=vt=null,Ar(t),e)))for(t=0;t<e.length;t++)Ar(e[t])}}function ln(e,t){var i=e.stateNode;if(i===null)return null;var l=i[dr]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var Ut=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vt=!1;if(Ut)try{var Ur={};Object.defineProperty(Ur,"passive",{get:function(){Vt=!0}}),window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{Vt=!1}var nr=null,h=null,y=null;function w(){if(y)return y;var e,t=h,i=t.length,l,f="value"in nr?nr.value:nr.textContent,g=f.length;for(e=0;e<i&&t[e]===f[e];e++);var C=i-e;for(l=1;l<=C&&t[i-l]===f[g-l];l++);return y=f.slice(e,1<l?1-l:void 0)}function U(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 Y(){return!0}function le(){return!1}function ye(e){function t(i,l,f,g,C){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=g,this.target=C,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(i=e[L],this[L]=i?i(g):g[L]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Y:le,this.isPropagationStopped=le,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Y)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Y)},persist:function(){},isPersistent:Y}),t}var qe={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},st=ye(qe),at=b({},qe,{view:0,detail:0}),qt=ye(at),vr,ls,Qi,Di=b({},at,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$s,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!==Qi&&(Qi&&e.type==="mousemove"?(vr=e.screenX-Qi.screenX,ls=e.screenY-Qi.screenY):ls=vr=0,Qi=e),vr)},movementY:function(e){return"movementY"in e?e.movementY:ls}}),lo=ye(Di),oo=b({},Di,{dataTransfer:0}),uc=ye(oo),cc=b({},at,{relatedTarget:0}),Js=ye(cc),dc=b({},qe,{animationName:0,elapsedTime:0,pseudoElement:0}),fc=ye(dc),Ac=b({},qe,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hc=ye(Ac),gc=b({},qe,{data:0}),Xs=ye(gc),mc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pc={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"},yc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ec(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yc[e])?!!t[e]:!1}function $s(){return Ec}var bc=b({},at,{key:function(e){if(e.key){var t=mc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=U(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$s,charCode:function(e){return e.type==="keypress"?U(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?U(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vc=ye(bc),uo=b({},Di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),co=ye(uo),xc=b({},at,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$s}),Cc=ye(xc),wc=b({},qe,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ic=ye(wc),Bc=b({},Di,{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}),fo=ye(Bc),Sc=b({},qe,{newState:0,oldState:0}),Nc=ye(Sc),Tc=[9,13,27,32],qa=Ut&&"CompositionEvent"in window,za=null;Ut&&"documentMode"in document&&(za=document.documentMode);var Ao=Ut&&"TextEvent"in window&&!za,Ws=Ut&&(!qa||za&&8<za&&11>=za),ie=" ",De=!1;function ze(e,t){switch(e){case"keyup":return Tc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $e(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var et=!1;function wt(e,t){switch(e){case"compositionend":return $e(t);case"keypress":return t.which!==32?null:(De=!0,ie);case"textInput":return e=t.data,e===ie&&De?null:e;default:return null}}function on(e,t){if(et)return e==="compositionend"||!qa&&ze(e,t)?(e=w(),y=h=nr=null,et=!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 Ws&&t.locale!=="ko"?null:t.data;default:return null}}var $r={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 Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$r[e.type]:t==="textarea"}function Wr(e,t,i,l){vt?Oe?Oe.push(l):Oe=[l]:vt=l,t=Zo(t,"onChange"),0<t.length&&(i=new st("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var ma=null,un=null;function Qc(e){g0(e,0)}function ho(e){var t=Gr(e);if(Xn(t))return e}function MA(e,t){if(e==="change")return t}var _A=!1;if(Ut){var Dc;if(Ut){var Rc="oninput"in document;if(!Rc){var OA=document.createElement("div");OA.setAttribute("oninput","return;"),Rc=typeof OA.oninput=="function"}Dc=Rc}else Dc=!1;_A=Dc&&(!document.documentMode||9<document.documentMode)}function FA(){ma&&(ma.detachEvent("onpropertychange",jA),un=ma=null)}function jA(e){if(e.propertyName==="value"&&ho(un)){var t=[];Wr(t,un,e,je(e)),Vr(Qc,t)}}function rE(e,t,i){e==="focusin"?(FA(),ma=t,un=i,ma.attachEvent("onpropertychange",jA)):e==="focusout"&&FA()}function nE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ho(un)}function aE(e,t){if(e==="click")return ho(t)}function iE(e,t){if(e==="input"||e==="change")return ho(t)}function sE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:sE;function Zs(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!Lt.call(t,f)||!cn(e[f],t[f]))return!1}return!0}function HA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function GA(e,t){var i=HA(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=HA(i)}}function VA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qA(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=rr(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=rr(e.document)}return t}function kc(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 lE=Ut&&"documentMode"in document&&11>=document.documentMode,os=null,Lc=null,el=null,Uc=!1;function zA(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Uc||os==null||os!==rr(l)||(l=os,"selectionStart"in l&&kc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),el&&Zs(el,l)||(el=l,l=Zo(Lc,"onSelect"),0<l.length&&(t=new st("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=os)))}function Ri(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var us={animationend:Ri("Animation","AnimationEnd"),animationiteration:Ri("Animation","AnimationIteration"),animationstart:Ri("Animation","AnimationStart"),transitionrun:Ri("Transition","TransitionRun"),transitionstart:Ri("Transition","TransitionStart"),transitioncancel:Ri("Transition","TransitionCancel"),transitionend:Ri("Transition","TransitionEnd")},Mc={},YA={};Ut&&(YA=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function ki(e){if(Mc[e])return Mc[e];if(!us[e])return e;var t=us[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in YA)return Mc[e]=t[i];return e}var PA=ki("animationend"),KA=ki("animationiteration"),JA=ki("animationstart"),oE=ki("transitionrun"),uE=ki("transitionstart"),cE=ki("transitioncancel"),XA=ki("transitionend"),$A=new Map,_c="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");_c.push("scrollEnd");function On(e,t){$A.set(e,t),Un(t,[e])}var WA=new WeakMap;function wn(e,t){if(typeof e=="object"&&e!==null){var i=WA.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ss(t)},WA.set(e,t),t)}return{value:e,source:t,stack:ss(t)}}var In=[],cs=0,Oc=0;function go(){for(var e=cs,t=Oc=cs=0;t<e;){var i=In[t];In[t++]=null;var l=In[t];In[t++]=null;var f=In[t];In[t++]=null;var g=In[t];if(In[t++]=null,l!==null&&f!==null){var C=l.pending;C===null?f.next=f:(f.next=C.next,C.next=f),l.pending=f}g!==0&&ZA(i,f,g)}}function mo(e,t,i,l){In[cs++]=e,In[cs++]=t,In[cs++]=i,In[cs++]=l,Oc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Fc(e,t,i,l){return mo(e,t,i,l),po(e)}function ds(e,t){return mo(e,null,null,t),po(e)}function ZA(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var f=!1,g=e.return;g!==null;)g.childLanes|=i,l=g.alternate,l!==null&&(l.childLanes|=i),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(f=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,f&&t!==null&&(f=31-x(i),e=g.hiddenUpdates,l=e[f],l===null?e[f]=[t]:l.push(t),t.lane=i|536870912),g):null}function po(e){if(50<Il)throw Il=0,zd=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fs={};function dE(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,i,l){return new dE(e,t,i,l)}function jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pa(e,t){var i=e.alternate;return i===null?(i=dn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function eh(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yo(e,t,i,l,f,g){var C=0;if(l=e,typeof e=="function")jc(e)&&(C=1);else if(typeof e=="string")C=Ab(e,i,He.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case J:return e=dn(31,i,t,f),e.elementType=J,e.lanes=g,e;case Q:return Li(i.children,f,g,t);case k:C=8,f|=24;break;case R:return e=dn(12,i,t,f|2),e.elementType=R,e.lanes=g,e;case V:return e=dn(13,i,t,f),e.elementType=V,e.lanes=g,e;case ge:return e=dn(19,i,t,f),e.elementType=ge,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:case _:C=10;break e;case O:C=9;break e;case q:C=11;break e;case ce:C=14;break e;case te:C=16,l=null;break e}C=29,i=Error(s(130,e===null?"null":typeof e,"")),l=null}return t=dn(C,i,t,f),t.elementType=e,t.type=l,t.lanes=g,t}function Li(e,t,i,l){return e=dn(7,e,l,t),e.lanes=i,e}function Hc(e,t,i){return e=dn(6,e,null,t),e.lanes=i,e}function Gc(e,t,i){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var As=[],hs=0,Eo=null,bo=0,Bn=[],Sn=0,Ui=null,ya=1,Ea="";function Mi(e,t){As[hs++]=bo,As[hs++]=Eo,Eo=e,bo=t}function th(e,t,i){Bn[Sn++]=ya,Bn[Sn++]=Ea,Bn[Sn++]=Ui,Ui=e;var l=ya;e=Ea;var f=32-x(l)-1;l&=~(1<<f),i+=1;var g=32-x(t)+f;if(30<g){var C=f-f%5;g=(l&(1<<C)-1).toString(32),l>>=C,f-=C,ya=1<<32-x(t)+f|i<<f|l,Ea=g+e}else ya=1<<g|i<<f|l,Ea=e}function Vc(e){e.return!==null&&(Mi(e,1),th(e,1,0))}function qc(e){for(;e===Eo;)Eo=As[--hs],As[hs]=null,bo=As[--hs],As[hs]=null;for(;e===Ui;)Ui=Bn[--Sn],Bn[Sn]=null,Ea=Bn[--Sn],Bn[Sn]=null,ya=Bn[--Sn],Bn[Sn]=null}var qr=null,Zt=null,It=!1,_i=null,Wn=!1,zc=Error(s(519));function Oi(e){var t=Error(s(418,""));throw nl(wn(t,e)),zc}function rh(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[_t]=e,t[dr]=l,i){case"dialog":pt("cancel",t),pt("close",t);break;case"iframe":case"object":case"embed":pt("load",t);break;case"video":case"audio":for(i=0;i<Sl.length;i++)pt(Sl[i],t);break;case"source":pt("error",t);break;case"img":case"image":case"link":pt("error",t),pt("load",t);break;case"details":pt("toggle",t);break;case"input":pt("invalid",t),$n(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),_n(t);break;case"select":pt("invalid",t);break;case"textarea":pt("invalid",t),Ti(t,l.value,l.defaultValue,l.children),_n(t)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||E0(t.textContent,i)?(l.popover!=null&&(pt("beforetoggle",t),pt("toggle",t)),l.onScroll!=null&&pt("scroll",t),l.onScrollEnd!=null&&pt("scrollend",t),l.onClick!=null&&(t.onclick=eu),t=!0):t=!1,t||Oi(e)}function nh(e){for(qr=e.return;qr;)switch(qr.tag){case 5:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:qr=qr.return}}function tl(e){if(e!==qr)return!1;if(!It)return nh(e),It=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||of(e.type,e.memoizedProps)),i=!i),i&&Zt&&Oi(e),nh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(i=e.data,i==="/$"){if(t===0){Zt=jn(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++;e=e.nextSibling}Zt=null}}else t===27?(t=Zt,li(e.type)?(e=ff,ff=null,Zt=e):Zt=t):Zt=qr?jn(e.stateNode.nextSibling):null;return!0}function rl(){Zt=qr=null,It=!1}function ah(){var e=_i;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),_i=null),e}function nl(e){_i===null?_i=[e]:_i.push(e)}var Yc=ne(null),Fi=null,ba=null;function Ya(e,t,i){ke(Yc,t._currentValue),t._currentValue=i}function va(e){e._currentValue=Yc.current,Ee(Yc)}function Pc(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Kc(e,t,i,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var g=f.dependencies;if(g!==null){var C=f.child;g=g.firstContext;e:for(;g!==null;){var L=g;g=f;for(var z=0;z<t.length;z++)if(L.context===t[z]){g.lanes|=i,L=g.alternate,L!==null&&(L.lanes|=i),Pc(g.return,i,e),l||(C=null);break e}g=L.next}}else if(f.tag===18){if(C=f.return,C===null)throw Error(s(341));C.lanes|=i,g=C.alternate,g!==null&&(g.lanes|=i),Pc(C,i,e),C=null}else C=f.child;if(C!==null)C.return=f;else for(C=f;C!==null;){if(C===e){C=null;break}if(f=C.sibling,f!==null){f.return=C.return,C=f;break}C=C.return}f=C}}function al(e,t,i,l){e=null;for(var f=t,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var C=f.alternate;if(C===null)throw Error(s(387));if(C=C.memoizedProps,C!==null){var L=f.type;cn(f.pendingProps.value,C.value)||(e!==null?e.push(L):e=[L])}}else if(f===yt.current){if(C=f.alternate,C===null)throw Error(s(387));C.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(kl):e=[kl])}f=f.return}e!==null&&Kc(t,e,i,l),t.flags|=262144}function vo(e){for(e=e.firstContext;e!==null;){if(!cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ji(e){Fi=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _r(e){return ih(Fi,e)}function xo(e,t){return Fi===null&&ji(e),ih(e,t)}function ih(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ba===null){if(e===null)throw Error(s(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return i}var fE=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},AE=n.unstable_scheduleCallback,hE=n.unstable_NormalPriority,hr={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jc(){return{controller:new fE,data:new Map,refCount:0}}function il(e){e.refCount--,e.refCount===0&&AE(hE,function(){e.controller.abort()})}var sl=null,Xc=0,gs=0,ms=null;function gE(e,t){if(sl===null){var i=sl=[];Xc=0,gs=Wd(),ms={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Xc++,t.then(sh,sh),t}function sh(){if(--Xc===0&&sl!==null){ms!==null&&(ms.status="fulfilled");var e=sl;sl=null,gs=0,ms=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function mE(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var f=0;f<i.length;f++)(0,i[f])(t)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var lh=P.S;P.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&gE(e,t),lh!==null&&lh(e,t)};var Hi=ne(null);function $c(){var e=Hi.current;return e!==null?e:Ft.pooledCache}function Co(e,t){t===null?ke(Hi,Hi.current):ke(Hi,t.pool)}function oh(){var e=$c();return e===null?null:{parent:hr._currentValue,pool:e}}var ll=Error(s(460)),uh=Error(s(474)),wo=Error(s(542)),Wc={then:function(){}};function ch(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Io(){}function dh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Io,Io),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ah(e),e;default:if(typeof t.status=="string")t.then(Io,Io);else{if(e=Ft,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=l}},function(l){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ah(e),e}throw ol=t,ll}}var ol=null;function fh(){if(ol===null)throw Error(s(459));var e=ol;return ol=null,e}function Ah(e){if(e===ll||e===wo)throw Error(s(483))}var Pa=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ed(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 Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(St&2)!==0){var f=l.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),l.pending=t,t=po(e),ZA(e,null,i),t}return mo(e,l,t,i),po(e)}function ul(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,rs(e,i)}}function td(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var C={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?f=g=C:g=g.next=C,i=i.next}while(i!==null);g===null?f=g=t:g=g.next=t}else f=g=t;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var rd=!1;function cl(){if(rd){var e=ms;if(e!==null)throw e}}function dl(e,t,i,l){rd=!1;var f=e.updateQueue;Pa=!1;var g=f.firstBaseUpdate,C=f.lastBaseUpdate,L=f.shared.pending;if(L!==null){f.shared.pending=null;var z=L,ue=z.next;z.next=null,C===null?g=ue:C.next=ue,C=z;var ve=e.alternate;ve!==null&&(ve=ve.updateQueue,L=ve.lastBaseUpdate,L!==C&&(L===null?ve.firstBaseUpdate=ue:L.next=ue,ve.lastBaseUpdate=z))}if(g!==null){var Se=f.baseState;C=0,ve=ue=z=null,L=g;do{var de=L.lane&-536870913,Ae=de!==L.lane;if(Ae?(xt&de)===de:(l&de)===de){de!==0&&de===gs&&(rd=!0),ve!==null&&(ve=ve.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var rt=e,Ze=L;de=t;var Rt=i;switch(Ze.tag){case 1:if(rt=Ze.payload,typeof rt=="function"){Se=rt.call(Rt,Se,de);break e}Se=rt;break e;case 3:rt.flags=rt.flags&-65537|128;case 0:if(rt=Ze.payload,de=typeof rt=="function"?rt.call(Rt,Se,de):rt,de==null)break e;Se=b({},Se,de);break e;case 2:Pa=!0}}de=L.callback,de!==null&&(e.flags|=64,Ae&&(e.flags|=8192),Ae=f.callbacks,Ae===null?f.callbacks=[de]:Ae.push(de))}else Ae={lane:de,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ve===null?(ue=ve=Ae,z=Se):ve=ve.next=Ae,C|=de;if(L=L.next,L===null){if(L=f.shared.pending,L===null)break;Ae=L,L=Ae.next,Ae.next=null,f.lastBaseUpdate=Ae,f.shared.pending=null}}while(!0);ve===null&&(z=Se),f.baseState=z,f.firstBaseUpdate=ue,f.lastBaseUpdate=ve,g===null&&(f.shared.lanes=0),ni|=C,e.lanes=C,e.memoizedState=Se}}function hh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function gh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)hh(i[e],t)}var ps=ne(null),Bo=ne(0);function mh(e,t){e=Na,ke(Bo,e),ke(ps,t),Na=e|t.baseLanes}function nd(){ke(Bo,Na),ke(ps,ps.current)}function ad(){Na=Bo.current,Ee(ps),Ee(Bo)}var Xa=0,At=null,Qt=null,lr=null,So=!1,ys=!1,Gi=!1,No=0,fl=0,Es=null,pE=0;function ar(){throw Error(s(321))}function id(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!cn(e[i],t[i]))return!1;return!0}function sd(e,t,i,l,f,g){return Xa=g,At=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Zh:eg,Gi=!1,g=i(l,f),Gi=!1,ys&&(g=yh(t,i,l,f)),ph(e),g}function ph(e){P.H=Lo;var t=Qt!==null&&Qt.next!==null;if(Xa=0,lr=Qt=At=null,So=!1,fl=0,Es=null,t)throw Error(s(300));e===null||xr||(e=e.dependencies,e!==null&&vo(e)&&(xr=!0))}function yh(e,t,i,l){At=e;var f=0;do{if(ys&&(Es=null),fl=0,ys=!1,25<=f)throw Error(s(301));if(f+=1,lr=Qt=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}P.H=wE,g=t(i,l)}while(ys);return g}function yE(){var e=P.H,t=e.useState()[0];return t=typeof t.then=="function"?Al(t):t,e=e.useState()[0],(Qt!==null?Qt.memoizedState:null)!==e&&(At.flags|=1024),t}function ld(){var e=No!==0;return No=0,e}function od(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function ud(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}Xa=0,lr=Qt=At=null,ys=!1,fl=No=0,Es=null}function Zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?At.memoizedState=lr=e:lr=lr.next=e,lr}function or(){if(Qt===null){var e=At.alternate;e=e!==null?e.memoizedState:null}else e=Qt.next;var t=lr===null?At.memoizedState:lr.next;if(t!==null)lr=t,Qt=e;else{if(e===null)throw At.alternate===null?Error(s(467)):Error(s(310));Qt=e,e={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},lr===null?At.memoizedState=lr=e:lr=lr.next=e}return lr}function cd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(e){var t=fl;return fl+=1,Es===null&&(Es=[]),e=dh(Es,e,t),t=At,(lr===null?t.memoizedState:lr.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Zh:eg),e}function To(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Al(e);if(e.$$typeof===_)return _r(e)}throw Error(s(438,String(e)))}function dd(e){var t=null,i=At.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=At.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=cd(),At.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=K;return t.index++,i}function xa(e,t){return typeof t=="function"?t(e):t}function Qo(e){var t=or();return fd(t,Qt,e)}function fd(e,t,i){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var f=e.baseQueue,g=l.pending;if(g!==null){if(f!==null){var C=f.next;f.next=g.next,g.next=C}t.baseQueue=f=g,l.pending=null}if(g=e.baseState,f===null)e.memoizedState=g;else{t=f.next;var L=C=null,z=null,ue=t,ve=!1;do{var Se=ue.lane&-536870913;if(Se!==ue.lane?(xt&Se)===Se:(Xa&Se)===Se){var de=ue.revertLane;if(de===0)z!==null&&(z=z.next={lane:0,revertLane:0,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),Se===gs&&(ve=!0);else if((Xa&de)===de){ue=ue.next,de===gs&&(ve=!0);continue}else Se={lane:0,revertLane:ue.revertLane,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},z===null?(L=z=Se,C=g):z=z.next=Se,At.lanes|=de,ni|=de;Se=ue.action,Gi&&i(g,Se),g=ue.hasEagerState?ue.eagerState:i(g,Se)}else de={lane:Se,revertLane:ue.revertLane,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},z===null?(L=z=de,C=g):z=z.next=de,At.lanes|=Se,ni|=Se;ue=ue.next}while(ue!==null&&ue!==t);if(z===null?C=g:z.next=L,!cn(g,e.memoizedState)&&(xr=!0,ve&&(i=ms,i!==null)))throw i;e.memoizedState=g,e.baseState=C,e.baseQueue=z,l.lastRenderedState=g}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Ad(e){var t=or(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,f=i.pending,g=t.memoizedState;if(f!==null){i.pending=null;var C=f=f.next;do g=e(g,C.action),C=C.next;while(C!==f);cn(g,t.memoizedState)||(xr=!0),t.memoizedState=g,t.baseQueue===null&&(t.baseState=g),i.lastRenderedState=g}return[g,l]}function Eh(e,t,i){var l=At,f=or(),g=It;if(g){if(i===void 0)throw Error(s(407));i=i()}else i=t();var C=!cn((Qt||f).memoizedState,i);C&&(f.memoizedState=i,xr=!0),f=f.queue;var L=xh.bind(null,l,f,e);if(hl(2048,8,L,[e]),f.getSnapshot!==t||C||lr!==null&&lr.memoizedState.tag&1){if(l.flags|=2048,bs(9,Do(),vh.bind(null,l,f,i,t),null),Ft===null)throw Error(s(349));g||(Xa&124)!==0||bh(l,t,i)}return i}function bh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=At.updateQueue,t===null?(t=cd(),At.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function vh(e,t,i,l){t.value=i,t.getSnapshot=l,Ch(t)&&wh(e)}function xh(e,t,i){return i(function(){Ch(t)&&wh(e)})}function Ch(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!cn(e,i)}catch{return!0}}function wh(e){var t=ds(e,2);t!==null&&mn(t,e,2)}function hd(e){var t=Zr();if(typeof e=="function"){var i=e;if(e=i(),Gi){E(!0);try{i()}finally{E(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:e},t}function Ih(e,t,i,l){return e.baseState=i,fd(e,Qt,typeof l=="function"?l:xa)}function EE(e,t,i,l,f){if(ko(e))throw Error(s(485));if(e=t.action,e!==null){var g={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){g.listeners.push(C)}};P.T!==null?i(!0):g.isTransition=!1,l(g),i=t.pending,i===null?(g.next=t.pending=g,Bh(t,g)):(g.next=i.next,t.pending=i.next=g)}}function Bh(e,t){var i=t.action,l=t.payload,f=e.state;if(t.isTransition){var g=P.T,C={};P.T=C;try{var L=i(f,l),z=P.S;z!==null&&z(C,L),Sh(e,t,L)}catch(ue){gd(e,t,ue)}finally{P.T=g}}else try{g=i(f,l),Sh(e,t,g)}catch(ue){gd(e,t,ue)}}function Sh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){Nh(e,t,l)},function(l){return gd(e,t,l)}):Nh(e,t,i)}function Nh(e,t,i){t.status="fulfilled",t.value=i,Th(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Bh(e,i)))}function gd(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,Th(t),t=t.next;while(t!==l)}e.action=null}function Th(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qh(e,t){return t}function Dh(e,t){if(It){var i=Ft.formState;if(i!==null){e:{var l=At;if(It){if(Zt){t:{for(var f=Zt,g=Wn;f.nodeType!==8;){if(!g){f=null;break t}if(f=jn(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Zt=jn(f.nextSibling),l=f.data==="F!";break e}}Oi(l)}l=!1}l&&(t=i[0])}}return i=Zr(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qh,lastRenderedState:t},i.queue=l,i=Xh.bind(null,At,l),l.dispatch=i,l=hd(!1),g=bd.bind(null,At,!1,l.queue),l=Zr(),f={state:t,dispatch:null,action:e,pending:null},l.queue=f,i=EE.bind(null,At,f,g,i),f.dispatch=i,l.memoizedState=e,[t,i,!1]}function Rh(e){var t=or();return kh(t,Qt,e)}function kh(e,t,i){if(t=fd(e,t,Qh)[0],e=Qo(xa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Al(t)}catch(C){throw C===ll?wo:C}else l=t;t=or();var f=t.queue,g=f.dispatch;return i!==t.memoizedState&&(At.flags|=2048,bs(9,Do(),bE.bind(null,f,i),null)),[l,g,e]}function bE(e,t){e.action=t}function Lh(e){var t=or(),i=Qt;if(i!==null)return kh(t,i,e);or(),t=t.memoizedState,i=or();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function bs(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=At.updateQueue,t===null&&(t=cd(),At.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Do(){return{destroy:void 0,resource:void 0}}function Uh(){return or().memoizedState}function Ro(e,t,i,l){var f=Zr();l=l===void 0?null:l,At.flags|=e,f.memoizedState=bs(1|t,Do(),i,l)}function hl(e,t,i,l){var f=or();l=l===void 0?null:l;var g=f.memoizedState.inst;Qt!==null&&l!==null&&id(l,Qt.memoizedState.deps)?f.memoizedState=bs(t,g,i,l):(At.flags|=e,f.memoizedState=bs(1|t,g,i,l))}function Mh(e,t){Ro(8390656,8,e,t)}function _h(e,t){hl(2048,8,e,t)}function Oh(e,t){return hl(4,2,e,t)}function Fh(e,t){return hl(4,4,e,t)}function jh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hh(e,t,i){i=i!=null?i.concat([e]):null,hl(4,4,jh.bind(null,t,e),i)}function md(){}function Gh(e,t){var i=or();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&id(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Vh(e,t){var i=or();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&id(t,l[1]))return l[0];if(l=e(),Gi){E(!0);try{e()}finally{E(!1)}}return i.memoizedState=[l,t],l}function pd(e,t,i){return i===void 0||(Xa&1073741824)!==0?e.memoizedState=t:(e.memoizedState=i,e=Yg(),At.lanes|=e,ni|=e,i)}function qh(e,t,i,l){return cn(i,t)?i:ps.current!==null?(e=pd(e,i,l),cn(e,t)||(xr=!0),e):(Xa&42)===0?(xr=!0,e.memoizedState=i):(e=Yg(),At.lanes|=e,ni|=e,t)}function zh(e,t,i,l,f){var g=ae.p;ae.p=g!==0&&8>g?g:8;var C=P.T,L={};P.T=L,bd(e,!1,t,i);try{var z=f(),ue=P.S;if(ue!==null&&ue(L,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ve=mE(z,l);gl(e,t,ve,gn(e))}else gl(e,t,l,gn(e))}catch(Se){gl(e,t,{then:function(){},status:"rejected",reason:Se},gn())}finally{ae.p=g,P.T=C}}function vE(){}function yd(e,t,i,l){if(e.tag!==5)throw Error(s(476));var f=Yh(e).queue;zh(e,f,t,Ne,i===null?vE:function(){return Ph(e),i(l)})}function Yh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:Ne},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ph(e){var t=Yh(e).next.queue;gl(e,t,{},gn())}function Ed(){return _r(kl)}function Kh(){return or().memoizedState}function Jh(){return or().memoizedState}function xE(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=gn();e=Ka(i);var l=Ja(t,e,i);l!==null&&(mn(l,t,i),ul(l,t,i)),t={cache:Jc()},e.payload=t;return}t=t.return}}function CE(e,t,i){var l=gn();i={lane:l,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},ko(e)?$h(t,i):(i=Fc(e,t,i,l),i!==null&&(mn(i,e,l),Wh(i,t,l)))}function Xh(e,t,i){var l=gn();gl(e,t,i,l)}function gl(e,t,i,l){var f={lane:l,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(ko(e))$h(t,f);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var C=t.lastRenderedState,L=g(C,i);if(f.hasEagerState=!0,f.eagerState=L,cn(L,C))return mo(e,t,f,0),Ft===null&&go(),!1}catch{}finally{}if(i=Fc(e,t,f,l),i!==null)return mn(i,e,l),Wh(i,t,l),!0}return!1}function bd(e,t,i,l){if(l={lane:2,revertLane:Wd(),action:l,hasEagerState:!1,eagerState:null,next:null},ko(e)){if(t)throw Error(s(479))}else t=Fc(e,i,l,2),t!==null&&mn(t,e,2)}function ko(e){var t=e.alternate;return e===At||t!==null&&t===At}function $h(e,t){ys=So=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Wh(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,rs(e,i)}}var Lo={readContext:_r,use:To,useCallback:ar,useContext:ar,useEffect:ar,useImperativeHandle:ar,useLayoutEffect:ar,useInsertionEffect:ar,useMemo:ar,useReducer:ar,useRef:ar,useState:ar,useDebugValue:ar,useDeferredValue:ar,useTransition:ar,useSyncExternalStore:ar,useId:ar,useHostTransitionStatus:ar,useFormState:ar,useActionState:ar,useOptimistic:ar,useMemoCache:ar,useCacheRefresh:ar},Zh={readContext:_r,use:To,useCallback:function(e,t){return Zr().memoizedState=[e,t===void 0?null:t],e},useContext:_r,useEffect:Mh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ro(4194308,4,jh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){Ro(4,2,e,t)},useMemo:function(e,t){var i=Zr();t=t===void 0?null:t;var l=e();if(Gi){E(!0);try{e()}finally{E(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Zr();if(i!==void 0){var f=i(t);if(Gi){E(!0);try{i(t)}finally{E(!1)}}}else f=t;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=CE.bind(null,At,e),[l.memoizedState,e]},useRef:function(e){var t=Zr();return e={current:e},t.memoizedState=e},useState:function(e){e=hd(e);var t=e.queue,i=Xh.bind(null,At,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:md,useDeferredValue:function(e,t){var i=Zr();return pd(i,e,t)},useTransition:function(){var e=hd(!1);return e=zh.bind(null,At,e.queue,!0,!1),Zr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=At,f=Zr();if(It){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Ft===null)throw Error(s(349));(xt&124)!==0||bh(l,t,i)}f.memoizedState=i;var g={value:i,getSnapshot:t};return f.queue=g,Mh(xh.bind(null,l,g,e),[e]),l.flags|=2048,bs(9,Do(),vh.bind(null,l,g,i,t),null),i},useId:function(){var e=Zr(),t=Ft.identifierPrefix;if(It){var i=Ea,l=ya;i=(l&~(1<<32-x(l)-1)).toString(32)+i,t="«"+t+"R"+i,i=No++,0<i&&(t+="H"+i.toString(32)),t+="»"}else i=pE++,t="«"+t+"r"+i.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Ed,useFormState:Dh,useActionState:Dh,useOptimistic:function(e){var t=Zr();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=bd.bind(null,At,!0,i),i.dispatch=t,[e,t]},useMemoCache:dd,useCacheRefresh:function(){return Zr().memoizedState=xE.bind(null,At)}},eg={readContext:_r,use:To,useCallback:Gh,useContext:_r,useEffect:_h,useImperativeHandle:Hh,useInsertionEffect:Oh,useLayoutEffect:Fh,useMemo:Vh,useReducer:Qo,useRef:Uh,useState:function(){return Qo(xa)},useDebugValue:md,useDeferredValue:function(e,t){var i=or();return qh(i,Qt.memoizedState,e,t)},useTransition:function(){var e=Qo(xa)[0],t=or().memoizedState;return[typeof e=="boolean"?e:Al(e),t]},useSyncExternalStore:Eh,useId:Kh,useHostTransitionStatus:Ed,useFormState:Rh,useActionState:Rh,useOptimistic:function(e,t){var i=or();return Ih(i,Qt,e,t)},useMemoCache:dd,useCacheRefresh:Jh},wE={readContext:_r,use:To,useCallback:Gh,useContext:_r,useEffect:_h,useImperativeHandle:Hh,useInsertionEffect:Oh,useLayoutEffect:Fh,useMemo:Vh,useReducer:Ad,useRef:Uh,useState:function(){return Ad(xa)},useDebugValue:md,useDeferredValue:function(e,t){var i=or();return Qt===null?pd(i,e,t):qh(i,Qt.memoizedState,e,t)},useTransition:function(){var e=Ad(xa)[0],t=or().memoizedState;return[typeof e=="boolean"?e:Al(e),t]},useSyncExternalStore:Eh,useId:Kh,useHostTransitionStatus:Ed,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var i=or();return Qt!==null?Ih(i,Qt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:dd,useCacheRefresh:Jh},vs=null,ml=0;function Uo(e){var t=ml;return ml+=1,vs===null&&(vs=[]),dh(vs,e,t)}function pl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Mo(e,t){throw t.$$typeof===v?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function tg(e){var t=e._init;return t(e._payload)}function rg(e){function t(re,Z){if(e){var oe=re.deletions;oe===null?(re.deletions=[Z],re.flags|=16):oe.push(Z)}}function i(re,Z){if(!e)return null;for(;Z!==null;)t(re,Z),Z=Z.sibling;return null}function l(re){for(var Z=new Map;re!==null;)re.key!==null?Z.set(re.key,re):Z.set(re.index,re),re=re.sibling;return Z}function f(re,Z){return re=pa(re,Z),re.index=0,re.sibling=null,re}function g(re,Z,oe){return re.index=oe,e?(oe=re.alternate,oe!==null?(oe=oe.index,oe<Z?(re.flags|=67108866,Z):oe):(re.flags|=67108866,Z)):(re.flags|=1048576,Z)}function C(re){return e&&re.alternate===null&&(re.flags|=67108866),re}function L(re,Z,oe,Ce){return Z===null||Z.tag!==6?(Z=Hc(oe,re.mode,Ce),Z.return=re,Z):(Z=f(Z,oe),Z.return=re,Z)}function z(re,Z,oe,Ce){var Ye=oe.type;return Ye===Q?ve(re,Z,oe.props.children,Ce,oe.key):Z!==null&&(Z.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===te&&tg(Ye)===Z.type)?(Z=f(Z,oe.props),pl(Z,oe),Z.return=re,Z):(Z=yo(oe.type,oe.key,oe.props,null,re.mode,Ce),pl(Z,oe),Z.return=re,Z)}function ue(re,Z,oe,Ce){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==oe.containerInfo||Z.stateNode.implementation!==oe.implementation?(Z=Gc(oe,re.mode,Ce),Z.return=re,Z):(Z=f(Z,oe.children||[]),Z.return=re,Z)}function ve(re,Z,oe,Ce,Ye){return Z===null||Z.tag!==7?(Z=Li(oe,re.mode,Ce,Ye),Z.return=re,Z):(Z=f(Z,oe),Z.return=re,Z)}function Se(re,Z,oe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Hc(""+Z,re.mode,oe),Z.return=re,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case B:return oe=yo(Z.type,Z.key,Z.props,null,re.mode,oe),pl(oe,Z),oe.return=re,oe;case T:return Z=Gc(Z,re.mode,oe),Z.return=re,Z;case te:var Ce=Z._init;return Z=Ce(Z._payload),Se(re,Z,oe)}if(pe(Z)||me(Z))return Z=Li(Z,re.mode,oe,null),Z.return=re,Z;if(typeof Z.then=="function")return Se(re,Uo(Z),oe);if(Z.$$typeof===_)return Se(re,xo(re,Z),oe);Mo(re,Z)}return null}function de(re,Z,oe,Ce){var Ye=Z!==null?Z.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Ye!==null?null:L(re,Z,""+oe,Ce);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case B:return oe.key===Ye?z(re,Z,oe,Ce):null;case T:return oe.key===Ye?ue(re,Z,oe,Ce):null;case te:return Ye=oe._init,oe=Ye(oe._payload),de(re,Z,oe,Ce)}if(pe(oe)||me(oe))return Ye!==null?null:ve(re,Z,oe,Ce,null);if(typeof oe.then=="function")return de(re,Z,Uo(oe),Ce);if(oe.$$typeof===_)return de(re,Z,xo(re,oe),Ce);Mo(re,oe)}return null}function Ae(re,Z,oe,Ce,Ye){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return re=re.get(oe)||null,L(Z,re,""+Ce,Ye);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case B:return re=re.get(Ce.key===null?oe:Ce.key)||null,z(Z,re,Ce,Ye);case T:return re=re.get(Ce.key===null?oe:Ce.key)||null,ue(Z,re,Ce,Ye);case te:var ht=Ce._init;return Ce=ht(Ce._payload),Ae(re,Z,oe,Ce,Ye)}if(pe(Ce)||me(Ce))return re=re.get(oe)||null,ve(Z,re,Ce,Ye,null);if(typeof Ce.then=="function")return Ae(re,Z,oe,Uo(Ce),Ye);if(Ce.$$typeof===_)return Ae(re,Z,oe,xo(Z,Ce),Ye);Mo(Z,Ce)}return null}function rt(re,Z,oe,Ce){for(var Ye=null,ht=null,Je=Z,tt=Z=0,wr=null;Je!==null&&tt<oe.length;tt++){Je.index>tt?(wr=Je,Je=null):wr=Je.sibling;var Ct=de(re,Je,oe[tt],Ce);if(Ct===null){Je===null&&(Je=wr);break}e&&Je&&Ct.alternate===null&&t(re,Je),Z=g(Ct,Z,tt),ht===null?Ye=Ct:ht.sibling=Ct,ht=Ct,Je=wr}if(tt===oe.length)return i(re,Je),It&&Mi(re,tt),Ye;if(Je===null){for(;tt<oe.length;tt++)Je=Se(re,oe[tt],Ce),Je!==null&&(Z=g(Je,Z,tt),ht===null?Ye=Je:ht.sibling=Je,ht=Je);return It&&Mi(re,tt),Ye}for(Je=l(Je);tt<oe.length;tt++)wr=Ae(Je,re,tt,oe[tt],Ce),wr!==null&&(e&&wr.alternate!==null&&Je.delete(wr.key===null?tt:wr.key),Z=g(wr,Z,tt),ht===null?Ye=wr:ht.sibling=wr,ht=wr);return e&&Je.forEach(function(fi){return t(re,fi)}),It&&Mi(re,tt),Ye}function Ze(re,Z,oe,Ce){if(oe==null)throw Error(s(151));for(var Ye=null,ht=null,Je=Z,tt=Z=0,wr=null,Ct=oe.next();Je!==null&&!Ct.done;tt++,Ct=oe.next()){Je.index>tt?(wr=Je,Je=null):wr=Je.sibling;var fi=de(re,Je,Ct.value,Ce);if(fi===null){Je===null&&(Je=wr);break}e&&Je&&fi.alternate===null&&t(re,Je),Z=g(fi,Z,tt),ht===null?Ye=fi:ht.sibling=fi,ht=fi,Je=wr}if(Ct.done)return i(re,Je),It&&Mi(re,tt),Ye;if(Je===null){for(;!Ct.done;tt++,Ct=oe.next())Ct=Se(re,Ct.value,Ce),Ct!==null&&(Z=g(Ct,Z,tt),ht===null?Ye=Ct:ht.sibling=Ct,ht=Ct);return It&&Mi(re,tt),Ye}for(Je=l(Je);!Ct.done;tt++,Ct=oe.next())Ct=Ae(Je,re,tt,Ct.value,Ce),Ct!==null&&(e&&Ct.alternate!==null&&Je.delete(Ct.key===null?tt:Ct.key),Z=g(Ct,Z,tt),ht===null?Ye=Ct:ht.sibling=Ct,ht=Ct);return e&&Je.forEach(function(Ib){return t(re,Ib)}),It&&Mi(re,tt),Ye}function Rt(re,Z,oe,Ce){if(typeof oe=="object"&&oe!==null&&oe.type===Q&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case B:e:{for(var Ye=oe.key;Z!==null;){if(Z.key===Ye){if(Ye=oe.type,Ye===Q){if(Z.tag===7){i(re,Z.sibling),Ce=f(Z,oe.props.children),Ce.return=re,re=Ce;break e}}else if(Z.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===te&&tg(Ye)===Z.type){i(re,Z.sibling),Ce=f(Z,oe.props),pl(Ce,oe),Ce.return=re,re=Ce;break e}i(re,Z);break}else t(re,Z);Z=Z.sibling}oe.type===Q?(Ce=Li(oe.props.children,re.mode,Ce,oe.key),Ce.return=re,re=Ce):(Ce=yo(oe.type,oe.key,oe.props,null,re.mode,Ce),pl(Ce,oe),Ce.return=re,re=Ce)}return C(re);case T:e:{for(Ye=oe.key;Z!==null;){if(Z.key===Ye)if(Z.tag===4&&Z.stateNode.containerInfo===oe.containerInfo&&Z.stateNode.implementation===oe.implementation){i(re,Z.sibling),Ce=f(Z,oe.children||[]),Ce.return=re,re=Ce;break e}else{i(re,Z);break}else t(re,Z);Z=Z.sibling}Ce=Gc(oe,re.mode,Ce),Ce.return=re,re=Ce}return C(re);case te:return Ye=oe._init,oe=Ye(oe._payload),Rt(re,Z,oe,Ce)}if(pe(oe))return rt(re,Z,oe,Ce);if(me(oe)){if(Ye=me(oe),typeof Ye!="function")throw Error(s(150));return oe=Ye.call(oe),Ze(re,Z,oe,Ce)}if(typeof oe.then=="function")return Rt(re,Z,Uo(oe),Ce);if(oe.$$typeof===_)return Rt(re,Z,xo(re,oe),Ce);Mo(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,Z!==null&&Z.tag===6?(i(re,Z.sibling),Ce=f(Z,oe),Ce.return=re,re=Ce):(i(re,Z),Ce=Hc(oe,re.mode,Ce),Ce.return=re,re=Ce),C(re)):i(re,Z)}return function(re,Z,oe,Ce){try{ml=0;var Ye=Rt(re,Z,oe,Ce);return vs=null,Ye}catch(Je){if(Je===ll||Je===wo)throw Je;var ht=dn(29,Je,null,re.mode);return ht.lanes=Ce,ht.return=re,ht}finally{}}}var xs=rg(!0),ng=rg(!1),Nn=ne(null),Zn=null;function $a(e){var t=e.alternate;ke(gr,gr.current&1),ke(Nn,e),Zn===null&&(t===null||ps.current!==null||t.memoizedState!==null)&&(Zn=e)}function ag(e){if(e.tag===22){if(ke(gr,gr.current),ke(Nn,e),Zn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Zn=e)}}else Wa()}function Wa(){ke(gr,gr.current),ke(Nn,Nn.current)}function Ca(e){Ee(Nn),Zn===e&&(Zn=null),Ee(gr)}var gr=ne(0);function _o(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||df(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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}function vd(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:b({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var xd={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=gn(),f=Ka(l);f.payload=t,i!=null&&(f.callback=i),t=Ja(e,f,l),t!==null&&(mn(t,e,l),ul(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=gn(),f=Ka(l);f.tag=1,f.payload=t,i!=null&&(f.callback=i),t=Ja(e,f,l),t!==null&&(mn(t,e,l),ul(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=gn(),l=Ka(i);l.tag=2,t!=null&&(l.callback=t),t=Ja(e,l,i),t!==null&&(mn(t,e,i),ul(t,e,i))}};function ig(e,t,i,l,f,g,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,g,C):t.prototype&&t.prototype.isPureReactComponent?!Zs(i,l)||!Zs(f,g):!0}function sg(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&xd.enqueueReplaceState(t,t.state,null)}function Vi(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=b({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}var Oo=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)};function lg(e){Oo(e)}function og(e){console.error(e)}function ug(e){Oo(e)}function Fo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function cg(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Cd(e,t,i){return i=Ka(i),i.tag=3,i.payload={element:null},i.callback=function(){Fo(e,t)},i}function dg(e){return e=Ka(e),e.tag=3,e}function fg(e,t,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=l.value;e.payload=function(){return f(g)},e.callback=function(){cg(t,i,l)}}var C=i.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(e.callback=function(){cg(t,i,l),typeof f!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var L=l.stack;this.componentDidCatch(l.value,{componentStack:L!==null?L:""})})}function IE(e,t,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&al(t,i,f,!0),i=Nn.current,i!==null){switch(i.tag){case 13:return Zn===null?Pd():i.alternate===null&&er===0&&(er=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===Wc?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),Jd(e,l,f)),!1;case 22:return i.flags|=65536,l===Wc?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),Jd(e,l,f)),!1}throw Error(s(435,i.tag))}return Jd(e,l,f),Pd(),!1}if(It)return t=Nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,l!==zc&&(e=Error(s(422),{cause:l}),nl(wn(e,i)))):(l!==zc&&(t=Error(s(423),{cause:l}),nl(wn(t,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=wn(l,i),f=Cd(e.stateNode,l,f),td(e,f),er!==4&&(er=2)),!1;var g=Error(s(520),{cause:l});if(g=wn(g,i),wl===null?wl=[g]:wl.push(g),er!==4&&(er=2),t===null)return!0;l=wn(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Cd(i.stateNode,l,e),td(i,e),!1;case 1:if(t=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ai===null||!ai.has(g))))return i.flags|=65536,f&=-f,i.lanes|=f,f=dg(f),fg(f,e,i,l),td(i,f),!1}i=i.return}while(i!==null);return!1}var Ag=Error(s(461)),xr=!1;function Tr(e,t,i,l){t.child=e===null?ng(t,null,i,l):xs(t,e.child,i,l)}function hg(e,t,i,l,f){i=i.render;var g=t.ref;if("ref"in l){var C={};for(var L in l)L!=="ref"&&(C[L]=l[L])}else C=l;return ji(t),l=sd(e,t,i,C,g,f),L=ld(),e!==null&&!xr?(od(e,t,f),wa(e,t,f)):(It&&L&&Vc(t),t.flags|=1,Tr(e,t,l,f),t.child)}function gg(e,t,i,l,f){if(e===null){var g=i.type;return typeof g=="function"&&!jc(g)&&g.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=g,mg(e,t,g,l,f)):(e=yo(i.type,null,l,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!Dd(e,f)){var C=g.memoizedProps;if(i=i.compare,i=i!==null?i:Zs,i(C,l)&&e.ref===t.ref)return wa(e,t,f)}return t.flags|=1,e=pa(g,l),e.ref=t.ref,e.return=t,t.child=e}function mg(e,t,i,l,f){if(e!==null){var g=e.memoizedProps;if(Zs(g,l)&&e.ref===t.ref)if(xr=!1,t.pendingProps=l=g,Dd(e,f))(e.flags&131072)!==0&&(xr=!0);else return t.lanes=e.lanes,wa(e,t,f)}return wd(e,t,i,l,f)}function pg(e,t,i){var l=t.pendingProps,f=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=g!==null?g.baseLanes|i:i,e!==null){for(f=t.child=e.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;t.childLanes=g&~l}else t.childLanes=0,t.child=null;return yg(e,t,l,i)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Co(t,g!==null?g.cachePool:null),g!==null?mh(t,g):nd(),ag(t);else return t.lanes=t.childLanes=536870912,yg(e,t,g!==null?g.baseLanes|i:i,i)}else g!==null?(Co(t,g.cachePool),mh(t,g),Wa(),t.memoizedState=null):(e!==null&&Co(t,null),nd(),Wa());return Tr(e,t,f,i),t.child}function yg(e,t,i,l){var f=$c();return f=f===null?null:{parent:hr._currentValue,pool:f},t.memoizedState={baseLanes:i,cachePool:f},e!==null&&Co(t,null),nd(),ag(t),e!==null&&al(e,t,l,!0),null}function jo(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function wd(e,t,i,l,f){return ji(t),i=sd(e,t,i,l,void 0,f),l=ld(),e!==null&&!xr?(od(e,t,f),wa(e,t,f)):(It&&l&&Vc(t),t.flags|=1,Tr(e,t,i,f),t.child)}function Eg(e,t,i,l,f,g){return ji(t),t.updateQueue=null,i=yh(t,l,i,f),ph(e),l=ld(),e!==null&&!xr?(od(e,t,g),wa(e,t,g)):(It&&l&&Vc(t),t.flags|=1,Tr(e,t,i,g),t.child)}function bg(e,t,i,l,f){if(ji(t),t.stateNode===null){var g=fs,C=i.contextType;typeof C=="object"&&C!==null&&(g=_r(C)),g=new i(l,g),t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=xd,t.stateNode=g,g._reactInternals=t,g=t.stateNode,g.props=l,g.state=t.memoizedState,g.refs={},Zc(t),C=i.contextType,g.context=typeof C=="object"&&C!==null?_r(C):fs,g.state=t.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&(vd(t,i,C,l),g.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(C=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),C!==g.state&&xd.enqueueReplaceState(g,g.state,null),dl(t,l,g,f),cl(),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){g=t.stateNode;var L=t.memoizedProps,z=Vi(i,L);g.props=z;var ue=g.context,ve=i.contextType;C=fs,typeof ve=="object"&&ve!==null&&(C=_r(ve));var Se=i.getDerivedStateFromProps;ve=typeof Se=="function"||typeof g.getSnapshotBeforeUpdate=="function",L=t.pendingProps!==L,ve||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(L||ue!==C)&&sg(t,g,l,C),Pa=!1;var de=t.memoizedState;g.state=de,dl(t,l,g,f),cl(),ue=t.memoizedState,L||de!==ue||Pa?(typeof Se=="function"&&(vd(t,i,Se,l),ue=t.memoizedState),(z=Pa||ig(t,i,z,l,de,ue,C))?(ve||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=ue),g.props=l,g.state=ue,g.context=C,l=z):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{g=t.stateNode,ed(e,t),C=t.memoizedProps,ve=Vi(i,C),g.props=ve,Se=t.pendingProps,de=g.context,ue=i.contextType,z=fs,typeof ue=="object"&&ue!==null&&(z=_r(ue)),L=i.getDerivedStateFromProps,(ue=typeof L=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C!==Se||de!==z)&&sg(t,g,l,z),Pa=!1,de=t.memoizedState,g.state=de,dl(t,l,g,f),cl();var Ae=t.memoizedState;C!==Se||de!==Ae||Pa||e!==null&&e.dependencies!==null&&vo(e.dependencies)?(typeof L=="function"&&(vd(t,i,L,l),Ae=t.memoizedState),(ve=Pa||ig(t,i,ve,l,de,Ae,z)||e!==null&&e.dependencies!==null&&vo(e.dependencies))?(ue||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,Ae,z),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,Ae,z)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Ae),g.props=l,g.state=Ae,g.context=z,l=ve):(typeof g.componentDidUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),l=!1)}return g=l,jo(e,t),l=(t.flags&128)!==0,g||l?(g=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:g.render(),t.flags|=1,e!==null&&l?(t.child=xs(t,e.child,null,f),t.child=xs(t,null,i,f)):Tr(e,t,i,f),t.memoizedState=g.state,e=t.child):e=wa(e,t,f),e}function vg(e,t,i,l){return rl(),t.flags|=256,Tr(e,t,i,l),t.child}var Id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bd(e){return{baseLanes:e,cachePool:oh()}}function Sd(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Tn),e}function xg(e,t,i){var l=t.pendingProps,f=!1,g=(t.flags&128)!==0,C;if((C=g)||(C=e!==null&&e.memoizedState===null?!1:(gr.current&2)!==0),C&&(f=!0,t.flags&=-129),C=(t.flags&32)!==0,t.flags&=-33,e===null){if(It){if(f?$a(t):Wa(),It){var L=Zt,z;if(z=L){e:{for(z=L,L=Wn;z.nodeType!==8;){if(!L){L=null;break e}if(z=jn(z.nextSibling),z===null){L=null;break e}}L=z}L!==null?(t.memoizedState={dehydrated:L,treeContext:Ui!==null?{id:ya,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},z=dn(18,null,null,0),z.stateNode=L,z.return=t,t.child=z,qr=t,Zt=null,z=!0):z=!1}z||Oi(t)}if(L=t.memoizedState,L!==null&&(L=L.dehydrated,L!==null))return df(L)?t.lanes=32:t.lanes=536870912,null;Ca(t)}return L=l.children,l=l.fallback,f?(Wa(),f=t.mode,L=Ho({mode:"hidden",children:L},f),l=Li(l,f,i,null),L.return=t,l.return=t,L.sibling=l,t.child=L,f=t.child,f.memoizedState=Bd(i),f.childLanes=Sd(e,C,i),t.memoizedState=Id,l):($a(t),Nd(t,L))}if(z=e.memoizedState,z!==null&&(L=z.dehydrated,L!==null)){if(g)t.flags&256?($a(t),t.flags&=-257,t=Td(e,t,i)):t.memoizedState!==null?(Wa(),t.child=e.child,t.flags|=128,t=null):(Wa(),f=l.fallback,L=t.mode,l=Ho({mode:"visible",children:l.children},L),f=Li(f,L,i,null),f.flags|=2,l.return=t,f.return=t,l.sibling=f,t.child=l,xs(t,e.child,null,i),l=t.child,l.memoizedState=Bd(i),l.childLanes=Sd(e,C,i),t.memoizedState=Id,t=f);else if($a(t),df(L)){if(C=L.nextSibling&&L.nextSibling.dataset,C)var ue=C.dgst;C=ue,l=Error(s(419)),l.stack="",l.digest=C,nl({value:l,source:null,stack:null}),t=Td(e,t,i)}else if(xr||al(e,t,i,!1),C=(i&e.childLanes)!==0,xr||C){if(C=Ft,C!==null&&(l=i&-i,l=(l&42)!==0?1:Ci(l),l=(l&(C.suspendedLanes|i))!==0?0:l,l!==0&&l!==z.retryLane))throw z.retryLane=l,ds(e,l),mn(C,e,l),Ag;L.data==="$?"||Pd(),t=Td(e,t,i)}else L.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,Zt=jn(L.nextSibling),qr=t,It=!0,_i=null,Wn=!1,e!==null&&(Bn[Sn++]=ya,Bn[Sn++]=Ea,Bn[Sn++]=Ui,ya=e.id,Ea=e.overflow,Ui=t),t=Nd(t,l.children),t.flags|=4096);return t}return f?(Wa(),f=l.fallback,L=t.mode,z=e.child,ue=z.sibling,l=pa(z,{mode:"hidden",children:l.children}),l.subtreeFlags=z.subtreeFlags&65011712,ue!==null?f=pa(ue,f):(f=Li(f,L,i,null),f.flags|=2),f.return=t,l.return=t,l.sibling=f,t.child=l,l=f,f=t.child,L=e.child.memoizedState,L===null?L=Bd(i):(z=L.cachePool,z!==null?(ue=hr._currentValue,z=z.parent!==ue?{parent:ue,pool:ue}:z):z=oh(),L={baseLanes:L.baseLanes|i,cachePool:z}),f.memoizedState=L,f.childLanes=Sd(e,C,i),t.memoizedState=Id,l):($a(t),i=e.child,e=i.sibling,i=pa(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(C=t.deletions,C===null?(t.deletions=[e],t.flags|=16):C.push(e)),t.child=i,t.memoizedState=null,i)}function Nd(e,t){return t=Ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ho(e,t){return e=dn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Td(e,t,i){return xs(t,e.child,null,i),e=Nd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cg(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Pc(e.return,t,i)}function Qd(e,t,i,l,f){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=i,g.tailMode=f)}function wg(e,t,i){var l=t.pendingProps,f=l.revealOrder,g=l.tail;if(Tr(e,t,l.children,i),l=gr.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cg(e,i,t);else if(e.tag===19)Cg(e,i,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}l&=1}switch(ke(gr,l),f){case"forwards":for(i=t.child,f=null;i!==null;)e=i.alternate,e!==null&&_o(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=t.child,t.child=null):(f=i.sibling,i.sibling=null),Qd(t,!1,f,i,g);break;case"backwards":for(i=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&_o(e)===null){t.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Qd(t,!0,i,null,g);break;case"together":Qd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wa(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ni|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(al(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=pa(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=pa(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Dd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vo(e)))}function BE(e,t,i){switch(t.tag){case 3:We(t,t.stateNode.containerInfo),Ya(t,hr,e.memoizedState.cache),rl();break;case 27:case 5:Kt(t);break;case 4:We(t,t.stateNode.containerInfo);break;case 10:Ya(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?($a(t),t.flags|=128,null):(i&t.child.childLanes)!==0?xg(e,t,i):($a(t),e=wa(e,t,i),e!==null?e.sibling:null);$a(t);break;case 19:var f=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(al(e,t,i,!1),l=(i&t.childLanes)!==0),f){if(l)return wg(e,t,i);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ke(gr,gr.current),l)break;return null;case 22:case 23:return t.lanes=0,pg(e,t,i);case 24:Ya(t,hr,e.memoizedState.cache)}return wa(e,t,i)}function Ig(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)xr=!0;else{if(!Dd(e,i)&&(t.flags&128)===0)return xr=!1,BE(e,t,i);xr=(e.flags&131072)!==0}else xr=!1,It&&(t.flags&1048576)!==0&&th(t,bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,f=l._init;if(l=f(l._payload),t.type=l,typeof l=="function")jc(l)?(e=Vi(l,e),t.tag=1,t=bg(null,t,l,e,i)):(t.tag=0,t=wd(null,t,l,e,i));else{if(l!=null){if(f=l.$$typeof,f===q){t.tag=11,t=hg(null,t,l,e,i);break e}else if(f===ce){t.tag=14,t=gg(null,t,l,e,i);break e}}throw t=we(l)||l,Error(s(306,t,""))}}return t;case 0:return wd(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,f=Vi(l,t.pendingProps),bg(e,t,l,f,i);case 3:e:{if(We(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var g=t.memoizedState;f=g.element,ed(e,t),dl(t,l,null,i);var C=t.memoizedState;if(l=C.cache,Ya(t,hr,l),l!==g.cache&&Kc(t,[hr],i,!0),cl(),l=C.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:C.cache},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){t=vg(e,t,l,i);break e}else if(l!==f){f=wn(Error(s(424)),t),nl(f),t=vg(e,t,l,i);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(Zt=jn(e.firstChild),qr=t,It=!0,_i=null,Wn=!0,i=ng(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(rl(),l===f){t=wa(e,t,i);break e}Tr(e,t,l,i)}t=t.child}return t;case 26:return jo(e,t),e===null?(i=T0(t.type,null,t.pendingProps,null))?t.memoizedState=i:It||(i=t.type,e=t.pendingProps,l=tu(Ge.current).createElement(i),l[_t]=t,l[dr]=e,Dr(l,i,e),Gt(l),t.stateNode=l):t.memoizedState=T0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Kt(t),e===null&&It&&(l=t.stateNode=B0(t.type,t.pendingProps,Ge.current),qr=t,Wn=!0,f=Zt,li(t.type)?(ff=f,Zt=jn(l.firstChild)):Zt=f),Tr(e,t,t.pendingProps.children,i),jo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&It&&((f=l=Zt)&&(l=eb(l,t.type,t.pendingProps,Wn),l!==null?(t.stateNode=l,qr=t,Zt=jn(l.firstChild),Wn=!1,f=!0):f=!1),f||Oi(t)),Kt(t),f=t.type,g=t.pendingProps,C=e!==null?e.memoizedProps:null,l=g.children,of(f,g)?l=null:C!==null&&of(f,C)&&(t.flags|=32),t.memoizedState!==null&&(f=sd(e,t,yE,null,null,i),kl._currentValue=f),jo(e,t),Tr(e,t,l,i),t.child;case 6:return e===null&&It&&((e=i=Zt)&&(i=tb(i,t.pendingProps,Wn),i!==null?(t.stateNode=i,qr=t,Zt=null,e=!0):e=!1),e||Oi(t)),null;case 13:return xg(e,t,i);case 4:return We(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=xs(t,null,l,i):Tr(e,t,l,i),t.child;case 11:return hg(e,t,t.type,t.pendingProps,i);case 7:return Tr(e,t,t.pendingProps,i),t.child;case 8:return Tr(e,t,t.pendingProps.children,i),t.child;case 12:return Tr(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,Ya(t,t.type,l.value),Tr(e,t,l.children,i),t.child;case 9:return f=t.type._context,l=t.pendingProps.children,ji(t),f=_r(f),l=l(f),t.flags|=1,Tr(e,t,l,i),t.child;case 14:return gg(e,t,t.type,t.pendingProps,i);case 15:return mg(e,t,t.type,t.pendingProps,i);case 19:return wg(e,t,i);case 31:return l=t.pendingProps,i=t.mode,l={mode:l.mode,children:l.children},e===null?(i=Ho(l,i),i.ref=t.ref,t.child=i,i.return=t,t=i):(i=pa(e.child,l),i.ref=t.ref,t.child=i,i.return=t,t=i),t;case 22:return pg(e,t,i);case 24:return ji(t),l=_r(hr),e===null?(f=$c(),f===null&&(f=Ft,g=Jc(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=i),f=g),t.memoizedState={parent:l,cache:f},Zc(t),Ya(t,hr,f)):((e.lanes&i)!==0&&(ed(e,t),dl(t,null,null,i),cl()),f=e.memoizedState,g=t.memoizedState,f.parent!==l?(f={parent:l,cache:l},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),Ya(t,hr,l)):(l=g.cache,Ya(t,hr,l),l!==f.cache&&Kc(t,[hr],i,!0))),Tr(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Ia(e){e.flags|=4}function Bg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!L0(t)){if(t=Nn.current,t!==null&&((xt&4194048)===xt?Zn!==null:(xt&62914560)!==xt&&(xt&536870912)===0||t!==Zn))throw ol=Wc,uh;e.flags|=8192}}function Go(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?sn():536870912,e.lanes|=t,Bs|=t)}function yl(e,t){if(!It)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function SE(e,t,i){var l=t.pendingProps;switch(qc(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(t),null;case 1:return Xt(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),va(hr),Et(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(tl(t)?Ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ah())),Xt(t),null;case 26:return i=t.memoizedState,e===null?(Ia(t),i!==null?(Xt(t),Bg(t,i)):(Xt(t),t.flags&=-16777217)):i?i!==e.memoizedState?(Ia(t),Xt(t),Bg(t,i)):(Xt(t),t.flags&=-16777217):(e.memoizedProps!==l&&Ia(t),Xt(t),t.flags&=-16777217),null;case 27:Sr(t),i=Ge.current;var f=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Xt(t),null}e=He.current,tl(t)?rh(t):(e=B0(f,l,i),t.stateNode=e,Ia(t))}return Xt(t),null;case 5:if(Sr(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Xt(t),null}if(e=He.current,tl(t))rh(t);else{switch(f=tu(Ge.current),e){case 1:e=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:e=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":e=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":e=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":e=f.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?e.multiple=!0:l.size&&(e.size=l.size);break;default:e=typeof l.is=="string"?f.createElement(i,{is:l.is}):f.createElement(i)}}e[_t]=t,e[dr]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)e.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=e;e:switch(Dr(e,i,l),i){case"button":case"input":case"select":case"textarea":e=!!l.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ia(t)}}return Xt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(e=Ge.current,tl(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,f=qr,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[_t]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||E0(e.nodeValue,i)),e||Oi(t)}else e=tu(e).createTextNode(l),e[_t]=t,t.stateNode=e}return Xt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=tl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[_t]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xt(t),f=!1}else f=ah(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(Ca(t),t):(Ca(t),null)}if(Ca(t),(t.flags&128)!==0)return t.lanes=i,t;if(i=l!==null,e=e!==null&&e.memoizedState!==null,i){l=t.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var g=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==f&&(l.flags|=2048)}return i!==e&&i&&(t.child.flags|=8192),Go(t,t.updateQueue),Xt(t),null;case 4:return Et(),e===null&&rf(t.stateNode.containerInfo),Xt(t),null;case 10:return va(t.type),Xt(t),null;case 19:if(Ee(gr),f=t.memoizedState,f===null)return Xt(t),null;if(l=(t.flags&128)!==0,g=f.rendering,g===null)if(l)yl(f,!1);else{if(er!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=_o(e),g!==null){for(t.flags|=128,yl(f,!1),e=g.updateQueue,t.updateQueue=e,Go(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)eh(i,e),i=i.sibling;return ke(gr,gr.current&1|2),t.child}e=e.sibling}f.tail!==null&&Fe()>zo&&(t.flags|=128,l=!0,yl(f,!1),t.lanes=4194304)}else{if(!l)if(e=_o(g),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Go(t,e),yl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!g.alternate&&!It)return Xt(t),null}else 2*Fe()-f.renderingStartTime>zo&&i!==536870912&&(t.flags|=128,l=!0,yl(f,!1),t.lanes=4194304);f.isBackwards?(g.sibling=t.child,t.child=g):(e=f.last,e!==null?e.sibling=g:t.child=g,f.last=g)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Fe(),t.sibling=null,e=gr.current,ke(gr,l?e&1|2:e&1),t):(Xt(t),null);case 22:case 23:return Ca(t),ad(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(Xt(t),t.subtreeFlags&6&&(t.flags|=8192)):Xt(t),i=t.updateQueue,i!==null&&Go(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&Ee(Hi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),va(hr),Xt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function NE(e,t){switch(qc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(hr),Et(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Sr(t),null;case 13:if(Ca(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(gr),null;case 4:return Et(),null;case 10:return va(t.type),null;case 22:case 23:return Ca(t),ad(),e!==null&&Ee(Hi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(hr),null;case 25:return null;default:return null}}function Sg(e,t){switch(qc(t),t.tag){case 3:va(hr),Et();break;case 26:case 27:case 5:Sr(t);break;case 4:Et();break;case 13:Ca(t);break;case 19:Ee(gr);break;case 10:va(t.type);break;case 22:case 23:Ca(t),ad(),e!==null&&Ee(Hi);break;case 24:va(hr)}}function El(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&e)===e){l=void 0;var g=i.create,C=i.inst;l=g(),C.destroy=l}i=i.next}while(i!==f)}}catch(L){Mt(t,t.return,L)}}function Za(e,t,i){try{var l=t.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var g=f.next;l=g;do{if((l.tag&e)===e){var C=l.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,f=t;var z=i,ue=L;try{ue()}catch(ve){Mt(f,z,ve)}}}l=l.next}while(l!==g)}}catch(ve){Mt(t,t.return,ve)}}function Ng(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{gh(t,i)}catch(l){Mt(e,e.return,l)}}}function Tg(e,t,i){i.props=Vi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){Mt(e,t,l)}}function bl(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(f){Mt(e,t,f)}}function ea(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){Mt(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Mt(e,t,f)}else i.current=null}function Qg(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){Mt(e,e.return,f)}}function Rd(e,t,i){try{var l=e.stateNode;JE(l,e.type,i,t),l[dr]=t}catch(f){Mt(e,e.return,f)}}function Dg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&li(e.type)||e.tag===4}function kd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dg(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&&li(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 Ld(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=eu));else if(l!==4&&(l===27&&li(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Ld(e,t,i),e=e.sibling;e!==null;)Ld(e,t,i),e=e.sibling}function Vo(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&li(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Vo(e,t,i),e=e.sibling;e!==null;)Vo(e,t,i),e=e.sibling}function Rg(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);Dr(t,l,i),t[_t]=e,t[dr]=i}catch(g){Mt(e,e.return,g)}}var Ba=!1,ir=!1,Ud=!1,kg=typeof WeakSet=="function"?WeakSet:Set,Cr=null;function TE(e,t){if(e=e.containerInfo,sf=lu,e=qA(e),kc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var C=0,L=-1,z=-1,ue=0,ve=0,Se=e,de=null;t:for(;;){for(var Ae;Se!==i||f!==0&&Se.nodeType!==3||(L=C+f),Se!==g||l!==0&&Se.nodeType!==3||(z=C+l),Se.nodeType===3&&(C+=Se.nodeValue.length),(Ae=Se.firstChild)!==null;)de=Se,Se=Ae;for(;;){if(Se===e)break t;if(de===i&&++ue===f&&(L=C),de===g&&++ve===l&&(z=C),(Ae=Se.nextSibling)!==null)break;Se=de,de=Se.parentNode}Se=Ae}i=L===-1||z===-1?null:{start:L,end:z}}else i=null}i=i||{start:0,end:0}}else i=null;for(lf={focusedElem:e,selectionRange:i},lu=!1,Cr=t;Cr!==null;)if(t=Cr,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Cr=e;else for(;Cr!==null;){switch(t=Cr,g=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,i=t,f=g.memoizedProps,g=g.memoizedState,l=i.stateNode;try{var rt=Vi(i.type,f,i.elementType===i.type);e=l.getSnapshotBeforeUpdate(rt,g),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ze){Mt(i,i.return,Ze)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)cf(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Cr=e;break}Cr=t.return}}function Lg(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ei(e,i),l&4&&El(5,i);break;case 1:if(ei(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(C){Mt(i,i.return,C)}else{var f=Vi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(C){Mt(i,i.return,C)}}l&64&&Ng(i),l&512&&bl(i,i.return);break;case 3:if(ei(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{gh(e,t)}catch(C){Mt(i,i.return,C)}}break;case 27:t===null&&l&4&&Rg(i);case 26:case 5:ei(e,i),t===null&&l&4&&Qg(i),l&512&&bl(i,i.return);break;case 12:ei(e,i);break;case 13:ei(e,i),l&4&&_g(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=OE.bind(null,i),rb(e,i))));break;case 22:if(l=i.memoizedState!==null||Ba,!l){t=t!==null&&t.memoizedState!==null||ir,f=Ba;var g=ir;Ba=l,(ir=t)&&!g?ti(e,i,(i.subtreeFlags&8772)!==0):ei(e,i),Ba=f,ir=g}break;case 30:break;default:ei(e,i)}}function Ug(e){var t=e.alternate;t!==null&&(e.alternate=null,Ug(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tr(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 zt=null,en=!1;function Sa(e,t,i){for(i=i.child;i!==null;)Mg(e,t,i),i=i.sibling}function Mg(e,t,i){if(S&&typeof S.onCommitFiberUnmount=="function")try{S.onCommitFiberUnmount(Ve,i)}catch{}switch(i.tag){case 26:ir||ea(i,t),Sa(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ir||ea(i,t);var l=zt,f=en;li(i.type)&&(zt=i.stateNode,en=!1),Sa(e,t,i),Tl(i.stateNode),zt=l,en=f;break;case 5:ir||ea(i,t);case 6:if(l=zt,f=en,zt=null,Sa(e,t,i),zt=l,en=f,zt!==null)if(en)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(i.stateNode)}catch(g){Mt(i,t,g)}else try{zt.removeChild(i.stateNode)}catch(g){Mt(i,t,g)}break;case 18:zt!==null&&(en?(e=zt,w0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),_l(e)):w0(zt,i.stateNode));break;case 4:l=zt,f=en,zt=i.stateNode.containerInfo,en=!0,Sa(e,t,i),zt=l,en=f;break;case 0:case 11:case 14:case 15:ir||Za(2,i,t),ir||Za(4,i,t),Sa(e,t,i);break;case 1:ir||(ea(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Tg(i,t,l)),Sa(e,t,i);break;case 21:Sa(e,t,i);break;case 22:ir=(l=ir)||i.memoizedState!==null,Sa(e,t,i),ir=l;break;default:Sa(e,t,i)}}function _g(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_l(e)}catch(i){Mt(t,t.return,i)}}function QE(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kg),t;default:throw Error(s(435,e.tag))}}function Md(e,t){var i=QE(e);t.forEach(function(l){var f=FE.bind(null,e,l);i.has(l)||(i.add(l),l.then(f,f))})}function fn(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l],g=e,C=t,L=C;e:for(;L!==null;){switch(L.tag){case 27:if(li(L.type)){zt=L.stateNode,en=!1;break e}break;case 5:zt=L.stateNode,en=!1;break e;case 3:case 4:zt=L.stateNode.containerInfo,en=!0;break e}L=L.return}if(zt===null)throw Error(s(160));Mg(g,C,f),zt=null,en=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Og(t,e),t=t.sibling}var Fn=null;function Og(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fn(t,e),An(e),l&4&&(Za(3,e,e.return),El(3,e),Za(5,e,e.return));break;case 1:fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),l&64&&Ba&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var f=Fn;if(fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),l&4){var g=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":g=f.getElementsByTagName("title")[0],(!g||g[En]||g[_t]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(l),f.head.insertBefore(g,f.querySelector("head > title"))),Dr(g,l,i),g[_t]=e,Gt(g),l=g;break e;case"link":var C=R0("link","href",f).get(l+(i.href||""));if(C){for(var L=0;L<C.length;L++)if(g=C[L],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){C.splice(L,1);break t}}g=f.createElement(l),Dr(g,l,i),f.head.appendChild(g);break;case"meta":if(C=R0("meta","content",f).get(l+(i.content||""))){for(L=0;L<C.length;L++)if(g=C[L],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){C.splice(L,1);break t}}g=f.createElement(l),Dr(g,l,i),f.head.appendChild(g);break;default:throw Error(s(468,l))}g[_t]=e,Gt(g),l=g}e.stateNode=l}else k0(f,e.type,e.stateNode);else e.stateNode=D0(f,l,e.memoizedProps);else g!==l?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,l===null?k0(f,e.type,e.stateNode):D0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Rd(e,e.memoizedProps,i.memoizedProps)}break;case 27:fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),i!==null&&l&4&&Rd(e,e.memoizedProps,i.memoizedProps);break;case 5:if(fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),e.flags&32){f=e.stateNode;try{Cn(f,"")}catch(Ae){Mt(e,e.return,Ae)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,Rd(e,f,i!==null?i.memoizedProps:f)),l&1024&&(Ud=!0);break;case 6:if(fn(t,e),An(e),l&4){if(e.stateNode===null)throw Error(s(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Ae){Mt(e,e.return,Ae)}}break;case 3:if(au=null,f=Fn,Fn=ru(t.containerInfo),fn(t,e),Fn=f,An(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{_l(t.containerInfo)}catch(Ae){Mt(e,e.return,Ae)}Ud&&(Ud=!1,Fg(e));break;case 4:l=Fn,Fn=ru(e.stateNode.containerInfo),fn(t,e),An(e),Fn=l;break;case 12:fn(t,e),An(e);break;case 13:fn(t,e),An(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Gd=Fe()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Md(e,l)));break;case 22:f=e.memoizedState!==null;var z=i!==null&&i.memoizedState!==null,ue=Ba,ve=ir;if(Ba=ue||f,ir=ve||z,fn(t,e),ir=ve,Ba=ue,An(e),l&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(i===null||z||Ba||ir||qi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){z=i=t;try{if(g=z.stateNode,f)C=g.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{L=z.stateNode;var Se=z.memoizedProps.style,de=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;L.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Ae){Mt(z,z.return,Ae)}}}else if(t.tag===6){if(i===null){z=t;try{z.stateNode.nodeValue=f?"":z.memoizedProps}catch(Ae){Mt(z,z.return,Ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,Md(e,i))));break;case 19:fn(t,e),An(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Md(e,l)));break;case 30:break;case 21:break;default:fn(t,e),An(e)}}function An(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Dg(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var f=i.stateNode,g=kd(e);Vo(e,g,f);break;case 5:var C=i.stateNode;i.flags&32&&(Cn(C,""),i.flags&=-33);var L=kd(e);Vo(e,L,C);break;case 3:case 4:var z=i.stateNode.containerInfo,ue=kd(e);Ld(e,ue,z);break;default:throw Error(s(161))}}catch(ve){Mt(e,e.return,ve)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ei(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Lg(e,t.alternate,t),t=t.sibling}function qi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Za(4,t,t.return),qi(t);break;case 1:ea(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Tg(t,t.return,i),qi(t);break;case 27:Tl(t.stateNode);case 26:case 5:ea(t,t.return),qi(t);break;case 22:t.memoizedState===null&&qi(t);break;case 30:qi(t);break;default:qi(t)}e=e.sibling}}function ti(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,f=e,g=t,C=g.flags;switch(g.tag){case 0:case 11:case 15:ti(f,g,i),El(4,g);break;case 1:if(ti(f,g,i),l=g,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ue){Mt(l,l.return,ue)}if(l=g,f=l.updateQueue,f!==null){var L=l.stateNode;try{var z=f.shared.hiddenCallbacks;if(z!==null)for(f.shared.hiddenCallbacks=null,f=0;f<z.length;f++)hh(z[f],L)}catch(ue){Mt(l,l.return,ue)}}i&&C&64&&Ng(g),bl(g,g.return);break;case 27:Rg(g);case 26:case 5:ti(f,g,i),i&&l===null&&C&4&&Qg(g),bl(g,g.return);break;case 12:ti(f,g,i);break;case 13:ti(f,g,i),i&&C&4&&_g(f,g);break;case 22:g.memoizedState===null&&ti(f,g,i),bl(g,g.return);break;case 30:break;default:ti(f,g,i)}t=t.sibling}}function _d(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&il(i))}function Od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&il(e))}function ta(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jg(e,t,i,l),t=t.sibling}function jg(e,t,i,l){var f=t.flags;switch(t.tag){case 0:case 11:case 15:ta(e,t,i,l),f&2048&&El(9,t);break;case 1:ta(e,t,i,l);break;case 3:ta(e,t,i,l),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&il(e)));break;case 12:if(f&2048){ta(e,t,i,l),e=t.stateNode;try{var g=t.memoizedProps,C=g.id,L=g.onPostCommit;typeof L=="function"&&L(C,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Mt(t,t.return,z)}}else ta(e,t,i,l);break;case 13:ta(e,t,i,l);break;case 23:break;case 22:g=t.stateNode,C=t.alternate,t.memoizedState!==null?g._visibility&2?ta(e,t,i,l):vl(e,t):g._visibility&2?ta(e,t,i,l):(g._visibility|=2,Cs(e,t,i,l,(t.subtreeFlags&10256)!==0)),f&2048&&_d(C,t);break;case 24:ta(e,t,i,l),f&2048&&Od(t.alternate,t);break;default:ta(e,t,i,l)}}function Cs(e,t,i,l,f){for(f=f&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var g=e,C=t,L=i,z=l,ue=C.flags;switch(C.tag){case 0:case 11:case 15:Cs(g,C,L,z,f),El(8,C);break;case 23:break;case 22:var ve=C.stateNode;C.memoizedState!==null?ve._visibility&2?Cs(g,C,L,z,f):vl(g,C):(ve._visibility|=2,Cs(g,C,L,z,f)),f&&ue&2048&&_d(C.alternate,C);break;case 24:Cs(g,C,L,z,f),f&&ue&2048&&Od(C.alternate,C);break;default:Cs(g,C,L,z,f)}t=t.sibling}}function vl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,f=l.flags;switch(l.tag){case 22:vl(i,l),f&2048&&_d(l.alternate,l);break;case 24:vl(i,l),f&2048&&Od(l.alternate,l);break;default:vl(i,l)}t=t.sibling}}var xl=8192;function ws(e){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)Hg(e),e=e.sibling}function Hg(e){switch(e.tag){case 26:ws(e),e.flags&xl&&e.memoizedState!==null&&gb(Fn,e.memoizedState,e.memoizedProps);break;case 5:ws(e);break;case 3:case 4:var t=Fn;Fn=ru(e.stateNode.containerInfo),ws(e),Fn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=xl,xl=16777216,ws(e),xl=t):ws(e));break;default:ws(e)}}function Gg(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 Cl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Cr=l,qg(l,e)}Gg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vg(e),e=e.sibling}function Vg(e){switch(e.tag){case 0:case 11:case 15:Cl(e),e.flags&2048&&Za(9,e,e.return);break;case 3:Cl(e);break;case 12:Cl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qo(e)):Cl(e);break;default:Cl(e)}}function qo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Cr=l,qg(l,e)}Gg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Za(8,t,t.return),qo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,qo(t));break;default:qo(t)}e=e.sibling}}function qg(e,t){for(;Cr!==null;){var i=Cr;switch(i.tag){case 0:case 11:case 15:Za(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:il(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Cr=l;else e:for(i=e;Cr!==null;){l=Cr;var f=l.sibling,g=l.return;if(Ug(l),l===i){Cr=null;break e}if(f!==null){f.return=g,Cr=f;break e}Cr=g}}}var DE={getCacheForType:function(e){var t=_r(hr),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i}},RE=typeof WeakMap=="function"?WeakMap:Map,St=0,Ft=null,mt=null,xt=0,Nt=0,hn=null,ri=!1,Is=!1,Fd=!1,Na=0,er=0,ni=0,zi=0,jd=0,Tn=0,Bs=0,wl=null,tn=null,Hd=!1,Gd=0,zo=1/0,Yo=null,ai=null,Qr=0,ii=null,Ss=null,Ns=0,Vd=0,qd=null,zg=null,Il=0,zd=null;function gn(){if((St&2)!==0&&xt!==0)return xt&-xt;if(P.T!==null){var e=gs;return e!==0?e:Wd()}return _a()}function Yg(){Tn===0&&(Tn=(xt&536870912)===0||It?es():536870912);var e=Nn.current;return e!==null&&(e.flags|=32),Tn}function mn(e,t,i){(e===Ft&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)&&(Ts(e,0),si(e,xt,Tn,!1)),Pn(e,i),((St&2)===0||e!==Ft)&&(e===Ft&&((St&2)===0&&(zi|=i),er===4&&si(e,xt,Tn,!1)),ra(e))}function Pg(e,t,i){if((St&6)!==0)throw Error(s(327));var l=!i&&(t&124)===0&&(t&e.expiredLanes)===0||bt(e,t),f=l?UE(e,t):Kd(e,t,!0),g=l;do{if(f===0){Is&&!l&&si(e,t,0,!1);break}else{if(i=e.current.alternate,g&&!kE(i)){f=Kd(e,t,!1),g=!1;continue}if(f===2){if(g=t,e.errorRecoveryDisabledLanes&g)var C=0;else C=e.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){t=C;e:{var L=e;f=wl;var z=L.current.memoizedState.isDehydrated;if(z&&(Ts(L,C).flags|=256),C=Kd(L,C,!1),C!==2){if(Fd&&!z){L.errorRecoveryDisabledLanes|=g,zi|=g,f=4;break e}g=tn,tn=f,g!==null&&(tn===null?tn=g:tn.push.apply(tn,g))}f=C}if(g=!1,f!==2)continue}}if(f===1){Ts(e,0),si(e,t,0,!0);break}e:{switch(l=e,g=f,g){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:si(l,t,Tn,!ri);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(f=Gd+300-Fe(),10<f)){if(si(l,t,Tn,!ri),ft(l,0,!0)!==0)break e;l.timeoutHandle=x0(Kg.bind(null,l,i,tn,Yo,Hd,t,Tn,zi,Bs,ri,g,2,-0,0),f);break e}Kg(l,i,tn,Yo,Hd,t,Tn,zi,Bs,ri,g,0,-0,0)}}break}while(!0);ra(e)}function Kg(e,t,i,l,f,g,C,L,z,ue,ve,Se,de,Ae){if(e.timeoutHandle=-1,Se=t.subtreeFlags,(Se&8192||(Se&16785408)===16785408)&&(Rl={stylesheets:null,count:0,unsuspend:hb},Hg(t),Se=mb(),Se!==null)){e.cancelPendingCommit=Se(t0.bind(null,e,t,g,i,l,f,C,L,z,ve,1,de,Ae)),si(e,g,C,!ue);return}t0(e,t,g,i,l,f,C,L,z)}function kE(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],g=f.getSnapshot;f=f.value;try{if(!cn(g(),f))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 si(e,t,i,l){t&=~jd,t&=~zi,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var f=t;0<f;){var g=31-x(f),C=1<<g;l[g]=-1,f&=~C}i!==0&&Me(e,i,t)}function Po(){return(St&6)===0?(Bl(0),!1):!0}function Yd(){if(mt!==null){if(Nt===0)var e=mt.return;else e=mt,ba=Fi=null,ud(e),vs=null,ml=0,e=mt;for(;e!==null;)Sg(e.alternate,e),e=e.return;mt=null}}function Ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,$E(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Yd(),Ft=e,mt=i=pa(e.current,null),xt=t,Nt=0,hn=null,ri=!1,Is=bt(e,t),Fd=!1,Bs=Tn=jd=zi=ni=er=0,tn=wl=null,Hd=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var f=31-x(l),g=1<<f;t|=e[f],l&=~g}return Na=t,go(),i}function Jg(e,t){At=null,P.H=Lo,t===ll||t===wo?(t=fh(),Nt=3):t===uh?(t=fh(),Nt=4):Nt=t===Ag?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,mt===null&&(er=1,Fo(e,wn(t,e.current)))}function Xg(){var e=P.H;return P.H=Lo,e===null?Lo:e}function $g(){var e=P.A;return P.A=DE,e}function Pd(){er=4,ri||(xt&4194048)!==xt&&Nn.current!==null||(Is=!0),(ni&134217727)===0&&(zi&134217727)===0||Ft===null||si(Ft,xt,Tn,!1)}function Kd(e,t,i){var l=St;St|=2;var f=Xg(),g=$g();(Ft!==e||xt!==t)&&(Yo=null,Ts(e,t)),t=!1;var C=er;e:do try{if(Nt!==0&&mt!==null){var L=mt,z=hn;switch(Nt){case 8:Yd(),C=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(t=!0);var ue=Nt;if(Nt=0,hn=null,Qs(e,L,z,ue),i&&Is){C=0;break e}break;default:ue=Nt,Nt=0,hn=null,Qs(e,L,z,ue)}}LE(),C=er;break}catch(ve){Jg(e,ve)}while(!0);return t&&e.shellSuspendCounter++,ba=Fi=null,St=l,P.H=f,P.A=g,mt===null&&(Ft=null,xt=0,go()),C}function LE(){for(;mt!==null;)Wg(mt)}function UE(e,t){var i=St;St|=2;var l=Xg(),f=$g();Ft!==e||xt!==t?(Yo=null,zo=Fe()+500,Ts(e,t)):Is=bt(e,t);e:do try{if(Nt!==0&&mt!==null){t=mt;var g=hn;t:switch(Nt){case 1:Nt=0,hn=null,Qs(e,t,g,1);break;case 2:case 9:if(ch(g)){Nt=0,hn=null,Zg(t);break}t=function(){Nt!==2&&Nt!==9||Ft!==e||(Nt=7),ra(e)},g.then(t,t);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:ch(g)?(Nt=0,hn=null,Zg(t)):(Nt=0,hn=null,Qs(e,t,g,7));break;case 5:var C=null;switch(mt.tag){case 26:C=mt.memoizedState;case 5:case 27:var L=mt;if(!C||L0(C)){Nt=0,hn=null;var z=L.sibling;if(z!==null)mt=z;else{var ue=L.return;ue!==null?(mt=ue,Ko(ue)):mt=null}break t}}Nt=0,hn=null,Qs(e,t,g,5);break;case 6:Nt=0,hn=null,Qs(e,t,g,6);break;case 8:Yd(),er=6;break e;default:throw Error(s(462))}}ME();break}catch(ve){Jg(e,ve)}while(!0);return ba=Fi=null,P.H=l,P.A=f,St=i,mt!==null?0:(Ft=null,xt=0,go(),er)}function ME(){for(;mt!==null&&!Er();)Wg(mt)}function Wg(e){var t=Ig(e.alternate,e,Na);e.memoizedProps=e.pendingProps,t===null?Ko(e):mt=t}function Zg(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Eg(i,t,t.pendingProps,t.type,void 0,xt);break;case 11:t=Eg(i,t,t.pendingProps,t.type.render,t.ref,xt);break;case 5:ud(t);default:Sg(i,t),t=mt=eh(t,Na),t=Ig(i,t,Na)}e.memoizedProps=e.pendingProps,t===null?Ko(e):mt=t}function Qs(e,t,i,l){ba=Fi=null,ud(t),vs=null,ml=0;var f=t.return;try{if(IE(e,f,t,i,xt)){er=1,Fo(e,wn(i,e.current)),mt=null;return}}catch(g){if(f!==null)throw mt=f,g;er=1,Fo(e,wn(i,e.current)),mt=null;return}t.flags&32768?(It||l===1?e=!0:Is||(xt&536870912)!==0?e=!1:(ri=e=!0,(l===2||l===9||l===3||l===6)&&(l=Nn.current,l!==null&&l.tag===13&&(l.flags|=16384))),e0(t,e)):Ko(t)}function Ko(e){var t=e;do{if((t.flags&32768)!==0){e0(t,ri);return}e=t.return;var i=SE(t.alternate,t,Na);if(i!==null){mt=i;return}if(t=t.sibling,t!==null){mt=t;return}mt=t=e}while(t!==null);er===0&&(er=5)}function e0(e,t){do{var i=NE(e.alternate,e);if(i!==null){i.flags&=32767,mt=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){mt=e;return}mt=e=i}while(e!==null);er=6,mt=null}function t0(e,t,i,l,f,g,C,L,z){e.cancelPendingCommit=null;do Jo();while(Qr!==0);if((St&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(g=t.lanes|t.childLanes,g|=Oc,ts(e,i,g,C,L,z),e===Ft&&(mt=Ft=null,xt=0),Ss=t,ii=e,Ns=i,Vd=g,qd=f,zg=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jE(X,function(){return s0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=P.T,P.T=null,f=ae.p,ae.p=2,C=St,St|=4;try{TE(e,t,i)}finally{St=C,ae.p=f,P.T=l}}Qr=1,r0(),n0(),a0()}}function r0(){if(Qr===1){Qr=0;var e=ii,t=Ss,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=P.T,P.T=null;var l=ae.p;ae.p=2;var f=St;St|=4;try{Og(t,e);var g=lf,C=qA(e.containerInfo),L=g.focusedElem,z=g.selectionRange;if(C!==L&&L&&L.ownerDocument&&VA(L.ownerDocument.documentElement,L)){if(z!==null&&kc(L)){var ue=z.start,ve=z.end;if(ve===void 0&&(ve=ue),"selectionStart"in L)L.selectionStart=ue,L.selectionEnd=Math.min(ve,L.value.length);else{var Se=L.ownerDocument||document,de=Se&&Se.defaultView||window;if(de.getSelection){var Ae=de.getSelection(),rt=L.textContent.length,Ze=Math.min(z.start,rt),Rt=z.end===void 0?Ze:Math.min(z.end,rt);!Ae.extend&&Ze>Rt&&(C=Rt,Rt=Ze,Ze=C);var re=GA(L,Ze),Z=GA(L,Rt);if(re&&Z&&(Ae.rangeCount!==1||Ae.anchorNode!==re.node||Ae.anchorOffset!==re.offset||Ae.focusNode!==Z.node||Ae.focusOffset!==Z.offset)){var oe=Se.createRange();oe.setStart(re.node,re.offset),Ae.removeAllRanges(),Ze>Rt?(Ae.addRange(oe),Ae.extend(Z.node,Z.offset)):(oe.setEnd(Z.node,Z.offset),Ae.addRange(oe))}}}}for(Se=[],Ae=L;Ae=Ae.parentNode;)Ae.nodeType===1&&Se.push({element:Ae,left:Ae.scrollLeft,top:Ae.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Se.length;L++){var Ce=Se[L];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}lu=!!sf,lf=sf=null}finally{St=f,ae.p=l,P.T=i}}e.current=t,Qr=2}}function n0(){if(Qr===2){Qr=0;var e=ii,t=Ss,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=P.T,P.T=null;var l=ae.p;ae.p=2;var f=St;St|=4;try{Lg(e,t.alternate,t)}finally{St=f,ae.p=l,P.T=i}}Qr=3}}function a0(){if(Qr===4||Qr===3){Qr=0,Qe();var e=ii,t=Ss,i=Ns,l=zg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qr=5:(Qr=0,Ss=ii=null,i0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(ai=null),br(i),t=t.stateNode,S&&typeof S.onCommitFiberRoot=="function")try{S.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=P.T,f=ae.p,ae.p=2,P.T=null;try{for(var g=e.onRecoverableError,C=0;C<l.length;C++){var L=l[C];g(L.value,{componentStack:L.stack})}}finally{P.T=t,ae.p=f}}(Ns&3)!==0&&Jo(),ra(e),f=e.pendingLanes,(i&4194090)!==0&&(f&42)!==0?e===zd?Il++:(Il=0,zd=e):Il=0,Bl(0)}}function i0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,il(t)))}function Jo(e){return r0(),n0(),a0(),s0()}function s0(){if(Qr!==5)return!1;var e=ii,t=Vd;Vd=0;var i=br(Ns),l=P.T,f=ae.p;try{ae.p=32>i?32:i,P.T=null,i=qd,qd=null;var g=ii,C=Ns;if(Qr=0,Ss=ii=null,Ns=0,(St&6)!==0)throw Error(s(331));var L=St;if(St|=4,Vg(g.current),jg(g,g.current,C,i),St=L,Bl(0,!1),S&&typeof S.onPostCommitFiberRoot=="function")try{S.onPostCommitFiberRoot(Ve,g)}catch{}return!0}finally{ae.p=f,P.T=l,i0(e,t)}}function l0(e,t,i){t=wn(i,t),t=Cd(e.stateNode,t,2),e=Ja(e,t,2),e!==null&&(Pn(e,2),ra(e))}function Mt(e,t,i){if(e.tag===3)l0(e,e,i);else for(;t!==null;){if(t.tag===3){l0(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ai===null||!ai.has(l))){e=wn(i,e),i=dg(2),l=Ja(t,i,2),l!==null&&(fg(i,l,t,e),Pn(l,2),ra(l));break}}t=t.return}}function Jd(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new RE;var f=new Set;l.set(t,f)}else f=l.get(t),f===void 0&&(f=new Set,l.set(t,f));f.has(i)||(Fd=!0,f.add(i),e=_E.bind(null,e,t,i),t.then(e,e))}function _E(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ft===e&&(xt&i)===i&&(er===4||er===3&&(xt&62914560)===xt&&300>Fe()-Gd?(St&2)===0&&Ts(e,0):jd|=i,Bs===xt&&(Bs=0)),ra(e)}function o0(e,t){t===0&&(t=sn()),e=ds(e,t),e!==null&&(Pn(e,t),ra(e))}function OE(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),o0(e,i)}function FE(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),o0(e,i)}function jE(e,t){return Ht(e,t)}var Xo=null,Ds=null,Xd=!1,$o=!1,$d=!1,Yi=0;function ra(e){e!==Ds&&e.next===null&&(Ds===null?Xo=Ds=e:Ds=Ds.next=e),$o=!0,Xd||(Xd=!0,GE())}function Bl(e,t){if(!$d&&$o){$d=!0;do for(var i=!1,l=Xo;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var g=0;else{var C=l.suspendedLanes,L=l.pingedLanes;g=(1<<31-x(42|e)+1)-1,g&=f&~(C&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,f0(l,g))}else g=xt,g=ft(l,l===Ft?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(g&3)===0||bt(l,g)||(i=!0,f0(l,g));l=l.next}while(i);$d=!1}}function HE(){u0()}function u0(){$o=Xd=!1;var e=0;Yi!==0&&(XE()&&(e=Yi),Yi=0);for(var t=Fe(),i=null,l=Xo;l!==null;){var f=l.next,g=c0(l,t);g===0?(l.next=null,i===null?Xo=f:i.next=f,f===null&&(Ds=i)):(i=l,(e!==0||(g&3)!==0)&&($o=!0)),l=f}Bl(e)}function c0(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var C=31-x(g),L=1<<C,z=f[C];z===-1?((L&i)===0||(L&l)!==0)&&(f[C]=ot(L,t)):z<=t&&(e.expiredLanes|=L),g&=~L}if(t=Ft,i=xt,i=ft(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&jt(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||bt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&jt(l),br(i)){case 2:case 8:i=j;break;case 32:i=X;break;case 268435456:i=Te;break;default:i=X}return l=d0.bind(null,e),i=Ht(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&jt(l),e.callbackPriority=2,e.callbackNode=null,2}function d0(e,t){if(Qr!==0&&Qr!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Jo()&&e.callbackNode!==i)return null;var l=xt;return l=ft(e,e===Ft?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Pg(e,l,t),c0(e,Fe()),e.callbackNode!=null&&e.callbackNode===i?d0.bind(null,e):null)}function f0(e,t){if(Jo())return null;Pg(e,t,!0)}function GE(){WE(function(){(St&6)!==0?Ht(lt,HE):u0()})}function Wd(){return Yi===0&&(Yi=es()),Yi}function A0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Be(""+e)}function h0(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function VE(e,t,i,l,f){if(t==="submit"&&i&&i.stateNode===f){var g=A0((f[dr]||null).action),C=l.submitter;C&&(t=(t=C[dr]||null)?A0(t.formAction):C.getAttribute("formAction"),t!==null&&(g=t,C=null));var L=new st("action","action",null,l,f);e.push({event:L,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Yi!==0){var z=C?h0(f,C):new FormData(f);yd(i,{pending:!0,data:z,method:f.method,action:g},null,z)}}else typeof g=="function"&&(L.preventDefault(),z=C?h0(f,C):new FormData(f),yd(i,{pending:!0,data:z,method:f.method,action:g},g,z))},currentTarget:f}]})}}for(var Zd=0;Zd<_c.length;Zd++){var ef=_c[Zd],qE=ef.toLowerCase(),zE=ef[0].toUpperCase()+ef.slice(1);On(qE,"on"+zE)}On(PA,"onAnimationEnd"),On(KA,"onAnimationIteration"),On(JA,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(oE,"onTransitionRun"),On(uE,"onTransitionStart"),On(cE,"onTransitionCancel"),On(XA,"onTransitionEnd"),fr("onMouseEnter",["mouseout","mouseover"]),fr("onMouseLeave",["mouseout","mouseover"]),fr("onPointerEnter",["pointerout","pointerover"]),fr("onPointerLeave",["pointerout","pointerover"]),Un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Un("onBeforeInput",["compositionend","keypress","textInput","paste"]),Un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="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(" "),YE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function g0(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],f=l.event;l=l.listeners;e:{var g=void 0;if(t)for(var C=l.length-1;0<=C;C--){var L=l[C],z=L.instance,ue=L.currentTarget;if(L=L.listener,z!==g&&f.isPropagationStopped())break e;g=L,f.currentTarget=ue;try{g(f)}catch(ve){Oo(ve)}f.currentTarget=null,g=z}else for(C=0;C<l.length;C++){if(L=l[C],z=L.instance,ue=L.currentTarget,L=L.listener,z!==g&&f.isPropagationStopped())break e;g=L,f.currentTarget=ue;try{g(f)}catch(ve){Oo(ve)}f.currentTarget=null,g=z}}}}function pt(e,t){var i=t[Oa];i===void 0&&(i=t[Oa]=new Set);var l=e+"__bubble";i.has(l)||(m0(t,e,2,!1),i.add(l))}function tf(e,t,i){var l=0;t&&(l|=4),m0(i,e,l,t)}var Wo="_reactListening"+Math.random().toString(36).slice(2);function rf(e){if(!e[Wo]){e[Wo]=!0,Bi.forEach(function(i){i!=="selectionchange"&&(YE.has(i)||tf(i,!1,e),tf(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wo]||(t[Wo]=!0,tf("selectionchange",!1,t))}}function m0(e,t,i,l){switch(j0(t)){case 2:var f=Eb;break;case 8:f=bb;break;default:f=pf}i=f.bind(null,t,i,e),f=void 0,!Vt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(t,i,{capture:!0,passive:f}):e.addEventListener(t,i,!0):f!==void 0?e.addEventListener(t,i,{passive:f}):e.addEventListener(t,i,!1)}function nf(e,t,i,l,f){var g=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var C=l.tag;if(C===3||C===4){var L=l.stateNode.containerInfo;if(L===f)break;if(C===4)for(C=l.return;C!==null;){var z=C.tag;if((z===3||z===4)&&C.stateNode.containerInfo===f)return;C=C.return}for(;L!==null;){if(C=kn(L),C===null)return;if(z=C.tag,z===5||z===6||z===26||z===27){l=g=C;continue e}L=L.parentNode}}l=l.return}Vr(function(){var ue=g,ve=je(i),Se=[];e:{var de=$A.get(e);if(de!==void 0){var Ae=st,rt=e;switch(e){case"keypress":if(U(i)===0)break e;case"keydown":case"keyup":Ae=vc;break;case"focusin":rt="focus",Ae=Js;break;case"focusout":rt="blur",Ae=Js;break;case"beforeblur":case"afterblur":Ae=Js;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ae=lo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ae=uc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ae=Cc;break;case PA:case KA:case JA:Ae=fc;break;case XA:Ae=Ic;break;case"scroll":case"scrollend":Ae=qt;break;case"wheel":Ae=fo;break;case"copy":case"cut":case"paste":Ae=hc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ae=co;break;case"toggle":case"beforetoggle":Ae=Nc}var Ze=(t&4)!==0,Rt=!Ze&&(e==="scroll"||e==="scrollend"),re=Ze?de!==null?de+"Capture":null:de;Ze=[];for(var Z=ue,oe;Z!==null;){var Ce=Z;if(oe=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||oe===null||re===null||(Ce=ln(Z,re),Ce!=null&&Ze.push(Nl(Z,Ce,oe))),Rt)break;Z=Z.return}0<Ze.length&&(de=new Ae(de,rt,null,i,ve),Se.push({event:de,listeners:Ze}))}}if((t&7)===0){e:{if(de=e==="mouseover"||e==="pointerover",Ae=e==="mouseout"||e==="pointerout",de&&i!==Ue&&(rt=i.relatedTarget||i.fromElement)&&(kn(rt)||rt[Jt]))break e;if((Ae||de)&&(de=ve.window===ve?ve:(de=ve.ownerDocument)?de.defaultView||de.parentWindow:window,Ae?(rt=i.relatedTarget||i.toElement,Ae=ue,rt=rt?kn(rt):null,rt!==null&&(Rt=u(rt),Ze=rt.tag,rt!==Rt||Ze!==5&&Ze!==27&&Ze!==6)&&(rt=null)):(Ae=null,rt=ue),Ae!==rt)){if(Ze=lo,Ce="onMouseLeave",re="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Ze=co,Ce="onPointerLeave",re="onPointerEnter",Z="pointer"),Rt=Ae==null?de:Gr(Ae),oe=rt==null?de:Gr(rt),de=new Ze(Ce,Z+"leave",Ae,i,ve),de.target=Rt,de.relatedTarget=oe,Ce=null,kn(ve)===ue&&(Ze=new Ze(re,Z+"enter",rt,i,ve),Ze.target=oe,Ze.relatedTarget=Rt,Ce=Ze),Rt=Ce,Ae&&rt)t:{for(Ze=Ae,re=rt,Z=0,oe=Ze;oe;oe=Rs(oe))Z++;for(oe=0,Ce=re;Ce;Ce=Rs(Ce))oe++;for(;0<Z-oe;)Ze=Rs(Ze),Z--;for(;0<oe-Z;)re=Rs(re),oe--;for(;Z--;){if(Ze===re||re!==null&&Ze===re.alternate)break t;Ze=Rs(Ze),re=Rs(re)}Ze=null}else Ze=null;Ae!==null&&p0(Se,de,Ae,Ze,!1),rt!==null&&Rt!==null&&p0(Se,Rt,rt,Ze,!0)}}e:{if(de=ue?Gr(ue):window,Ae=de.nodeName&&de.nodeName.toLowerCase(),Ae==="select"||Ae==="input"&&de.type==="file")var Ye=MA;else if(Mr(de))if(_A)Ye=iE;else{Ye=nE;var ht=rE}else Ae=de.nodeName,!Ae||Ae.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ue&&F(ue.elementType)&&(Ye=MA):Ye=aE;if(Ye&&(Ye=Ye(e,ue))){Wr(Se,Ye,i,ve);break e}ht&&ht(e,de,ue),e==="focusout"&&ue&&de.type==="number"&&ue.memoizedProps.value!=null&&ha(de,"number",de.value)}switch(ht=ue?Gr(ue):window,e){case"focusin":(Mr(ht)||ht.contentEditable==="true")&&(os=ht,Lc=ue,el=null);break;case"focusout":el=Lc=os=null;break;case"mousedown":Uc=!0;break;case"contextmenu":case"mouseup":case"dragend":Uc=!1,zA(Se,i,ve);break;case"selectionchange":if(lE)break;case"keydown":case"keyup":zA(Se,i,ve)}var Je;if(qa)e:{switch(e){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else et?ze(e,i)&&(tt="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(tt="onCompositionStart");tt&&(Ws&&i.locale!=="ko"&&(et||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&et&&(Je=w()):(nr=ve,h="value"in nr?nr.value:nr.textContent,et=!0)),ht=Zo(ue,tt),0<ht.length&&(tt=new Xs(tt,e,null,i,ve),Se.push({event:tt,listeners:ht}),Je?tt.data=Je:(Je=$e(i),Je!==null&&(tt.data=Je)))),(Je=Ao?wt(e,i):on(e,i))&&(tt=Zo(ue,"onBeforeInput"),0<tt.length&&(ht=new Xs("onBeforeInput","beforeinput",null,i,ve),Se.push({event:ht,listeners:tt}),ht.data=Je)),VE(Se,e,ue,i,ve)}g0(Se,t)})}function Nl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Zo(e,t){for(var i=t+"Capture",l=[];e!==null;){var f=e,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=ln(e,i),f!=null&&l.unshift(Nl(e,f,g)),f=ln(e,t),f!=null&&l.push(Nl(e,f,g))),e.tag===3)return l;e=e.return}return[]}function Rs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function p0(e,t,i,l,f){for(var g=t._reactName,C=[];i!==null&&i!==l;){var L=i,z=L.alternate,ue=L.stateNode;if(L=L.tag,z!==null&&z===l)break;L!==5&&L!==26&&L!==27||ue===null||(z=ue,f?(ue=ln(i,g),ue!=null&&C.unshift(Nl(i,ue,z))):f||(ue=ln(i,g),ue!=null&&C.push(Nl(i,ue,z)))),i=i.return}C.length!==0&&e.push({event:t,listeners:C})}var PE=/\r\n?/g,KE=/\u0000|\uFFFD/g;function y0(e){return(typeof e=="string"?e:""+e).replace(PE,`
`).replace(KE,"")}function E0(e,t){return t=y0(t),y0(e)===t}function eu(){}function Dt(e,t,i,l,f,g){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Cn(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Cn(e,""+l);break;case"className":Aa(e,"class",l);break;case"tabIndex":Aa(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Aa(e,i,l);break;case"style":D(e,l,g);break;case"data":if(t!=="object"){Aa(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Be(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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 g=="function"&&(i==="formAction"?(t!=="input"&&Dt(e,t,"name",f.name,f,null),Dt(e,t,"formEncType",f.formEncType,f,null),Dt(e,t,"formMethod",f.formMethod,f,null),Dt(e,t,"formTarget",f.formTarget,f,null)):(Dt(e,t,"encType",f.encType,f,null),Dt(e,t,"method",f.method,f,null),Dt(e,t,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Be(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=eu);break;case"onScroll":l!=null&&pt("scroll",e);break;case"onScrollEnd":l!=null&&pt("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=Be(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":pt("beforetoggle",e),pt("toggle",e),bn(e,"popover",l);break;case"xlinkActuate":Lr(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Lr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Lr(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Lr(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Lr(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Lr(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Lr(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":bn(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=ee.get(i)||i,bn(e,i,l))}}function af(e,t,i,l,f,g){switch(i){case"style":D(e,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Cn(e,l):(typeof l=="number"||typeof l=="bigint")&&Cn(e,""+l);break;case"onScroll":l!=null&&pt("scroll",e);break;case"onScrollEnd":l!=null&&pt("scrollend",e);break;case"onClick":l!=null&&(e.onclick=eu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fa.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),t=i.slice(2,f?i.length-7:void 0),g=e[dr]||null,g=g!=null?g[i]:null,typeof g=="function"&&e.removeEventListener(t,g,f),typeof l=="function")){typeof g!="function"&&g!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,f);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):bn(e,i,l)}}}function Dr(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pt("error",e),pt("load",e);var l=!1,f=!1,g;for(g in i)if(i.hasOwnProperty(g)){var C=i[g];if(C!=null)switch(g){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Dt(e,t,g,C,i,null)}}f&&Dt(e,t,"srcSet",i.srcSet,i,null),l&&Dt(e,t,"src",i.src,i,null);return;case"input":pt("invalid",e);var L=g=C=f=null,z=null,ue=null;for(l in i)if(i.hasOwnProperty(l)){var ve=i[l];if(ve!=null)switch(l){case"name":f=ve;break;case"type":C=ve;break;case"checked":z=ve;break;case"defaultChecked":ue=ve;break;case"value":g=ve;break;case"defaultValue":L=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(s(137,t));break;default:Dt(e,t,l,ve,i,null)}}$n(e,g,L,z,ue,C,f,!1),_n(e);return;case"select":pt("invalid",e),l=C=g=null;for(f in i)if(i.hasOwnProperty(f)&&(L=i[f],L!=null))switch(f){case"value":g=L;break;case"defaultValue":C=L;break;case"multiple":l=L;default:Dt(e,t,f,L,i,null)}t=g,i=C,e.multiple=!!l,t!=null?xn(e,!!l,t,!1):i!=null&&xn(e,!!l,i,!0);return;case"textarea":pt("invalid",e),g=f=l=null;for(C in i)if(i.hasOwnProperty(C)&&(L=i[C],L!=null))switch(C){case"value":l=L;break;case"defaultValue":f=L;break;case"children":g=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:Dt(e,t,C,L,i,null)}Ti(e,l,f,g),_n(e);return;case"option":for(z in i)if(i.hasOwnProperty(z)&&(l=i[z],l!=null))switch(z){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Dt(e,t,z,l,i,null)}return;case"dialog":pt("beforetoggle",e),pt("toggle",e),pt("cancel",e),pt("close",e);break;case"iframe":case"object":pt("load",e);break;case"video":case"audio":for(l=0;l<Sl.length;l++)pt(Sl[l],e);break;case"image":pt("error",e),pt("load",e);break;case"details":pt("toggle",e);break;case"embed":case"source":case"link":pt("error",e),pt("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(ue in i)if(i.hasOwnProperty(ue)&&(l=i[ue],l!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Dt(e,t,ue,l,i,null)}return;default:if(F(t)){for(ve in i)i.hasOwnProperty(ve)&&(l=i[ve],l!==void 0&&af(e,t,ve,l,i,void 0));return}}for(L in i)i.hasOwnProperty(L)&&(l=i[L],l!=null&&Dt(e,t,L,l,i,null))}function JE(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,C=null,L=null,z=null,ue=null,ve=null;for(Ae in i){var Se=i[Ae];if(i.hasOwnProperty(Ae)&&Se!=null)switch(Ae){case"checked":break;case"value":break;case"defaultValue":z=Se;default:l.hasOwnProperty(Ae)||Dt(e,t,Ae,null,l,Se)}}for(var de in l){var Ae=l[de];if(Se=i[de],l.hasOwnProperty(de)&&(Ae!=null||Se!=null))switch(de){case"type":g=Ae;break;case"name":f=Ae;break;case"checked":ue=Ae;break;case"defaultChecked":ve=Ae;break;case"value":C=Ae;break;case"defaultValue":L=Ae;break;case"children":case"dangerouslySetInnerHTML":if(Ae!=null)throw Error(s(137,t));break;default:Ae!==Se&&Dt(e,t,de,Ae,l,Se)}}Ni(e,C,L,z,ue,ve,g,f);return;case"select":Ae=C=L=de=null;for(g in i)if(z=i[g],i.hasOwnProperty(g)&&z!=null)switch(g){case"value":break;case"multiple":Ae=z;default:l.hasOwnProperty(g)||Dt(e,t,g,null,l,z)}for(f in l)if(g=l[f],z=i[f],l.hasOwnProperty(f)&&(g!=null||z!=null))switch(f){case"value":de=g;break;case"defaultValue":L=g;break;case"multiple":C=g;default:g!==z&&Dt(e,t,f,g,l,z)}t=L,i=C,l=Ae,de!=null?xn(e,!!i,de,!1):!!l!=!!i&&(t!=null?xn(e,!!i,t,!0):xn(e,!!i,i?[]:"",!1));return;case"textarea":Ae=de=null;for(L in i)if(f=i[L],i.hasOwnProperty(L)&&f!=null&&!l.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Dt(e,t,L,null,l,f)}for(C in l)if(f=l[C],g=i[C],l.hasOwnProperty(C)&&(f!=null||g!=null))switch(C){case"value":de=f;break;case"defaultValue":Ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==g&&Dt(e,t,C,f,l,g)}Va(e,de,Ae);return;case"option":for(var rt in i)if(de=i[rt],i.hasOwnProperty(rt)&&de!=null&&!l.hasOwnProperty(rt))switch(rt){case"selected":e.selected=!1;break;default:Dt(e,t,rt,null,l,de)}for(z in l)if(de=l[z],Ae=i[z],l.hasOwnProperty(z)&&de!==Ae&&(de!=null||Ae!=null))switch(z){case"selected":e.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:Dt(e,t,z,de,l,Ae)}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 Ze in i)de=i[Ze],i.hasOwnProperty(Ze)&&de!=null&&!l.hasOwnProperty(Ze)&&Dt(e,t,Ze,null,l,de);for(ue in l)if(de=l[ue],Ae=i[ue],l.hasOwnProperty(ue)&&de!==Ae&&(de!=null||Ae!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,t));break;default:Dt(e,t,ue,de,l,Ae)}return;default:if(F(t)){for(var Rt in i)de=i[Rt],i.hasOwnProperty(Rt)&&de!==void 0&&!l.hasOwnProperty(Rt)&&af(e,t,Rt,void 0,l,de);for(ve in l)de=l[ve],Ae=i[ve],!l.hasOwnProperty(ve)||de===Ae||de===void 0&&Ae===void 0||af(e,t,ve,de,l,Ae);return}}for(var re in i)de=i[re],i.hasOwnProperty(re)&&de!=null&&!l.hasOwnProperty(re)&&Dt(e,t,re,null,l,de);for(Se in l)de=l[Se],Ae=i[Se],!l.hasOwnProperty(Se)||de===Ae||de==null&&Ae==null||Dt(e,t,Se,de,l,Ae)}var sf=null,lf=null;function tu(e){return e.nodeType===9?e:e.ownerDocument}function b0(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 v0(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 of(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 uf=null;function XE(){var e=window.event;return e&&e.type==="popstate"?e===uf?!1:(uf=e,!0):(uf=null,!1)}var x0=typeof setTimeout=="function"?setTimeout:void 0,$E=typeof clearTimeout=="function"?clearTimeout:void 0,C0=typeof Promise=="function"?Promise:void 0,WE=typeof queueMicrotask=="function"?queueMicrotask:typeof C0<"u"?function(e){return C0.resolve(null).then(e).catch(ZE)}:x0;function ZE(e){setTimeout(function(){throw e})}function li(e){return e==="head"}function w0(e,t){var i=t,l=0,f=0;do{var g=i.nextSibling;if(e.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"){if(0<l&&8>l){i=l;var C=e.ownerDocument;if(i&1&&Tl(C.documentElement),i&2&&Tl(C.body),i&4)for(i=C.head,Tl(i),C=i.firstChild;C;){var L=C.nextSibling,z=C.nodeName;C[En]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=L}}if(f===0){e.removeChild(g),_l(t);return}f--}else i==="$"||i==="$?"||i==="$!"?f++:l=i.charCodeAt(0)-48;else l=0;i=g}while(i);_l(t)}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":cf(i),tr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function eb(e,t,i,l){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[En])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function tb(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=jn(e.nextSibling),e===null))return null;return e}function df(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function rb(e,t){var i=e.ownerDocument;if(e.data!=="$?"||i.readyState==="complete")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function jn(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==="F!"||t==="F")break;if(t==="/$")return null}}return e}var ff=null;function I0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}function B0(e,t,i){switch(t=tu(i),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Tl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);tr(e)}var Qn=new Map,S0=new Set;function ru(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ta=ae.d;ae.d={f:nb,r:ab,D:ib,C:sb,L:lb,m:ob,X:cb,S:ub,M:db};function nb(){var e=Ta.f(),t=Po();return e||t}function ab(e){var t=Jn(e);t!==null&&t.tag===5&&t.type==="form"?Ph(t):Ta.r(e)}var ks=typeof document>"u"?null:document;function N0(e,t,i){var l=ks;if(l&&typeof t=="string"&&t){var f=Nr(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),S0.has(f)||(S0.add(f),e={rel:e,crossOrigin:i,href:t},l.querySelector(f)===null&&(t=l.createElement("link"),Dr(t,"link",e),Gt(t),l.head.appendChild(t)))}}function ib(e){Ta.D(e),N0("dns-prefetch",e,null)}function sb(e,t){Ta.C(e,t),N0("preconnect",e,t)}function lb(e,t,i){Ta.L(e,t,i);var l=ks;if(l&&e&&t){var f='link[rel="preload"][as="'+Nr(t)+'"]';t==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+Nr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+Nr(i.imageSizes)+'"]')):f+='[href="'+Nr(e)+'"]';var g=f;switch(t){case"style":g=Ls(e);break;case"script":g=Us(e)}Qn.has(g)||(e=b({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Qn.set(g,e),l.querySelector(f)!==null||t==="style"&&l.querySelector(Ql(g))||t==="script"&&l.querySelector(Dl(g))||(t=l.createElement("link"),Dr(t,"link",e),Gt(t),l.head.appendChild(t)))}}function ob(e,t){Ta.m(e,t);var i=ks;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+Nr(l)+'"][href="'+Nr(e)+'"]',g=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Us(e)}if(!Qn.has(g)&&(e=b({rel:"modulepreload",href:e},t),Qn.set(g,e),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Dl(g)))return}l=i.createElement("link"),Dr(l,"link",e),Gt(l),i.head.appendChild(l)}}}function ub(e,t,i){Ta.S(e,t,i);var l=ks;if(l&&e){var f=Ln(l).hoistableStyles,g=Ls(e);t=t||"default";var C=f.get(g);if(!C){var L={loading:0,preload:null};if(C=l.querySelector(Ql(g)))L.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Qn.get(g))&&Af(e,i);var z=C=l.createElement("link");Gt(z),Dr(z,"link",e),z._p=new Promise(function(ue,ve){z.onload=ue,z.onerror=ve}),z.addEventListener("load",function(){L.loading|=1}),z.addEventListener("error",function(){L.loading|=2}),L.loading|=4,nu(C,t,l)}C={type:"stylesheet",instance:C,count:1,state:L},f.set(g,C)}}}function cb(e,t){Ta.X(e,t);var i=ks;if(i&&e){var l=Ln(i).hoistableScripts,f=Us(e),g=l.get(f);g||(g=i.querySelector(Dl(f)),g||(e=b({src:e,async:!0},t),(t=Qn.get(f))&&hf(e,t),g=i.createElement("script"),Gt(g),Dr(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function db(e,t){Ta.M(e,t);var i=ks;if(i&&e){var l=Ln(i).hoistableScripts,f=Us(e),g=l.get(f);g||(g=i.querySelector(Dl(f)),g||(e=b({src:e,async:!0,type:"module"},t),(t=Qn.get(f))&&hf(e,t),g=i.createElement("script"),Gt(g),Dr(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function T0(e,t,i,l){var f=(f=Ge.current)?ru(f):null;if(!f)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Ls(i.href),i=Ln(f).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ls(i.href);var g=Ln(f).hoistableStyles,C=g.get(e);if(C||(f=f.ownerDocument||f,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,C),(g=f.querySelector(Ql(e)))&&!g._p&&(C.instance=g,C.state.loading=5),Qn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Qn.set(e,i),g||fb(f,e,i,C.state))),t&&l===null)throw Error(s(528,""));return C}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Us(i),i=Ln(f).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Ls(e){return'href="'+Nr(e)+'"'}function Ql(e){return'link[rel="stylesheet"]['+e+"]"}function Q0(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function fb(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Dr(t,"link",i),Gt(t),e.head.appendChild(t))}function Us(e){return'[src="'+Nr(e)+'"]'}function Dl(e){return"script[async]"+e}function D0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Nr(i.href)+'"]');if(l)return t.instance=l,Gt(l),l;var f=b({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Gt(l),Dr(l,"style",f),nu(l,i.precedence,e),t.instance=l;case"stylesheet":f=Ls(i.href);var g=e.querySelector(Ql(f));if(g)return t.state.loading|=4,t.instance=g,Gt(g),g;l=Q0(i),(f=Qn.get(f))&&Af(l,f),g=(e.ownerDocument||e).createElement("link"),Gt(g);var C=g;return C._p=new Promise(function(L,z){C.onload=L,C.onerror=z}),Dr(g,"link",l),t.state.loading|=4,nu(g,i.precedence,e),t.instance=g;case"script":return g=Us(i.src),(f=e.querySelector(Dl(g)))?(t.instance=f,Gt(f),f):(l=i,(f=Qn.get(g))&&(l=b({},i),hf(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),Gt(f),Dr(f,"link",l),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,nu(l,i.precedence,e));return t.instance}function nu(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,g=f,C=0;C<l.length;C++){var L=l[C];if(L.dataset.precedence===t)g=L;else if(g!==f)break}g?g.parentNode.insertBefore(e,g.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Af(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var au=null;function R0(e,t,i){if(au===null){var l=new Map,f=au=new Map;f.set(i,l)}else f=au,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var g=i[f];if(!(g[En]||g[_t]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var C=g.getAttribute(t)||"";C=e+C;var L=l.get(C);L?L.push(g):l.set(C,[g])}}return l}function k0(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Ab(e,t,i){if(i===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 L0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Rl=null;function hb(){}function gb(e,t,i){if(Rl===null)throw Error(s(475));var l=Rl;if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var f=Ls(i.href),g=e.querySelector(Ql(f));if(g){e=g._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=iu.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=g,Gt(g);return}g=e.ownerDocument||e,i=Q0(i),(f=Qn.get(f))&&Af(i,f),g=g.createElement("link"),Gt(g);var C=g;C._p=new Promise(function(L,z){C.onload=L,C.onerror=z}),Dr(g,"link",i),t.instance=g}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(l.count++,t=iu.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function mb(){if(Rl===null)throw Error(s(475));var e=Rl;return e.stylesheets&&e.count===0&&gf(e,e.stylesheets),0<e.count?function(t){var i=setTimeout(function(){if(e.stylesheets&&gf(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(i)}}:null}function iu(){if(this.count--,this.count===0){if(this.stylesheets)gf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var su=null;function gf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,su=new Map,t.forEach(pb,e),su=null,iu.call(e))}function pb(e,t){if(!(t.state.loading&4)){var i=su.get(e);if(i)var l=i.get(null);else{i=new Map,su.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var C=f[g];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(i.set(C.dataset.precedence,C),l=C)}l&&i.set(null,l)}f=t.instance,C=f.getAttribute("data-precedence"),g=i.get(C)||l,g===l&&i.set(null,f),i.set(C,f),this.count++,l=iu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),g?g.parentNode.insertBefore(f,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var kl={$$typeof:_,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function yb(e,t,i,l,f,g,C,L){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=Ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.hiddenUpdates=Ma(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function U0(e,t,i,l,f,g,C,L,z,ue,ve,Se){return e=new yb(e,t,i,C,L,z,ue,Se),t=1,g===!0&&(t|=24),g=dn(3,null,null,t),e.current=g,g.stateNode=e,t=Jc(),t.refCount++,e.pooledCache=t,t.refCount++,g.memoizedState={element:l,isDehydrated:i,cache:t},Zc(g),e}function M0(e){return e?(e=fs,e):fs}function _0(e,t,i,l,f,g){f=M0(f),l.context===null?l.context=f:l.pendingContext=f,l=Ka(t),l.payload={element:i},g=g===void 0?null:g,g!==null&&(l.callback=g),i=Ja(e,l,t),i!==null&&(mn(i,e,t),ul(i,e,t))}function O0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function mf(e,t){O0(e,t),(e=e.alternate)&&O0(e,t)}function F0(e){if(e.tag===13){var t=ds(e,67108864);t!==null&&mn(t,e,67108864),mf(e,67108864)}}var lu=!0;function Eb(e,t,i,l){var f=P.T;P.T=null;var g=ae.p;try{ae.p=2,pf(e,t,i,l)}finally{ae.p=g,P.T=f}}function bb(e,t,i,l){var f=P.T;P.T=null;var g=ae.p;try{ae.p=8,pf(e,t,i,l)}finally{ae.p=g,P.T=f}}function pf(e,t,i,l){if(lu){var f=yf(l);if(f===null)nf(e,t,l,ou,i),H0(e,l);else if(xb(f,e,t,i,l))l.stopPropagation();else if(H0(e,l),t&4&&-1<vb.indexOf(e)){for(;f!==null;){var g=Jn(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var C=gt(g.pendingLanes);if(C!==0){var L=g;for(L.pendingLanes|=2,L.entangledLanes|=2;C;){var z=1<<31-x(C);L.entanglements[1]|=z,C&=~z}ra(g),(St&6)===0&&(zo=Fe()+500,Bl(0))}}break;case 13:L=ds(g,2),L!==null&&mn(L,g,2),Po(),mf(g,2)}if(g=yf(l),g===null&&nf(e,t,l,ou,i),g===f)break;f=g}f!==null&&l.stopPropagation()}else nf(e,t,l,null,i)}}function yf(e){return e=je(e),Ef(e)}var ou=null;function Ef(e){if(ou=null,e=kn(e),e!==null){var t=u(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=c(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ou=e,null}function j0(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nt()){case lt:return 2;case j:return 8;case X:case se:return 32;case Te:return 268435456;default:return 32}default:return 32}}var bf=!1,oi=null,ui=null,ci=null,Ll=new Map,Ul=new Map,di=[],vb="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 H0(e,t){switch(e){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":ui=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":Ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ul.delete(t.pointerId)}}function Ml(e,t,i,l,f,g){return e===null||e.nativeEvent!==g?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:g,targetContainers:[f]},t!==null&&(t=Jn(t),t!==null&&F0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function xb(e,t,i,l,f){switch(t){case"focusin":return oi=Ml(oi,e,t,i,l,f),!0;case"dragenter":return ui=Ml(ui,e,t,i,l,f),!0;case"mouseover":return ci=Ml(ci,e,t,i,l,f),!0;case"pointerover":var g=f.pointerId;return Ll.set(g,Ml(Ll.get(g)||null,e,t,i,l,f)),!0;case"gotpointercapture":return g=f.pointerId,Ul.set(g,Ml(Ul.get(g)||null,e,t,i,l,f)),!0}return!1}function G0(e){var t=kn(e.target);if(t!==null){var i=u(t);if(i!==null){if(t=i.tag,t===13){if(t=c(i),t!==null){e.blockedOn=t,wi(e.priority,function(){if(i.tag===13){var l=gn();l=Ci(l);var f=ds(i,l);f!==null&&mn(f,i,l),mf(i,l)}});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=yf(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Ue=l,i.target.dispatchEvent(l),Ue=null}else return t=Jn(i),t!==null&&F0(t),e.blockedOn=i,!1;t.shift()}return!0}function V0(e,t,i){uu(e)&&i.delete(t)}function Cb(){bf=!1,oi!==null&&uu(oi)&&(oi=null),ui!==null&&uu(ui)&&(ui=null),ci!==null&&uu(ci)&&(ci=null),Ll.forEach(V0),Ul.forEach(V0)}function cu(e,t){e.blockedOn===t&&(e.blockedOn=null,bf||(bf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Cb)))}var du=null;function q0(e){du!==e&&(du=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){du===e&&(du=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],f=e[t+2];if(typeof l!="function"){if(Ef(l||i)===null)continue;break}var g=Jn(i);g!==null&&(e.splice(t,3),t-=3,yd(g,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function _l(e){function t(z){return cu(z,e)}oi!==null&&cu(oi,e),ui!==null&&cu(ui,e),ci!==null&&cu(ci,e),Ll.forEach(t),Ul.forEach(t);for(var i=0;i<di.length;i++){var l=di[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<di.length&&(i=di[0],i.blockedOn===null);)G0(i),i.blockedOn===null&&di.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],g=i[l+1],C=f[dr]||null;if(typeof g=="function")C||q0(i);else if(C){var L=null;if(g&&g.hasAttribute("formAction")){if(f=g,C=g[dr]||null)L=C.formAction;else if(Ef(f)!==null)continue}else L=C.action;typeof L=="function"?i[l+1]=L:(i.splice(l,3),l-=3),q0(i)}}}function vf(e){this._internalRoot=e}fu.prototype.render=vf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var i=t.current,l=gn();_0(i,l,e,t,null,null)},fu.prototype.unmount=vf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_0(e.current,2,null,e,null,null),Po(),t[Jt]=null}};function fu(e){this._internalRoot=e}fu.prototype.unstable_scheduleHydration=function(e){if(e){var t=_a();e={blockedOn:null,target:e,priority:t};for(var i=0;i<di.length&&t!==0&&t<di[i].priority;i++);di.splice(i,0,e),i===0&&G0(e)}};var z0=r.version;if(z0!=="19.1.0")throw Error(s(527,z0,"19.1.0"));ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=m(t),e=e!==null?A(e):null,e=e===null?null:e.stateNode,e};var wb={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Au.isDisabled&&Au.supportsFiber)try{Ve=Au.inject(wb),S=Au}catch{}}return Fl.createRoot=function(e,t){if(!o(e))throw Error(s(299));var i=!1,l="",f=lg,g=og,C=ug,L=null;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(C=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(L=t.unstable_transitionCallbacks)),t=U0(e,1,!1,null,null,i,l,f,g,C,L,null),e[Jt]=t.current,rf(e),new vf(t)},Fl.hydrateRoot=function(e,t,i){if(!o(e))throw Error(s(299));var l=!1,f="",g=lg,C=og,L=ug,z=null,ue=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(C=i.onCaughtError),i.onRecoverableError!==void 0&&(L=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(z=i.unstable_transitionCallbacks),i.formState!==void 0&&(ue=i.formState)),t=U0(e,1,!0,t,i??null,l,f,g,C,L,z,ue),t.context=M0(null),i=t.current,l=gn(),l=Ci(l),f=Ka(l),f.callback=null,Ja(i,f,l),i=l,t.current.lanes=i,Pn(t,i),ra(t),e[Jt]=t.current,rf(e),new fu(t)},Fl.version="19.1.0",Fl}var tm;function _b(){if(tm)return Cf.exports;tm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Cf.exports=Mb(),Cf.exports}var Ob=_b();const Fb=xi(Ob);var rm=Object.prototype.hasOwnProperty;function Wf(n,r){var a,s;if(n===r)return!0;if(n&&r&&(a=n.constructor)===r.constructor){if(a===Date)return n.getTime()===r.getTime();if(a===RegExp)return n.toString()===r.toString();if(a===Array){if((s=n.length)===r.length)for(;s--&&Wf(n[s],r[s]););return s===-1}if(!a||typeof n=="object"){s=0;for(a in n)if(rm.call(n,a)&&++s&&!rm.call(r,a)||!(a in r)||!Wf(n[a],r[a]))return!1;return Object.keys(r).length===s}}return n!==n&&r!==r}const jb=new Error("request for lock canceled");var Hb=function(n,r,a,s){function o(u){return u instanceof a?u:new a(function(c){c(u)})}return new(a||(a=Promise))(function(u,c){function d(b){try{A(s.next(b))}catch(v){c(v)}}function m(b){try{A(s.throw(b))}catch(v){c(v)}}function A(b){b.done?u(b.value):o(b.value).then(d,m)}A((s=s.apply(n,r||[])).next())})};class Gb{constructor(r,a=jb){this._value=r,this._cancelError=a,this._queue=[],this._weightedWaiters=[]}acquire(r=1,a=0){if(r<=0)throw new Error(`invalid weight ${r}: must be positive`);return new Promise((s,o)=>{const u={resolve:s,reject:o,weight:r,priority:a},c=Up(this._queue,d=>a<=d.priority);c===-1&&r<=this._value?this._dispatchItem(u):this._queue.splice(c+1,0,u)})}runExclusive(r){return Hb(this,arguments,void 0,function*(a,s=1,o=0){const[u,c]=yield this.acquire(s,o);try{return yield a(u)}finally{c()}})}waitForUnlock(r=1,a=0){if(r<=0)throw new Error(`invalid weight ${r}: must be positive`);return this._couldLockImmediately(r,a)?Promise.resolve():new Promise(s=>{this._weightedWaiters[r-1]||(this._weightedWaiters[r-1]=[]),Vb(this._weightedWaiters[r-1],{resolve:s,priority:a})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(r){this._value=r,this._dispatchQueue()}release(r=1){if(r<=0)throw new Error(`invalid weight ${r}: must be positive`);this._value+=r,this._dispatchQueue()}cancel(){this._queue.forEach(r=>r.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(r){const a=this._value;this._value-=r.weight,r.resolve([a,this._newReleaser(r.weight)])}_newReleaser(r){let a=!1;return()=>{a||(a=!0,this.release(r))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let r=this._value;r>0;r--){const a=this._weightedWaiters[r-1];a&&(a.forEach(s=>s.resolve()),this._weightedWaiters[r-1]=[])}else{const r=this._queue[0].priority;for(let a=this._value;a>0;a--){const s=this._weightedWaiters[a-1];if(!s)continue;const o=s.findIndex(u=>u.priority<=r);(o===-1?s:s.splice(0,o)).forEach(u=>u.resolve())}}}_couldLockImmediately(r,a){return(this._queue.length===0||this._queue[0].priority<a)&&r<=this._value}}function Vb(n,r){const a=Up(n,s=>r.priority<=s.priority);n.splice(a+1,0,r)}function Up(n,r){for(let a=n.length-1;a>=0;a--)if(r(n[a]))return a;return-1}var qb=function(n,r,a,s){function o(u){return u instanceof a?u:new a(function(c){c(u)})}return new(a||(a=Promise))(function(u,c){function d(b){try{A(s.next(b))}catch(v){c(v)}}function m(b){try{A(s.throw(b))}catch(v){c(v)}}function A(b){b.done?u(b.value):o(b.value).then(d,m)}A((s=s.apply(n,r||[])).next())})};class zb{constructor(r){this._semaphore=new Gb(1,r)}acquire(){return qb(this,arguments,void 0,function*(r=0){const[,a]=yield this._semaphore.acquire(1,r);return a})}runExclusive(r,a=0){return this._semaphore.runExclusive(()=>r(),1,a)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(r=0){return this._semaphore.waitForUnlock(1,r)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}var Dp,Rp;const Iu=((Rp=(Dp=globalThis.browser)==null?void 0:Dp.runtime)==null?void 0:Rp.id)==null?globalThis.chrome:globalThis.browser,Xe=Yb();function Yb(){const n={local:hu("local"),session:hu("session"),sync:hu("sync"),managed:hu("managed")},r=k=>{const R=n[k];if(R==null){const N=Object.keys(n).join(", ");throw Error(`Invalid area "${k}". Options: ${N}`)}return R},a=k=>{const R=k.indexOf(":"),N=k.substring(0,R),O=k.substring(R+1);if(O==null)throw Error(`Storage key should be in the form of "area:key", but received "${k}"`);return{driverArea:N,driverKey:O,driver:r(N)}},s=k=>k+"$",o=(k,R)=>{const N={...k};return Object.entries(R).forEach(([O,_])=>{_==null?delete N[O]:N[O]=_}),N},u=(k,R)=>k??R??null,c=k=>typeof k=="object"&&!Array.isArray(k)?k:{},d=async(k,R,N)=>{const O=await k.getItem(R);return u(O,(N==null?void 0:N.fallback)??(N==null?void 0:N.defaultValue))},m=async(k,R)=>{const N=s(R),O=await k.getItem(N);return c(O)},A=async(k,R,N)=>{await k.setItem(R,N??null)},b=async(k,R,N)=>{const O=s(R),_=c(await k.getItem(O));await k.setItem(O,o(_,N))},v=async(k,R,N)=>{if(await k.removeItem(R),N!=null&&N.removeMeta){const O=s(R);await k.removeItem(O)}},B=async(k,R,N)=>{const O=s(R);if(N==null)await k.removeItem(O);else{const _=c(await k.getItem(O));[N].flat().forEach(q=>delete _[q]),await k.setItem(O,_)}},T=(k,R,N)=>k.watch(R,N);return{getItem:async(k,R)=>{const{driver:N,driverKey:O}=a(k);return await d(N,O,R)},getItems:async k=>{const R=new Map,N=new Map,O=[];k.forEach(q=>{let V,ge;typeof q=="string"?V=q:"getValue"in q?(V=q.key,ge={fallback:q.fallback}):(V=q.key,ge=q.options),O.push(V);const{driverArea:ce,driverKey:te}=a(V),J=R.get(ce)??[];R.set(ce,J.concat(te)),N.set(V,ge)});const _=new Map;return await Promise.all(Array.from(R.entries()).map(async([q,V])=>{(await n[q].getItems(V)).forEach(ce=>{const te=`${q}:${ce.key}`,J=N.get(te),K=u(ce.value,(J==null?void 0:J.fallback)??(J==null?void 0:J.defaultValue));_.set(te,K)})})),O.map(q=>({key:q,value:_.get(q)}))},getMeta:async k=>{const{driver:R,driverKey:N}=a(k);return await m(R,N)},getMetas:async k=>{const R=k.map(_=>{const q=typeof _=="string"?_:_.key,{driverArea:V,driverKey:ge}=a(q);return{key:q,driverArea:V,driverKey:ge,driverMetaKey:s(ge)}}),N=R.reduce((_,q)=>{var V;return _[V=q.driverArea]??(_[V]=[]),_[q.driverArea].push(q),_},{}),O={};return await Promise.all(Object.entries(N).map(async([_,q])=>{const V=await Iu.storage[_].get(q.map(ge=>ge.driverMetaKey));q.forEach(ge=>{O[ge.key]=V[ge.driverMetaKey]??{}})})),R.map(_=>({key:_.key,meta:O[_.key]}))},setItem:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await A(N,O,R)},setItems:async k=>{const R={};k.forEach(N=>{const{driverArea:O,driverKey:_}=a("key"in N?N.key:N.item.key);R[O]??(R[O]=[]),R[O].push({key:_,value:N.value})}),await Promise.all(Object.entries(R).map(async([N,O])=>{await r(N).setItems(O)}))},setMeta:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await b(N,O,R)},setMetas:async k=>{const R={};k.forEach(N=>{const{driverArea:O,driverKey:_}=a("key"in N?N.key:N.item.key);R[O]??(R[O]=[]),R[O].push({key:_,properties:N.meta})}),await Promise.all(Object.entries(R).map(async([N,O])=>{const _=r(N),q=O.map(({key:te})=>s(te));console.log(N,q);const V=await _.getItems(q),ge=Object.fromEntries(V.map(({key:te,value:J})=>[te,c(J)])),ce=O.map(({key:te,properties:J})=>{const K=s(te);return{key:K,value:o(ge[K]??{},J)}});await _.setItems(ce)}))},removeItem:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await v(N,O,R)},removeItems:async k=>{const R={};k.forEach(N=>{let O,_;typeof N=="string"?O=N:"getValue"in N?O=N.key:"item"in N?(O=N.item.key,_=N.options):(O=N.key,_=N.options);const{driverArea:q,driverKey:V}=a(O);R[q]??(R[q]=[]),R[q].push(V),_!=null&&_.removeMeta&&R[q].push(s(V))}),await Promise.all(Object.entries(R).map(async([N,O])=>{await r(N).removeItems(O)}))},clear:async k=>{await r(k).clear()},removeMeta:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await B(N,O,R)},snapshot:async(k,R)=>{var _;const O=await r(k).snapshot();return(_=R==null?void 0:R.excludeKeys)==null||_.forEach(q=>{delete O[q],delete O[s(q)]}),O},restoreSnapshot:async(k,R)=>{await r(k).restoreSnapshot(R)},watch:(k,R)=>{const{driver:N,driverKey:O}=a(k);return T(N,O,R)},unwatch(){Object.values(n).forEach(k=>{k.unwatch()})},defineItem:(k,R)=>{const{driver:N,driverKey:O}=a(k),{version:_=1,migrations:q={}}=R??{};if(_<1)throw Error("Storage item version cannot be less than 1. Initial versions should be set to 1, not 0.");const V=async()=>{var P;const K=s(O),[{value:$},{value:me}]=await N.getItems([O,K]);if($==null)return;const he=(me==null?void 0:me.v)??1;if(he>_)throw Error(`Version downgrade detected (v${he} -> v${_}) for "${k}"`);if(he===_)return;console.debug(`[@wxt-dev/storage] Running storage migration for ${k}: v${he} -> v${_}`);const we=Array.from({length:_-he},(ae,Ne)=>he+Ne+1);let pe=$;for(const ae of we)try{pe=await((P=q==null?void 0:q[ae])==null?void 0:P.call(q,pe))??pe}catch(Ne){throw new Pb(k,ae,{cause:Ne})}await N.setItems([{key:O,value:pe},{key:K,value:{...me,v:_}}]),console.debug(`[@wxt-dev/storage] Storage migration completed for ${k} v${_}`,{migratedValue:pe})},ge=(R==null?void 0:R.migrations)==null?Promise.resolve():V().catch(K=>{console.error(`[@wxt-dev/storage] Migration failed for ${k}`,K)}),ce=new zb,te=()=>(R==null?void 0:R.fallback)??(R==null?void 0:R.defaultValue)??null,J=()=>ce.runExclusive(async()=>{const K=await N.getItem(O);if(K!=null||(R==null?void 0:R.init)==null)return K;const $=await R.init();return await N.setItem(O,$),$});return ge.then(J),{key:k,get defaultValue(){return te()},get fallback(){return te()},getValue:async()=>(await ge,R!=null&&R.init?await J():await d(N,O,R)),getMeta:async()=>(await ge,await m(N,O)),setValue:async K=>(await ge,await A(N,O,K)),setMeta:async K=>(await ge,await b(N,O,K)),removeValue:async K=>(await ge,await v(N,O,K)),removeMeta:async K=>(await ge,await B(N,O,K)),watch:K=>T(N,O,($,me)=>K($??te(),me??te())),migrate:V}}}}function hu(n){const r=()=>{if(Iu.runtime==null)throw Error(["'wxt/storage' must be loaded in a web extension environment",`
 - If thrown during a build, see https://github.com/wxt-dev/wxt/issues/371`,` - If thrown during tests, mock 'wxt/browser' correctly. See https://wxt.dev/guide/go-further/testing.html
`].join(`
`));if(Iu.storage==null)throw Error("You must add the 'storage' permission to your manifest to use 'wxt/storage'");const s=Iu.storage[n];if(s==null)throw Error(`"browser.storage.${n}" is undefined`);return s},a=new Set;return{getItem:async s=>(await r().get(s))[s],getItems:async s=>{const o=await r().get(s);return s.map(u=>({key:u,value:o[u]??null}))},setItem:async(s,o)=>{o==null?await r().remove(s):await r().set({[s]:o})},setItems:async s=>{const o=s.reduce((u,{key:c,value:d})=>(u[c]=d,u),{});await r().set(o)},removeItem:async s=>{await r().remove(s)},removeItems:async s=>{await r().remove(s)},clear:async()=>{await r().clear()},snapshot:async()=>await r().get(),restoreSnapshot:async s=>{await r().set(s)},watch(s,o){const u=c=>{const d=c[s];d!=null&&(Wf(d.newValue,d.oldValue)||o(d.newValue??null,d.oldValue??null))};return r().onChanged.addListener(u),a.add(u),()=>{r().onChanged.removeListener(u),a.delete(u)}},unwatch(){a.forEach(s=>{r().onChanged.removeListener(s)}),a.clear()}}}class Pb extends Error{constructor(r,a,s){super(`v${a} migration failed for "${r}"`,s),this.key=r,this.version=a}}const it=n=>typeof n=="string",jl=()=>{let n,r;const a=new Promise((s,o)=>{n=s,r=o});return a.resolve=n,a.reject=r,a},nm=n=>n==null?"":""+n,Kb=(n,r,a)=>{n.forEach(s=>{r[s]&&(a[s]=r[s])})},Jb=/###/g,am=n=>n&&n.indexOf("###")>-1?n.replace(Jb,"."):n,im=n=>!n||it(n),Kl=(n,r,a)=>{const s=it(r)?r.split("."):r;let o=0;for(;o<s.length-1;){if(im(n))return{};const u=am(s[o]);!n[u]&&a&&(n[u]=new a),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return im(n)?{}:{obj:n,k:am(s[o])}},sm=(n,r,a)=>{const{obj:s,k:o}=Kl(n,r,Object);if(s!==void 0||r.length===1){s[o]=a;return}let u=r[r.length-1],c=r.slice(0,r.length-1),d=Kl(n,c,Object);for(;d.obj===void 0&&c.length;)u=`${c[c.length-1]}.${u}`,c=c.slice(0,c.length-1),d=Kl(n,c,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${u}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${u}`]=a},Xb=(n,r,a,s)=>{const{obj:o,k:u}=Kl(n,r,Object);o[u]=o[u]||[],o[u].push(a)},Uu=(n,r)=>{const{obj:a,k:s}=Kl(n,r);if(a&&Object.prototype.hasOwnProperty.call(a,s))return a[s]},$b=(n,r,a)=>{const s=Uu(n,a);return s!==void 0?s:Uu(r,a)},Mp=(n,r,a)=>{for(const s in r)s!=="__proto__"&&s!=="constructor"&&(s in n?it(n[s])||n[s]instanceof String||it(r[s])||r[s]instanceof String?a&&(n[s]=r[s]):Mp(n[s],r[s],a):n[s]=r[s]);return n},Ms=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Wb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Zb=n=>it(n)?n.replace(/[&<>"'\/]/g,r=>Wb[r]):n;class ev{constructor(r){this.capacity=r,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(r){const a=this.regExpMap.get(r);if(a!==void 0)return a;const s=new RegExp(r);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(r,s),this.regExpQueue.push(r),s}}const tv=[" ",",","?","!",";"],rv=new ev(20),nv=(n,r,a)=>{r=r||"",a=a||"";const s=tv.filter(c=>r.indexOf(c)<0&&a.indexOf(c)<0);if(s.length===0)return!0;const o=rv.getRegExp(`(${s.map(c=>c==="?"?"\\?":c).join("|")})`);let u=!o.test(n);if(!u){const c=n.indexOf(a);c>0&&!o.test(n.substring(0,c))&&(u=!0)}return u},Zf=(n,r,a=".")=>{if(!n)return;if(n[r])return Object.prototype.hasOwnProperty.call(n,r)?n[r]:void 0;const s=r.split(a);let o=n;for(let u=0;u<s.length;){if(!o||typeof o!="object")return;let c,d="";for(let m=u;m<s.length;++m)if(m!==u&&(d+=a),d+=s[m],c=o[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&m<s.length-1)continue;u+=m-u+1;break}o=c}return o},to=n=>n==null?void 0:n.replace("_","-"),av={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,r){var a,s;(s=(a=console==null?void 0:console[n])==null?void 0:a.apply)==null||s.call(a,console,r)}};class Mu{constructor(r,a={}){this.init(r,a)}init(r,a={}){this.prefix=a.prefix||"i18next:",this.logger=r||av,this.options=a,this.debug=a.debug}log(...r){return this.forward(r,"log","",!0)}warn(...r){return this.forward(r,"warn","",!0)}error(...r){return this.forward(r,"error","")}deprecate(...r){return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(r,a,s,o){return o&&!this.debug?null:(it(r[0])&&(r[0]=`${s}${this.prefix} ${r[0]}`),this.logger[a](r))}create(r){return new Mu(this.logger,{prefix:`${this.prefix}:${r}:`,...this.options})}clone(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new Mu(this.logger,r)}}var la=new Mu;class Zu{constructor(){this.observers={}}on(r,a){return r.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const o=this.observers[s].get(a)||0;this.observers[s].set(a,o+1)}),this}off(r,a){if(this.observers[r]){if(!a){delete this.observers[r];return}this.observers[r].delete(a)}}emit(r,...a){this.observers[r]&&Array.from(this.observers[r].entries()).forEach(([o,u])=>{for(let c=0;c<u;c++)o(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let c=0;c<u;c++)o.apply(o,[r,...a])})}}class lm extends Zu{constructor(r,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=r||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}removeNamespaces(r){const a=this.options.ns.indexOf(r);a>-1&&this.options.ns.splice(a,1)}getResource(r,a,s,o={}){var A,b;const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;r.indexOf(".")>-1?d=r.split("."):(d=[r,a],s&&(Array.isArray(s)?d.push(...s):it(s)&&u?d.push(...s.split(u)):d.push(s)));const m=Uu(this.data,d);return!m&&!a&&!s&&r.indexOf(".")>-1&&(r=d[0],a=d[1],s=d.slice(2).join(".")),m||!c||!it(s)?m:Zf((b=(A=this.data)==null?void 0:A[r])==null?void 0:b[a],s,u)}addResource(r,a,s,o,u={silent:!1}){const c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let d=[r,a];s&&(d=d.concat(c?s.split(c):s)),r.indexOf(".")>-1&&(d=r.split("."),o=a,a=d[1]),this.addNamespaces(a),sm(this.data,d,o),u.silent||this.emit("added",r,a,s,o)}addResources(r,a,s,o={silent:!1}){for(const u in s)(it(s[u])||Array.isArray(s[u]))&&this.addResource(r,a,u,s[u],{silent:!0});o.silent||this.emit("added",r,a,s)}addResourceBundle(r,a,s,o,u,c={silent:!1,skipCopy:!1}){let d=[r,a];r.indexOf(".")>-1&&(d=r.split("."),o=s,s=a,a=d[1]),this.addNamespaces(a);let m=Uu(this.data,d)||{};c.skipCopy||(s=JSON.parse(JSON.stringify(s))),o?Mp(m,s,u):m={...m,...s},sm(this.data,d,m),c.silent||this.emit("added",r,a,s)}removeResourceBundle(r,a){this.hasResourceBundle(r,a)&&delete this.data[r][a],this.removeNamespaces(a),this.emit("removed",r,a)}hasResourceBundle(r,a){return this.getResource(r,a)!==void 0}getResourceBundle(r,a){return a||(a=this.options.defaultNS),this.getResource(r,a)}getDataByLanguage(r){return this.data[r]}hasLanguageSomeTranslations(r){const a=this.getDataByLanguage(r);return!!(a&&Object.keys(a)||[]).find(o=>a[o]&&Object.keys(a[o]).length>0)}toJSON(){return this.data}}var _p={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,r,a,s,o){return n.forEach(u=>{var c;r=((c=this.processors[u])==null?void 0:c.process(r,a,s,o))??r}),r}};const om={},um=n=>!it(n)&&typeof n!="boolean"&&typeof n!="number";class _u extends Zu{constructor(r,a={}){super(),Kb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=la.create("translator")}changeLanguage(r){r&&(this.language=r)}exists(r,a={interpolation:{}}){const s={...a};if(r==null)return!1;const o=this.resolve(r,s);return(o==null?void 0:o.res)!==void 0}extractFromKey(r,a){let s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let u=a.ns||this.options.defaultNS||[];const c=s&&r.indexOf(s)>-1,d=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!nv(r,s,o);if(c&&!d){const m=r.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:r,namespaces:it(u)?[u]:u};const A=r.split(s);(s!==o||s===o&&this.options.ns.indexOf(A[0])>-1)&&(u=A.shift()),r=A.join(o)}return{key:r,namespaces:it(u)?[u]:u}}translate(r,a,s){let o=typeof a=="object"?{...a}:a;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:d,namespaces:m}=this.extractFromKey(r[r.length-1],o),A=m[m.length-1];let b=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const v=o.lng||this.language,B=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return B?u?{res:`${A}${b}${d}`,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:A,usedParams:this.getUsedParamsDetails(o)}:`${A}${b}${d}`:u?{res:d,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:A,usedParams:this.getUsedParamsDetails(o)}:d;const T=this.resolve(r,o);let Q=T==null?void 0:T.res;const k=(T==null?void 0:T.usedKey)||d,R=(T==null?void 0:T.exactUsedKey)||d,N=["[object Number]","[object Function]","[object RegExp]"],O=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,q=o.count!==void 0&&!it(o.count),V=_u.hasDefaultValue(o),ge=q?this.pluralResolver.getSuffix(v,o.count,o):"",ce=o.ordinal&&q?this.pluralResolver.getSuffix(v,o.count,{ordinal:!1}):"",te=q&&!o.ordinal&&o.count===0,J=te&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${ge}`]||o[`defaultValue${ce}`]||o.defaultValue;let K=Q;_&&!Q&&V&&(K=J);const $=um(K),me=Object.prototype.toString.apply(K);if(_&&K&&$&&N.indexOf(me)<0&&!(it(O)&&Array.isArray(K))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const he=this.options.returnedObjectHandler?this.options.returnedObjectHandler(k,K,{...o,ns:m}):`key '${d} (${this.language})' returned an object instead of string.`;return u?(T.res=he,T.usedParams=this.getUsedParamsDetails(o),T):he}if(c){const he=Array.isArray(K),we=he?[]:{},pe=he?R:k;for(const P in K)if(Object.prototype.hasOwnProperty.call(K,P)){const ae=`${pe}${c}${P}`;V&&!Q?we[P]=this.translate(ae,{...o,defaultValue:um(J)?J[P]:void 0,joinArrays:!1,ns:m}):we[P]=this.translate(ae,{...o,joinArrays:!1,ns:m}),we[P]===ae&&(we[P]=K[P])}Q=we}}else if(_&&it(O)&&Array.isArray(Q))Q=Q.join(O),Q&&(Q=this.extendTranslation(Q,r,o,s));else{let he=!1,we=!1;!this.isValidLookup(Q)&&V&&(he=!0,Q=J),this.isValidLookup(Q)||(we=!0,Q=d);const P=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&we?void 0:Q,ae=V&&J!==Q&&this.options.updateMissing;if(we||he||ae){if(this.logger.log(ae?"updateKey":"missingKey",v,A,d,ae?J:Q),c){const ne=this.resolve(d,{...o,keySeparator:!1});ne&&ne.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Ne=[];const _e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_e&&_e[0])for(let ne=0;ne<_e.length;ne++)Ne.push(_e[ne]);else this.options.saveMissingTo==="all"?Ne=this.languageUtils.toResolveHierarchy(o.lng||this.language):Ne.push(o.lng||this.language);const G=(ne,Ee,ke)=>{var Ke;const He=V&&ke!==Q?ke:P;this.options.missingKeyHandler?this.options.missingKeyHandler(ne,A,Ee,He,ae,o):(Ke=this.backendConnector)!=null&&Ke.saveMissing&&this.backendConnector.saveMissing(ne,A,Ee,He,ae,o),this.emit("missingKey",ne,A,Ee,Q)};this.options.saveMissing&&(this.options.saveMissingPlurals&&q?Ne.forEach(ne=>{const Ee=this.pluralResolver.getSuffixes(ne,o);te&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ee.push(`${this.options.pluralSeparator}zero`),Ee.forEach(ke=>{G([ne],d+ke,o[`defaultValue${ke}`]||J)})}):G(Ne,d,J))}Q=this.extendTranslation(Q,r,o,T,s),we&&Q===d&&this.options.appendNamespaceToMissingKey&&(Q=`${A}${b}${d}`),(we||he)&&this.options.parseMissingKeyHandler&&(Q=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${A}${b}${d}`:d,he?Q:void 0,o))}return u?(T.res=Q,T.usedParams=this.getUsedParamsDetails(o),T):Q}extendTranslation(r,a,s,o,u){var m,A;if((m=this.i18nFormat)!=null&&m.parse)r=this.i18nFormat.parse(r,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const b=it(r)&&(((A=s==null?void 0:s.interpolation)==null?void 0:A.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(b){const T=r.match(this.interpolator.nestingRegexp);v=T&&T.length}let B=s.replace&&!it(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(B={...this.options.interpolation.defaultVariables,...B}),r=this.interpolator.interpolate(r,B,s.lng||this.language||o.usedLng,s),b){const T=r.match(this.interpolator.nestingRegexp),Q=T&&T.length;v<Q&&(s.nest=!1)}!s.lng&&o&&o.res&&(s.lng=this.language||o.usedLng),s.nest!==!1&&(r=this.interpolator.nest(r,(...T)=>(u==null?void 0:u[0])===T[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${T[0]} in key: ${a[0]}`),null):this.translate(...T,a),s)),s.interpolation&&this.interpolator.reset()}const c=s.postProcess||this.options.postProcess,d=it(c)?[c]:c;return r!=null&&(d!=null&&d.length)&&s.applyPostProcessor!==!1&&(r=_p.handle(d,r,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),r}resolve(r,a={}){let s,o,u,c,d;return it(r)&&(r=[r]),r.forEach(m=>{if(this.isValidLookup(s))return;const A=this.extractFromKey(m,a),b=A.key;o=b;let v=A.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const B=a.count!==void 0&&!it(a.count),T=B&&!a.ordinal&&a.count===0,Q=a.context!==void 0&&(it(a.context)||typeof a.context=="number")&&a.context!=="",k=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);v.forEach(R=>{var N,O;this.isValidLookup(s)||(d=R,!om[`${k[0]}-${R}`]&&((N=this.utils)!=null&&N.hasLoadedNamespace)&&!((O=this.utils)!=null&&O.hasLoadedNamespace(d))&&(om[`${k[0]}-${R}`]=!0,this.logger.warn(`key "${o}" for languages "${k.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(_=>{var ge;if(this.isValidLookup(s))return;c=_;const q=[b];if((ge=this.i18nFormat)!=null&&ge.addLookupKeys)this.i18nFormat.addLookupKeys(q,b,_,R,a);else{let ce;B&&(ce=this.pluralResolver.getSuffix(_,a.count,a));const te=`${this.options.pluralSeparator}zero`,J=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(B&&(q.push(b+ce),a.ordinal&&ce.indexOf(J)===0&&q.push(b+ce.replace(J,this.options.pluralSeparator)),T&&q.push(b+te)),Q){const K=`${b}${this.options.contextSeparator}${a.context}`;q.push(K),B&&(q.push(K+ce),a.ordinal&&ce.indexOf(J)===0&&q.push(K+ce.replace(J,this.options.pluralSeparator)),T&&q.push(K+te))}}let V;for(;V=q.pop();)this.isValidLookup(s)||(u=V,s=this.getResource(_,R,V,a))}))})}),{res:s,usedKey:o,exactUsedKey:u,usedLng:c,usedNS:d}}isValidLookup(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}getResource(r,a,s,o={}){var u;return(u=this.i18nFormat)!=null&&u.getResource?this.i18nFormat.getResource(r,a,s,o):this.resourceStore.getResource(r,a,s,o)}getUsedParamsDetails(r={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=r.replace&&!it(r.replace);let o=s?r.replace:r;if(s&&typeof r.count<"u"&&(o.count=r.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!s){o={...o};for(const u of a)delete o[u]}return o}static hasDefaultValue(r){const a="defaultValue";for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&a===s.substring(0,a.length)&&r[s]!==void 0)return!0;return!1}}class cm{constructor(r){this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=la.create("languageUtils")}getScriptPartFromCode(r){if(r=to(r),!r||r.indexOf("-")<0)return null;const a=r.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(r){if(r=to(r),!r||r.indexOf("-")<0)return r;const a=r.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(r){if(it(r)&&r.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(r)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?r.toLowerCase():r)}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}isSupportedCode(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}getBestMatchFromCodes(r){if(!r)return null;let a;return r.forEach(s=>{if(a)return;const o=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(o))&&(a=o)}),!a&&this.options.supportedLngs&&r.forEach(s=>{if(a)return;const o=this.getScriptPartFromCode(s);if(this.isSupportedCode(o))return a=o;const u=this.getLanguagePartFromCode(s);if(this.isSupportedCode(u))return a=u;a=this.options.supportedLngs.find(c=>{if(c===u)return c;if(!(c.indexOf("-")<0&&u.indexOf("-")<0)&&(c.indexOf("-")>0&&u.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===u||c.indexOf(u)===0&&u.length>1))return c})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(r,a){if(!r)return[];if(typeof r=="function"&&(r=r(a)),it(r)&&(r=[r]),Array.isArray(r))return r;if(!a)return r.default||[];let s=r[a];return s||(s=r[this.getScriptPartFromCode(a)]),s||(s=r[this.formatLanguageCode(a)]),s||(s=r[this.getLanguagePartFromCode(a)]),s||(s=r.default),s||[]}toResolveHierarchy(r,a){const s=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],r),o=[],u=c=>{c&&(this.isSupportedCode(c)?o.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return it(r)&&(r.indexOf("-")>-1||r.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(r))):it(r)&&u(this.formatLanguageCode(r)),s.forEach(c=>{o.indexOf(c)<0&&u(this.formatLanguageCode(c))}),o}}const dm={zero:0,one:1,two:2,few:3,many:4,other:5},fm={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class iv{constructor(r,a={}){this.languageUtils=r,this.options=a,this.logger=la.create("pluralResolver"),this.pluralRulesCache={}}addRule(r,a){this.rules[r]=a}clearCache(){this.pluralRulesCache={}}getRule(r,a={}){const s=to(r==="dev"?"en":r),o=a.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:s,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let c;try{c=new Intl.PluralRules(s,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),fm;if(!r.match(/-|_/))return fm;const m=this.languageUtils.getLanguagePartFromCode(r);c=this.getRule(m,a)}return this.pluralRulesCache[u]=c,c}needsPlural(r,a={}){let s=this.getRule(r,a);return s||(s=this.getRule("dev",a)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(r,a,s={}){return this.getSuffixes(r,s).map(o=>`${a}${o}`)}getSuffixes(r,a={}){let s=this.getRule(r,a);return s||(s=this.getRule("dev",a)),s?s.resolvedOptions().pluralCategories.sort((o,u)=>dm[o]-dm[u]).map(o=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(r,a,s={}){const o=this.getRule(r,s);return o?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o.select(a)}`:(this.logger.warn(`no plural rule found for: ${r}`),this.getSuffix("dev",a,s))}}const Am=(n,r,a,s=".",o=!0)=>{let u=$b(n,r,a);return!u&&o&&it(a)&&(u=Zf(n,a,s),u===void 0&&(u=Zf(r,a,s))),u},Nf=n=>n.replace(/\$/g,"$$$$");class sv{constructor(r={}){var a;this.logger=la.create("interpolator"),this.options=r,this.format=((a=r==null?void 0:r.interpolation)==null?void 0:a.format)||(s=>s),this.init(r)}init(r={}){r.interpolation||(r.interpolation={escapeValue:!0});const{escape:a,escapeValue:s,useRawValueToEscape:o,prefix:u,prefixEscaped:c,suffix:d,suffixEscaped:m,formatSeparator:A,unescapeSuffix:b,unescapePrefix:v,nestingPrefix:B,nestingPrefixEscaped:T,nestingSuffix:Q,nestingSuffixEscaped:k,nestingOptionsSeparator:R,maxReplaces:N,alwaysFormat:O}=r.interpolation;this.escape=a!==void 0?a:Zb,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Ms(u):c||"{{",this.suffix=d?Ms(d):m||"}}",this.formatSeparator=A||",",this.unescapePrefix=b?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=B?Ms(B):T||Ms("$t("),this.nestingSuffix=Q?Ms(Q):k||Ms(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=N||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const r=(a,s)=>(a==null?void 0:a.source)===s?(a.lastIndex=0,a):new RegExp(s,"g");this.regexp=r(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=r(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=r(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(r,a,s,o){var T;let u,c,d;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},A=Q=>{if(Q.indexOf(this.formatSeparator)<0){const O=Am(a,m,Q,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,s,{...o,...a,interpolationkey:Q}):O}const k=Q.split(this.formatSeparator),R=k.shift().trim(),N=k.join(this.formatSeparator).trim();return this.format(Am(a,m,R,this.options.keySeparator,this.options.ignoreJSONStructure),N,s,{...o,...a,interpolationkey:R})};this.resetRegExp();const b=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((T=o==null?void 0:o.interpolation)==null?void 0:T.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:Q=>Nf(Q)},{regex:this.regexp,safeValue:Q=>this.escapeValue?Nf(this.escape(Q)):Nf(Q)}].forEach(Q=>{for(d=0;u=Q.regex.exec(r);){const k=u[1].trim();if(c=A(k),c===void 0)if(typeof b=="function"){const N=b(r,u,o);c=it(N)?N:""}else if(o&&Object.prototype.hasOwnProperty.call(o,k))c="";else if(v){c=u[0];continue}else this.logger.warn(`missed to pass in variable ${k} for interpolating ${r}`),c="";else!it(c)&&!this.useRawValueToEscape&&(c=nm(c));const R=Q.safeValue(c);if(r=r.replace(u[0],R),v?(Q.regex.lastIndex+=c.length,Q.regex.lastIndex-=u[0].length):Q.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),r}nest(r,a,s={}){let o,u,c;const d=(m,A)=>{const b=this.nestingOptionsSeparator;if(m.indexOf(b)<0)return m;const v=m.split(new RegExp(`${b}[ ]*{`));let B=`{${v[1]}`;m=v[0],B=this.interpolate(B,c);const T=B.match(/'/g),Q=B.match(/"/g);(((T==null?void 0:T.length)??0)%2===0&&!Q||Q.length%2!==0)&&(B=B.replace(/'/g,'"'));try{c=JSON.parse(B),A&&(c={...A,...c})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,k),`${m}${b}${B}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,m};for(;o=this.nestingRegexp.exec(r);){let m=[];c={...s},c=c.replace&&!it(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const A=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(A!==-1&&(m=o[1].slice(A).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),o[1]=o[1].slice(0,A)),u=a(d.call(this,o[1].trim(),c),c),u&&o[0]===r&&!it(u))return u;it(u)||(u=nm(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${r}`),u=""),m.length&&(u=m.reduce((b,v)=>this.format(b,v,s.lng,{...s,interpolationkey:o[1].trim()}),u.trim())),r=r.replace(o[0],u),this.regexp.lastIndex=0}return r}}const lv=n=>{let r=n.toLowerCase().trim();const a={};if(n.indexOf("(")>-1){const s=n.split("(");r=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);r==="currency"&&o.indexOf(":")<0?a.currency||(a.currency=o.trim()):r==="relativetime"&&o.indexOf(":")<0?a.range||(a.range=o.trim()):o.split(";").forEach(c=>{if(c){const[d,...m]=c.split(":"),A=m.join(":").trim().replace(/^'+|'+$/g,""),b=d.trim();a[b]||(a[b]=A),A==="false"&&(a[b]=!1),A==="true"&&(a[b]=!0),isNaN(A)||(a[b]=parseInt(A,10))}})}return{formatName:r,formatOptions:a}},hm=n=>{const r={};return(a,s,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const c=s+JSON.stringify(u);let d=r[c];return d||(d=n(to(s),o),r[c]=d),d(a)}},ov=n=>(r,a,s)=>n(to(a),s)(r);class uv{constructor(r={}){this.logger=la.create("formatter"),this.options=r,this.init(r)}init(r,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const s=a.cacheInBuiltFormats?hm:ov;this.formats={number:s((o,u)=>{const c=new Intl.NumberFormat(o,{...u});return d=>c.format(d)}),currency:s((o,u)=>{const c=new Intl.NumberFormat(o,{...u,style:"currency"});return d=>c.format(d)}),datetime:s((o,u)=>{const c=new Intl.DateTimeFormat(o,{...u});return d=>c.format(d)}),relativetime:s((o,u)=>{const c=new Intl.RelativeTimeFormat(o,{...u});return d=>c.format(d,u.range||"day")}),list:s((o,u)=>{const c=new Intl.ListFormat(o,{...u});return d=>c.format(d)})}}add(r,a){this.formats[r.toLowerCase().trim()]=a}addCached(r,a){this.formats[r.toLowerCase().trim()]=hm(a)}format(r,a,s,o={}){const u=a.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(d=>d.indexOf(")")>-1)){const d=u.findIndex(m=>m.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,d)].join(this.formatSeparator)}return u.reduce((d,m)=>{var v;const{formatName:A,formatOptions:b}=lv(m);if(this.formats[A]){let B=d;try{const T=((v=o==null?void 0:o.formatParams)==null?void 0:v[o.interpolationkey])||{},Q=T.locale||T.lng||o.locale||o.lng||s;B=this.formats[A](d,Q,{...b,...o,...T})}catch(T){this.logger.warn(T)}return B}else this.logger.warn(`there was no format function for ${A}`);return d},r)}}const cv=(n,r)=>{n.pending[r]!==void 0&&(delete n.pending[r],n.pendingCount--)};class dv extends Zu{constructor(r,a,s,o={}){var u,c;super(),this.backend=r,this.store=a,this.services=s,this.languageUtils=s.languageUtils,this.options=o,this.logger=la.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(c=(u=this.backend)==null?void 0:u.init)==null||c.call(u,s,o.backend,o)}queueLoad(r,a,s,o){const u={},c={},d={},m={};return r.forEach(A=>{let b=!0;a.forEach(v=>{const B=`${A}|${v}`;!s.reload&&this.store.hasResourceBundle(A,v)?this.state[B]=2:this.state[B]<0||(this.state[B]===1?c[B]===void 0&&(c[B]=!0):(this.state[B]=1,b=!1,c[B]===void 0&&(c[B]=!0),u[B]===void 0&&(u[B]=!0),m[v]===void 0&&(m[v]=!0)))}),b||(d[A]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(m)}}loaded(r,a,s){const o=r.split("|"),u=o[0],c=o[1];a&&this.emit("failedLoading",u,c,a),!a&&s&&this.store.addResourceBundle(u,c,s,void 0,void 0,{skipCopy:!0}),this.state[r]=a?-1:2,a&&s&&(this.state[r]=0);const d={};this.queue.forEach(m=>{Xb(m.loaded,[u],c),cv(m,r),a&&m.errors.push(a),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(A=>{d[A]||(d[A]={});const b=m.loaded[A];b.length&&b.forEach(v=>{d[A][v]===void 0&&(d[A][v]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(m=>!m.done)}read(r,a,s,o=0,u=this.retryTimeout,c){if(!r.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:a,fcName:s,tried:o,wait:u,callback:c});return}this.readingCalls++;const d=(A,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(A&&b&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,r,a,s,o+1,u*2,c)},u);return}c(A,b)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const A=m(r,a);A&&typeof A.then=="function"?A.then(b=>d(null,b)).catch(d):d(null,A)}catch(A){d(A)}return}return m(r,a,d)}prepareLoading(r,a,s={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();it(r)&&(r=this.languageUtils.toResolveHierarchy(r)),it(a)&&(a=[a]);const u=this.queueLoad(r,a,s,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(c=>{this.loadOne(c)})}load(r,a,s){this.prepareLoading(r,a,{},s)}reload(r,a,s){this.prepareLoading(r,a,{reload:!0},s)}loadOne(r,a=""){const s=r.split("|"),o=s[0],u=s[1];this.read(o,u,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${a}loading namespace ${u} for language ${o} failed`,c),!c&&d&&this.logger.log(`${a}loaded namespace ${u} for language ${o}`,d),this.loaded(r,c,d)})}saveMissing(r,a,s,o,u,c={},d=()=>{}){var m,A,b,v,B;if((A=(m=this.services)==null?void 0:m.utils)!=null&&A.hasLoadedNamespace&&!((v=(b=this.services)==null?void 0:b.utils)!=null&&v.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${s}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((B=this.backend)!=null&&B.create){const T={...c,isUpdate:u},Q=this.backend.create.bind(this.backend);if(Q.length<6)try{let k;Q.length===5?k=Q(r,a,s,o,T):k=Q(r,a,s,o),k&&typeof k.then=="function"?k.then(R=>d(null,R)).catch(d):d(null,k)}catch(k){d(k)}else Q(r,a,s,o,d,T)}!r||!r[0]||this.store.addResource(r[0],a,s,o)}}}const gm=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let r={};if(typeof n[1]=="object"&&(r=n[1]),it(n[1])&&(r.defaultValue=n[1]),it(n[2])&&(r.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const a=n[3]||n[2];Object.keys(a).forEach(s=>{r[s]=a[s]})}return r},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),mm=n=>{var r,a;return it(n.ns)&&(n.ns=[n.ns]),it(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),it(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),((a=(r=n.supportedLngs)==null?void 0:r.indexOf)==null?void 0:a.call(r,"cimode"))<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n},gu=()=>{},fv=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(a=>{typeof n[a]=="function"&&(n[a]=n[a].bind(n))})};class ro extends Zu{constructor(r={},a){if(super(),this.options=mm(r),this.services={},this.logger=la,this.modules={external:[]},fv(this),a&&!this.isInitialized&&!r.isClone){if(!this.options.initAsync)return this.init(r,a),this;setTimeout(()=>{this.init(r,a)},0)}}init(r={},a){this.isInitializing=!0,typeof r=="function"&&(a=r,r={}),r.defaultNS==null&&r.ns&&(it(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const s=gm();this.options={...s,...this.options,...mm(r)},this.options.interpolation={...s.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const o=A=>A?typeof A=="function"?new A:A:null;if(!this.options.isClone){this.modules.logger?la.init(o(this.modules.logger),this.options):la.init(null,this.options);let A;this.modules.formatter?A=this.modules.formatter:A=uv;const b=new cm(this.options);this.store=new lm(this.options.resources,this.options);const v=this.services;v.logger=la,v.resourceStore=this.store,v.languageUtils=b,v.pluralResolver=new iv(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),A&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(v.formatter=o(A),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new sv(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new dv(o(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(T,...Q)=>{this.emit(T,...Q)}),this.modules.languageDetector&&(v.languageDetector=o(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=o(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new _u(this.services,this.options),this.translator.on("*",(T,...Q)=>{this.emit(T,...Q)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,a||(a=gu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const A=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);A.length>0&&A[0]!=="dev"&&(this.options.lng=A[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(A=>{this[A]=(...b)=>this.store[A](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(A=>{this[A]=(...b)=>(this.store[A](...b),this)});const d=jl(),m=()=>{const A=(b,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(v),a(b,v)};if(this.languages&&!this.isInitialized)return A(null,this.t.bind(this));this.changeLanguage(this.options.lng,A)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),d}loadResources(r,a=gu){var u,c;let s=a;const o=it(r)?r:this.language;if(typeof r=="function"&&(s=r),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const d=[],m=A=>{if(!A||A==="cimode")return;this.services.languageUtils.toResolveHierarchy(A).forEach(v=>{v!=="cimode"&&d.indexOf(v)<0&&d.push(v)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>m(b)),(c=(u=this.options.preload)==null?void 0:u.forEach)==null||c.call(u,A=>m(A)),this.services.backendConnector.load(d,this.options.ns,A=>{!A&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(A)})}else s(null)}reloadResources(r,a,s){const o=jl();return typeof r=="function"&&(s=r,r=void 0),typeof a=="function"&&(s=a,a=void 0),r||(r=this.languages),a||(a=this.options.ns),s||(s=gu),this.services.backendConnector.reload(r,a,u=>{o.resolve(),s(u)}),o}use(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&_p.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}setResolvedLanguage(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1)){for(let a=0;a<this.languages.length;a++){const s=this.languages[a];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(r)<0&&this.store.hasLanguageSomeTranslations(r)&&(this.resolvedLanguage=r,this.languages.unshift(r))}}changeLanguage(r,a){this.isLanguageChangingTo=r;const s=jl();this.emit("languageChanging",r);const o=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},u=(d,m)=>{m?this.isLanguageChangingTo===r&&(o(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...A)=>this.t(...A)),a&&a(d,(...A)=>this.t(...A))},c=d=>{var b,v;!r&&!d&&this.services.languageDetector&&(d=[]);const m=it(d)?d:d&&d[0],A=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(it(d)?[d]:d);A&&(this.language||o(A),this.translator.language||this.translator.changeLanguage(A),(v=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||v.call(b,A)),this.loadResources(A,B=>{u(B,A)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(r),s}getFixedT(r,a,s){const o=(u,c,...d)=>{let m;typeof c!="object"?m=this.options.overloadTranslationOptionHandler([u,c].concat(d)):m={...c},m.lng=m.lng||o.lng,m.lngs=m.lngs||o.lngs,m.ns=m.ns||o.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||o.keyPrefix);const A=this.options.keySeparator||".";let b;return m.keyPrefix&&Array.isArray(u)?b=u.map(v=>`${m.keyPrefix}${A}${v}`):b=m.keyPrefix?`${m.keyPrefix}${A}${u}`:u,this.t(b,m)};return it(r)?o.lng=r:o.lngs=r,o.ns=a,o.keyPrefix=s,o}t(...r){var a;return(a=this.translator)==null?void 0:a.translate(...r)}exists(...r){var a;return(a=this.translator)==null?void 0:a.exists(...r)}setDefaultNamespace(r){this.options.defaultNS=r}hasLoadedNamespace(r,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=a.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const c=(d,m)=>{const A=this.services.backendConnector.state[`${d}|${m}`];return A===-1||A===0||A===2};if(a.precheck){const d=a.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(s,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,r)&&(!o||c(u,r)))}loadNamespaces(r,a){const s=jl();return this.options.ns?(it(r)&&(r=[r]),r.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{s.resolve(),a&&a(o)}),s):(a&&a(),Promise.resolve())}loadLanguages(r,a){const s=jl();it(r)&&(r=[r]);const o=this.options.preload||[],u=r.filter(c=>o.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return u.length?(this.options.preload=o.concat(u),this.loadResources(c=>{s.resolve(),a&&a(c)}),s):(a&&a(),Promise.resolve())}dir(r){var o,u;if(r||(r=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!r)return"rtl";if(Intl.Locale){const c=new Intl.Locale(r);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((u=this.services)==null?void 0:u.languageUtils)||new cm(gm());return r.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(s.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(r={},a){return new ro(r,a)}cloneInstance(r={},a=gu){const s=r.forkResourceStore;s&&delete r.forkResourceStore;const o={...this.options,...r,isClone:!0},u=new ro(o);if((r.debug!==void 0||r.prefix!==void 0)&&(u.logger=u.logger.clone(r)),["store","services","language"].forEach(d=>{u[d]=this[d]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},s){const d=Object.keys(this.store.data).reduce((m,A)=>(m[A]={...this.store.data[A]},m[A]=Object.keys(m[A]).reduce((b,v)=>(b[v]={...m[A][v]},b),m[A]),m),{});u.store=new lm(d,o),u.services.resourceStore=u.store}return u.translator=new _u(u.services,o),u.translator.on("*",(d,...m)=>{u.emit(d,...m)}),u.init(o,a),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Hr=ro.createInstance();Hr.createInstance=ro.createInstance;Hr.createInstance;Hr.dir;Hr.init;Hr.loadResources;Hr.reloadResources;Hr.use;Hr.changeLanguage;Hr.getFixedT;Hr.t;Hr.exists;Hr.setDefaultNamespace;Hr.hasLoadedNamespace;Hr.loadNamespaces;Hr.loadLanguages;var M=hA();const pn=xi(M),Av=(n,r,a,s)=>{var u,c,d,m;const o=[a,{code:r,...s||{}}];if((c=(u=n==null?void 0:n.services)==null?void 0:u.logger)!=null&&c.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Ji(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),(m=(d=n==null?void 0:n.services)==null?void 0:d.logger)!=null&&m.warn?n.services.logger.warn(...o):console!=null&&console.warn&&console.warn(...o)},pm={},eA=(n,r,a,s)=>{Ji(a)&&pm[a]||(Ji(a)&&(pm[a]=new Date),Av(n,r,a,s))},Op=(n,r)=>()=>{if(n.isInitialized)r();else{const a=()=>{setTimeout(()=>{n.off("initialized",a)},0),r()};n.on("initialized",a)}},tA=(n,r,a)=>{n.loadNamespaces(r,Op(n,a))},ym=(n,r,a,s)=>{if(Ji(a)&&(a=[a]),n.options.preload&&n.options.preload.indexOf(r)>-1)return tA(n,a,s);a.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(r,Op(n,s))},hv=(n,r,a={})=>!r.languages||!r.languages.length?(eA(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.hasLoadedNamespace(n,{lng:a.lng,precheck:(s,o)=>{var u;if(((u=a.bindI18n)==null?void 0:u.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!o(s.isLanguageChangingTo,n))return!1}}),Ji=n=>typeof n=="string",gv=n=>typeof n=="object"&&n!==null,mv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pv={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},yv=n=>pv[n],Ev=n=>n.replace(mv,yv);let rA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ev};const bv=(n={})=>{rA={...rA,...n}},vv=()=>rA;let Fp;const xv=n=>{Fp=n},Cv=()=>Fp,wv={type:"3rdParty",init(n){bv(n.options.react),xv(n)}},Iv=M.createContext();class Bv{constructor(){this.usedNamespaces={}}addUsedNamespaces(r){r.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Sv=(n,r)=>{const a=M.useRef();return M.useEffect(()=>{a.current=n},[n,r]),a.current},jp=(n,r,a,s)=>n.getFixedT(r,a,s),Nv=(n,r,a,s)=>M.useCallback(jp(n,r,a,s),[n,r,a,s]),Bt=(n,r={})=>{var q,V,ge,ce;const{i18n:a}=r,{i18n:s,defaultNS:o}=M.useContext(Iv)||{},u=a||s||Cv();if(u&&!u.reportNamespaces&&(u.reportNamespaces=new Bv),!u){eA(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const te=(K,$)=>Ji($)?$:gv($)&&Ji($.defaultValue)?$.defaultValue:Array.isArray(K)?K[K.length-1]:K,J=[te,{},!1];return J.t=te,J.i18n={},J.ready=!1,J}(q=u.options.react)!=null&&q.wait&&eA(u,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...vv(),...u.options.react,...r},{useSuspense:d,keyPrefix:m}=c;let A=o||((V=u.options)==null?void 0:V.defaultNS);A=Ji(A)?[A]:A||["translation"],(ce=(ge=u.reportNamespaces).addUsedNamespaces)==null||ce.call(ge,A);const b=(u.isInitialized||u.initializedStoreOnce)&&A.every(te=>hv(te,u,c)),v=Nv(u,r.lng||null,c.nsMode==="fallback"?A:A[0],m),B=()=>v,T=()=>jp(u,r.lng||null,c.nsMode==="fallback"?A:A[0],m),[Q,k]=M.useState(B);let R=A.join();r.lng&&(R=`${r.lng}${R}`);const N=Sv(R),O=M.useRef(!0);M.useEffect(()=>{const{bindI18n:te,bindI18nStore:J}=c;O.current=!0,!b&&!d&&(r.lng?ym(u,r.lng,A,()=>{O.current&&k(T)}):tA(u,A,()=>{O.current&&k(T)})),b&&N&&N!==R&&O.current&&k(T);const K=()=>{O.current&&k(T)};return te&&(u==null||u.on(te,K)),J&&(u==null||u.store.on(J,K)),()=>{O.current=!1,u&&(te==null||te.split(" ").forEach($=>u.off($,K))),J&&u&&J.split(" ").forEach($=>u.store.off($,K))}},[u,R]),M.useEffect(()=>{O.current&&b&&k(B)},[u,m,b]);const _=[Q,u,b];if(_.t=Q,_.i18n=u,_.ready=b,b||!b&&!d)return _;throw new Promise(te=>{r.lng?ym(u,r.lng,A,()=>te()):tA(u,A,()=>te())})},Tv={loginTitle:"Log in to AliasVault",username:"Username or email",usernamePlaceholder:"name / name@company.com",password:"Password",passwordPlaceholder:"Enter your password",rememberMe:"Remember me",loginButton:"Login",noAccount:"No account yet?",createVault:"Create new vault",twoFactorTitle:"Please enter the authentication code from your authenticator app.",authCode:"Authentication Code",authCodePlaceholder:"Enter 6-digit code",verify:"Verify",cancel:"Cancel",twoFactorNote:"Note: if you don't have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.",masterPassword:"Master Password",unlockVault:"Unlock Vault",unlockTitle:"Unlock Your Vault",unlockDescription:"Enter your master password to unlock your vault.",logout:"Logout",logoutConfirm:"Are you sure you want to logout?",sessionExpired:"Your session has expired. Please log in again.",unlockSuccess:"Vault unlocked successfully!",unlockSuccessTitle:"Your vault is successfully unlocked",unlockSuccessDescription:"You can now use autofill in login forms in your browser.",closePopup:"Close this popup",browseVault:"Browse vault contents",connectingTo:"Connecting to",switchAccounts:"Switch accounts?",loggedIn:"Logged in",errors:{invalidCode:"Please enter a valid 6-digit authentication code.",serverError:"Could not reach AliasVault server. Please try again later or contact support if the problem persists.",noToken:"Login failed -- no token returned",migrationError:"An error occurred while checking for pending migrations.",wrongPassword:"Incorrect password. Please try again.",accountLocked:"Account temporarily locked due to too many failed attempts.",networkError:"Network error. Please check your connection and try again.",loginDataMissing:"Login session expired. Please try again."}},Qv={credentials:"Credentials",emails:"Emails",settings:"Settings"},Dv={appName:"AliasVault",loading:"Loading...",error:"Error",success:"Success",cancel:"Cancel",use:"Use",delete:"Delete",close:"Close",copied:"Copied!",openInNewWindow:"Open in new window",language:"Language",enabled:"Enabled",disabled:"Disabled",showPassword:"Show password",hidePassword:"Hide password",copyToClipboard:"Copy to clipboard",loadingEmails:"Loading emails...",loadingTotpCodes:"Loading TOTP codes...",attachments:"Attachments",loadingAttachments:"Loading attachments...",settings:"Settings",recentEmails:"Recent emails",loginCredentials:"Login credentials",twoFactorAuthentication:"Two-factor authentication",alias:"Alias",notes:"Notes",fullName:"Full Name",firstName:"First Name",lastName:"Last Name",birthDate:"Birth Date",nickname:"Nickname",email:"Email",username:"Username",password:"Password",syncingVault:"Syncing vault",savingChangesToVault:"Saving changes to vault",uploadingVaultToServer:"Uploading vault to server",checkingVaultUpdates:"Checking for vault updates",syncingUpdatedVault:"Syncing updated vault",executingOperation:"Executing operation...",loadMore:"Load more",errors:{VaultMergeRequired:"Your vault needs to be updated. Please login on the AliasVault website and follow the steps.",VaultOutdated:"Your vault is outdated. Please login on the AliasVault website and follow the steps.",NoVaultFound:"Your account does not have a vault yet. Please complete the tutorial in the AliasVault web client before using the browser extension.",serverNotAvailable:"The AliasVault server is not available. Please try again later or contact support if the problem persists.",clientVersionNotSupported:"This version of the AliasVault browser extension is not supported by the server anymore. Please update your browser extension to the latest version.",serverVersionNotSupported:"The AliasVault server needs to be updated to a newer version in order to use this browser extension. Please contact support if you need help.",unknownError:"An unknown error occurred",failedToStoreVault:"Failed to store vault",vaultNotAvailable:"Vault not available",failedToGetVault:"Failed to get vault",vaultIsLocked:"Vault is locked",failedToGetCredentials:"Failed to get credentials",failedToCreateIdentity:"Failed to create identity",failedToGetDefaultEmailDomain:"Failed to get default email domain",failedToGetDefaultIdentitySettings:"Failed to get default identity settings",failedToGetPasswordSettings:"Failed to get password settings",failedToUploadVault:"Failed to upload vault",noDerivedKeyAvailable:"No derived key available for encryption",failedToUploadVaultToServer:"Failed to upload new vault to server",noVaultOrDerivedKeyFound:"No vault or derived key found"},apiErrors:{UNKNOWN_ERROR:"An unknown error occurred. Please try again.",ACCOUNT_LOCKED:"Account temporarily locked due to too many failed attempts. Please try again later.",ACCOUNT_BLOCKED:"Your account has been disabled. If you believe this is a mistake, please contact support.",USER_NOT_FOUND:"Invalid username or password. Please try again.",INVALID_AUTHENTICATOR_CODE:"Invalid authenticator code. Please try again.",INVALID_RECOVERY_CODE:"Invalid recovery code. Please try again.",REFRESH_TOKEN_REQUIRED:"Refresh token is required.",USER_NOT_FOUND_IN_TOKEN:"User not found in token.",USER_NOT_FOUND_IN_DATABASE:"User not found in database.",INVALID_REFRESH_TOKEN:"Invalid refresh token.",REFRESH_TOKEN_REVOKED_SUCCESSFULLY:"Refresh token revoked successfully.",PUBLIC_REGISTRATION_DISABLED:"New account registration is currently disabled on this server. Please contact the administrator.",USERNAME_REQUIRED:"Username is required.",USERNAME_ALREADY_IN_USE:"Username is already in use.",USERNAME_AVAILABLE:"Username is available.",USERNAME_MISMATCH:"Username does not match the current user.",PASSWORD_MISMATCH:"The provided password does not match your current password.",ACCOUNT_SUCCESSFULLY_DELETED:"Account successfully deleted.",USERNAME_EMPTY_OR_WHITESPACE:"Username cannot be empty or whitespace.",USERNAME_TOO_SHORT:"Username too short: must be at least 3 characters long.",USERNAME_TOO_LONG:"Username too long: cannot be longer than 40 characters.",USERNAME_INVALID_EMAIL:"Invalid email address.",USERNAME_INVALID_CHARACTERS:"Username is invalid, can only contain letters or digits.",VAULT_NOT_UP_TO_DATE:"Your vault is not up-to-date. Please synchronize your vault and try again.",INTERNAL_SERVER_ERROR:"Internal server error.",VAULT_ERROR:"The local vault is not up-to-date. Please synchronize your vault by refreshing the page and try again."}},Rv={or:"or",new:"New",cancel:"Cancel",search:"Search",vaultLocked:"AliasVault is locked.",creatingNewAlias:"Creating new alias...",noMatchesFound:"No matches found",searchVault:"Search vault...",serviceName:"Service name",email:"Email",username:"Username",password:"Password",enterServiceName:"Enter service name",enterEmailAddress:"Enter email address",enterUsername:"Enter username",hideFor1Hour:"Hide for 1 hour (current site)",hidePermanently:"Hide permanently (current site)",createRandomAlias:"Create random alias",createUsernamePassword:"Create username/password",randomAlias:"Random alias",usernamePassword:"Username/password",createAndSaveAlias:"Create and save alias",createAndSaveCredential:"Create and save credential",randomIdentityDescription:"Generate a random identity with a random email address accessible in AliasVault.",randomIdentityDescriptionDropdown:"Random identity with random email",manualCredentialDescription:"Specify your own email address and username.",manualCredentialDescriptionDropdown:"Manual username and password",failedToCreateIdentity:"Failed to create identity. Please try again.",enterEmailAndOrUsername:"Enter email and/or username",autofillWithAliasVault:"Autofill with AliasVault",generateRandomPassword:"Generate random password (copy to clipboard)",generateNewPassword:"Generate new password",togglePasswordVisibility:"Toggle password visibility",passwordCopiedToClipboard:"Password copied to clipboard",enterEmailAndOrUsernameError:"Enter email and/or username",openAliasVaultToUpgrade:"Open AliasVault to upgrade",vaultUpgradeRequired:"Vault upgrade required.",dismissPopup:"Dismiss popup"},kv={title:"Credentials",addCredential:"Add Credential",editCredential:"Edit Credential",deleteCredential:"Delete Credential",credentialDetails:"Credential Details",serviceName:"Service Name",serviceNamePlaceholder:"e.g., Gmail, Facebook, Bank",website:"Website",websitePlaceholder:"https://example.com",username:"Username",usernamePlaceholder:"Enter username",password:"Password",passwordPlaceholder:"Enter password",generatePassword:"Generate Password",copyPassword:"Copy Password",showPassword:"Show Password",hidePassword:"Hide Password",notes:"Notes",notesPlaceholder:"Additional notes...",totp:"Two-Factor Authentication",totpCode:"TOTP Code",copyTotp:"Copy TOTP",totpSecret:"TOTP Secret",totpSecretPlaceholder:"Enter TOTP secret key",noCredentials:"No credentials found",noCredentialsDescription:"Add your first credential to get started",searchCredentials:"Search credentials...",searchPlaceholder:"Search credentials...",welcomeTitle:"Welcome to AliasVault!",welcomeDescription:"To use the AliasVault browser extension: navigate to a website and use the AliasVault autofill popup to create a new credential.",lastUsed:"Last used",createdAt:"Created",updatedAt:"Last updated",autofill:"Autofill",fillForm:"Fill Form",copyUsername:"Copy Username",openWebsite:"Open Website",favorite:"Favorite",unfavorite:"Remove from Favorites",deleteConfirm:"Are you sure you want to delete this credential?",deleteSuccess:"Credential deleted successfully",saveSuccess:"Credential saved successfully",copySuccess:"Copied to clipboard",tags:"Tags",addTag:"Add Tag",removeTag:"Remove Tag",folder:"Folder",selectFolder:"Select Folder",createFolder:"Create Folder",saveCredential:"Save credential",deleteCredentialTitle:"Delete Credential",deleteCredentialConfirm:"Are you sure you want to delete this credential? This action cannot be undone.",randomAlias:"Random Alias",manual:"Manual",service:"Service",serviceUrl:"Service URL",loginCredentials:"Login Credentials",generateRandomUsername:"Generate random username",generateRandomPassword:"Generate random password",changePasswordComplexity:"Change password complexity",passwordLength:"Password length",includeLowercase:"Include lowercase letters",includeUppercase:"Include uppercase letters",includeNumbers:"Include numbers",includeSpecialChars:"Include special characters",avoidAmbiguousChars:"Avoid ambiguous characters (o, 0, etc.)",generateNewPreview:"Generate new preview",generateRandomAlias:"Generate Random Alias",alias:"Alias",firstName:"First Name",lastName:"Last Name",nickName:"Nick Name",gender:"Gender",birthDate:"Birth Date",birthDatePlaceholder:"YYYY-MM-DD",metadata:"Metadata",errors:{invalidUrl:"Please enter a valid URL",saveError:"Failed to save credential",loadError:"Failed to load credentials",deleteError:"Failed to delete credential",copyError:"Failed to copy to clipboard"},validation:{required:"This field is required",serviceNameRequired:"Service name is required",invalidUrl:"Invalid URL format",invalidEmail:"Invalid email format",invalidDateFormat:"Date must be in YYYY-MM-DD format"}},Lv={title:"Emails",deleteEmailTitle:"Delete Email",deleteEmailConfirm:"Are you sure you want to permanently delete this email?",from:"From",to:"To",date:"Date",emailContent:"Email content",attachments:"Attachments",emailNotFound:"Email not found",noEmails:"No emails found",noEmailsDescription:"You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",dateFormat:{justNow:"just now",minutesAgo_single:"{{count}} min ago",minutesAgo_plural:"{{count}} mins ago",hoursAgo_single:"{{count}} hr ago",hoursAgo_plural:"{{count}} hrs ago",yesterday:"yesterday"},errors:{emailLoadError:"An error occurred while loading emails. Please try again later.",emailUnexpectedError:"An unexpected error occurred while loading emails. Please try again later."},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"The current chosen email address is already in use. Please change the email address by editing this credential.",CLAIM_DOES_NOT_EXIST:"An error occurred while trying to load the emails. Please try to edit and save the credential entry to synchronize the database, then try again."}},Uv={title:"Settings",serverUrl:"Server URL",language:"Language",autofillEnabled:"Enable Autofill",version:"Version",openInNewWindow:"Open in new window",openWebApp:"Open web app",loggedIn:"Logged in",logout:"Logout",globalSettings:"Global Settings",autofillPopup:"Autofill popup",activeOnAllSites:"Active on all sites (unless disabled below)",disabledOnAllSites:"Disabled on all sites",enabled:"Enabled",disabled:"Disabled",rightClickContextMenu:"Right-click context menu",siteSpecificSettings:"Site-Specific Settings",autofillPopupOn:"Autofill popup on: ",enabledForThisSite:"Enabled for this site",disabledForThisSite:"Disabled for this site",temporarilyDisabledUntil:"Temporarily disabled until ",resetAllSiteSettings:"Reset all site-specific settings",appearance:"Appearance",theme:"Theme",useDefault:"Use default",light:"Light",dark:"Dark",keyboardShortcuts:"Keyboard Shortcuts",configureKeyboardShortcuts:"Configure keyboard shortcuts",configure:"Configure",versionPrefix:"Version ",validation:{apiUrlRequired:"API URL is required",apiUrlInvalid:"Please enter a valid API URL",clientUrlRequired:"Client URL is required",clientUrlInvalid:"Please enter a valid client URL"}},Mv={title:"Upgrade Vault",subtitle:"AliasVault has updated and your vault needs to be upgraded. This should only take a few seconds.",versionInformation:"Version Information",yourVault:"Your vault:",newVersion:"New version:",upgrade:"Upgrade Vault",upgrading:"Upgrading...",logout:"Logout",whatsNew:"What's New",whatsNewDescription:"An upgrade is required to support the following changes:",noDescriptionAvailable:"No description available for this version.",okay:"Ok",status:{preparingUpgrade:"Preparing upgrade...",vaultAlreadyUpToDate:"Vault is already up to date",startingDatabaseTransaction:"Starting database transaction...",applyingDatabaseMigrations:"Applying database migrations...",applyingMigration:"Applying migration {{current}} of {{total}}...",committingChanges:"Committing changes..."},alerts:{error:"Error",unableToGetVersionInfo:"Unable to get version information. Please try again.",selfHostedServer:"Self-Hosted Server",selfHostedWarning:"If you're using a self-hosted server, make sure to also update your self-hosted instance as otherwise logging in to the web client will stop working.",cancel:"Cancel",continueUpgrade:"Continue Upgrade",upgradeFailed:"Upgrade Failed",failedToApplyMigration:"Failed to apply migration ({{current}} of {{total}})",unknownErrorDuringUpgrade:"An unknown error occurred during the upgrade. Please try again."}},_v={auth:Tv,menu:Qv,common:Dv,content:Rv,credentials:kv,emails:Lv,settings:Uv,upgrade:Mv},Ov={loginTitle:"Inloggen bij AliasVault",username:"Gebruikersnaam of e-mail",usernamePlaceholder:"naam / naam@bedrijf.com",password:"Wachtwoord",passwordPlaceholder:"Voer je wachtwoord in",rememberMe:"Onthoud mij",loginButton:"Inloggen",noAccount:"Nog geen account?",createVault:"Nieuwe vault aanmaken",twoFactorTitle:"Voer de authenticatiecode van je authenticator-app in.",authCode:"Authenticatiecode",authCodePlaceholder:"Voer 6-cijferige code in",verify:"Verifiëren",cancel:"Annuleren",twoFactorNote:"Opmerking: als je geen toegang hebt tot je authenticator, kunt je je 2FA resetten door met een in te loggen via de website.",masterPassword:"Hoofdwachtwoord",unlockVault:"Vault ontgrendelen",unlockTitle:"Ontgrendel je vault",unlockDescription:"Voer je hoofdwachtwoord in om je vault te ontgrendelen.",logout:"Uitloggen",logoutConfirm:"Weet je zeker dat je wilt uitloggen?",sessionExpired:"Je sessie is verlopen. Log opnieuw in.",unlockSuccess:"Vault succesvol ontgrendeld!",unlockSuccessTitle:"Je vault is succesvol ontgrendeld",unlockSuccessDescription:"Je kunt nu automatisch invullen gebruiken in inlogformulieren in je browser.",closePopup:"Sluit deze popup",browseVault:"Bekijk vault inhoud",connectingTo:"Verbinden met",switchAccounts:"Wisselen van account?",loggedIn:"Ingelogd",errors:{invalidCode:"Voer een geldige 6-cijferige code in.",serverError:"Kon de AliasVault server niet bereiken. Probeer het later opnieuw of neem contact op met support als het probleem aanhoudt.",noToken:"Inloggen mislukt -- geen token ontvangen",migrationError:"Er is een fout opgetreden bij het controleren op updates.",wrongPassword:"Onjuist wachtwoord. Probeer het opnieuw.",accountLocked:"Account tijdelijk vergrendeld vanwege te veel mislukte pogingen.",networkError:"Netwerkfout. Controleer de verbinding en probeer het opnieuw.",loginDataMissing:"Sessie verlopen. Probeer het opnieuw."}},Fv={credentials:"Credentials",emails:"E-mails",settings:"Instellingen"},jv={appName:"AliasVault",loading:"Laden...",error:"Fout",success:"Succes",cancel:"Annuleren",use:"Gebruik",delete:"Verwijderen",close:"Sluiten",copied:"Gekopieerd!",openInNewWindow:"Openen in nieuw venster",language:"Taal",enabled:"Ingeschakeld",disabled:"Uitgeschakeld",showPassword:"Wachtwoord tonen",hidePassword:"Wachtwoord verbergen",copyToClipboard:"Naar klembord kopiëren",loadingEmails:"E-mails laden...",loadingTotpCodes:"TOTP-codes laden...",attachments:"Bijlagen",loadingAttachments:"Bijlagen laden...",settings:"Instellingen",recentEmails:"Recente e-mails",loginCredentials:"Inloggegevens",twoFactorAuthentication:"Tweestapsverificatie",alias:"Alias",notes:"Notities",fullName:"Volledige naam",firstName:"Voornaam",lastName:"Achternaam",birthDate:"Geboortedatum",nickname:"Bijnaam",email:"E-mail",username:"Gebruikersnaam",password:"Wachtwoord",syncingVault:"Vault synchroniseren",savingChangesToVault:"Wijzigingen opslaan in vault",uploadingVaultToServer:"Vault uploaden naar server",checkingVaultUpdates:"Controleren op vault updates",syncingUpdatedVault:"Bijgewerkte vault synchroniseren",executingOperation:"Actie uitvoeren...",loadMore:"Laad meer",errors:{VaultMergeRequired:"Je vault moet worden bijgewerkt. Log in op de AliasVault website en volg de stappen.",VaultOutdated:"Je vault is verouderd. Log in op de AliasVault website en volg de stappen.",NoVaultFound:"Je account heeft nog geen vault. Voltooi eerst de tutorial in de AliasVault webclient voordat je de browserextensie gebruikt.",serverNotAvailable:"De AliasVault server is niet beschikbaar. Probeer het later opnieuw of neem contact op met de ondersteuning als het probleem aanhoudt.",clientVersionNotSupported:"Deze versie van de AliasVault browserextensie wordt niet meer ondersteund door de server. Update je browserextensie naar de nieuwste versie.",serverVersionNotSupported:"De AliasVault server moet worden bijgewerkt naar een nieuwere versie om deze browserextensie te kunnen gebruiken. Neem contact op met support als je hulp nodig hebt.",unknownError:"Er is een onbekende fout opgetreden",failedToStoreVault:"Vault opslaan mislukt",vaultNotAvailable:"Vault niet beschikbaar",failedToGetVault:"Vault ophalen mislukt",vaultIsLocked:"Vault is vergrendeld",failedToGetCredentials:"Credentials ophalen mislukt",failedToCreateIdentity:"Identiteit aanmaken mislukt",failedToGetDefaultEmailDomain:"Standaard e-maildomein ophalen mislukt",failedToGetDefaultIdentitySettings:"Standaard identiteit instellingen ophalen mislukt",failedToGetPasswordSettings:"Wachtwoordinstellingen ophalen mislukt",failedToUploadVault:"Vault uploaden mislukt",noDerivedKeyAvailable:"Geen afgeleide sleutel beschikbaar voor versleuteling",failedToUploadVaultToServer:"Nieuwe vault uploaden naar server mislukt",noVaultOrDerivedKeyFound:"Geen vault of afgeleide sleutel gevonden"},apiErrors:{UNKNOWN_ERROR:"Er is een onbekende fout opgetreden. Probeer het opnieuw.",ACCOUNT_LOCKED:"Account tijdelijk vergrendeld vanwege te veel mislukte pogingen. Probeer het later opnieuw.",ACCOUNT_BLOCKED:"Je account is uitgeschakeld. Als je denkt dat dit een vergissing is, neem dan contact op met support.",USER_NOT_FOUND:"Gebruikersnaam of wachtwoord is onjuist. Probeer het opnieuw.",INVALID_AUTHENTICATOR_CODE:"Ongeldige authenticator code. Probeer het opnieuw.",INVALID_RECOVERY_CODE:"Ongeldige herstelcode. Probeer het opnieuw.",REFRESH_TOKEN_REQUIRED:"Refresh token is vereist.",USER_NOT_FOUND_IN_TOKEN:"Gebruiker niet gevonden in token.",USER_NOT_FOUND_IN_DATABASE:"Gebruiker niet gevonden in database.",INVALID_REFRESH_TOKEN:"Ongeldig refresh token.",REFRESH_TOKEN_REVOKED_SUCCESSFULLY:"Refresh token succesvol ingetrokken.",PUBLIC_REGISTRATION_DISABLED:"Registratie van nieuwe accounts is momenteel uitgeschakeld op deze server. Neem contact op met de beheerder.",USERNAME_REQUIRED:"Gebruikersnaam is vereist.",USERNAME_ALREADY_IN_USE:"Gebruikersnaam is al in gebruik.",USERNAME_AVAILABLE:"Gebruikersnaam is beschikbaar.",USERNAME_MISMATCH:"Gebruikersnaam komt niet overeen met de huidige gebruiker.",PASSWORD_MISMATCH:"Het opgegeven wachtwoord komt niet overeen met je huidige wachtwoord.",ACCOUNT_SUCCESSFULLY_DELETED:"Account succesvol verwijderd.",USERNAME_EMPTY_OR_WHITESPACE:"Gebruikersnaam mag niet leeg zijn of alleen uit spaties bestaan.",USERNAME_TOO_SHORT:"Gebruikersnaam te kort: moet minimaal 3 tekens lang zijn.",USERNAME_TOO_LONG:"Gebruikersnaam te lang: mag niet langer zijn dan 40 tekens.",USERNAME_INVALID_EMAIL:"Ongeldig e-mailadres.",USERNAME_INVALID_CHARACTERS:"Gebruikersnaam is ongeldig, mag alleen letters of cijfers bevatten.",VAULT_NOT_UP_TO_DATE:"Je vault is niet up-to-date. Synchroniseer je vault en probeer het opnieuw.",INTERNAL_SERVER_ERROR:"Interne serverfout.",VAULT_ERROR:"Je lokale vault is niet up-to-date. Synchroniseer je vault door de pagina te vernieuwen en probeer het opnieuw."}},Hv={or:"of",new:"Nieuw",cancel:"Annuleren",search:"Zoeken",vaultLocked:"AliasVault is vergrendeld.",creatingNewAlias:"Nieuwe alias aanmaken...",noMatchesFound:"Geen resultaten gevonden",searchVault:"Vault doorzoeken...",serviceName:"Servicenaam",email:"E-mail",username:"Gebruikersnaam",password:"Wachtwoord",enterServiceName:"Voer servicenaam in",enterEmailAddress:"Voer e-mailadres in",enterUsername:"Voer gebruikersnaam in",hideFor1Hour:"Verberg voor 1 uur (huidige site)",hidePermanently:"Permanent verbergen (huidige site)",createRandomAlias:"Willekeurige alias aanmaken",createUsernamePassword:"Gebruikersnaam/wachtwoord aanmaken",randomAlias:"Alias",usernamePassword:"Gebruikersnaam/wachtwoord",createAndSaveAlias:"Alias aanmaken",createAndSaveCredential:"Credential aanmaken",randomIdentityDescription:"Genereer een willekeurige identiteit met een willekeurig e-mailadres toegankelijk in AliasVault.",randomIdentityDescriptionDropdown:"Willekeurige identiteit met willekeurige e-mail",manualCredentialDescription:"Specificeer je eigen e-mailadres en/of gebruikersnaam.",manualCredentialDescriptionDropdown:"Handmatige gebruikersnaam en wachtwoord",failedToCreateIdentity:"Identiteit aanmaken mislukt. Probeer opnieuw.",enterEmailAndOrUsername:"Voer e-mail en/of gebruikersnaam in",autofillWithAliasVault:"Autofill met AliasVault",generateRandomPassword:"Willekeurig wachtwoord genereren (kopiëren naar klembord)",generateNewPassword:"Genereer nieuw wachtwoord",togglePasswordVisibility:"Schakel zichtbaarheid van wachtwoord in/uit",passwordCopiedToClipboard:"Wachtwoord gekopieerd naar klembord",enterEmailAndOrUsernameError:"Voer e-mail en/of gebruikersnaam in",openAliasVaultToUpgrade:"Open AliasVault om te upgraden",vaultUpgradeRequired:"Update is vereist.",dismissPopup:"Pop-up sluiten"},Gv={title:"Credentials",addCredential:"Credential toevoegen",editCredential:"Credential bewerken",deleteCredential:"Credential verwijderen",credentialDetails:"Credential details",serviceName:"Naam",serviceNamePlaceholder:"bijv. Gmail, Facebook, Bank",website:"Website",websitePlaceholder:"https://voorbeeld.nl",username:"Gebruikersnaam",usernamePlaceholder:"Voer gebruikersnaam in",password:"Wachtwoord",passwordPlaceholder:"Voer wachtwoord in",generatePassword:"Wachtwoord genereren",copyPassword:"Wachtwoord kopiëren",showPassword:"Wachtwoord tonen",hidePassword:"Wachtwoord verbergen",notes:"Notities",notesPlaceholder:"Aanvullende notities...",totp:"Tweestapsverificatie",totpCode:"TOTP-code",copyTotp:"Kopiëren",totpSecret:"TOTP secret",totpSecretPlaceholder:"Voer TOTP secret in",noCredentials:"Geen credentials gevonden",noCredentialsDescription:"Voeg je eerste credentials toe om te beginnen",searchCredentials:"Zoek credentials...",searchPlaceholder:"Credentials zoeken...",welcomeTitle:"Welkom bij AliasVault!",welcomeDescription:"Om de AliasVault browser extensie te gebruiken: navigeer naar een website en gebruik de AliasVault autofill popup om nieuwe credentials aan te maken.",lastUsed:"Laatst gebruikt",createdAt:"Aangemaakt",updatedAt:"Laatst bijgewerkt",autofill:"Autofill",fillForm:"Formulier invullen",copyUsername:"Gebruikersnaam kopiëren",openWebsite:"Website openen",favorite:"Favoriet",unfavorite:"Uit favorieten verwijderen",deleteConfirm:"Weet je zeker dat je deze credential wilt verwijderen?",deleteSuccess:"Credential succesvol verwijderd",saveSuccess:"Credential succesvol opgeslagen",copySuccess:"Gekopieerd naar klembord",tags:"Labels",addTag:"Label toevoegen",removeTag:"Label verwijderen",folder:"Map",selectFolder:"Map selecteren",createFolder:"Map aanmaken",saveCredential:"Credential opslaan",deleteCredentialTitle:"Credential verwijderen",deleteCredentialConfirm:"Weet je zeker dat je deze credential wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.",randomAlias:"Alias",manual:"Handmatig",service:"Naam",serviceUrl:"URL",loginCredentials:"Inloggegevens",generateRandomUsername:"Gebruikersnaam genereren",generateRandomPassword:"Wachtwoord genereren",changePasswordComplexity:"Wijzig wachtwoord complexiteit",passwordLength:"Wachtwoordlengte",includeLowercase:"Inclusief kleine letters",includeUppercase:"Inclusief hoofdletters",includeNumbers:"Inclusief cijfers",includeSpecialChars:"Inclusief speciale karakters",avoidAmbiguousChars:"Onduidelijke tekens vermijden (o, 0, etc.)",generateNewPreview:"Genereer nieuw voorbeeld",generateRandomAlias:"Alias genereren",alias:"Alias",firstName:"Voornaam",lastName:"Achternaam",nickName:"Bijnaam",gender:"Geslacht",birthDate:"Geboortedatum",birthDatePlaceholder:"YYYY-MM-DD",metadata:"Metadata",errors:{invalidUrl:"Voer een geldige URL in",saveError:"Credential opslaan mislukt",loadError:"Credential laden mislukt",deleteError:"Credential verwijderen mislukt",copyError:"Kopiëren naar klembord mislukt"},validation:{required:"Dit veld is verplicht",serviceNameRequired:"Servicenaam is verplicht",invalidUrl:"Ongeldig URL-formaat",invalidEmail:"Ongeldig e-mailformaat",invalidDateFormat:"Datum moet in YYYY-MM-DD formaat zijn"}},Vv={title:"E-mails",deleteEmailTitle:"E-mail verwijderen",deleteEmailConfirm:"Weet je zeker dat je deze e-mail definitief wilt verwijderen?",from:"Van",to:"Naar",date:"Datum",emailContent:"E-mailinhoud",attachments:"Bijlagen",emailNotFound:"E-mail niet gevonden",noEmails:"Geen e-mails gevonden",noEmailsDescription:"Je hebt nog geen e-mails ontvangen op je privé e-mailadressen. Wanneer je een nieuwe e-mail ontvangt, zal deze hier verschijnen.",dateFormat:{justNow:"zojuist",minutesAgo_single:"{{count}} min geleden",minutesAgo_plural:"{{count}} min. geleden",hoursAgo_single:"{{count}} uur geleden",hoursAgo_plural:"{{count}} uur geleden",yesterday:"gisteren"},errors:{emailLoadError:"Er is een fout opgetreden bij het laden van e-mails. Probeer het later opnieuw.",emailUnexpectedError:"Er is een onverwachte fout opgetreden bij het laden van e-mails. Probeer het later opnieuw."},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Het huidige gekozen e-mailadres is al in gebruik. Wijzig het e-mailadres door deze credential te bewerken.",CLAIM_DOES_NOT_EXIST:"Er is een fout opgetreden bij het laden van e-mails. Probeer de credential te bewerken en op te slaan om de database te synchroniseren, en probeer het opnieuw."}},qv={title:"Instellingen",serverUrl:"Server URL",language:"Taal",autofillEnabled:"Autofill",version:"Versie",openInNewWindow:"Openen in nieuw venster",openWebApp:"Web-app openen",loggedIn:"Ingelogd",logout:"Uitloggen",globalSettings:"Globale Instellingen",autofillPopup:"Autofill popup",activeOnAllSites:"Actief voor alle sites (tenzij hieronder uitgeschakeld)",disabledOnAllSites:"Uitgeschakeld op alle sites",enabled:"Ingeschakeld",disabled:"Uitgeschakeld",rightClickContextMenu:"Rechtermuisknop menu",siteSpecificSettings:"Site-specifieke Instellingen",autofillPopupOn:"Autofill popup op: ",enabledForThisSite:"Ingeschakeld voor deze site",disabledForThisSite:"Uitgeschakeld voor deze site",temporarilyDisabledUntil:"Tijdelijk uitgeschakeld tot ",resetAllSiteSettings:"Alle site-specifieke instellingen resetten",appearance:"Uiterlijk",theme:"Thema",useDefault:"Standaard gebruiken",light:"Licht",dark:"Donker",keyboardShortcuts:"Snelkoppelingen",configureKeyboardShortcuts:"Snelkoppelingen configureren",configure:"Configureren",versionPrefix:"Versie ",validation:{apiUrlRequired:"API URL is vereist",apiUrlInvalid:"Voer een geldige API URL in",clientUrlRequired:"Client URL is vereist",clientUrlInvalid:"Voer een geldige client URL in"}},zv={title:"Vault upgraden",subtitle:"AliasVault is vernieuwd en je vault moet worden bijgewerkt. Dit kan enkele seconden duren.",versionInformation:"Versie-informatie",yourVault:"Jouw vault:",newVersion:"Nieuwe versie:",upgrade:"Vault upgraden",upgrading:"Aan het upgraden...",logout:"Uitloggen",whatsNew:"Wat is er nieuw",whatsNewDescription:"Een upgrade is vereist vanwege de volgende wijzigingen:",noDescriptionAvailable:"Voor deze versie is geen beschrijving beschikbaar.",okay:"Ok",status:{preparingUpgrade:"Upgrade voorbereiden...",vaultAlreadyUpToDate:"De vault is al bijgewerkt",startingDatabaseTransaction:"Starten van database transactie...",applyingDatabaseMigrations:"Databasemigratie toepassen...",applyingMigration:"Toepassen van migratie {{current}} van {{total}}...",committingChanges:"Wijzigingen doorvoeren..."},alerts:{error:"Fout",unableToGetVersionInfo:"Kan versie-informatie niet ophalen. Probeer het opnieuw.",selfHostedServer:"Self-hosted server",selfHostedWarning:"Als je een self-hosted server gebruikt, zorg er dan voor dat je ook je eigen self-hosted instantie bijwerkt, omdat anders het inloggen via de web client niet meer zal werken.",cancel:"Annuleren",continueUpgrade:"Verdergaan",upgradeFailed:"Upgrade mislukt",failedToApplyMigration:"Kon migratie niet toepassen ({{current}} van {{total}})",unknownErrorDuringUpgrade:"Er is een onbekende fout opgetreden tijdens de upgrade. Probeer het opnieuw."}},Yv={auth:Ov,menu:Fv,common:jv,content:Hv,credentials:Gv,emails:Vv,settings:qv,upgrade:zv},Pv={en:{translation:_v},nl:{translation:Yv}},Jl=[{code:"en",name:"English",nativeName:"English",flag:"🇺🇸"},{code:"nl",name:"Dutch",nativeName:"Nederlands",flag:"🇳🇱"}],Hp="en",Em=Jl.map(n=>n.code);function Kv(n){return Jl.find(r=>r.code===n)}const Jv=async()=>{const n=await Xe.getItem("local:language");if(n&&Em.includes(n))return n;const r=navigator.language.split("-")[0];return Em.includes(r)?r:Hp},Xv=async()=>{const n=await Jv();await Hr.use(wv).init({resources:Pv,lng:n,fallbackLng:Hp,debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1,bindI18n:"languageChanged loaded",bindI18nStore:""}})};Xv();var Hl={},bm;function $v(){if(bm)return Hl;bm=1,Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.parse=c,Hl.serialize=A;const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,u=(()=>{const B=function(){};return B.prototype=Object.create(null),B})();function c(B,T){const Q=new u,k=B.length;if(k<2)return Q;const R=(T==null?void 0:T.decode)||b;let N=0;do{const O=B.indexOf("=",N);if(O===-1)break;const _=B.indexOf(";",N),q=_===-1?k:_;if(O>q){N=B.lastIndexOf(";",O-1)+1;continue}const V=d(B,N,O),ge=m(B,O,V),ce=B.slice(V,ge);if(Q[ce]===void 0){let te=d(B,O+1,q),J=m(B,q,te);const K=R(B.slice(te,J));Q[ce]=K}N=q+1}while(N<k);return Q}function d(B,T,Q){do{const k=B.charCodeAt(T);if(k!==32&&k!==9)return T}while(++T<Q);return Q}function m(B,T,Q){for(;T>Q;){const k=B.charCodeAt(--T);if(k!==32&&k!==9)return T+1}return Q}function A(B,T,Q){const k=(Q==null?void 0:Q.encode)||encodeURIComponent;if(!n.test(B))throw new TypeError(`argument name is invalid: ${B}`);const R=k(T);if(!r.test(R))throw new TypeError(`argument val is invalid: ${T}`);let N=B+"="+R;if(!Q)return N;if(Q.maxAge!==void 0){if(!Number.isInteger(Q.maxAge))throw new TypeError(`option maxAge is invalid: ${Q.maxAge}`);N+="; Max-Age="+Q.maxAge}if(Q.domain){if(!a.test(Q.domain))throw new TypeError(`option domain is invalid: ${Q.domain}`);N+="; Domain="+Q.domain}if(Q.path){if(!s.test(Q.path))throw new TypeError(`option path is invalid: ${Q.path}`);N+="; Path="+Q.path}if(Q.expires){if(!v(Q.expires)||!Number.isFinite(Q.expires.valueOf()))throw new TypeError(`option expires is invalid: ${Q.expires}`);N+="; Expires="+Q.expires.toUTCString()}if(Q.httpOnly&&(N+="; HttpOnly"),Q.secure&&(N+="; Secure"),Q.partitioned&&(N+="; Partitioned"),Q.priority)switch(typeof Q.priority=="string"?Q.priority.toLowerCase():void 0){case"low":N+="; Priority=Low";break;case"medium":N+="; Priority=Medium";break;case"high":N+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${Q.priority}`)}if(Q.sameSite)switch(typeof Q.sameSite=="string"?Q.sameSite.toLowerCase():Q.sameSite){case!0:case"strict":N+="; SameSite=Strict";break;case"lax":N+="; SameSite=Lax";break;case"none":N+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${Q.sameSite}`)}return N}function b(B){if(B.indexOf("%")===-1)return B;try{return decodeURIComponent(B)}catch{return B}}function v(B){return o.call(B)==="[object Date]"}return Hl}$v();var vm="popstate";function Wv(n={}){function r(o,u){let{pathname:c="/",search:d="",hash:m=""}=Wi(o.location.hash.substring(1));return!c.startsWith("/")&&!c.startsWith(".")&&(c="/"+c),nA("",{pathname:c,search:d,hash:m},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function a(o,u){let c=o.document.querySelector("base"),d="";if(c&&c.getAttribute("href")){let m=o.location.href,A=m.indexOf("#");d=A===-1?m:m.slice(0,A)}return d+"#"+(typeof u=="string"?u:no(u))}function s(o,u){Rn(o.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(u)})`)}return ex(r,a,s,n)}function Pt(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function Rn(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Zv(){return Math.random().toString(36).substring(2,10)}function xm(n,r){return{usr:n.state,key:n.key,idx:r}}function nA(n,r,a=null,s){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?Wi(r):r,state:a,key:r&&r.key||s||Zv()}}function no({pathname:n="/",search:r="",hash:a=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function Wi(n){let r={};if(n){let a=n.indexOf("#");a>=0&&(r.hash=n.substring(a),n=n.substring(0,a));let s=n.indexOf("?");s>=0&&(r.search=n.substring(s),n=n.substring(0,s)),n&&(r.pathname=n)}return r}function ex(n,r,a,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,c=o.history,d="POP",m=null,A=b();A==null&&(A=0,c.replaceState({...c.state,idx:A},""));function b(){return(c.state||{idx:null}).idx}function v(){d="POP";let R=b(),N=R==null?null:R-A;A=R,m&&m({action:d,location:k.location,delta:N})}function B(R,N){d="PUSH";let O=nA(k.location,R,N);a&&a(O,R),A=b()+1;let _=xm(O,A),q=k.createHref(O);try{c.pushState(_,"",q)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(q)}u&&m&&m({action:d,location:k.location,delta:1})}function T(R,N){d="REPLACE";let O=nA(k.location,R,N);a&&a(O,R),A=b();let _=xm(O,A),q=k.createHref(O);c.replaceState(_,"",q),u&&m&&m({action:d,location:k.location,delta:0})}function Q(R){return tx(R)}let k={get action(){return d},get location(){return n(o,c)},listen(R){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(vm,v),m=R,()=>{o.removeEventListener(vm,v),m=null}},createHref(R){return r(o,R)},createURL:Q,encodeLocation(R){let N=Q(R);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:B,replace:T,go(R){return c.go(R)}};return k}function tx(n,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Pt(a,"No window.location.(origin|href) available to create URL");let s=typeof n=="string"?n:no(n);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function Gp(n,r,a="/"){return rx(n,r,a,!1)}function rx(n,r,a,s){let o=typeof r=="string"?Wi(r):r,u=Ua(o.pathname||"/",a);if(u==null)return null;let c=Vp(n);nx(c);let d=null;for(let m=0;d==null&&m<c.length;++m){let A=hx(u);d=fx(c[m],A,s)}return d}function Vp(n,r=[],a=[],s=""){let o=(u,c,d)=>{let m={relativePath:d===void 0?u.path||"":d,caseSensitive:u.caseSensitive===!0,childrenIndex:c,route:u};m.relativePath.startsWith("/")&&(Pt(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length));let A=La([s,m.relativePath]),b=a.concat(m);u.children&&u.children.length>0&&(Pt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${A}".`),Vp(u.children,r,b,A)),!(u.path==null&&!u.index)&&r.push({path:A,score:cx(A,u.index),routesMeta:b})};return n.forEach((u,c)=>{var d;if(u.path===""||!((d=u.path)!=null&&d.includes("?")))o(u,c);else for(let m of qp(u.path))o(u,c,m)}),r}function qp(n){let r=n.split("/");if(r.length===0)return[];let[a,...s]=r,o=a.endsWith("?"),u=a.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let c=qp(s.join("/")),d=[];return d.push(...c.map(m=>m===""?u:[u,m].join("/"))),o&&d.push(...c),d.map(m=>n.startsWith("/")&&m===""?"/":m)}function nx(n){n.sort((r,a)=>r.score!==a.score?a.score-r.score:dx(r.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var ax=/^:[\w-]+$/,ix=3,sx=2,lx=1,ox=10,ux=-2,Cm=n=>n==="*";function cx(n,r){let a=n.split("/"),s=a.length;return a.some(Cm)&&(s+=ux),r&&(s+=sx),a.filter(o=>!Cm(o)).reduce((o,u)=>o+(ax.test(u)?ix:u===""?lx:ox),s)}function dx(n,r){return n.length===r.length&&n.slice(0,-1).every((s,o)=>s===r[o])?n[n.length-1]-r[r.length-1]:0}function fx(n,r,a=!1){let{routesMeta:s}=n,o={},u="/",c=[];for(let d=0;d<s.length;++d){let m=s[d],A=d===s.length-1,b=u==="/"?r:r.slice(u.length)||"/",v=Ou({path:m.relativePath,caseSensitive:m.caseSensitive,end:A},b),B=m.route;if(!v&&A&&a&&!s[s.length-1].route.index&&(v=Ou({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},b)),!v)return null;Object.assign(o,v.params),c.push({params:o,pathname:La([u,v.pathname]),pathnameBase:yx(La([u,v.pathnameBase])),route:B}),v.pathnameBase!=="/"&&(u=La([u,v.pathnameBase]))}return c}function Ou(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[a,s]=Ax(n.path,n.caseSensitive,n.end),o=r.match(a);if(!o)return null;let u=o[0],c=u.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:s.reduce((A,{paramName:b,isOptional:v},B)=>{if(b==="*"){let Q=d[B]||"";c=u.slice(0,u.length-Q.length).replace(/(.)\/+$/,"$1")}const T=d[B];return v&&!T?A[b]=void 0:A[b]=(T||"").replace(/%2F/g,"/"),A},{}),pathname:u,pathnameBase:c,pattern:n}}function Ax(n,r=!1,a=!0){Rn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let s=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m)=>(s.push({paramName:d,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(s.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),s]}function hx(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Rn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),n}}function Ua(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,s=n.charAt(a);return s&&s!=="/"?null:n.slice(a)||"/"}function gx(n,r="/"){let{pathname:a,search:s="",hash:o=""}=typeof n=="string"?Wi(n):n;return{pathname:a?a.startsWith("/")?a:mx(a,r):r,search:Ex(s),hash:bx(o)}}function mx(n,r){let a=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Tf(n,r,a,s){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(s)}].  Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function px(n){return n.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function gA(n){let r=px(n);return r.map((a,s)=>s===r.length-1?a.pathname:a.pathnameBase)}function mA(n,r,a,s=!1){let o;typeof n=="string"?o=Wi(n):(o={...n},Pt(!o.pathname||!o.pathname.includes("?"),Tf("?","pathname","search",o)),Pt(!o.pathname||!o.pathname.includes("#"),Tf("#","pathname","hash",o)),Pt(!o.search||!o.search.includes("#"),Tf("#","search","hash",o)));let u=n===""||o.pathname==="",c=u?"/":o.pathname,d;if(c==null)d=a;else{let v=r.length-1;if(!s&&c.startsWith("..")){let B=c.split("/");for(;B[0]==="..";)B.shift(),v-=1;o.pathname=B.join("/")}d=v>=0?r[v]:"/"}let m=gx(o,d),A=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(A||b)&&(m.pathname+="/"),m}var La=n=>n.join("/").replace(/\/\/+/g,"/"),yx=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Ex=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,bx=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function vx(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}var zp=["POST","PUT","PATCH","DELETE"];new Set(zp);var xx=["GET",...zp];new Set(xx);var zs=M.createContext(null);zs.displayName="DataRouter";var ec=M.createContext(null);ec.displayName="DataRouterState";var Yp=M.createContext({isTransitioning:!1});Yp.displayName="ViewTransition";var Cx=M.createContext(new Map);Cx.displayName="Fetchers";var wx=M.createContext(null);wx.displayName="Await";var Vn=M.createContext(null);Vn.displayName="Navigation";var ao=M.createContext(null);ao.displayName="Location";var qn=M.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName="Route";var pA=M.createContext(null);pA.displayName="RouteError";function Ix(n,{relative:r}={}){Pt(Ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=M.useContext(Vn),{hash:o,pathname:u,search:c}=io(n,{relative:r}),d=u;return a!=="/"&&(d=u==="/"?a:La([a,u])),s.createHref({pathname:d,search:c,hash:o})}function Ys(){return M.useContext(ao)!=null}function zn(){return Pt(Ys(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(ao).location}var Pp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Kp(n){M.useContext(Vn).static||M.useLayoutEffect(n)}function Rr(){let{isDataRoute:n}=M.useContext(qn);return n?Ox():Bx()}function Bx(){Pt(Ys(),"useNavigate() may be used only in the context of a <Router> component.");let n=M.useContext(zs),{basename:r,navigator:a}=M.useContext(Vn),{matches:s}=M.useContext(qn),{pathname:o}=zn(),u=JSON.stringify(gA(s)),c=M.useRef(!1);return Kp(()=>{c.current=!0}),M.useCallback((m,A={})=>{if(Rn(c.current,Pp),!c.current)return;if(typeof m=="number"){a.go(m);return}let b=mA(m,JSON.parse(u),o,A.relative==="path");n==null&&r!=="/"&&(b.pathname=b.pathname==="/"?r:La([r,b.pathname])),(A.replace?a.replace:a.push)(b,A.state,A)},[r,a,u,o,n])}M.createContext(null);function yA(){let{matches:n}=M.useContext(qn),r=n[n.length-1];return r?r.params:{}}function io(n,{relative:r}={}){let{matches:a}=M.useContext(qn),{pathname:s}=zn(),o=JSON.stringify(gA(a));return M.useMemo(()=>mA(n,JSON.parse(o),s,r==="path"),[n,o,s,r])}function Sx(n,r){return Jp(n,r)}function Jp(n,r,a,s){var O;Pt(Ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o,static:u}=M.useContext(Vn),{matches:c}=M.useContext(qn),d=c[c.length-1],m=d?d.params:{},A=d?d.pathname:"/",b=d?d.pathnameBase:"/",v=d&&d.route;{let _=v&&v.path||"";Xp(A,!v||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${A}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let B=zn(),T;if(r){let _=typeof r=="string"?Wi(r):r;Pt(b==="/"||((O=_.pathname)==null?void 0:O.startsWith(b)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${b}" but pathname "${_.pathname}" was given in the \`location\` prop.`),T=_}else T=B;let Q=T.pathname||"/",k=Q;if(b!=="/"){let _=b.replace(/^\//,"").split("/");k="/"+Q.replace(/^\//,"").split("/").slice(_.length).join("/")}let R=!u&&a&&a.matches&&a.matches.length>0?a.matches:Gp(n,{pathname:k});Rn(v||R!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),Rn(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=Rx(R&&R.map(_=>Object.assign({},_,{params:Object.assign({},m,_.params),pathname:La([b,o.encodeLocation?o.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?b:La([b,o.encodeLocation?o.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),c,a,s);return r&&N?M.createElement(ao.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},N):N}function Nx(){let n=_x(),r=vx(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),a=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",n),c=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:u},"ErrorBoundary")," or"," ",M.createElement("code",{style:u},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},r),a?M.createElement("pre",{style:o},a):null,c)}var Tx=M.createElement(Nx,null),Qx=class extends M.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){console.error("React Router caught the following error during render",n,r)}render(){return this.state.error!==void 0?M.createElement(qn.Provider,{value:this.props.routeContext},M.createElement(pA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Dx({routeContext:n,match:r,children:a}){let s=M.useContext(zs);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),M.createElement(qn.Provider,{value:n},a)}function Rx(n,r=[],a=null,s=null){if(n==null){if(!a)return null;if(a.errors)n=a.matches;else if(r.length===0&&!a.initialized&&a.matches.length>0)n=a.matches;else return null}let o=n,u=a==null?void 0:a.errors;if(u!=null){let m=o.findIndex(A=>A.route.id&&(u==null?void 0:u[A.route.id])!==void 0);Pt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,d=-1;if(a)for(let m=0;m<o.length;m++){let A=o[m];if((A.route.HydrateFallback||A.route.hydrateFallbackElement)&&(d=m),A.route.id){let{loaderData:b,errors:v}=a,B=A.route.loader&&!b.hasOwnProperty(A.route.id)&&(!v||v[A.route.id]===void 0);if(A.route.lazy||B){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((m,A,b)=>{let v,B=!1,T=null,Q=null;a&&(v=u&&A.route.id?u[A.route.id]:void 0,T=A.route.errorElement||Tx,c&&(d<0&&b===0?(Xp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),B=!0,Q=null):d===b&&(B=!0,Q=A.route.hydrateFallbackElement||null)));let k=r.concat(o.slice(0,b+1)),R=()=>{let N;return v?N=T:B?N=Q:A.route.Component?N=M.createElement(A.route.Component,null):A.route.element?N=A.route.element:N=m,M.createElement(Dx,{match:A,routeContext:{outlet:m,matches:k,isDataRoute:a!=null},children:N})};return a&&(A.route.ErrorBoundary||A.route.errorElement||b===0)?M.createElement(Qx,{location:a.location,revalidation:a.revalidation,component:T,error:v,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):R()},null)}function EA(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function kx(n){let r=M.useContext(zs);return Pt(r,EA(n)),r}function Lx(n){let r=M.useContext(ec);return Pt(r,EA(n)),r}function Ux(n){let r=M.useContext(qn);return Pt(r,EA(n)),r}function bA(n){let r=Ux(n),a=r.matches[r.matches.length-1];return Pt(a.route.id,`${n} can only be used on routes that contain a unique "id"`),a.route.id}function Mx(){return bA("useRouteId")}function _x(){var s;let n=M.useContext(pA),r=Lx("useRouteError"),a=bA("useRouteError");return n!==void 0?n:(s=r.errors)==null?void 0:s[a]}function Ox(){let{router:n}=kx("useNavigate"),r=bA("useNavigate"),a=M.useRef(!1);return Kp(()=>{a.current=!0}),M.useCallback(async(o,u={})=>{Rn(a.current,Pp),a.current&&(typeof o=="number"?n.navigate(o):await n.navigate(o,{fromRouteId:r,...u}))},[n,r])}var wm={};function Xp(n,r,a){!r&&!wm[n]&&(wm[n]=!0,Rn(!1,a))}M.memo(Fx);function Fx({routes:n,future:r,state:a}){return Jp(n,void 0,a,r)}function jx({to:n,replace:r,state:a,relative:s}){Pt(Ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=M.useContext(Vn);Rn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=M.useContext(qn),{pathname:c}=zn(),d=Rr(),m=mA(n,gA(u),c,s==="path"),A=JSON.stringify(m);return M.useEffect(()=>{d(JSON.parse(A),{replace:r,state:a,relative:s})},[d,A,s,r,a]),null}function $p(n){Pt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Hx({basename:n="/",children:r=null,location:a,navigationType:s="POP",navigator:o,static:u=!1}){Pt(!Ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=n.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:c,navigator:o,static:u,future:{}}),[c,o,u]);typeof a=="string"&&(a=Wi(a));let{pathname:m="/",search:A="",hash:b="",state:v=null,key:B="default"}=a,T=M.useMemo(()=>{let Q=Ua(m,c);return Q==null?null:{location:{pathname:Q,search:A,hash:b,state:v,key:B},navigationType:s}},[c,m,A,b,v,B,s]);return Rn(T!=null,`<Router basename="${c}"> is not able to match the URL "${m}${A}${b}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:M.createElement(Vn.Provider,{value:d},M.createElement(ao.Provider,{children:r,value:T}))}function Gx({children:n,location:r}){return Sx(aA(n),r)}function aA(n,r=[]){let a=[];return M.Children.forEach(n,(s,o)=>{if(!M.isValidElement(s))return;let u=[...r,o];if(s.type===M.Fragment){a.push.apply(a,aA(s.props.children,u));return}Pt(s.type===$p,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=aA(s.props.children,u)),a.push(c)}),a}var Bu="get",Su="application/x-www-form-urlencoded";function tc(n){return n!=null&&typeof n.tagName=="string"}function Vx(n){return tc(n)&&n.tagName.toLowerCase()==="button"}function qx(n){return tc(n)&&n.tagName.toLowerCase()==="form"}function zx(n){return tc(n)&&n.tagName.toLowerCase()==="input"}function Yx(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Px(n,r){return n.button===0&&(!r||r==="_self")&&!Yx(n)}var mu=null;function Kx(){if(mu===null)try{new FormData(document.createElement("form"),0),mu=!1}catch{mu=!0}return mu}var Jx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qf(n){return n!=null&&!Jx.has(n)?(Rn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Su}"`),null):n}function Xx(n,r){let a,s,o,u,c;if(qx(n)){let d=n.getAttribute("action");s=d?Ua(d,r):null,a=n.getAttribute("method")||Bu,o=Qf(n.getAttribute("enctype"))||Su,u=new FormData(n)}else if(Vx(n)||zx(n)&&(n.type==="submit"||n.type==="image")){let d=n.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||d.getAttribute("action");if(s=m?Ua(m,r):null,a=n.getAttribute("formmethod")||d.getAttribute("method")||Bu,o=Qf(n.getAttribute("formenctype"))||Qf(d.getAttribute("enctype"))||Su,u=new FormData(d,n),!Kx()){let{name:A,type:b,value:v}=n;if(b==="image"){let B=A?`${A}.`:"";u.append(`${B}x`,"0"),u.append(`${B}y`,"0")}else A&&u.append(A,v)}}else{if(tc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Bu,s=null,o=Su,c=n}return u&&o==="text/plain"&&(c=u,u=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:u,body:c}}function vA(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}async function $x(n,r){if(n.id in r)return r[n.id];try{let a=await import(n.module);return r[n.id]=a,a}catch(a){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Wx(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function Zx(n,r,a){let s=await Promise.all(n.map(async o=>{let u=r.routes[o.route.id];if(u){let c=await $x(u,a);return c.links?c.links():[]}return[]}));return nC(s.flat(1).filter(Wx).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Im(n,r,a,s,o,u){let c=(m,A)=>a[A]?m.route.id!==a[A].route.id:!0,d=(m,A)=>{var b;return a[A].pathname!==m.pathname||((b=a[A].route.path)==null?void 0:b.endsWith("*"))&&a[A].params["*"]!==m.params["*"]};return u==="assets"?r.filter((m,A)=>c(m,A)||d(m,A)):u==="data"?r.filter((m,A)=>{var v;let b=s.routes[m.route.id];if(!b||!b.hasLoader)return!1;if(c(m,A)||d(m,A))return!0;if(m.route.shouldRevalidate){let B=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((v=a[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof B=="boolean")return B}return!0}):[]}function eC(n,r,{includeHydrateFallback:a}={}){return tC(n.map(s=>{let o=r.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function tC(n){return[...new Set(n)]}function rC(n){let r={},a=Object.keys(n).sort();for(let s of a)r[s]=n[s];return r}function nC(n,r){let a=new Set;return new Set(r),n.reduce((s,o)=>{let u=JSON.stringify(rC(o));return a.has(u)||(a.add(u),s.push({key:u,link:o})),s},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var aC=new Set([100,101,204,205]);function iC(n,r){let a=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return a.pathname==="/"?a.pathname="_root.data":r&&Ua(a.pathname,r)==="/"?a.pathname=`${r.replace(/\/$/,"")}/_root.data`:a.pathname=`${a.pathname.replace(/\/$/,"")}.data`,a}function Wp(){let n=M.useContext(zs);return vA(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function sC(){let n=M.useContext(ec);return vA(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var xA=M.createContext(void 0);xA.displayName="FrameworkContext";function Zp(){let n=M.useContext(xA);return vA(n,"You must render this element inside a <HydratedRouter> element"),n}function lC(n,r){let a=M.useContext(xA),[s,o]=M.useState(!1),[u,c]=M.useState(!1),{onFocus:d,onBlur:m,onMouseEnter:A,onMouseLeave:b,onTouchStart:v}=r,B=M.useRef(null);M.useEffect(()=>{if(n==="render"&&c(!0),n==="viewport"){let k=N=>{N.forEach(O=>{c(O.isIntersecting)})},R=new IntersectionObserver(k,{threshold:.5});return B.current&&R.observe(B.current),()=>{R.disconnect()}}},[n]),M.useEffect(()=>{if(s){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[s]);let T=()=>{o(!0)},Q=()=>{o(!1),c(!1)};return a?n!=="intent"?[u,B,{}]:[u,B,{onFocus:Gl(d,T),onBlur:Gl(m,Q),onMouseEnter:Gl(A,T),onMouseLeave:Gl(b,Q),onTouchStart:Gl(v,T)}]:[!1,B,{}]}function Gl(n,r){return a=>{n&&n(a),a.defaultPrevented||r(a)}}function oC({page:n,...r}){let{router:a}=Wp(),s=M.useMemo(()=>Gp(a.routes,n,a.basename),[a.routes,n,a.basename]);return s?M.createElement(cC,{page:n,matches:s,...r}):null}function uC(n){let{manifest:r,routeModules:a}=Zp(),[s,o]=M.useState([]);return M.useEffect(()=>{let u=!1;return Zx(n,r,a).then(c=>{u||o(c)}),()=>{u=!0}},[n,r,a]),s}function cC({page:n,matches:r,...a}){let s=zn(),{manifest:o,routeModules:u}=Zp(),{basename:c}=Wp(),{loaderData:d,matches:m}=sC(),A=M.useMemo(()=>Im(n,r,m,o,s,"data"),[n,r,m,o,s]),b=M.useMemo(()=>Im(n,r,m,o,s,"assets"),[n,r,m,o,s]),v=M.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let Q=new Set,k=!1;if(r.forEach(N=>{var _;let O=o.routes[N.route.id];!O||!O.hasLoader||(!A.some(q=>q.route.id===N.route.id)&&N.route.id in d&&((_=u[N.route.id])!=null&&_.shouldRevalidate)||O.hasClientLoader?k=!0:Q.add(N.route.id))}),Q.size===0)return[];let R=iC(n,c);return k&&Q.size>0&&R.searchParams.set("_routes",r.filter(N=>Q.has(N.route.id)).map(N=>N.route.id).join(",")),[R.pathname+R.search]},[c,d,s,o,A,r,n,u]),B=M.useMemo(()=>eC(b,o),[b,o]),T=uC(b);return M.createElement(M.Fragment,null,v.map(Q=>M.createElement("link",{key:Q,rel:"prefetch",as:"fetch",href:Q,...a})),B.map(Q=>M.createElement("link",{key:Q,rel:"modulepreload",href:Q,...a})),T.map(({key:Q,link:k})=>M.createElement("link",{key:Q,...k})))}function dC(...n){return r=>{n.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var ey=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ey&&(window.__reactRouterVersion="7.6.0")}catch{}function fC({basename:n,children:r,window:a}){let s=M.useRef();s.current==null&&(s.current=Wv({window:a,v5Compat:!0}));let o=s.current,[u,c]=M.useState({action:o.action,location:o.location}),d=M.useCallback(m=>{M.startTransition(()=>c(m))},[c]);return M.useLayoutEffect(()=>o.listen(d),[o,d]),M.createElement(Hx,{basename:n,children:r,location:u.location,navigationType:u.action,navigator:o})}var ty=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rc=M.forwardRef(function({onClick:r,discover:a="render",prefetch:s="none",relative:o,reloadDocument:u,replace:c,state:d,target:m,to:A,preventScrollReset:b,viewTransition:v,...B},T){let{basename:Q}=M.useContext(Vn),k=typeof A=="string"&&ty.test(A),R,N=!1;if(typeof A=="string"&&k&&(R=A,ey))try{let J=new URL(window.location.href),K=A.startsWith("//")?new URL(J.protocol+A):new URL(A),$=Ua(K.pathname,Q);K.origin===J.origin&&$!=null?A=$+K.search+K.hash:N=!0}catch{Rn(!1,`<Link to="${A}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let O=Ix(A,{relative:o}),[_,q,V]=lC(s,B),ge=mC(A,{replace:c,state:d,target:m,preventScrollReset:b,relative:o,viewTransition:v});function ce(J){r&&r(J),J.defaultPrevented||ge(J)}let te=M.createElement("a",{...B,...V,href:R||O,onClick:N||u?r:ce,ref:dC(T,q),target:m,"data-discover":!k&&a==="render"?"true":void 0});return _&&!k?M.createElement(M.Fragment,null,te,M.createElement(oC,{page:O})):te});rc.displayName="Link";var AC=M.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:s="",end:o=!1,style:u,to:c,viewTransition:d,children:m,...A},b){let v=io(c,{relative:A.relative}),B=zn(),T=M.useContext(ec),{navigator:Q,basename:k}=M.useContext(Vn),R=T!=null&&vC(v)&&d===!0,N=Q.encodeLocation?Q.encodeLocation(v).pathname:v.pathname,O=B.pathname,_=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;a||(O=O.toLowerCase(),_=_?_.toLowerCase():null,N=N.toLowerCase()),_&&k&&(_=Ua(_,k)||_);const q=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let V=O===N||!o&&O.startsWith(N)&&O.charAt(q)==="/",ge=_!=null&&(_===N||!o&&_.startsWith(N)&&_.charAt(N.length)==="/"),ce={isActive:V,isPending:ge,isTransitioning:R},te=V?r:void 0,J;typeof s=="function"?J=s(ce):J=[s,V?"active":null,ge?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let K=typeof u=="function"?u(ce):u;return M.createElement(rc,{...A,"aria-current":te,className:J,ref:b,style:K,to:c,viewTransition:d},typeof m=="function"?m(ce):m)});AC.displayName="NavLink";var hC=M.forwardRef(({discover:n="render",fetcherKey:r,navigate:a,reloadDocument:s,replace:o,state:u,method:c=Bu,action:d,onSubmit:m,relative:A,preventScrollReset:b,viewTransition:v,...B},T)=>{let Q=EC(),k=bC(d,{relative:A}),R=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&ty.test(d),O=_=>{if(m&&m(_),_.defaultPrevented)return;_.preventDefault();let q=_.nativeEvent.submitter,V=(q==null?void 0:q.getAttribute("formmethod"))||c;Q(q||_.currentTarget,{fetcherKey:r,method:V,navigate:a,replace:o,state:u,relative:A,preventScrollReset:b,viewTransition:v})};return M.createElement("form",{ref:T,method:R,action:k,onSubmit:s?m:O,...B,"data-discover":!N&&n==="render"?"true":void 0})});hC.displayName="Form";function gC(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function ry(n){let r=M.useContext(zs);return Pt(r,gC(n)),r}function mC(n,{target:r,replace:a,state:s,preventScrollReset:o,relative:u,viewTransition:c}={}){let d=Rr(),m=zn(),A=io(n,{relative:u});return M.useCallback(b=>{if(Px(b,r)){b.preventDefault();let v=a!==void 0?a:no(m)===no(A);d(n,{replace:v,state:s,preventScrollReset:o,relative:u,viewTransition:c})}},[m,d,A,a,s,r,n,o,u,c])}var pC=0,yC=()=>`__${String(++pC)}__`;function EC(){let{router:n}=ry("useSubmit"),{basename:r}=M.useContext(Vn),a=Mx();return M.useCallback(async(s,o={})=>{let{action:u,method:c,encType:d,formData:m,body:A}=Xx(s,r);if(o.navigate===!1){let b=o.fetcherKey||yC();await n.fetch(b,a,o.action||u,{preventScrollReset:o.preventScrollReset,formData:m,body:A,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await n.navigate(o.action||u,{preventScrollReset:o.preventScrollReset,formData:m,body:A,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,r,a])}function bC(n,{relative:r}={}){let{basename:a}=M.useContext(Vn),s=M.useContext(qn);Pt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...io(n||".",{relative:r})},c=zn();if(n==null){u.search=c.search;let d=new URLSearchParams(u.search),m=d.getAll("index");if(m.some(b=>b==="")){d.delete("index"),m.filter(v=>v).forEach(v=>d.append("index",v));let b=d.toString();u.search=b?`?${b}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(u.pathname=u.pathname==="/"?a:La([a,u.pathname])),no(u)}function vC(n,r={}){let a=M.useContext(Yp);Pt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=ry("useViewTransitionState"),o=io(n,{relative:r.relative});if(!a.isTransitioning)return!1;let u=Ua(a.currentLocation.pathname,s)||a.currentLocation.pathname,c=Ua(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Ou(o.pathname,c)!=null||Ou(o.pathname,u)!=null}[...aC];const xC=()=>{const{t:n}=Bt(),r=Rr(),a=zn(),[s,o]=M.useState("credentials");M.useEffect(()=>{const b=a.pathname.substring(1),B=["credentials","emails","settings"].find(T=>b===T||b.startsWith(`${T}/`));B&&o(B)},[a]);const u=b=>{o(b),r(`/${b}`)};return["/login","/auth-settings","/unlock","/unlock-success","/upgrade"].includes(a.pathname)||new URLSearchParams(window.location.search).get("mode")==="inline_unlock"?null:p.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"flex justify-around items-center h-14",children:[p.jsxs("button",{onClick:()=>u("credentials"),className:`flex flex-col items-center justify-center w-1/3 h-full ${s==="credentials"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[p.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),p.jsx("span",{className:"text-xs mt-1",children:n("menu.credentials")})]}),p.jsxs("button",{onClick:()=>u("emails"),className:`flex flex-col items-center justify-center w-1/3 h-full ${s==="emails"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[p.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),p.jsx("span",{className:"text-xs mt-1",children:n("menu.emails")})]}),p.jsxs("button",{onClick:()=>u("settings"),className:`flex flex-col items-center justify-center w-1/3 h-full ${s==="settings"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[p.jsxs("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),p.jsx("span",{className:"text-xs mt-1",children:n("menu.settings")})]})]})})};var pu={exports:{}},Bm;function CC(){if(Bm)return pu.exports;Bm=1;const n=a=>typeof crypto<"u"&&typeof crypto.getRandomValues=="function"?()=>{const s=crypto.getRandomValues(new Uint8Array(1))[0];return(s>=a?s%a:s).toString(a)}:()=>Math.floor(Math.random()*a).toString(a),r=(a=7,s=!1)=>Array.from({length:a},n(s?16:36)).join("");return pu.exports=r,pu.exports.default=r,pu.exports}var wC=CC();const Fu=xi(wC);var IC=()=>`uid::${Fu(7)}`,BC=(n,r=["endpointName","fingerprint"])=>typeof n=="object"&&n!==null&&r.every(a=>a in n),SC=n=>{if(!BC(n))throw new TypeError("Invalid connection args");return JSON.stringify(n)},NC=()=>{let n=[];return{add:(...r)=>{n=[...n,...r]},remove:r=>{n=typeof r=="string"?n.filter(a=>a.message.transactionId!==r):n.filter(a=>!r.includes(a))},entries:()=>n}},Df=class{static toBackground(n,r){return n.postMessage(r)}static toExtensionContext(n,r){return n.postMessage(r)}},Nu={exports:{}},TC=Nu.exports,Sm;function QC(){return Sm||(Sm=1,function(n,r){(function(a,s){s(n)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:TC,function(a){if(typeof globalThis!="object"||typeof chrome!="object"||!chrome||!chrome.runtime||!chrome.runtime.id)throw new Error("This script should only be loaded in a browser extension.");if(typeof globalThis.browser>"u"||Object.getPrototypeOf(globalThis.browser)!==Object.prototype){const s="The message port closed before a response was received.",o="Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)",u=c=>{const d={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(Object.keys(d).length===0)throw new Error("api-metadata.json has not been included in browser-polyfill");class m extends WeakMap{constructor(J,K=void 0){super(K),this.createItem=J}get(J){return this.has(J)||this.set(J,this.createItem(J)),super.get(J)}}const A=te=>te&&typeof te=="object"&&typeof te.then=="function",b=(te,J)=>(...K)=>{c.runtime.lastError?te.reject(new Error(c.runtime.lastError.message)):J.singleCallbackArg||K.length<=1&&J.singleCallbackArg!==!1?te.resolve(K[0]):te.resolve(K)},v=te=>te==1?"argument":"arguments",B=(te,J)=>function($,...me){if(me.length<J.minArgs)throw new Error(`Expected at least ${J.minArgs} ${v(J.minArgs)} for ${te}(), got ${me.length}`);if(me.length>J.maxArgs)throw new Error(`Expected at most ${J.maxArgs} ${v(J.maxArgs)} for ${te}(), got ${me.length}`);return new Promise((he,we)=>{if(J.fallbackToNoCallback)try{$[te](...me,b({resolve:he,reject:we},J))}catch(pe){console.warn(`${te} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,pe),$[te](...me),J.fallbackToNoCallback=!1,J.noCallback=!0,he()}else J.noCallback?($[te](...me),he()):$[te](...me,b({resolve:he,reject:we},J))})},T=(te,J,K)=>new Proxy(J,{apply($,me,he){return K.call(me,te,...he)}});let Q=Function.call.bind(Object.prototype.hasOwnProperty);const k=(te,J={},K={})=>{let $=Object.create(null),me={has(we,pe){return pe in te||pe in $},get(we,pe,P){if(pe in $)return $[pe];if(!(pe in te))return;let ae=te[pe];if(typeof ae=="function")if(typeof J[pe]=="function")ae=T(te,te[pe],J[pe]);else if(Q(K,pe)){let Ne=B(pe,K[pe]);ae=T(te,te[pe],Ne)}else ae=ae.bind(te);else if(typeof ae=="object"&&ae!==null&&(Q(J,pe)||Q(K,pe)))ae=k(ae,J[pe],K[pe]);else if(Q(K,"*"))ae=k(ae,J[pe],K["*"]);else return Object.defineProperty($,pe,{configurable:!0,enumerable:!0,get(){return te[pe]},set(Ne){te[pe]=Ne}}),ae;return $[pe]=ae,ae},set(we,pe,P,ae){return pe in $?$[pe]=P:te[pe]=P,!0},defineProperty(we,pe,P){return Reflect.defineProperty($,pe,P)},deleteProperty(we,pe){return Reflect.deleteProperty($,pe)}},he=Object.create(te);return new Proxy(he,me)},R=te=>({addListener(J,K,...$){J.addListener(te.get(K),...$)},hasListener(J,K){return J.hasListener(te.get(K))},removeListener(J,K){J.removeListener(te.get(K))}}),N=new m(te=>typeof te!="function"?te:function(K){const $=k(K,{},{getContent:{minArgs:0,maxArgs:0}});te($)});let O=!1;const _=new m(te=>typeof te!="function"?te:function(K,$,me){let he=!1,we,pe=new Promise(_e=>{we=function(G){O||(console.warn(o,new Error().stack),O=!0),he=!0,_e(G)}}),P;try{P=te(K,$,we)}catch(_e){P=Promise.reject(_e)}const ae=P!==!0&&A(P);if(P!==!0&&!ae&&!he)return!1;const Ne=_e=>{_e.then(G=>{me(G)},G=>{let ne;G&&(G instanceof Error||typeof G.message=="string")?ne=G.message:ne="An unexpected error occurred",me({__mozWebExtensionPolyfillReject__:!0,message:ne})}).catch(G=>{console.error("Failed to send onMessage rejected reply",G)})};return Ne(ae?P:pe),!0}),q=({reject:te,resolve:J},K)=>{c.runtime.lastError?c.runtime.lastError.message===s?J():te(new Error(c.runtime.lastError.message)):K&&K.__mozWebExtensionPolyfillReject__?te(new Error(K.message)):J(K)},V=(te,J,K,...$)=>{if($.length<J.minArgs)throw new Error(`Expected at least ${J.minArgs} ${v(J.minArgs)} for ${te}(), got ${$.length}`);if($.length>J.maxArgs)throw new Error(`Expected at most ${J.maxArgs} ${v(J.maxArgs)} for ${te}(), got ${$.length}`);return new Promise((me,he)=>{const we=q.bind(null,{resolve:me,reject:he});$.push(we),K.sendMessage(...$)})},ge={devtools:{network:{onRequestFinished:R(N)}},runtime:{onMessage:R(_),onMessageExternal:R(_),sendMessage:V.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:V.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},ce={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return d.privacy={network:{"*":ce},services:{"*":ce},websites:{"*":ce}},k(c,ge,d)};a.exports=u(chrome)}else a.exports=globalThis.browser})}(Nu)),Nu.exports}var DC=QC();const RC=xi(DC);var kC=(n="")=>{const r=IC();let a,s=[];const o=NC(),u=new Set,c=new Set,d=(A,b)=>{switch(A.status){case"undeliverable":s.some(v=>v.message.messageID===A.message.messageID)||(s=[...s,{message:A.message,resolvedDestination:A.resolvedDestination}]);return;case"deliverable":s=s.reduce((v,B)=>B.resolvedDestination===A.deliverableTo?(Df.toBackground(b,{type:"deliver",message:B.message}),v):[...v,B],[]);return;case"delivered":A.receipt.message.messageType==="message"&&o.add(A.receipt);return;case"incoming":A.message.messageType==="reply"&&o.remove(A.message.messageID),u.forEach(v=>v(A.message,b));return;case"terminated":{const v=o.entries().filter(B=>A.fingerprint===B.to);o.remove(v),v.forEach(({message:B})=>c.forEach(T=>T(B)))}}},m=()=>{a=RC.runtime.connect({name:SC({endpointName:n,fingerprint:r})}),a.onMessage.addListener(d),a.onDisconnect.addListener(m),Df.toBackground(a,{type:"sync",pendingResponses:o.entries(),pendingDeliveries:[...new Set(s.map(({resolvedDestination:A})=>A))]})};return m(),{onFailure(A){c.add(A)},onMessage(A){u.add(A)},postMessage(A){Df.toBackground(a,{type:"deliver",message:A})}}},LC=Object.defineProperty,UC=Object.defineProperties,MC=Object.getOwnPropertyDescriptors,Nm=Object.getOwnPropertySymbols,_C=Object.prototype.hasOwnProperty,OC=Object.prototype.propertyIsEnumerable,Tm=(n,r,a)=>r in n?LC(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a,ny=(n,r)=>{for(var a in r||(r={}))_C.call(r,a)&&Tm(n,a,r[a]);if(Nm)for(var a of Nm(r))OC.call(r,a)&&Tm(n,a,r[a]);return n},ay=(n,r)=>UC(n,MC(r)),FC=/^((?:background$)|devtools|popup|options|content-script|window)(?:@(\d+)(?:\.(\d+))?)?$/,iy=n=>{const[,r,a,s]=n.match(FC)||[];return{context:r,tabId:+a,frameId:s?+s:void 0}};const jC=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],iA=Symbol(".toJSON was called"),HC=n=>{n[iA]=!0;const r=n.toJSON();return delete n[iA],r},sy=({from:n,seen:r,to_:a,forceEnumerable:s,maxDepth:o,depth:u})=>{const c=a||(Array.isArray(n)?[]:{});if(r.push(n),u>=o)return c;if(typeof n.toJSON=="function"&&n[iA]!==!0)return HC(n);for(const[d,m]of Object.entries(n)){if(typeof Buffer=="function"&&Buffer.isBuffer(m)){c[d]="[object Buffer]";continue}if(m!==null&&typeof m=="object"&&typeof m.pipe=="function"){c[d]="[object Stream]";continue}if(typeof m!="function"){if(!m||typeof m!="object"){c[d]=m;continue}if(!r.includes(n[d])){u++,c[d]=sy({from:n[d],seen:[...r],forceEnumerable:s,maxDepth:o,depth:u});continue}c[d]="[Circular]"}}for(const{property:d,enumerable:m}of jC)typeof n[d]=="string"&&Object.defineProperty(c,d,{value:n[d],enumerable:!0,configurable:!0,writable:!0});return c};function GC(n,r={}){const{maxDepth:a=Number.POSITIVE_INFINITY}=r;return typeof n=="object"&&n!==null?sy({from:n,seen:[],forceEnumerable:!0,maxDepth:a,depth:0}):typeof n=="function"?`[Function: ${n.name||"anonymous"}]`:n}let ly=()=>({events:{},emit(n,...r){(this.events[n]||[]).forEach(a=>a(...r))},on(n,r){return(this.events[n]=this.events[n]||[]).push(r),()=>this.events[n]=(this.events[n]||[]).filter(a=>a!==r)}});var VC=(n,r,a)=>{const s=Fu(),o=new Map,u=new Map,c=d=>{if(d.destination.context===n&&!d.destination.frameId&&!d.destination.tabId){const{transactionId:m,messageID:A,messageType:b}=d,v=()=>{const T=o.get(m);if(T){const{err:Q,data:k}=d;if(Q){const R=Q,N=self[R.name],O=new(typeof N=="function"?N:Error)(R.message);for(const _ in R)O[_]=R[_];T.reject(O)}else T.resolve(k);o.delete(m)}},B=async()=>{let T,Q,k=!1;try{const R=u.get(A);if(typeof R=="function")T=await R({sender:d.origin,id:A,data:d.data,timestamp:d.timestamp});else throw k=!0,new Error(`[webext-bridge] No handler registered in '${n}' to accept messages with id '${A}'`)}catch(R){Q=R}finally{if(Q&&(d.err=GC(Q)),c(ay(ny({},d),{messageType:"reply",data:T,origin:{context:n,tabId:null},destination:d.origin,hops:[]})),Q&&!k)throw T}};switch(b){case"reply":return v();case"message":return B()}}return d.hops.push(`${n}::${s}`),r(d)};return{handleMessage:c,endTransaction:d=>{const m=o.get(d);m==null||m.reject("Transaction was ended before it could complete"),o.delete(d)},sendMessage:(d,m,A="background")=>{const b=typeof A=="string"?iy(A):A,v="Bridge#sendMessage ->";if(!b.context)throw new TypeError(`${v} Destination must be any one of known destinations`);return new Promise((B,T)=>{const Q={messageID:d,data:m,destination:b,messageType:"message",transactionId:Fu(),origin:{context:n,tabId:null},hops:[],timestamp:Date.now()};o.set(Q.transactionId,{resolve:B,reject:T});try{c(Q)}catch(k){o.delete(Q.transactionId),T(k)}})},onMessage:(d,m)=>(u.set(d,m),()=>u.delete(d))}},js=class{constructor(n,r){this.endpointRuntime=n,this.streamInfo=r,this.emitter=ly(),this.isClosed=!1,this.handleStreamClose=()=>{this.isClosed||(this.isClosed=!0,this.emitter.emit("closed",!0),this.emitter.events={})},js.initDone||(n.onMessage("__crx_bridge_stream_transfer__",a=>{const{streamId:s,streamTransfer:o,action:u}=a.data,c=js.openStreams.get(s);c&&!c.isClosed&&(u==="transfer"&&c.emitter.emit("message",o),u==="close"&&(js.openStreams.delete(s),c.handleStreamClose()))}),js.initDone=!0),js.openStreams.set(this.streamInfo.streamId,this)}get info(){return this.streamInfo}send(n){if(this.isClosed)throw new Error("Attempting to send a message over closed stream. Use stream.onClose(<callback>) to keep an eye on stream status");this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:n,action:"transfer"},this.streamInfo.endpoint)}close(n){n&&this.send(n),this.handleStreamClose(),this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:null,action:"close"},this.streamInfo.endpoint)}onMessage(n){return this.getDisposable("message",n)}onClose(n){return this.getDisposable("closed",n)}getDisposable(n,r){const a=this.emitter.on(n,r);return Object.assign(a,{dispose:a,close:a})}},ju=js;ju.initDone=!1;ju.openStreams=new Map;var qC=n=>{const r=new Map,a=new Map,s=ly();n.onMessage("__crx_bridge_stream_open__",c=>new Promise(d=>{const{sender:m,data:A}=c,{channel:b}=A;let v=!1,B=()=>{};const T=()=>{const Q=a.get(b);typeof Q=="function"?(Q(new ju(n,ay(ny({},A),{endpoint:m}))),v&&B(),d(!0)):v||(v=!0,B=s.on("did-change-stream-callbacks",T))};T()}));async function o(c,d){if(r.has(c))throw new Error("webext-bridge: A Stream is already open at this channel");const m=typeof d=="string"?iy(d):d,A={streamId:Fu(),channel:c,endpoint:m},b=new ju(n,A);return b.onClose(()=>r.delete(c)),await n.sendMessage("__crx_bridge_stream_open__",A,m),r.set(c,b),b}function u(c,d){if(a.has(c))throw new Error("webext-bridge: This channel has already been claimed. Stream allows only one-on-one communication");a.set(c,d),s.emit("did-change-stream-callbacks")}return{openStream:o,onOpenStreamChannel:u}},oy=kC("popup"),CA=VC("popup",n=>oy.postMessage(n));oy.onMessage(CA.handleMessage);var{sendMessage:Dn,onMessage:D2}=CA;qC(CA);var Rf={},Vl={},Qm;function zC(){if(Qm)return Vl;Qm=1,Vl.byteLength=d,Vl.toByteArray=A,Vl.fromByteArray=B;for(var n=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=s.length;o<u;++o)n[o]=s[o],r[s.charCodeAt(o)]=o;r[45]=62,r[95]=63;function c(T){var Q=T.length;if(Q%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=T.indexOf("=");k===-1&&(k=Q);var R=k===Q?0:4-k%4;return[k,R]}function d(T){var Q=c(T),k=Q[0],R=Q[1];return(k+R)*3/4-R}function m(T,Q,k){return(Q+k)*3/4-k}function A(T){var Q,k=c(T),R=k[0],N=k[1],O=new a(m(T,R,N)),_=0,q=N>0?R-4:R,V;for(V=0;V<q;V+=4)Q=r[T.charCodeAt(V)]<<18|r[T.charCodeAt(V+1)]<<12|r[T.charCodeAt(V+2)]<<6|r[T.charCodeAt(V+3)],O[_++]=Q>>16&255,O[_++]=Q>>8&255,O[_++]=Q&255;return N===2&&(Q=r[T.charCodeAt(V)]<<2|r[T.charCodeAt(V+1)]>>4,O[_++]=Q&255),N===1&&(Q=r[T.charCodeAt(V)]<<10|r[T.charCodeAt(V+1)]<<4|r[T.charCodeAt(V+2)]>>2,O[_++]=Q>>8&255,O[_++]=Q&255),O}function b(T){return n[T>>18&63]+n[T>>12&63]+n[T>>6&63]+n[T&63]}function v(T,Q,k){for(var R,N=[],O=Q;O<k;O+=3)R=(T[O]<<16&16711680)+(T[O+1]<<8&65280)+(T[O+2]&255),N.push(b(R));return N.join("")}function B(T){for(var Q,k=T.length,R=k%3,N=[],O=16383,_=0,q=k-R;_<q;_+=O)N.push(v(T,_,_+O>q?q:_+O));return R===1?(Q=T[k-1],N.push(n[Q>>2]+n[Q<<4&63]+"==")):R===2&&(Q=(T[k-2]<<8)+T[k-1],N.push(n[Q>>10]+n[Q>>4&63]+n[Q<<2&63]+"=")),N.join("")}return Vl}var yu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Dm;function YC(){return Dm||(Dm=1,yu.read=function(n,r,a,s,o){var u,c,d=o*8-s-1,m=(1<<d)-1,A=m>>1,b=-7,v=a?o-1:0,B=a?-1:1,T=n[r+v];for(v+=B,u=T&(1<<-b)-1,T>>=-b,b+=d;b>0;u=u*256+n[r+v],v+=B,b-=8);for(c=u&(1<<-b)-1,u>>=-b,b+=s;b>0;c=c*256+n[r+v],v+=B,b-=8);if(u===0)u=1-A;else{if(u===m)return c?NaN:(T?-1:1)*(1/0);c=c+Math.pow(2,s),u=u-A}return(T?-1:1)*c*Math.pow(2,u-s)},yu.write=function(n,r,a,s,o,u){var c,d,m,A=u*8-o-1,b=(1<<A)-1,v=b>>1,B=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=s?0:u-1,Q=s?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(d=isNaN(r)?1:0,c=b):(c=Math.floor(Math.log(r)/Math.LN2),r*(m=Math.pow(2,-c))<1&&(c--,m*=2),c+v>=1?r+=B/m:r+=B*Math.pow(2,1-v),r*m>=2&&(c++,m/=2),c+v>=b?(d=0,c=b):c+v>=1?(d=(r*m-1)*Math.pow(2,o),c=c+v):(d=r*Math.pow(2,v-1)*Math.pow(2,o),c=0));o>=8;n[a+T]=d&255,T+=Q,d/=256,o-=8);for(c=c<<o|d,A+=o;A>0;n[a+T]=c&255,T+=Q,c/=256,A-=8);n[a+T-Q]|=k*128}),yu}/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var Rm;function PC(){return Rm||(Rm=1,function(n){const r=zC(),a=YC(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=d,n.SlowBuffer=O,n.INSPECT_MAX_BYTES=50;const o=2147483647;n.kMaxLength=o,d.TYPED_ARRAY_SUPPORT=u(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const S=new Uint8Array(1),E={foo:function(){return 42}};return Object.setPrototypeOf(E,Uint8Array.prototype),Object.setPrototypeOf(S,E),S.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function c(S){if(S>o)throw new RangeError('The value "'+S+'" is invalid for option "size"');const E=new Uint8Array(S);return Object.setPrototypeOf(E,d.prototype),E}function d(S,E,x){if(typeof S=="number"){if(typeof E=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(S)}return m(S,E,x)}d.poolSize=8192;function m(S,E,x){if(typeof S=="string")return B(S,E);if(ArrayBuffer.isView(S))return Q(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(se(S,ArrayBuffer)||S&&se(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(se(S,SharedArrayBuffer)||S&&se(S.buffer,SharedArrayBuffer)))return k(S,E,x);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=S.valueOf&&S.valueOf();if(H!=null&&H!==S)return d.from(H,E,x);const W=R(S);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return d.from(S[Symbol.toPrimitive]("string"),E,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}d.from=function(S,E,x){return m(S,E,x)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function A(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function b(S,E,x){return A(S),S<=0?c(S):E!==void 0?typeof x=="string"?c(S).fill(E,x):c(S).fill(E):c(S)}d.alloc=function(S,E,x){return b(S,E,x)};function v(S){return A(S),c(S<0?0:N(S)|0)}d.allocUnsafe=function(S){return v(S)},d.allocUnsafeSlow=function(S){return v(S)};function B(S,E){if((typeof E!="string"||E==="")&&(E="utf8"),!d.isEncoding(E))throw new TypeError("Unknown encoding: "+E);const x=_(S,E)|0;let H=c(x);const W=H.write(S,E);return W!==x&&(H=H.slice(0,W)),H}function T(S){const E=S.length<0?0:N(S.length)|0,x=c(E);for(let H=0;H<E;H+=1)x[H]=S[H]&255;return x}function Q(S){if(se(S,Uint8Array)){const E=new Uint8Array(S);return k(E.buffer,E.byteOffset,E.byteLength)}return T(S)}function k(S,E,x){if(E<0||S.byteLength<E)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<E+(x||0))throw new RangeError('"length" is outside of buffer bounds');let H;return E===void 0&&x===void 0?H=new Uint8Array(S):x===void 0?H=new Uint8Array(S,E):H=new Uint8Array(S,E,x),Object.setPrototypeOf(H,d.prototype),H}function R(S){if(d.isBuffer(S)){const E=N(S.length)|0,x=c(E);return x.length===0||S.copy(x,0,0,E),x}if(S.length!==void 0)return typeof S.length!="number"||Te(S.length)?c(0):T(S);if(S.type==="Buffer"&&Array.isArray(S.data))return T(S.data)}function N(S){if(S>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return S|0}function O(S){return+S!=S&&(S=0),d.alloc(+S)}d.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==d.prototype},d.compare=function(E,x){if(se(E,Uint8Array)&&(E=d.from(E,E.offset,E.byteLength)),se(x,Uint8Array)&&(x=d.from(x,x.offset,x.byteLength)),!d.isBuffer(E)||!d.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===x)return 0;let H=E.length,W=x.length;for(let fe=0,be=Math.min(H,W);fe<be;++fe)if(E[fe]!==x[fe]){H=E[fe],W=x[fe];break}return H<W?-1:W<H?1:0},d.isEncoding=function(E){switch(String(E).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(E,x){if(!Array.isArray(E))throw new TypeError('"list" argument must be an Array of Buffers');if(E.length===0)return d.alloc(0);let H;if(x===void 0)for(x=0,H=0;H<E.length;++H)x+=E[H].length;const W=d.allocUnsafe(x);let fe=0;for(H=0;H<E.length;++H){let be=E[H];if(se(be,Uint8Array))fe+be.length>W.length?(d.isBuffer(be)||(be=d.from(be)),be.copy(W,fe)):Uint8Array.prototype.set.call(W,be,fe);else if(d.isBuffer(be))be.copy(W,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=be.length}return W};function _(S,E){if(d.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||se(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const x=S.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&x===0)return 0;let W=!1;for(;;)switch(E){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return Fe(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return j(S).length;default:if(W)return H?-1:Fe(S).length;E=(""+E).toLowerCase(),W=!0}}d.byteLength=_;function q(S,E,x){let H=!1;if((E===void 0||E<0)&&(E=0),E>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,E>>>=0,x<=E))return"";for(S||(S="utf8");;)switch(S){case"hex":return _e(this,E,x);case"utf8":case"utf-8":return we(this,E,x);case"ascii":return ae(this,E,x);case"latin1":case"binary":return Ne(this,E,x);case"base64":return he(this,E,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,E,x);default:if(H)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),H=!0}}d.prototype._isBuffer=!0;function V(S,E,x){const H=S[E];S[E]=S[x],S[x]=H}d.prototype.swap16=function(){const E=this.length;if(E%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<E;x+=2)V(this,x,x+1);return this},d.prototype.swap32=function(){const E=this.length;if(E%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<E;x+=4)V(this,x,x+3),V(this,x+1,x+2);return this},d.prototype.swap64=function(){const E=this.length;if(E%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<E;x+=8)V(this,x,x+7),V(this,x+1,x+6),V(this,x+2,x+5),V(this,x+3,x+4);return this},d.prototype.toString=function(){const E=this.length;return E===0?"":arguments.length===0?we(this,0,E):q.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(E){if(!d.isBuffer(E))throw new TypeError("Argument must be a Buffer");return this===E?!0:d.compare(this,E)===0},d.prototype.inspect=function(){let E="";const x=n.INSPECT_MAX_BYTES;return E=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(E+=" ... "),"<Buffer "+E+">"},s&&(d.prototype[s]=d.prototype.inspect),d.prototype.compare=function(E,x,H,W,fe){if(se(E,Uint8Array)&&(E=d.from(E,E.offset,E.byteLength)),!d.isBuffer(E))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof E);if(x===void 0&&(x=0),H===void 0&&(H=E?E.length:0),W===void 0&&(W=0),fe===void 0&&(fe=this.length),x<0||H>E.length||W<0||fe>this.length)throw new RangeError("out of range index");if(W>=fe&&x>=H)return 0;if(W>=fe)return-1;if(x>=H)return 1;if(x>>>=0,H>>>=0,W>>>=0,fe>>>=0,this===E)return 0;let be=fe-W,Le=H-x;const gt=Math.min(be,Le),ft=this.slice(W,fe),bt=E.slice(x,H);for(let ot=0;ot<gt;++ot)if(ft[ot]!==bt[ot]){be=ft[ot],Le=bt[ot];break}return be<Le?-1:Le<be?1:0};function ge(S,E,x,H,W){if(S.length===0)return-1;if(typeof x=="string"?(H=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,Te(x)&&(x=W?0:S.length-1),x<0&&(x=S.length+x),x>=S.length){if(W)return-1;x=S.length-1}else if(x<0)if(W)x=0;else return-1;if(typeof E=="string"&&(E=d.from(E,H)),d.isBuffer(E))return E.length===0?-1:ce(S,E,x,H,W);if(typeof E=="number")return E=E&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(S,E,x):Uint8Array.prototype.lastIndexOf.call(S,E,x):ce(S,[E],x,H,W);throw new TypeError("val must be string, number or Buffer")}function ce(S,E,x,H,W){let fe=1,be=S.length,Le=E.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(S.length<2||E.length<2)return-1;fe=2,be/=2,Le/=2,x/=2}function gt(bt,ot){return fe===1?bt[ot]:bt.readUInt16BE(ot*fe)}let ft;if(W){let bt=-1;for(ft=x;ft<be;ft++)if(gt(S,ft)===gt(E,bt===-1?0:ft-bt)){if(bt===-1&&(bt=ft),ft-bt+1===Le)return bt*fe}else bt!==-1&&(ft-=ft-bt),bt=-1}else for(x+Le>be&&(x=be-Le),ft=x;ft>=0;ft--){let bt=!0;for(let ot=0;ot<Le;ot++)if(gt(S,ft+ot)!==gt(E,ot)){bt=!1;break}if(bt)return ft}return-1}d.prototype.includes=function(E,x,H){return this.indexOf(E,x,H)!==-1},d.prototype.indexOf=function(E,x,H){return ge(this,E,x,H,!0)},d.prototype.lastIndexOf=function(E,x,H){return ge(this,E,x,H,!1)};function te(S,E,x,H){x=Number(x)||0;const W=S.length-x;H?(H=Number(H),H>W&&(H=W)):H=W;const fe=E.length;H>fe/2&&(H=fe/2);let be;for(be=0;be<H;++be){const Le=parseInt(E.substr(be*2,2),16);if(Te(Le))return be;S[x+be]=Le}return be}function J(S,E,x,H){return X(Fe(E,S.length-x),S,x,H)}function K(S,E,x,H){return X(nt(E),S,x,H)}function $(S,E,x,H){return X(j(E),S,x,H)}function me(S,E,x,H){return X(lt(E,S.length-x),S,x,H)}d.prototype.write=function(E,x,H,W){if(x===void 0)W="utf8",H=this.length,x=0;else if(H===void 0&&typeof x=="string")W=x,H=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(H)?(H=H>>>0,W===void 0&&(W="utf8")):(W=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-x;if((H===void 0||H>fe)&&(H=fe),E.length>0&&(H<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let be=!1;for(;;)switch(W){case"hex":return te(this,E,x,H);case"utf8":case"utf-8":return J(this,E,x,H);case"ascii":case"latin1":case"binary":return K(this,E,x,H);case"base64":return $(this,E,x,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,E,x,H);default:if(be)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),be=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function he(S,E,x){return E===0&&x===S.length?r.fromByteArray(S):r.fromByteArray(S.slice(E,x))}function we(S,E,x){x=Math.min(S.length,x);const H=[];let W=E;for(;W<x;){const fe=S[W];let be=null,Le=fe>239?4:fe>223?3:fe>191?2:1;if(W+Le<=x){let gt,ft,bt,ot;switch(Le){case 1:fe<128&&(be=fe);break;case 2:gt=S[W+1],(gt&192)===128&&(ot=(fe&31)<<6|gt&63,ot>127&&(be=ot));break;case 3:gt=S[W+1],ft=S[W+2],(gt&192)===128&&(ft&192)===128&&(ot=(fe&15)<<12|(gt&63)<<6|ft&63,ot>2047&&(ot<55296||ot>57343)&&(be=ot));break;case 4:gt=S[W+1],ft=S[W+2],bt=S[W+3],(gt&192)===128&&(ft&192)===128&&(bt&192)===128&&(ot=(fe&15)<<18|(gt&63)<<12|(ft&63)<<6|bt&63,ot>65535&&ot<1114112&&(be=ot))}}be===null?(be=65533,Le=1):be>65535&&(be-=65536,H.push(be>>>10&1023|55296),be=56320|be&1023),H.push(be),W+=Le}return P(H)}const pe=4096;function P(S){const E=S.length;if(E<=pe)return String.fromCharCode.apply(String,S);let x="",H=0;for(;H<E;)x+=String.fromCharCode.apply(String,S.slice(H,H+=pe));return x}function ae(S,E,x){let H="";x=Math.min(S.length,x);for(let W=E;W<x;++W)H+=String.fromCharCode(S[W]&127);return H}function Ne(S,E,x){let H="";x=Math.min(S.length,x);for(let W=E;W<x;++W)H+=String.fromCharCode(S[W]);return H}function _e(S,E,x){const H=S.length;(!E||E<0)&&(E=0),(!x||x<0||x>H)&&(x=H);let W="";for(let fe=E;fe<x;++fe)W+=Re[S[fe]];return W}function G(S,E,x){const H=S.slice(E,x);let W="";for(let fe=0;fe<H.length-1;fe+=2)W+=String.fromCharCode(H[fe]+H[fe+1]*256);return W}d.prototype.slice=function(E,x){const H=this.length;E=~~E,x=x===void 0?H:~~x,E<0?(E+=H,E<0&&(E=0)):E>H&&(E=H),x<0?(x+=H,x<0&&(x=0)):x>H&&(x=H),x<E&&(x=E);const W=this.subarray(E,x);return Object.setPrototypeOf(W,d.prototype),W};function ne(S,E,x){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+E>x)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=this[E],fe=1,be=0;for(;++be<x&&(fe*=256);)W+=this[E+be]*fe;return W},d.prototype.readUintBE=d.prototype.readUIntBE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=this[E+--x],fe=1;for(;x>0&&(fe*=256);)W+=this[E+--x]*fe;return W},d.prototype.readUint8=d.prototype.readUInt8=function(E,x){return E=E>>>0,x||ne(E,1,this.length),this[E]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(E,x){return E=E>>>0,x||ne(E,2,this.length),this[E]|this[E+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(E,x){return E=E>>>0,x||ne(E,2,this.length),this[E]<<8|this[E+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+this[E+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),this[E]*16777216+(this[E+1]<<16|this[E+2]<<8|this[E+3])},d.prototype.readBigUInt64LE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=x+this[++E]*2**8+this[++E]*2**16+this[++E]*2**24,fe=this[++E]+this[++E]*2**8+this[++E]*2**16+H*2**24;return BigInt(W)+(BigInt(fe)<<BigInt(32))}),d.prototype.readBigUInt64BE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=x*2**24+this[++E]*2**16+this[++E]*2**8+this[++E],fe=this[++E]*2**24+this[++E]*2**16+this[++E]*2**8+H;return(BigInt(W)<<BigInt(32))+BigInt(fe)}),d.prototype.readIntLE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=this[E],fe=1,be=0;for(;++be<x&&(fe*=256);)W+=this[E+be]*fe;return fe*=128,W>=fe&&(W-=Math.pow(2,8*x)),W},d.prototype.readIntBE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=x,fe=1,be=this[E+--W];for(;W>0&&(fe*=256);)be+=this[E+--W]*fe;return fe*=128,be>=fe&&(be-=Math.pow(2,8*x)),be},d.prototype.readInt8=function(E,x){return E=E>>>0,x||ne(E,1,this.length),this[E]&128?(255-this[E]+1)*-1:this[E]},d.prototype.readInt16LE=function(E,x){E=E>>>0,x||ne(E,2,this.length);const H=this[E]|this[E+1]<<8;return H&32768?H|4294901760:H},d.prototype.readInt16BE=function(E,x){E=E>>>0,x||ne(E,2,this.length);const H=this[E+1]|this[E]<<8;return H&32768?H|4294901760:H},d.prototype.readInt32LE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},d.prototype.readInt32BE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},d.prototype.readBigInt64LE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=this[E+4]+this[E+5]*2**8+this[E+6]*2**16+(H<<24);return(BigInt(W)<<BigInt(32))+BigInt(x+this[++E]*2**8+this[++E]*2**16+this[++E]*2**24)}),d.prototype.readBigInt64BE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=(x<<24)+this[++E]*2**16+this[++E]*2**8+this[++E];return(BigInt(W)<<BigInt(32))+BigInt(this[++E]*2**24+this[++E]*2**16+this[++E]*2**8+H)}),d.prototype.readFloatLE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),a.read(this,E,!0,23,4)},d.prototype.readFloatBE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),a.read(this,E,!1,23,4)},d.prototype.readDoubleLE=function(E,x){return E=E>>>0,x||ne(E,8,this.length),a.read(this,E,!0,52,8)},d.prototype.readDoubleBE=function(E,x){return E=E>>>0,x||ne(E,8,this.length),a.read(this,E,!1,52,8)};function Ee(S,E,x,H,W,fe){if(!d.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(E>W||E<fe)throw new RangeError('"value" argument is out of bounds');if(x+H>S.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(E,x,H,W){if(E=+E,x=x>>>0,H=H>>>0,!W){const Le=Math.pow(2,8*H)-1;Ee(this,E,x,H,Le,0)}let fe=1,be=0;for(this[x]=E&255;++be<H&&(fe*=256);)this[x+be]=E/fe&255;return x+H},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(E,x,H,W){if(E=+E,x=x>>>0,H=H>>>0,!W){const Le=Math.pow(2,8*H)-1;Ee(this,E,x,H,Le,0)}let fe=H-1,be=1;for(this[x+fe]=E&255;--fe>=0&&(be*=256);)this[x+fe]=E/be&255;return x+H},d.prototype.writeUint8=d.prototype.writeUInt8=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,1,255,0),this[x]=E&255,x+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,65535,0),this[x]=E&255,this[x+1]=E>>>8,x+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,65535,0),this[x]=E>>>8,this[x+1]=E&255,x+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,4294967295,0),this[x+3]=E>>>24,this[x+2]=E>>>16,this[x+1]=E>>>8,this[x]=E&255,x+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,4294967295,0),this[x]=E>>>24,this[x+1]=E>>>16,this[x+2]=E>>>8,this[x+3]=E&255,x+4};function ke(S,E,x,H,W){Lt(E,H,W,S,x,7);let fe=Number(E&BigInt(4294967295));S[x++]=fe,fe=fe>>8,S[x++]=fe,fe=fe>>8,S[x++]=fe,fe=fe>>8,S[x++]=fe;let be=Number(E>>BigInt(32)&BigInt(4294967295));return S[x++]=be,be=be>>8,S[x++]=be,be=be>>8,S[x++]=be,be=be>>8,S[x++]=be,x}function He(S,E,x,H,W){Lt(E,H,W,S,x,7);let fe=Number(E&BigInt(4294967295));S[x+7]=fe,fe=fe>>8,S[x+6]=fe,fe=fe>>8,S[x+5]=fe,fe=fe>>8,S[x+4]=fe;let be=Number(E>>BigInt(32)&BigInt(4294967295));return S[x+3]=be,be=be>>8,S[x+2]=be,be=be>>8,S[x+1]=be,be=be>>8,S[x]=be,x+8}d.prototype.writeBigUInt64LE=xe(function(E,x=0){return ke(this,E,x,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=xe(function(E,x=0){return He(this,E,x,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(E,x,H,W){if(E=+E,x=x>>>0,!W){const gt=Math.pow(2,8*H-1);Ee(this,E,x,H,gt-1,-gt)}let fe=0,be=1,Le=0;for(this[x]=E&255;++fe<H&&(be*=256);)E<0&&Le===0&&this[x+fe-1]!==0&&(Le=1),this[x+fe]=(E/be>>0)-Le&255;return x+H},d.prototype.writeIntBE=function(E,x,H,W){if(E=+E,x=x>>>0,!W){const gt=Math.pow(2,8*H-1);Ee(this,E,x,H,gt-1,-gt)}let fe=H-1,be=1,Le=0;for(this[x+fe]=E&255;--fe>=0&&(be*=256);)E<0&&Le===0&&this[x+fe+1]!==0&&(Le=1),this[x+fe]=(E/be>>0)-Le&255;return x+H},d.prototype.writeInt8=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,1,127,-128),E<0&&(E=255+E+1),this[x]=E&255,x+1},d.prototype.writeInt16LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,32767,-32768),this[x]=E&255,this[x+1]=E>>>8,x+2},d.prototype.writeInt16BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,32767,-32768),this[x]=E>>>8,this[x+1]=E&255,x+2},d.prototype.writeInt32LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,2147483647,-2147483648),this[x]=E&255,this[x+1]=E>>>8,this[x+2]=E>>>16,this[x+3]=E>>>24,x+4},d.prototype.writeInt32BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),this[x]=E>>>24,this[x+1]=E>>>16,this[x+2]=E>>>8,this[x+3]=E&255,x+4},d.prototype.writeBigInt64LE=xe(function(E,x=0){return ke(this,E,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=xe(function(E,x=0){return He(this,E,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(S,E,x,H,W,fe){if(x+H>S.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function Ge(S,E,x,H,W){return E=+E,x=x>>>0,W||Ke(S,E,x,4),a.write(S,E,x,H,23,4),x+4}d.prototype.writeFloatLE=function(E,x,H){return Ge(this,E,x,!0,H)},d.prototype.writeFloatBE=function(E,x,H){return Ge(this,E,x,!1,H)};function yt(S,E,x,H,W){return E=+E,x=x>>>0,W||Ke(S,E,x,8),a.write(S,E,x,H,52,8),x+8}d.prototype.writeDoubleLE=function(E,x,H){return yt(this,E,x,!0,H)},d.prototype.writeDoubleBE=function(E,x,H){return yt(this,E,x,!1,H)},d.prototype.copy=function(E,x,H,W){if(!d.isBuffer(E))throw new TypeError("argument should be a Buffer");if(H||(H=0),!W&&W!==0&&(W=this.length),x>=E.length&&(x=E.length),x||(x=0),W>0&&W<H&&(W=H),W===H||E.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),E.length-x<W-H&&(W=E.length-x+H);const fe=W-H;return this===E&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(x,H,W):Uint8Array.prototype.set.call(E,this.subarray(H,W),x),fe},d.prototype.fill=function(E,x,H,W){if(typeof E=="string"){if(typeof x=="string"?(W=x,x=0,H=this.length):typeof H=="string"&&(W=H,H=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!d.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(E.length===1){const be=E.charCodeAt(0);(W==="utf8"&&be<128||W==="latin1")&&(E=be)}}else typeof E=="number"?E=E&255:typeof E=="boolean"&&(E=Number(E));if(x<0||this.length<x||this.length<H)throw new RangeError("Out of range index");if(H<=x)return this;x=x>>>0,H=H===void 0?this.length:H>>>0,E||(E=0);let fe;if(typeof E=="number")for(fe=x;fe<H;++fe)this[fe]=E;else{const be=d.isBuffer(E)?E:d.from(E,W),Le=be.length;if(Le===0)throw new TypeError('The value "'+E+'" is invalid for argument "value"');for(fe=0;fe<H-x;++fe)this[fe+x]=be[fe%Le]}return this};const We={};function Et(S,E,x){We[S]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:E.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}Et("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Et("ERR_INVALID_ARG_TYPE",function(S,E){return`The "${S}" argument must be of type number. Received type ${typeof E}`},TypeError),Et("ERR_OUT_OF_RANGE",function(S,E,x){let H=`The value of "${S}" is out of range.`,W=x;return Number.isInteger(x)&&Math.abs(x)>2**32?W=Kt(String(x)):typeof x=="bigint"&&(W=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(W=Kt(W)),W+="n"),H+=` It must be ${E}. Received ${W}`,H},RangeError);function Kt(S){let E="",x=S.length;const H=S[0]==="-"?1:0;for(;x>=H+4;x-=3)E=`_${S.slice(x-3,x)}${E}`;return`${S.slice(0,x)}${E}`}function Sr(S,E,x){Ht(E,"offset"),(S[E]===void 0||S[E+x]===void 0)&&jt(E,S.length-(x+1))}function Lt(S,E,x,H,W,fe){if(S>x||S<E){const be=typeof E=="bigint"?"n":"";let Le;throw E===0||E===BigInt(0)?Le=`>= 0${be} and < 2${be} ** ${(fe+1)*8}${be}`:Le=`>= -(2${be} ** ${(fe+1)*8-1}${be}) and < 2 ** ${(fe+1)*8-1}${be}`,new We.ERR_OUT_OF_RANGE("value",Le,S)}Sr(H,W,fe)}function Ht(S,E){if(typeof S!="number")throw new We.ERR_INVALID_ARG_TYPE(E,"number",S)}function jt(S,E,x){throw Math.floor(S)!==S?(Ht(S,x),new We.ERR_OUT_OF_RANGE("offset","an integer",S)):E<0?new We.ERR_BUFFER_OUT_OF_BOUNDS:new We.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${E}`,S)}const Er=/[^+/0-9A-Za-z-_]/g;function Qe(S){if(S=S.split("=")[0],S=S.trim().replace(Er,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function Fe(S,E){E=E||1/0;let x;const H=S.length;let W=null;const fe=[];for(let be=0;be<H;++be){if(x=S.charCodeAt(be),x>55295&&x<57344){if(!W){if(x>56319){(E-=3)>-1&&fe.push(239,191,189);continue}else if(be+1===H){(E-=3)>-1&&fe.push(239,191,189);continue}W=x;continue}if(x<56320){(E-=3)>-1&&fe.push(239,191,189),W=x;continue}x=(W-55296<<10|x-56320)+65536}else W&&(E-=3)>-1&&fe.push(239,191,189);if(W=null,x<128){if((E-=1)<0)break;fe.push(x)}else if(x<2048){if((E-=2)<0)break;fe.push(x>>6|192,x&63|128)}else if(x<65536){if((E-=3)<0)break;fe.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((E-=4)<0)break;fe.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return fe}function nt(S){const E=[];for(let x=0;x<S.length;++x)E.push(S.charCodeAt(x)&255);return E}function lt(S,E){let x,H,W;const fe=[];for(let be=0;be<S.length&&!((E-=2)<0);++be)x=S.charCodeAt(be),H=x>>8,W=x%256,fe.push(W),fe.push(H);return fe}function j(S){return r.toByteArray(Qe(S))}function X(S,E,x,H){let W;for(W=0;W<H&&!(W+x>=E.length||W>=S.length);++W)E[W+x]=S[W];return W}function se(S,E){return S instanceof E||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===E.name}function Te(S){return S!==S}const Re=function(){const S="0123456789abcdef",E=new Array(256);for(let x=0;x<16;++x){const H=x*16;for(let W=0;W<16;++W)E[H+W]=S[x]+S[W]}return E}();function xe(S){return typeof BigInt>"u"?Ve:S}function Ve(){throw new Error("BigInt not supported")}}(Rf)),Rf}var Xi=PC(),Tu={exports:{}},KC=Tu.exports,km;function JC(){return km||(km=1,function(n,r){(function(a,s){n.exports=s()})(KC,function(){return(()=>{var a,s,o={773:(d,m,A)=>{var b,v=typeof self<"u"&&self.Module!==void 0?self.Module:{},B={};for(b in v)v.hasOwnProperty(b)&&(B[b]=v[b]);var T,Q,k,R;T=typeof window=="object",Q=typeof importScripts=="function",k=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",R=!T&&!k&&!Q;var N,O,_,q,V,ge="";k?(ge=Q?A(967).dirname(ge)+"/":"//",N=function(Qe,Fe){return q||(q=A(145)),V||(V=A(967)),Qe=V.normalize(Qe),q.readFileSync(Qe,Fe?null:"utf8")},_=function(Qe){var Fe=N(Qe,!0);return Fe.buffer||(Fe=new Uint8Array(Fe)),$(Fe.buffer),Fe},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),d.exports=v,process.on("uncaughtException",function(Qe){if(!(Qe instanceof jt))throw Qe}),process.on("unhandledRejection",Ee),v.inspect=function(){return"[Emscripten Module object]"}):R?(typeof read<"u"&&(N=function(Qe){return read(Qe)}),_=function(Qe){var Fe;return typeof readbuffer=="function"?new Uint8Array(readbuffer(Qe)):($(typeof(Fe=read(Qe,"binary"))=="object"),Fe)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(T||Q)&&(Q?ge=self.location.href:typeof document<"u"&&document.currentScript&&(ge=document.currentScript.src),ge=ge.indexOf("blob:")!==0?ge.substr(0,ge.lastIndexOf("/")+1):"",N=function(Qe){var Fe=new XMLHttpRequest;return Fe.open("GET",Qe,!1),Fe.send(null),Fe.responseText},Q&&(_=function(Qe){var Fe=new XMLHttpRequest;return Fe.open("GET",Qe,!1),Fe.responseType="arraybuffer",Fe.send(null),new Uint8Array(Fe.response)}),O=function(Qe,Fe,nt){var lt=new XMLHttpRequest;lt.open("GET",Qe,!0),lt.responseType="arraybuffer",lt.onload=function(){lt.status==200||lt.status==0&&lt.response?Fe(lt.response):nt()},lt.onerror=nt,lt.send(null)}),v.print||console.log.bind(console);var ce,te,J=v.printErr||console.warn.bind(console);for(b in B)B.hasOwnProperty(b)&&(v[b]=B[b]);B=null,v.arguments&&v.arguments,v.thisProgram&&v.thisProgram,v.quit&&v.quit,v.wasmBinary&&(ce=v.wasmBinary),v.noExitRuntime,typeof WebAssembly!="object"&&Ee("no native wasm support detected");var K=!1;function $(Qe,Fe){Qe||Ee("Assertion failed: "+Fe)}var me,he,we=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function pe(Qe){me=Qe,v.HEAP8=new Int8Array(Qe),v.HEAP16=new Int16Array(Qe),v.HEAP32=new Int32Array(Qe),v.HEAPU8=he=new Uint8Array(Qe),v.HEAPU16=new Uint16Array(Qe),v.HEAPU32=new Uint32Array(Qe),v.HEAPF32=new Float32Array(Qe),v.HEAPF64=new Float64Array(Qe)}v.INITIAL_MEMORY;var P,ae=[],Ne=[],_e=[],G=0,ne=null;function Ee(Qe){throw v.onAbort&&v.onAbort(Qe),J(Qe+=""),K=!0,Qe="abort("+Qe+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(Qe)}function ke(Qe){return Qe.startsWith("data:application/octet-stream;base64,")}function He(Qe){return Qe.startsWith("file://")}v.preloadedImages={},v.preloadedAudios={};var Ke,Ge="argon2.wasm";function yt(Qe){try{if(Qe==Ge&&ce)return new Uint8Array(ce);if(_)return _(Qe);throw"both async and sync fetching of the wasm failed"}catch(Fe){Ee(Fe)}}function We(Qe){for(;Qe.length>0;){var Fe=Qe.shift();if(typeof Fe!="function"){var nt=Fe.func;typeof nt=="number"?Fe.arg===void 0?P.get(nt)():P.get(nt)(Fe.arg):nt(Fe.arg===void 0?null:Fe.arg)}else Fe(v)}}function Et(Qe){try{return te.grow(Qe-me.byteLength+65535>>>16),pe(te.buffer),1}catch{}}ke(Ge)||(Ke=Ge,Ge=v.locateFile?v.locateFile(Ke,ge):ge+Ke);var Kt,Sr={a:function(Qe,Fe,nt){he.copyWithin(Qe,Fe,Fe+nt)},b:function(Qe){var Fe,nt=he.length,lt=2147418112;if((Qe>>>=0)>lt)return!1;for(var j=1;j<=4;j*=2){var X=nt*(1+.2/j);if(X=Math.min(X,Qe+100663296),Et(Math.min(lt,((Fe=Math.max(Qe,X))%65536>0&&(Fe+=65536-Fe%65536),Fe))))return!0}return!1}},Lt=(function(){var Qe={a:Sr};function Fe(j,X){var se,Te=j.exports;v.asm=Te,pe((te=v.asm.c).buffer),P=v.asm.k,se=v.asm.d,Ne.unshift(se),function(Re){if(G--,v.monitorRunDependencies&&v.monitorRunDependencies(G),G==0&&ne){var xe=ne;ne=null,xe()}}()}function nt(j){Fe(j.instance)}function lt(j){return function(){if(!ce&&(T||Q)){if(typeof fetch=="function"&&!He(Ge))return fetch(Ge,{credentials:"same-origin"}).then(function(X){if(!X.ok)throw"failed to load wasm binary file at '"+Ge+"'";return X.arrayBuffer()}).catch(function(){return yt(Ge)});if(O)return new Promise(function(X,se){O(Ge,function(Te){X(new Uint8Array(Te))},se)})}return Promise.resolve().then(function(){return yt(Ge)})}().then(function(X){return WebAssembly.instantiate(X,Qe)}).then(j,function(X){J("failed to asynchronously prepare wasm: "+X),Ee(X)})}if(G++,v.monitorRunDependencies&&v.monitorRunDependencies(G),v.instantiateWasm)try{return v.instantiateWasm(Qe,Fe)}catch(j){return J("Module.instantiateWasm callback failed with error: "+j),!1}ce||typeof WebAssembly.instantiateStreaming!="function"||ke(Ge)||He(Ge)||typeof fetch!="function"?lt(nt):fetch(Ge,{credentials:"same-origin"}).then(function(j){return WebAssembly.instantiateStreaming(j,Qe).then(nt,function(X){return J("wasm streaming compile failed: "+X),J("falling back to ArrayBuffer instantiation"),lt(nt)})})}(),v.___wasm_call_ctors=function(){return(v.___wasm_call_ctors=v.asm.d).apply(null,arguments)},v._argon2_hash=function(){return(v._argon2_hash=v.asm.e).apply(null,arguments)},v._malloc=function(){return(Lt=v._malloc=v.asm.f).apply(null,arguments)}),Ht=(v._free=function(){return(v._free=v.asm.g).apply(null,arguments)},v._argon2_verify=function(){return(v._argon2_verify=v.asm.h).apply(null,arguments)},v._argon2_error_message=function(){return(v._argon2_error_message=v.asm.i).apply(null,arguments)},v._argon2_encodedlen=function(){return(v._argon2_encodedlen=v.asm.j).apply(null,arguments)},v._argon2_hash_ext=function(){return(v._argon2_hash_ext=v.asm.l).apply(null,arguments)},v._argon2_verify_ext=function(){return(v._argon2_verify_ext=v.asm.m).apply(null,arguments)},v.stackAlloc=function(){return(Ht=v.stackAlloc=v.asm.n).apply(null,arguments)});function jt(Qe){this.name="ExitStatus",this.message="Program terminated with exit("+Qe+")",this.status=Qe}function Er(Qe){function Fe(){Kt||(Kt=!0,v.calledRun=!0,K||(We(Ne),v.onRuntimeInitialized&&v.onRuntimeInitialized(),function(){if(v.postRun)for(typeof v.postRun=="function"&&(v.postRun=[v.postRun]);v.postRun.length;)nt=v.postRun.shift(),_e.unshift(nt);var nt;We(_e)}()))}G>0||(function(){if(v.preRun)for(typeof v.preRun=="function"&&(v.preRun=[v.preRun]);v.preRun.length;)nt=v.preRun.shift(),ae.unshift(nt);var nt;We(ae)}(),G>0||(v.setStatus?(v.setStatus("Running..."),setTimeout(function(){setTimeout(function(){v.setStatus("")},1),Fe()},1)):Fe()))}if(v.allocate=function(Qe,Fe){var nt;return nt=Fe==1?Ht(Qe.length):Lt(Qe.length),Qe.subarray||Qe.slice?he.set(Qe,nt):he.set(new Uint8Array(Qe),nt),nt},v.UTF8ToString=function(Qe,Fe){return Qe?function(nt,lt,j){for(var X=lt+j,se=lt;nt[se]&&!(se>=X);)++se;if(se-lt>16&&nt.subarray&&we)return we.decode(nt.subarray(lt,se));for(var Te="";lt<se;){var Re=nt[lt++];if(128&Re){var xe=63&nt[lt++];if((224&Re)!=192){var Ve=63&nt[lt++];if((Re=(240&Re)==224?(15&Re)<<12|xe<<6|Ve:(7&Re)<<18|xe<<12|Ve<<6|63&nt[lt++])<65536)Te+=String.fromCharCode(Re);else{var S=Re-65536;Te+=String.fromCharCode(55296|S>>10,56320|1023&S)}}else Te+=String.fromCharCode((31&Re)<<6|xe)}else Te+=String.fromCharCode(Re)}return Te}(he,Qe,Fe):""},v.ALLOC_NORMAL=0,ne=function Qe(){Kt||Er(),Kt||(ne=Qe)},v.run=Er,v.preInit)for(typeof v.preInit=="function"&&(v.preInit=[v.preInit]);v.preInit.length>0;)v.preInit.pop()();Er(),d.exports=v,v.unloadRuntime=function(){typeof self<"u"&&delete self.Module,v=te=P=me=he=void 0,delete d.exports}},631:function(d,m,A){var b,v;(v=typeof(b=function(){const B=typeof self<"u"?self:this,T={Argon2d:0,Argon2i:1,Argon2id:2};function Q(_){if(Q._promise)return Q._promise;if(Q._module)return Promise.resolve(Q._module);let q;return q=B.process&&B.process.versions&&B.process.versions.node?k().then(V=>new Promise(ge=>{V.postRun=()=>ge(V)})):(B.loadArgon2WasmBinary?B.loadArgon2WasmBinary():Promise.resolve(A(721)).then(V=>function(ge){const ce=atob(ge),te=new Uint8Array(new ArrayBuffer(ce.length));for(let J=0;J<ce.length;J++)te[J]=ce.charCodeAt(J);return te}(V))).then(V=>function(ge,ce){return new Promise(te=>(B.Module={wasmBinary:ge,wasmMemory:ce,postRun(){te(Module)}},k()))}(V,_?function(ge){const K=Math.min(Math.max(Math.ceil(ge*1024/65536),256)+256,32767);return new WebAssembly.Memory({initial:K,maximum:32767})}(_):void 0)),Q._promise=q,q.then(V=>(Q._module=V,delete Q._promise,V))}function k(){return B.loadArgon2WasmModule?B.loadArgon2WasmModule():Promise.resolve(A(773))}function R(_,q){return _.allocate(q,"i8",_.ALLOC_NORMAL)}function N(_,q){return R(_,new Uint8Array([...q,0]))}function O(_){if(typeof _!="string")return _;if(typeof TextEncoder=="function")return new TextEncoder().encode(_);if(typeof Buffer=="function")return Buffer.from(_);throw new Error("Don't know how to encode UTF8")}return{ArgonType:T,hash:function(_){const q=_.mem||1024;return Q(q).then(V=>{const ge=_.time||1,ce=_.parallelism||1,te=O(_.pass),J=N(V,te),K=te.length,$=O(_.salt),me=N(V,$),he=$.length,we=_.type||T.Argon2d,pe=V.allocate(new Array(_.hashLen||24),"i8",V.ALLOC_NORMAL),P=_.secret?R(V,_.secret):0,ae=_.secret?_.secret.byteLength:0,Ne=_.ad?R(V,_.ad):0,_e=_.ad?_.ad.byteLength:0,G=_.hashLen||24,ne=V._argon2_encodedlen(ge,q,ce,he,G,we),Ee=V.allocate(new Array(ne+1),"i8",V.ALLOC_NORMAL);let ke,He,Ke;try{He=V._argon2_hash_ext(ge,q,ce,J,K,me,he,pe,G,Ee,ne,we,P,ae,Ne,_e,19)}catch(Ge){ke=Ge}if(He!==0||ke){try{ke||(ke=V.UTF8ToString(V._argon2_error_message(He)))}catch{}Ke={message:ke,code:He}}else{let Ge="";const yt=new Uint8Array(G);for(let We=0;We<G;We++){const Et=V.HEAP8[pe+We];yt[We]=Et,Ge+=("0"+(255&Et).toString(16)).slice(-2)}Ke={hash:yt,hashHex:Ge,encoded:V.UTF8ToString(Ee)}}try{V._free(J),V._free(me),V._free(pe),V._free(Ee),Ne&&V._free(Ne),P&&V._free(P)}catch{}if(ke)throw Ke;return Ke})},verify:function(_){return Q().then(q=>{const V=O(_.pass),ge=N(q,V),ce=V.length,te=_.secret?R(q,_.secret):0,J=_.secret?_.secret.byteLength:0,K=_.ad?R(q,_.ad):0,$=_.ad?_.ad.byteLength:0,me=N(q,O(_.encoded));let he,we,pe,P=_.type;if(P===void 0){let ae=_.encoded.split("$")[1];ae&&(ae=ae.replace("a","A"),P=T[ae]||T.Argon2d)}try{we=q._argon2_verify_ext(me,ge,ce,te,J,K,$,P)}catch(ae){he=ae}if(we||he){try{he||(he=q.UTF8ToString(q._argon2_error_message(we)))}catch{}pe={message:he,code:we}}try{q._free(ge),q._free(me)}catch{}if(he)throw pe;return pe})},unloadRuntime:function(){Q._module&&(Q._module.unloadRuntime(),delete Q._promise,delete Q._module)}}})=="function"?b.apply(m,[]):b)===void 0||(d.exports=v)},721:function(d,m){d.exports=" "},145:()=>{},967:()=>{}},u={};function c(d){var m=u[d];if(m!==void 0)return m.exports;var A=u[d]={exports:{}};return o[d].call(A.exports,A,A.exports,c),A.exports}return s=Object.getPrototypeOf?d=>Object.getPrototypeOf(d):d=>d.__proto__,c.t=function(d,m){if(1&m&&(d=this(d)),8&m||typeof d=="object"&&d&&(4&m&&d.__esModule||16&m&&typeof d.then=="function"))return d;var A=Object.create(null);c.r(A);var b={};a=a||[null,s({}),s([]),s(s)];for(var v=2&m&&d;typeof v=="object"&&!~a.indexOf(v);v=s(v))Object.getOwnPropertyNames(v).forEach(B=>b[B]=()=>d[B]);return b.default=()=>d,c.d(A,b),A},c.d=(d,m)=>{for(var A in m)c.o(m,A)&&!c.o(d,A)&&Object.defineProperty(d,A,{enumerable:!0,get:m[A]})},c.o=(d,m)=>Object.prototype.hasOwnProperty.call(d,m),c.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},c(631)})()})}(Tu)),Tu.exports}var XC=JC();const $C=xi(XC);class Yt{static async deriveKeyFromPassword(r,a,s="Argon2Id",o='{"Iterations":2,"MemorySize":19456,"DegreeOfParallelism":1}'){const u=JSON.parse(o);try{if(s!=="Argon2Id")throw new Error("Unsupported encryption type");return(await $C.hash({pass:r,salt:a,time:u.Iterations,mem:u.MemorySize,parallelism:u.DegreeOfParallelism,hashLen:32,type:2})).hash}catch(c){throw console.error("Argon2 hashing failed:",c),c}}static async symmetricEncrypt(r,a){if(!r)return r;const s=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),A=>A.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["encrypt"]),o=crypto.getRandomValues(new Uint8Array(12)),c=new TextEncoder().encode(r),d=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},s,c),m=new Uint8Array(o.length+d.byteLength);return m.set(o,0),m.set(new Uint8Array(d),o.length),btoa(Array.from(m).map(A=>String.fromCharCode(A)).join(""))}static async symmetricDecrypt(r,a){if(!r)return r;const s=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),A=>A.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),o=Uint8Array.from(atob(r),A=>A.charCodeAt(0)),u=o.slice(0,12),c=o.slice(12),d=await crypto.subtle.decrypt({name:"AES-GCM",iv:u},s,c);return new TextDecoder().decode(d)}static async symmetricDecryptBytes(r,a){if(!r||r.length===0)return r;const s=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),d=>d.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),o=r.slice(0,12),u=r.slice(12),c=await crypto.subtle.decrypt({name:"AES-GCM",iv:o},s,u);return new Uint8Array(c)}static async generateRsaKeyPair(){const r=await crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),a=await crypto.subtle.exportKey("jwk",r.publicKey),s=await crypto.subtle.exportKey("jwk",r.privateKey);return{publicKey:JSON.stringify(a),privateKey:JSON.stringify(s)}}static async encryptWithPublicKey(r,a){const s=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),o=new TextEncoder().encode(r),u=await crypto.subtle.encrypt({name:"RSA-OAEP"},s,o);return btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(u))))}static async decryptWithPrivateKey(r,a){try{const s=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),o=Uint8Array.from(atob(r),c=>c.charCodeAt(0)),u=await crypto.subtle.decrypt({name:"RSA-OAEP"},s,o);return new Uint8Array(u)}catch(s){throw console.error("RSA decryption failed:",s),new Error(`Failed to decrypt: ${s instanceof Error?s.message:"Unknown error"}`)}}static async decryptEmail(r,a){try{const s=a.find(d=>d.PublicKey===r.encryptionKey);if(!s)throw new Error("Encryption key not found");const o=await Yt.decryptWithPrivateKey(r.encryptedSymmetricKey,s.PrivateKey),u=Xi.Buffer.from(o).toString("base64"),c={...r};return c.subject=await Yt.symmetricDecrypt(r.subject,u),c.fromDisplay=await Yt.symmetricDecrypt(r.fromDisplay,u),c.fromDomain=await Yt.symmetricDecrypt(r.fromDomain,u),c.fromLocal=await Yt.symmetricDecrypt(r.fromLocal,u),r.messageHtml&&(c.messageHtml=await Yt.symmetricDecrypt(r.messageHtml,u)),r.messagePlain&&(c.messagePlain=await Yt.symmetricDecrypt(r.messagePlain,u)),c}catch(s){throw new Error(s instanceof Error?s.message:"Failed to decrypt email")}}static async decryptEmailList(r,a){return Promise.all(r.map(async s=>{try{const o=a.find(m=>m.PublicKey===s.encryptionKey);if(!o)throw new Error("Encryption key not found");const u=await Yt.decryptWithPrivateKey(s.encryptedSymmetricKey,o.PrivateKey),c=Xi.Buffer.from(u).toString("base64"),d={...s};return d.subject=await Yt.symmetricDecrypt(s.subject,c),d.fromDisplay=await Yt.symmetricDecrypt(s.fromDisplay,c),d.fromDomain=await Yt.symmetricDecrypt(s.fromDomain,c),d.fromLocal=await Yt.symmetricDecrypt(s.fromLocal,c),s.messagePreview&&(d.messagePreview=await Yt.symmetricDecrypt(s.messagePreview,c)),d}catch(o){throw new Error(o instanceof Error?o.message:"Failed to decrypt email")}}))}static async decryptAttachment(r,a,s){try{const o=s.find(d=>d.PublicKey===a.encryptionKey);if(!o)throw new Error("Encryption key not found");const u=await Yt.decryptWithPrivateKey(a.encryptedSymmetricKey,o.PrivateKey),c=Xi.Buffer.from(u).toString("base64");return await Yt.symmetricDecryptBytes(r,c)}catch(o){throw new Error(o instanceof Error?o.message:"Failed to decrypt attachment")}}}var kf={exports:{}};const WC={},ZC=Object.freeze(Object.defineProperty({__proto__:null,default:WC},Symbol.toStringTag,{value:"Module"})),Lm=Nb(ZC);var Um;function ew(){return Um||(Um=1,function(n,r){var a=void 0,s=function(o){return a||(a=new Promise(function(u,c){var d=typeof o<"u"?o:{},m=d.onAbort;d.onAbort=function(h){c(new Error(h)),m&&m(h)},d.postRun=d.postRun||[],d.postRun.push(function(){u(d)}),n=void 0;var A;A||(A=typeof d<"u"?d:{});var b=typeof window=="object",v=typeof WorkerGlobalScope<"u",B=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";A.onRuntimeInitialized=function(){function h(ie,De){switch(typeof De){case"boolean":Tc(ie,De?1:0);break;case"number":Bc(ie,De);break;case"string":Sc(ie,De,-1,-1);break;case"object":if(De===null)fo(ie);else if(De.length!=null){var ze=F(De,D);Nc(ie,ze,De.length,-1),Wt(ze)}else qa(ie,"Wrong API use : tried to return a value of an unknown type ("+De+").",-1);break;default:fo(ie)}}function y(ie,De){for(var ze=[],$e=0;$e<ie;$e+=1){var et=Lt(De+4*$e,"i32"),wt=co(et);if(wt===1||wt===2)et=Ic(et);else if(wt===3)et=Cc(et);else if(wt===4){wt=et,et=xc(wt),wt=wc(wt);for(var on=new Uint8Array(et),$r=0;$r<et;$r+=1)on[$r]=K[wt+$r];et=on}else et=null;ze.push(et)}return ze}function w(ie,De){this.Qa=ie,this.db=De,this.Oa=1,this.lb=[]}function U(ie,De){if(this.db=De,De=Ve(ie)+1,this.eb=Ar(De),this.eb===null)throw Error("Unable to allocate memory for the SQL string");S(ie,$,this.eb,De),this.kb=this.eb,this.Za=this.pb=null}function Y(ie){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),ie!=null){var De=this.filename,ze="/",$e=De;if(ze&&(ze=typeof ze=="string"?ze:_a(ze),$e=De?lt(ze+"/"+De):ze),De=gt(!0,!0),$e=Un($e,De),ie){if(typeof ie=="string"){ze=Array(ie.length);for(var et=0,wt=ie.length;et<wt;++et)ze[et]=ie.charCodeAt(et);ie=ze}Lr($e,De|146),ze=Mn($e,577),is(ze,ie,0,ie.length,0),vn(ze),Lr($e,De)}}this.handleError(qe(this.filename,le)),this.db=Lt(le,"i32"),Ao(this.db),this.fb={},this.Sa={}}var le=Vt(4),ye=A.cwrap,qe=ye("sqlite3_open","number",["string","number"]),st=ye("sqlite3_close_v2","number",["number"]),at=ye("sqlite3_exec","number",["number","string","number","number","number"]),qt=ye("sqlite3_changes","number",["number"]),vr=ye("sqlite3_prepare_v2","number",["number","string","number","number","number"]),ls=ye("sqlite3_sql","string",["number"]),Qi=ye("sqlite3_normalized_sql","string",["number"]),Di=ye("sqlite3_prepare_v2","number",["number","number","number","number","number"]),lo=ye("sqlite3_bind_text","number",["number","number","number","number","number"]),oo=ye("sqlite3_bind_blob","number",["number","number","number","number","number"]),uc=ye("sqlite3_bind_double","number",["number","number","number"]),cc=ye("sqlite3_bind_int","number",["number","number","number"]),Js=ye("sqlite3_bind_parameter_index","number",["number","string"]),dc=ye("sqlite3_step","number",["number"]),fc=ye("sqlite3_errmsg","string",["number"]),Ac=ye("sqlite3_column_count","number",["number"]),hc=ye("sqlite3_data_count","number",["number"]),gc=ye("sqlite3_column_double","number",["number","number"]),Xs=ye("sqlite3_column_text","string",["number","number"]),mc=ye("sqlite3_column_blob","number",["number","number"]),pc=ye("sqlite3_column_bytes","number",["number","number"]),yc=ye("sqlite3_column_type","number",["number","number"]),Ec=ye("sqlite3_column_name","string",["number","number"]),$s=ye("sqlite3_reset","number",["number"]),bc=ye("sqlite3_clear_bindings","number",["number"]),vc=ye("sqlite3_finalize","number",["number"]),uo=ye("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),co=ye("sqlite3_value_type","number",["number"]),xc=ye("sqlite3_value_bytes","number",["number"]),Cc=ye("sqlite3_value_text","string",["number"]),wc=ye("sqlite3_value_blob","number",["number"]),Ic=ye("sqlite3_value_double","number",["number"]),Bc=ye("sqlite3_result_double","",["number","number"]),fo=ye("sqlite3_result_null","",["number"]),Sc=ye("sqlite3_result_text","",["number","string","number","number"]),Nc=ye("sqlite3_result_blob","",["number","number","number","number"]),Tc=ye("sqlite3_result_int","",["number","number"]),qa=ye("sqlite3_result_error","",["number","string","number"]),za=ye("sqlite3_aggregate_context","number",["number","number"]),Ao=ye("RegisterExtensionFunctions","number",["number"]),Ws=ye("sqlite3_update_hook","number",["number","number","number"]);w.prototype.bind=function(ie){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(ie)?this.Cb(ie):ie!=null&&typeof ie=="object"?this.Db(ie):!0},w.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var ie=dc(this.Qa);switch(ie){case 100:return!0;case 101:return!1;default:throw this.db.handleError(ie)}},w.prototype.wb=function(ie){return ie==null&&(ie=this.Oa,this.Oa+=1),gc(this.Qa,ie)},w.prototype.Gb=function(ie){if(ie==null&&(ie=this.Oa,this.Oa+=1),ie=Xs(this.Qa,ie),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(ie)},w.prototype.Hb=function(ie){return ie==null&&(ie=this.Oa,this.Oa+=1),Xs(this.Qa,ie)},w.prototype.getBlob=function(ie){ie==null&&(ie=this.Oa,this.Oa+=1);var De=pc(this.Qa,ie);ie=mc(this.Qa,ie);for(var ze=new Uint8Array(De),$e=0;$e<De;$e+=1)ze[$e]=K[ie+$e];return ze},w.prototype.get=function(ie,De){De=De||{},ie!=null&&this.bind(ie)&&this.step(),ie=[];for(var ze=hc(this.Qa),$e=0;$e<ze;$e+=1)switch(yc(this.Qa,$e)){case 1:var et=De.useBigInt?this.Gb($e):this.wb($e);ie.push(et);break;case 2:ie.push(this.wb($e));break;case 3:ie.push(this.Hb($e));break;case 4:ie.push(this.getBlob($e));break;default:ie.push(null)}return ie},w.prototype.getColumnNames=function(){for(var ie=[],De=Ac(this.Qa),ze=0;ze<De;ze+=1)ie.push(Ec(this.Qa,ze));return ie},w.prototype.getAsObject=function(ie,De){ie=this.get(ie,De),De=this.getColumnNames();for(var ze={},$e=0;$e<De.length;$e+=1)ze[De[$e]]=ie[$e];return ze},w.prototype.getSQL=function(){return ls(this.Qa)},w.prototype.getNormalizedSQL=function(){return Qi(this.Qa)},w.prototype.run=function(ie){return ie!=null&&this.bind(ie),this.step(),this.reset()},w.prototype.sb=function(ie,De){De==null&&(De=this.Oa,this.Oa+=1),ie=E(ie);var ze=F(ie,D);this.lb.push(ze),this.db.handleError(lo(this.Qa,De,ze,ie.length-1,0))},w.prototype.Bb=function(ie,De){De==null&&(De=this.Oa,this.Oa+=1);var ze=F(ie,D);this.lb.push(ze),this.db.handleError(oo(this.Qa,De,ze,ie.length,0))},w.prototype.rb=function(ie,De){De==null&&(De=this.Oa,this.Oa+=1),this.db.handleError((ie===(ie|0)?cc:uc)(this.Qa,De,ie))},w.prototype.Eb=function(ie){ie==null&&(ie=this.Oa,this.Oa+=1),oo(this.Qa,ie,0,0,0)},w.prototype.tb=function(ie,De){switch(De==null&&(De=this.Oa,this.Oa+=1),typeof ie){case"string":this.sb(ie,De);return;case"number":this.rb(ie,De);return;case"bigint":this.sb(ie.toString(),De);return;case"boolean":this.rb(ie+0,De);return;case"object":if(ie===null){this.Eb(De);return}if(ie.length!=null){this.Bb(ie,De);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+ie+")."},w.prototype.Db=function(ie){var De=this;return Object.keys(ie).forEach(function(ze){var $e=Js(De.Qa,ze);$e!==0&&De.tb(ie[ze],$e)}),!0},w.prototype.Cb=function(ie){for(var De=0;De<ie.length;De+=1)this.tb(ie[De],De+1);return!0},w.prototype.reset=function(){return this.freemem(),bc(this.Qa)===0&&$s(this.Qa)===0},w.prototype.freemem=function(){for(var ie;(ie=this.lb.pop())!==void 0;)Wt(ie)},w.prototype.free=function(){this.freemem();var ie=vc(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,ie},U.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.mb(),Error("Database closed");var ie=Ur(),De=Vt(4);jt(le),jt(De);try{this.db.handleError(Di(this.db.db,this.kb,-1,le,De)),this.kb=Lt(De,"i32");var ze=Lt(le,"i32");return ze===0?(this.mb(),{done:!0}):(this.Za=new w(ze,this.db),this.db.fb[ze]=this.Za,{value:this.Za,done:!1})}catch($e){throw this.pb=Fe(this.kb),this.mb(),$e}finally{Ut(ie)}},U.prototype.mb=function(){Wt(this.eb),this.eb=null},U.prototype.getRemainingSQL=function(){return this.pb!==null?this.pb:Fe(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(U.prototype[Symbol.iterator]=function(){return this}),Y.prototype.run=function(ie,De){if(!this.db)throw"Database closed";if(De){ie=this.prepare(ie,De);try{ie.step()}finally{ie.free()}}else this.handleError(at(this.db,ie,0,0,le));return this},Y.prototype.exec=function(ie,De,ze){if(!this.db)throw"Database closed";var $e=Ur(),et=null;try{var wt=ga(ie),on=Vt(4);for(ie=[];Lt(wt,"i8")!==0;){jt(le),jt(on),this.handleError(Di(this.db,wt,-1,le,on));var $r=Lt(le,"i32");if(wt=Lt(on,"i32"),$r!==0){var Mr=null;for(et=new w($r,this),De!=null&&et.bind(De);et.step();)Mr===null&&(Mr={columns:et.getColumnNames(),values:[]},ie.push(Mr)),Mr.values.push(et.get(null,ze));et.free()}}return ie}catch(Wr){throw et&&et.free(),Wr}finally{Ut($e)}},Y.prototype.each=function(ie,De,ze,$e,et){typeof De=="function"&&($e=ze,ze=De,De=void 0),ie=this.prepare(ie,De);try{for(;ie.step();)ze(ie.getAsObject(null,et))}finally{ie.free()}if(typeof $e=="function")return $e()},Y.prototype.prepare=function(ie,De){if(jt(le),this.handleError(vr(this.db,ie,-1,le,0)),ie=Lt(le,"i32"),ie===0)throw"Nothing to prepare";var ze=new w(ie,this);return De!=null&&ze.bind(De),this.fb[ie]=ze},Y.prototype.iterateStatements=function(ie){return new U(ie,this)},Y.prototype.export=function(){Object.values(this.fb).forEach(function(De){De.free()}),Object.values(this.Sa).forEach(Ue),this.Sa={},this.handleError(st(this.db));var ie=ss(this.filename);return this.handleError(qe(this.filename,le)),this.db=Lt(le,"i32"),Ao(this.db),ie},Y.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(ie){ie.free()}),Object.values(this.Sa).forEach(Ue),this.Sa={},this.Ya&&(Ue(this.Ya),this.Ya=void 0),this.handleError(st(this.db)),as("/"+this.filename),this.db=null)},Y.prototype.handleError=function(ie){if(ie===0)return null;throw ie=fc(this.db),Error(ie)},Y.prototype.getRowsModified=function(){return qt(this.db)},Y.prototype.create_function=function(ie,De){Object.prototype.hasOwnProperty.call(this.Sa,ie)&&(Ue(this.Sa[ie]),delete this.Sa[ie]);var ze=je(function($e,et,wt){et=y(et,wt);try{var on=De.apply(null,et)}catch($r){qa($e,$r,-1);return}h($e,on)},"viii");return this.Sa[ie]=ze,this.handleError(uo(this.db,ie,De.length,1,0,ze,0,0,0)),this},Y.prototype.create_aggregate=function(ie,De){var ze=De.init||function(){return null},$e=De.finalize||function(Mr){return Mr},et=De.step;if(!et)throw"An aggregate function must have a step function in "+ie;var wt={};Object.hasOwnProperty.call(this.Sa,ie)&&(Ue(this.Sa[ie]),delete this.Sa[ie]),De=ie+"__finalize",Object.hasOwnProperty.call(this.Sa,De)&&(Ue(this.Sa[De]),delete this.Sa[De]);var on=je(function(Mr,Wr,ma){var un=za(Mr,1);Object.hasOwnProperty.call(wt,un)||(wt[un]=ze()),Wr=y(Wr,ma),Wr=[wt[un]].concat(Wr);try{wt[un]=et.apply(null,Wr)}catch(Qc){delete wt[un],qa(Mr,Qc,-1)}},"viii"),$r=je(function(Mr){var Wr=za(Mr,1);try{var ma=$e(wt[Wr])}catch(un){delete wt[Wr],qa(Mr,un,-1);return}h(Mr,ma),delete wt[Wr]},"vi");return this.Sa[ie]=on,this.Sa[De]=$r,this.handleError(uo(this.db,ie,et.length-1,1,0,0,on,$r,0)),this},Y.prototype.updateHook=function(ie){this.Ya&&(Ws(this.db,0,0),Ue(this.Ya),this.Ya=void 0),ie&&(this.Ya=je(function(De,ze,$e,et,wt){switch(ze){case 18:De="insert";break;case 23:De="update";break;case 9:De="delete";break;default:throw"unknown operationCode in updateHook callback: "+ze}if($e=$e?Qe($,$e):"",et=et?Qe($,et):"",wt>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";ie(De,$e,et,Number(wt))},"viiiij"),Ws(this.db,this.Ya,0))},A.Database=Y};var T={...A},Q="./this.program",k=(h,y)=>{throw y},R="",N,O;if(B){var _=Lm;R=__dirname+"/",O=h=>(h=Ne(h)?new URL(h):h,_.readFileSync(h)),N=async h=>(h=Ne(h)?new URL(h):h,_.readFileSync(h,void 0)),!A.thisProgram&&1<process.argv.length&&(Q=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),n.exports=A,k=(h,y)=>{throw process.exitCode=h,y}}else(b||v)&&(v?R=self.location.href:typeof document<"u"&&document.currentScript&&(R=document.currentScript.src),R=R.startsWith("blob:")?"":R.slice(0,R.replace(/[?#].*/,"").lastIndexOf("/")+1),v&&(O=h=>{var y=new XMLHttpRequest;return y.open("GET",h,!1),y.responseType="arraybuffer",y.send(null),new Uint8Array(y.response)}),N=async h=>{if(Ne(h))return new Promise((w,U)=>{var Y=new XMLHttpRequest;Y.open("GET",h,!0),Y.responseType="arraybuffer",Y.onload=()=>{Y.status==200||Y.status==0&&Y.response?w(Y.response):U(Y.status)},Y.onerror=U,Y.send(null)});var y=await fetch(h,{credentials:"same-origin"});if(y.ok)return y.arrayBuffer();throw Error(y.status+" : "+y.url)});var q=A.print||console.log.bind(console),V=A.printErr||console.error.bind(console);Object.assign(A,T),T=null,A.thisProgram&&(Q=A.thisProgram);var ge=A.wasmBinary,ce,te=!1,J,K,$,me,he,we,pe,P,ae,Ne=h=>h.startsWith("file://");function _e(){var h=ce.buffer;A.HEAP8=K=new Int8Array(h),A.HEAP16=me=new Int16Array(h),A.HEAPU8=$=new Uint8Array(h),A.HEAPU16=new Uint16Array(h),A.HEAP32=he=new Int32Array(h),A.HEAPU32=we=new Uint32Array(h),A.HEAPF32=pe=new Float32Array(h),A.HEAPF64=ae=new Float64Array(h),A.HEAP64=P=new BigInt64Array(h),A.HEAPU64=new BigUint64Array(h)}var G=0,ne=null;function Ee(h){var y;throw(y=A.onAbort)==null||y.call(A,h),h="Aborted("+h+")",V(h),te=!0,new WebAssembly.RuntimeError(h+". Build with -sASSERTIONS for more info.")}var ke;async function He(h){if(!ge)try{var y=await N(h);return new Uint8Array(y)}catch{}if(h==ke&&ge)h=new Uint8Array(ge);else if(O)h=O(h);else throw"both async and sync fetching of the wasm failed";return h}async function Ke(h,y){try{var w=await He(h);return await WebAssembly.instantiate(w,y)}catch(U){V(`failed to asynchronously prepare wasm: ${U}`),Ee(U)}}async function Ge(h){var y=ke;if(!ge&&typeof WebAssembly.instantiateStreaming=="function"&&!Ne(y)&&!B)try{var w=fetch(y,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(w,h)}catch(U){V(`wasm streaming compile failed: ${U}`),V("falling back to ArrayBuffer instantiation")}return Ke(y,h)}class yt{constructor(y){Ir(this,"name","ExitStatus");this.message=`Program terminated with exit(${y})`,this.status=y}}var We=h=>{for(;0<h.length;)h.shift()(A)},Et=[],Kt=[],Sr=()=>{var h=A.preRun.shift();Kt.unshift(h)};function Lt(h,y="i8"){switch(y.endsWith("*")&&(y="*"),y){case"i1":return K[h];case"i8":return K[h];case"i16":return me[h>>1];case"i32":return he[h>>2];case"i64":return P[h>>3];case"float":return pe[h>>2];case"double":return ae[h>>3];case"*":return we[h>>2];default:Ee(`invalid type for getValue: ${y}`)}}var Ht=A.noExitRuntime||!0;function jt(h){var y="i32";switch(y.endsWith("*")&&(y="*"),y){case"i1":K[h]=0;break;case"i8":K[h]=0;break;case"i16":me[h>>1]=0;break;case"i32":he[h>>2]=0;break;case"i64":P[h>>3]=BigInt(0);break;case"float":pe[h>>2]=0;break;case"double":ae[h>>3]=0;break;case"*":we[h>>2]=0;break;default:Ee(`invalid type for setValue: ${y}`)}}var Er=typeof TextDecoder<"u"?new TextDecoder:void 0,Qe=(h,y=0,w=NaN)=>{var U=y+w;for(w=y;h[w]&&!(w>=U);)++w;if(16<w-y&&h.buffer&&Er)return Er.decode(h.subarray(y,w));for(U="";y<w;){var Y=h[y++];if(Y&128){var le=h[y++]&63;if((Y&224)==192)U+=String.fromCharCode((Y&31)<<6|le);else{var ye=h[y++]&63;Y=(Y&240)==224?(Y&15)<<12|le<<6|ye:(Y&7)<<18|le<<12|ye<<6|h[y++]&63,65536>Y?U+=String.fromCharCode(Y):(Y-=65536,U+=String.fromCharCode(55296|Y>>10,56320|Y&1023))}}else U+=String.fromCharCode(Y)}return U},Fe=(h,y)=>h?Qe($,h,y):"",nt=(h,y)=>{for(var w=0,U=h.length-1;0<=U;U--){var Y=h[U];Y==="."?h.splice(U,1):Y===".."?(h.splice(U,1),w++):w&&(h.splice(U,1),w--)}if(y)for(;w;w--)h.unshift("..");return h},lt=h=>{var y=h.charAt(0)==="/",w=h.slice(-1)==="/";return(h=nt(h.split("/").filter(U=>!!U),!y).join("/"))||y||(h="."),h&&w&&(h+="/"),(y?"/":"")+h},j=h=>{var y=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(h).slice(1);return h=y[0],y=y[1],!h&&!y?".":(y&&(y=y.slice(0,-1)),h+y)},X=h=>h&&h.match(/([^\/]+|\/)\/*$/)[1],se=()=>{if(B){var h=Lm;return y=>h.randomFillSync(y)}return y=>crypto.getRandomValues(y)},Te=h=>{(Te=se())(h)},Re=(...h)=>{for(var y="",w=!1,U=h.length-1;-1<=U&&!w;U--){if(w=0<=U?h[U]:"/",typeof w!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!w)return"";y=w+"/"+y,w=w.charAt(0)==="/"}return y=nt(y.split("/").filter(Y=>!!Y),!w).join("/"),(w?"/":"")+y||"."},xe=[],Ve=h=>{for(var y=0,w=0;w<h.length;++w){var U=h.charCodeAt(w);127>=U?y++:2047>=U?y+=2:55296<=U&&57343>=U?(y+=4,++w):y+=3}return y},S=(h,y,w,U)=>{if(!(0<U))return 0;var Y=w;U=w+U-1;for(var le=0;le<h.length;++le){var ye=h.charCodeAt(le);if(55296<=ye&&57343>=ye){var qe=h.charCodeAt(++le);ye=65536+((ye&1023)<<10)|qe&1023}if(127>=ye){if(w>=U)break;y[w++]=ye}else{if(2047>=ye){if(w+1>=U)break;y[w++]=192|ye>>6}else{if(65535>=ye){if(w+2>=U)break;y[w++]=224|ye>>12}else{if(w+3>=U)break;y[w++]=240|ye>>18,y[w++]=128|ye>>12&63}y[w++]=128|ye>>6&63}y[w++]=128|ye&63}}return y[w]=0,w-Y},E=(h,y)=>{var w=Array(Ve(h)+1);return h=S(h,w,0,w.length),y&&(w.length=h),w},x=[];function H(h,y){x[h]={input:[],output:[],cb:y},Gt(h,W)}var W={open(h){var y=x[h.node.rdev];if(!y)throw new Me(43);h.tty=y,h.seekable=!1},close(h){h.tty.cb.fsync(h.tty)},fsync(h){h.tty.cb.fsync(h.tty)},read(h,y,w,U){if(!h.tty||!h.tty.cb.xb)throw new Me(60);for(var Y=0,le=0;le<U;le++){try{var ye=h.tty.cb.xb(h.tty)}catch{throw new Me(29)}if(ye===void 0&&Y===0)throw new Me(6);if(ye==null)break;Y++,y[w+le]=ye}return Y&&(h.node.atime=Date.now()),Y},write(h,y,w,U){if(!h.tty||!h.tty.cb.qb)throw new Me(60);try{for(var Y=0;Y<U;Y++)h.tty.cb.qb(h.tty,y[w+Y])}catch{throw new Me(29)}return U&&(h.node.mtime=h.node.ctime=Date.now()),Y}},fe={xb(){e:{if(!xe.length){var h=null;if(B){var y=Buffer.alloc(256),w=0,U=process.stdin.fd;try{w=_.readSync(U,y,0,256)}catch(Y){if(Y.toString().includes("EOF"))w=0;else throw Y}0<w&&(h=y.slice(0,w).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(h=window.prompt("Input: "),h!==null&&(h+=`
`));if(!h){h=null;break e}xe=E(h,!0)}h=xe.shift()}return h},qb(h,y){y===null||y===10?(q(Qe(h.output)),h.output=[]):y!=0&&h.output.push(y)},fsync(h){var y;0<((y=h.output)==null?void 0:y.length)&&(q(Qe(h.output)),h.output=[])},Tb(){return{Ob:25856,Qb:5,Nb:191,Pb:35387,Mb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},be={qb(h,y){y===null||y===10?(V(Qe(h.output)),h.output=[]):y!=0&&h.output.push(y)},fsync(h){var y;0<((y=h.output)==null?void 0:y.length)&&(V(Qe(h.output)),h.output=[])}},Le={Wa:null,Xa(){return Le.createNode(null,"/",16895,0)},createNode(h,y,w,U){if((w&61440)===24576||(w&61440)===4096)throw new Me(63);return Le.Wa||(Le.Wa={dir:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua,lookup:Le.La.lookup,hb:Le.La.hb,rename:Le.La.rename,unlink:Le.La.unlink,rmdir:Le.La.rmdir,readdir:Le.La.readdir,symlink:Le.La.symlink},stream:{Va:Le.Ma.Va}},file:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua},stream:{Va:Le.Ma.Va,read:Le.Ma.read,write:Le.Ma.write,ib:Le.Ma.ib,jb:Le.Ma.jb}},link:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua,readlink:Le.La.readlink},stream:{}},ub:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua},stream:Ln}}),w=dr(h,y,w,U),Jt(w.mode)?(w.La=Le.Wa.dir.node,w.Ma=Le.Wa.dir.stream,w.Na={}):(w.mode&61440)===32768?(w.La=Le.Wa.file.node,w.Ma=Le.Wa.file.stream,w.Ra=0,w.Na=null):(w.mode&61440)===40960?(w.La=Le.Wa.link.node,w.Ma=Le.Wa.link.stream):(w.mode&61440)===8192&&(w.La=Le.Wa.ub.node,w.Ma=Le.Wa.ub.stream),w.atime=w.mtime=w.ctime=Date.now(),h&&(h.Na[y]=w,h.atime=h.mtime=h.ctime=w.atime),w},Sb(h){return h.Na?h.Na.subarray?h.Na.subarray(0,h.Ra):new Uint8Array(h.Na):new Uint8Array(0)},La:{Ta(h){var y={};return y.dev=(h.mode&61440)===8192?h.id:1,y.ino=h.id,y.mode=h.mode,y.nlink=1,y.uid=0,y.gid=0,y.rdev=h.rdev,Jt(h.mode)?y.size=4096:(h.mode&61440)===32768?y.size=h.Ra:(h.mode&61440)===40960?y.size=h.link.length:y.size=0,y.atime=new Date(h.atime),y.mtime=new Date(h.mtime),y.ctime=new Date(h.ctime),y.blksize=4096,y.blocks=Math.ceil(y.size/y.blksize),y},Ua(h,y){for(var w of["mode","atime","mtime","ctime"])y[w]!=null&&(h[w]=y[w]);y.size!==void 0&&(y=y.size,h.Ra!=y&&(y==0?(h.Na=null,h.Ra=0):(w=h.Na,h.Na=new Uint8Array(y),w&&h.Na.set(w.subarray(0,Math.min(y,h.Ra))),h.Ra=y)))},lookup(){throw Le.vb},hb(h,y,w,U){return Le.createNode(h,y,w,U)},rename(h,y,w){try{var U=_t(y,w)}catch{}if(U){if(Jt(h.mode))for(var Y in U.Na)throw new Me(55);Jr(U)}delete h.parent.Na[h.name],y.Na[w]=h,h.name=w,y.ctime=y.mtime=h.parent.ctime=h.parent.mtime=Date.now()},unlink(h,y){delete h.Na[y],h.ctime=h.mtime=Date.now()},rmdir(h,y){var w=_t(h,y),U;for(U in w.Na)throw new Me(55);delete h.Na[y],h.ctime=h.mtime=Date.now()},readdir(h){return[".","..",...Object.keys(h.Na)]},symlink(h,y,w){return h=Le.createNode(h,y,41471,0),h.link=w,h},readlink(h){if((h.mode&61440)!==40960)throw new Me(28);return h.link}},Ma:{read(h,y,w,U,Y){var le=h.node.Na;if(Y>=h.node.Ra)return 0;if(h=Math.min(h.node.Ra-Y,U),8<h&&le.subarray)y.set(le.subarray(Y,Y+h),w);else for(U=0;U<h;U++)y[w+U]=le[Y+U];return h},write(h,y,w,U,Y,le){if(y.buffer===K.buffer&&(le=!1),!U)return 0;if(h=h.node,h.mtime=h.ctime=Date.now(),y.subarray&&(!h.Na||h.Na.subarray)){if(le)return h.Na=y.subarray(w,w+U),h.Ra=U;if(h.Ra===0&&Y===0)return h.Na=y.slice(w,w+U),h.Ra=U;if(Y+U<=h.Ra)return h.Na.set(y.subarray(w,w+U),Y),U}le=Y+U;var ye=h.Na?h.Na.length:0;if(ye>=le||(le=Math.max(le,ye*(1048576>ye?2:1.125)>>>0),ye!=0&&(le=Math.max(le,256)),ye=h.Na,h.Na=new Uint8Array(le),0<h.Ra&&h.Na.set(ye.subarray(0,h.Ra),0)),h.Na.subarray&&y.subarray)h.Na.set(y.subarray(w,w+U),Y);else for(le=0;le<U;le++)h.Na[Y+le]=y[w+le];return h.Ra=Math.max(h.Ra,Y+U),U},Va(h,y,w){if(w===1?y+=h.position:w===2&&(h.node.mode&61440)===32768&&(y+=h.node.Ra),0>y)throw new Me(28);return y},ib(h,y,w,U,Y){if((h.node.mode&61440)!==32768)throw new Me(43);if(h=h.node.Na,Y&2||!h||h.buffer!==K.buffer){Y=!0,U=65536*Math.ceil(y/65536);var le=Vr(65536,U);if(le&&$.fill(0,le,le+U),U=le,!U)throw new Me(48);h&&((0<w||w+y<h.length)&&(h.subarray?h=h.subarray(w,w+y):h=Array.prototype.slice.call(h,w,w+y)),K.set(h,U))}else Y=!1,U=h.byteOffset;return{Kb:U,Ab:Y}},jb(h,y,w,U){return Le.Ma.write(h,y,0,U,w,!1),0}}},gt=(h,y)=>{var w=0;return h&&(w|=365),y&&(w|=146),w},ft=null,bt={},ot=[],es=1,sn=null,Ma=!1,Pn=!0,ts={},Me=class{constructor(h){Ir(this,"name","ErrnoError");this.Pa=h}},rs=class{constructor(){Ir(this,"gb",{});Ir(this,"node",null)}get flags(){return this.gb.flags}set flags(h){this.gb.flags=h}get position(){return this.gb.position}set position(h){this.gb.position=h}},Ci=class{constructor(h,y,w,U){Ir(this,"La",{});Ir(this,"Ma",{});Ir(this,"ab",null);h||(h=this),this.parent=h,this.Xa=h.Xa,this.id=es++,this.name=y,this.mode=w,this.rdev=U,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(h){h?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(h){h?this.mode|=146:this.mode&=-147}};function br(h,y={}){if(!h)throw new Me(44);y.nb??(y.nb=!0),h.charAt(0)==="/"||(h="//"+h);var w=0;e:for(;40>w;w++){h=h.split("/").filter(qe=>!!qe);for(var U=ft,Y="/",le=0;le<h.length;le++){var ye=le===h.length-1;if(ye&&y.parent)break;if(h[le]!==".")if(h[le]==="..")Y=j(Y),U=U.parent;else{Y=lt(Y+"/"+h[le]);try{U=_t(U,h[le])}catch(qe){if((qe==null?void 0:qe.Pa)===44&&ye&&y.Jb)return{path:Y};throw qe}if(!U.ab||ye&&!y.nb||(U=U.ab.root),(U.mode&61440)===40960&&(!ye||y.$a)){if(!U.La.readlink)throw new Me(52);U=U.La.readlink(U),U.charAt(0)==="/"||(U=j(Y)+"/"+U),h=U+"/"+h.slice(le+1).join("/");continue e}}}return{path:Y,node:U}}throw new Me(32)}function _a(h){for(var y;;){if(h===h.parent)return h=h.Xa.zb,y?h[h.length-1]!=="/"?`${h}/${y}`:h+y:h;y=y?`${h.name}/${y}`:h.name,h=h.parent}}function wi(h,y){for(var w=0,U=0;U<y.length;U++)w=(w<<5)-w+y.charCodeAt(U)|0;return(h+w>>>0)%sn.length}function Jr(h){var y=wi(h.parent.id,h.name);if(sn[y]===h)sn[y]=h.bb;else for(y=sn[y];y;){if(y.bb===h){y.bb=h.bb;break}y=y.bb}}function _t(h,y){var w=Jt(h.mode)?(w=Kn(h,"x"))?w:h.La.lookup?0:2:54;if(w)throw new Me(w);for(w=sn[wi(h.id,y)];w;w=w.bb){var U=w.name;if(w.parent.id===h.id&&U===y)return w}return h.La.lookup(h,y)}function dr(h,y,w,U){return h=new Ci(h,y,w,U),y=wi(h.parent.id,h.name),h.bb=sn[y],sn[y]=h}function Jt(h){return(h&61440)===16384}function Oa(h){var y=["r","w","rw"][h&3];return h&512&&(y+="w"),y}function Kn(h,y){if(Pn)return 0;if(!y.includes("r")||h.mode&292){if(y.includes("w")&&!(h.mode&146)||y.includes("x")&&!(h.mode&73))return 2}else return 2;return 0}function ns(h,y){if(!Jt(h.mode))return 54;try{return _t(h,y),20}catch{}return Kn(h,"wx")}function Ii(h,y,w){try{var U=_t(h,y)}catch(Y){return Y.Pa}if(h=Kn(h,"wx"))return h;if(w){if(!Jt(U.mode))return 54;if(U===U.parent||_a(U)==="/")return 10}else if(Jt(U.mode))return 31;return 0}function En(h){if(!h)throw new Me(63);return h}function tr(h){if(h=ot[h],!h)throw new Me(8);return h}function kn(h,y=-1){if(h=Object.assign(new rs,h),y==-1)e:{for(y=0;4096>=y;y++)if(!ot[y])break e;throw new Me(33)}return h.fd=y,ot[y]=h}function Jn(h,y=-1){var w,U;return h=kn(h,y),(U=(w=h.Ma)==null?void 0:w.Rb)==null||U.call(w,h),h}function Gr(h,y,w){var U=h==null?void 0:h.Ma.Ua;h=U?h:y,U??(U=y.La.Ua),En(U),U(h,w)}var Ln={open(h){var y,w;h.Ma=bt[h.node.rdev].Ma,(w=(y=h.Ma).open)==null||w.call(y,h)},Va(){throw new Me(70)}};function Gt(h,y){bt[h]={Ma:y}}function Bi(h,y){var w=y==="/";if(w&&ft)throw new Me(10);if(!w&&y){var U=br(y,{nb:!1});if(y=U.path,U=U.node,U.ab)throw new Me(10);if(!Jt(U.mode))throw new Me(54)}y={type:h,Wb:{},zb:y,Ib:[]},h=h.Xa(y),h.Xa=y,y.root=h,w?ft=h:U&&(U.ab=y,U.Xa&&U.Xa.Ib.push(y))}function fa(h,y,w){var U=br(h,{parent:!0}).node;if(h=X(h),!h)throw new Me(28);if(h==="."||h==="..")throw new Me(20);var Y=ns(U,h);if(Y)throw new Me(Y);if(!U.La.hb)throw new Me(63);return U.La.hb(U,h,y,w)}function Un(h,y=438){return fa(h,y&4095|32768,0)}function fr(h,y=511){return fa(h,y&1023|16384,0)}function Xr(h,y,w){typeof w>"u"&&(w=y,y=438),fa(h,y|8192,w)}function Fa(h,y){if(!Re(h))throw new Me(44);var w=br(y,{parent:!0}).node;if(!w)throw new Me(44);y=X(y);var U=ns(w,y);if(U)throw new Me(U);if(!w.La.symlink)throw new Me(63);w.La.symlink(w,y,h)}function Si(h){var y=br(h,{parent:!0}).node;h=X(h);var w=_t(y,h),U=Ii(y,h,!0);if(U)throw new Me(U);if(!y.La.rmdir)throw new Me(63);if(w.ab)throw new Me(10);y.La.rmdir(y,h),Jr(w)}function as(h){var y=br(h,{parent:!0}).node;if(!y)throw new Me(44);h=X(h);var w=_t(y,h),U=Ii(y,h,!1);if(U)throw new Me(U);if(!y.La.unlink)throw new Me(63);if(w.ab)throw new Me(10);y.La.unlink(y,h),Jr(w)}function bn(h,y){return h=br(h,{$a:!y}).node,En(h.La.Ta)(h)}function Aa(h,y,w,U){Gr(h,y,{mode:w&4095|y.mode&-4096,ctime:Date.now(),Fb:U})}function Lr(h,y){h=typeof h=="string"?br(h,{$a:!0}).node:h,Aa(null,h,y)}function ja(h,y,w){if(Jt(y.mode))throw new Me(31);if((y.mode&61440)!==32768)throw new Me(28);var U=Kn(y,"w");if(U)throw new Me(U);Gr(h,y,{size:w,timestamp:Date.now()})}function Mn(h,y,w=438){if(h==="")throw new Me(44);if(typeof y=="string"){var U={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[y];if(typeof U>"u")throw Error(`Unknown file open mode: ${y}`);y=U}if(w=y&64?w&4095|32768:0,typeof h=="object")U=h;else{var Y=h.endsWith("/");h=br(h,{$a:!(y&131072),Jb:!0}),U=h.node,h=h.path}var le=!1;if(y&64)if(U){if(y&128)throw new Me(20)}else{if(Y)throw new Me(31);U=fa(h,w|511,0),le=!0}if(!U)throw new Me(44);if((U.mode&61440)===8192&&(y&=-513),y&65536&&!Jt(U.mode))throw new Me(54);if(!le&&(Y=U?(U.mode&61440)===40960?32:Jt(U.mode)&&(Oa(y)!=="r"||y&576)?31:Kn(U,Oa(y)):44))throw new Me(Y);return y&512&&!le&&(Y=U,Y=typeof Y=="string"?br(Y,{$a:!0}).node:Y,ja(null,Y,0)),y&=-131713,Y=kn({node:U,path:_a(U),flags:y,seekable:!0,position:0,Ma:U.Ma,Lb:[],error:!1}),Y.Ma.open&&Y.Ma.open(Y),le&&Lr(U,w&511),!A.logReadFiles||y&1||h in ts||(ts[h]=1),Y}function vn(h){if(h.fd===null)throw new Me(8);h.ob&&(h.ob=null);try{h.Ma.close&&h.Ma.close(h)}catch(y){throw y}finally{ot[h.fd]=null}h.fd=null}function $t(h,y,w){if(h.fd===null)throw new Me(8);if(!h.seekable||!h.Ma.Va)throw new Me(70);if(w!=0&&w!=1&&w!=2)throw new Me(28);h.position=h.Ma.Va(h,y,w),h.Lb=[]}function Ha(h,y,w,U,Y){if(0>U||0>Y)throw new Me(28);if(h.fd===null)throw new Me(8);if((h.flags&2097155)===1)throw new Me(8);if(Jt(h.node.mode))throw new Me(31);if(!h.Ma.read)throw new Me(28);var le=typeof Y<"u";if(!le)Y=h.position;else if(!h.seekable)throw new Me(70);return y=h.Ma.read(h,y,w,U,Y),le||(h.position+=y),y}function is(h,y,w,U,Y){if(0>U||0>Y)throw new Me(28);if(h.fd===null)throw new Me(8);if((h.flags&2097155)===0)throw new Me(8);if(Jt(h.node.mode))throw new Me(31);if(!h.Ma.write)throw new Me(28);h.seekable&&h.flags&1024&&$t(h,0,2);var le=typeof Y<"u";if(!le)Y=h.position;else if(!h.seekable)throw new Me(70);return y=h.Ma.write(h,y,w,U,Y,void 0),le||(h.position+=y),y}function ss(h){var y,w=Mn(h,w||0);h=bn(h).size;var U=new Uint8Array(h);return Ha(w,U,0,h,0),y=U,vn(w),y}function Ot(h,y,w){h=lt("/dev/"+h);var U=gt(!!y,!!w);Ot.yb??(Ot.yb=64);var Y=Ot.yb++<<8|0;Gt(Y,{open(le){le.seekable=!1},close(){var le;(le=w==null?void 0:w.buffer)!=null&&le.length&&w(10)},read(le,ye,qe,st){for(var at=0,qt=0;qt<st;qt++){try{var vr=y()}catch{throw new Me(29)}if(vr===void 0&&at===0)throw new Me(6);if(vr==null)break;at++,ye[qe+qt]=vr}return at&&(le.node.atime=Date.now()),at},write(le,ye,qe,st){for(var at=0;at<st;at++)try{w(ye[qe+at])}catch{throw new Me(29)}return st&&(le.node.mtime=le.node.ctime=Date.now()),at}}),Xr(h,U,Y)}var ut={};function Tt(h,y,w){if(y.charAt(0)==="/")return y;if(h=h===-100?"/":tr(h).path,y.length==0){if(!w)throw new Me(44);return h}return h+"/"+y}function _n(h,y){he[h>>2]=y.dev,he[h+4>>2]=y.mode,we[h+8>>2]=y.nlink,he[h+12>>2]=y.uid,he[h+16>>2]=y.gid,he[h+20>>2]=y.rdev,P[h+24>>3]=BigInt(y.size),he[h+32>>2]=4096,he[h+36>>2]=y.blocks;var w=y.atime.getTime(),U=y.mtime.getTime(),Y=y.ctime.getTime();return P[h+40>>3]=BigInt(Math.floor(w/1e3)),we[h+48>>2]=w%1e3*1e6,P[h+56>>3]=BigInt(Math.floor(U/1e3)),we[h+64>>2]=U%1e3*1e6,P[h+72>>3]=BigInt(Math.floor(Y/1e3)),we[h+80>>2]=Y%1e3*1e6,P[h+88>>3]=BigInt(y.ino),0}var Xn=void 0,rr=()=>{var h=he[+Xn>>2];return Xn+=4,h},Ga=0,Nr=[0,31,60,91,121,152,182,213,244,274,305,335],Ni=[0,31,59,90,120,151,181,212,243,273,304,334],$n={},ha=h=>{var y;J=h,Ht||0<Ga||((y=A.onExit)==null||y.call(A,h),te=!0),k(h,new yt(h))},xn=h=>{if(!te)try{if(h(),!(Ht||0<Ga))try{J=h=J,ha(h)}catch(y){y instanceof yt||y=="unwind"||k(1,y)}}catch(y){y instanceof yt||y=="unwind"||k(1,y)}},Va={},Ti=()=>{if(!Cn){var h={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Q||"./this.program"},y;for(y in Va)Va[y]===void 0?delete h[y]:h[y]=Va[y];var w=[];for(y in h)w.push(`${y}=${h[y]}`);Cn=w}return Cn},Cn,ga=h=>{var y=Ve(h)+1,w=Vt(y);return S(h,$,w,y),w},I=(h,y,w,U)=>{var Y={string:at=>{var qt=0;return at!=null&&at!==0&&(qt=ga(at)),qt},array:at=>{var qt=Vt(at.length);return K.set(at,qt),qt}};h=A["_"+h];var le=[],ye=0;if(U)for(var qe=0;qe<U.length;qe++){var st=Y[w[qe]];st?(ye===0&&(ye=Ur()),le[qe]=st(U[qe])):le[qe]=U[qe]}return w=h(...le),w=function(at){return ye!==0&&Ut(ye),y==="string"?at?Qe($,at):"":y==="boolean"?!!at:at}(w)},D=0,F=(h,y)=>(y=y==1?Vt(h.length):Ar(h.length),h.subarray||h.slice||(h=new Uint8Array(h)),$.set(h,y),y),ee,Ie=[],Be,Ue=h=>{ee.delete(Be.get(h)),Be.set(h,null),Ie.push(h)},je=(h,y)=>{if(!ee){ee=new WeakMap;var w=Be.length;if(ee)for(var U=0;U<0+w;U++){var Y=Be.get(U);Y&&ee.set(Y,U)}}if(w=ee.get(h)||0)return w;if(Ie.length)w=Ie.pop();else{try{Be.grow(1)}catch(st){throw st instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":st}w=Be.length-1}try{Be.set(w,h)}catch(st){if(!(st instanceof TypeError))throw st;if(typeof WebAssembly.Function=="function"){var le=WebAssembly.Function;U={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},Y={parameters:[],results:y[0]=="v"?[]:[U[y[0]]]};for(var ye=1;ye<y.length;++ye)Y.parameters.push(U[y[ye]]);y=new le(Y,h)}else{U=[1],Y=y.slice(0,1),y=y.slice(1),ye={i:127,p:127,j:126,f:125,d:124,e:111},U.push(96);var qe=y.length;128>qe?U.push(qe):U.push(qe%128|128,qe>>7);for(le of y)U.push(ye[le]);Y=="v"?U.push(0):U.push(1,ye[Y]),y=[0,97,115,109,1,0,0,0,1],le=U.length,128>le?y.push(le):y.push(le%128|128,le>>7),y.push(...U),y.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),y=new WebAssembly.Module(new Uint8Array(y)),y=new WebAssembly.Instance(y,{e:{f:h}}).exports.f}Be.set(w,y)}return ee.set(h,w),w};sn=Array(4096),Bi(Le,"/"),fr("/tmp"),fr("/home"),fr("/home/web_user"),function(){fr("/dev"),Gt(259,{read:()=>0,write:(U,Y,le,ye)=>ye,Va:()=>0}),Xr("/dev/null",259),H(1280,fe),H(1536,be),Xr("/dev/tty",1280),Xr("/dev/tty1",1536);var h=new Uint8Array(1024),y=0,w=()=>(y===0&&(Te(h),y=h.byteLength),h[--y]);Ot("random",w),Ot("urandom",w),fr("/dev/shm"),fr("/dev/shm/tmp")}(),function(){fr("/proc");var h=fr("/proc/self");fr("/proc/self/fd"),Bi({Xa(){var y=dr(h,"fd",16895,73);return y.Ma={Va:Le.Ma.Va},y.La={lookup(w,U){w=+U;var Y=tr(w);return w={parent:null,Xa:{zb:"fake"},La:{readlink:()=>Y.path},id:w+1},w.parent=w},readdir(){return Array.from(ot.entries()).filter(([,w])=>w).map(([w])=>w.toString())}},y}},"/proc/self/fd")}(),Le.vb=new Me(44),Le.vb.stack="<generic error, no stack>";var vt={a:(h,y,w,U)=>Ee(`Assertion failed: ${h?Qe($,h):""}, at: `+[y?y?Qe($,y):"":"unknown filename",w,U?U?Qe($,U):"":"unknown function"]),i:function(h,y){try{return h=h?Qe($,h):"",Lr(h,y),0}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},L:function(h,y,w){try{if(y=y?Qe($,y):"",y=Tt(h,y),w&-8)return-28;var U=br(y,{$a:!0}).node;return U?(h="",w&4&&(h+="r"),w&2&&(h+="w"),w&1&&(h+="x"),h&&Kn(U,h)?-2:0):-44}catch(Y){if(typeof ut>"u"||Y.name!=="ErrnoError")throw Y;return-Y.Pa}},j:function(h,y){try{var w=tr(h);return Aa(w,w.node,y,!1),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},h:function(h){try{var y=tr(h);return Gr(y,y.node,{timestamp:Date.now(),Fb:!1}),0}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},b:function(h,y,w){Xn=w;try{var U=tr(h);switch(y){case 0:var Y=rr();if(0>Y)break;for(;ot[Y];)Y++;return Jn(U,Y).fd;case 1:case 2:return 0;case 3:return U.flags;case 4:return Y=rr(),U.flags|=Y,0;case 12:return Y=rr(),me[Y+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(le){if(typeof ut>"u"||le.name!=="ErrnoError")throw le;return-le.Pa}},g:function(h,y){try{var w=tr(h),U=w.node,Y=w.Ma.Ta;h=Y?w:U,Y??(Y=U.La.Ta),En(Y);var le=Y(h);return _n(y,le)}catch(ye){if(typeof ut>"u"||ye.name!=="ErrnoError")throw ye;return-ye.Pa}},H:function(h,y){y=-9007199254740992>y||9007199254740992<y?NaN:Number(y);try{if(isNaN(y))return 61;var w=tr(h);if(0>y||(w.flags&2097155)===0)throw new Me(28);return ja(w,w.node,y),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},G:function(h,y){try{if(y===0)return-28;var w=Ve("/")+1;return y<w?-68:(S("/",$,h,y),w)}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},K:function(h,y){try{return h=h?Qe($,h):"",_n(y,bn(h,!0))}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},C:function(h,y,w){try{return y=y?Qe($,y):"",y=Tt(h,y),fr(y,w),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},J:function(h,y,w,U){try{y=y?Qe($,y):"";var Y=U&256;return y=Tt(h,y,U&4096),_n(w,Y?bn(y,!0):bn(y))}catch(le){if(typeof ut>"u"||le.name!=="ErrnoError")throw le;return-le.Pa}},x:function(h,y,w,U){Xn=U;try{y=y?Qe($,y):"",y=Tt(h,y);var Y=U?rr():0;return Mn(y,w,Y).fd}catch(le){if(typeof ut>"u"||le.name!=="ErrnoError")throw le;return-le.Pa}},v:function(h,y,w,U){try{if(y=y?Qe($,y):"",y=Tt(h,y),0>=U)return-28;var Y=br(y).node;if(!Y)throw new Me(44);if(!Y.La.readlink)throw new Me(28);var le=Y.La.readlink(Y),ye=Math.min(U,Ve(le)),qe=K[w+ye];return S(le,$,w,U+1),K[w+ye]=qe,ye}catch(st){if(typeof ut>"u"||st.name!=="ErrnoError")throw st;return-st.Pa}},u:function(h){try{return h=h?Qe($,h):"",Si(h),0}catch(y){if(typeof ut>"u"||y.name!=="ErrnoError")throw y;return-y.Pa}},f:function(h,y){try{return h=h?Qe($,h):"",_n(y,bn(h))}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},r:function(h,y,w){try{return y=y?Qe($,y):"",y=Tt(h,y),w===0?as(y):w===512?Si(y):Ee("Invalid flags passed to unlinkat"),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},q:function(h,y,w){try{y=y?Qe($,y):"",y=Tt(h,y,!0);var U=Date.now(),Y,le;if(w){var ye=we[w>>2]+4294967296*he[w+4>>2],qe=he[w+8>>2];qe==1073741823?Y=U:qe==1073741822?Y=null:Y=1e3*ye+qe/1e6,w+=16,ye=we[w>>2]+4294967296*he[w+4>>2],qe=he[w+8>>2],qe==1073741823?le=U:qe==1073741822?le=null:le=1e3*ye+qe/1e6}else le=Y=U;if((le??Y)!==null){h=Y;var st=br(y,{$a:!0}).node;En(st.La.Ua)(st,{atime:h,mtime:le})}return 0}catch(at){if(typeof ut>"u"||at.name!=="ErrnoError")throw at;return-at.Pa}},m:()=>Ee(""),l:()=>{Ht=!1,Ga=0},A:function(h,y){h=-9007199254740992>h||9007199254740992<h?NaN:Number(h),h=new Date(1e3*h),he[y>>2]=h.getSeconds(),he[y+4>>2]=h.getMinutes(),he[y+8>>2]=h.getHours(),he[y+12>>2]=h.getDate(),he[y+16>>2]=h.getMonth(),he[y+20>>2]=h.getFullYear()-1900,he[y+24>>2]=h.getDay();var w=h.getFullYear();he[y+28>>2]=(w%4!==0||w%100===0&&w%400!==0?Ni:Nr)[h.getMonth()]+h.getDate()-1|0,he[y+36>>2]=-(60*h.getTimezoneOffset()),w=new Date(h.getFullYear(),6,1).getTimezoneOffset();var U=new Date(h.getFullYear(),0,1).getTimezoneOffset();he[y+32>>2]=(w!=U&&h.getTimezoneOffset()==Math.min(U,w))|0},y:function(h,y,w,U,Y,le,ye){Y=-9007199254740992>Y||9007199254740992<Y?NaN:Number(Y);try{if(isNaN(Y))return 61;var qe=tr(U);if((y&2)!==0&&(w&2)===0&&(qe.flags&2097155)!==2)throw new Me(2);if((qe.flags&2097155)===1)throw new Me(2);if(!qe.Ma.ib)throw new Me(43);if(!h)throw new Me(28);var st=qe.Ma.ib(qe,h,Y,y,w),at=st.Kb;return he[le>>2]=st.Ab,we[ye>>2]=at,0}catch(qt){if(typeof ut>"u"||qt.name!=="ErrnoError")throw qt;return-qt.Pa}},z:function(h,y,w,U,Y,le){le=-9007199254740992>le||9007199254740992<le?NaN:Number(le);try{var ye=tr(Y);if(w&2){if(w=le,(ye.node.mode&61440)!==32768)throw new Me(43);if(!(U&2)){var qe=$.slice(h,h+y);ye.Ma.jb&&ye.Ma.jb(ye,qe,w,y,U)}}}catch(st){if(typeof ut>"u"||st.name!=="ErrnoError")throw st;return-st.Pa}},n:(h,y)=>{if($n[h]&&(clearTimeout($n[h].id),delete $n[h]),!y)return 0;var w=setTimeout(()=>{delete $n[h],xn(()=>ln(h,performance.now()))},y);return $n[h]={id:w,Xb:y},0},B:(h,y,w,U)=>{var Y=new Date().getFullYear(),le=new Date(Y,0,1).getTimezoneOffset();Y=new Date(Y,6,1).getTimezoneOffset(),we[h>>2]=60*Math.max(le,Y),he[y>>2]=+(le!=Y),y=ye=>{var qe=Math.abs(ye);return`UTC${0<=ye?"-":"+"}${String(Math.floor(qe/60)).padStart(2,"0")}${String(qe%60).padStart(2,"0")}`},h=y(le),y=y(Y),Y<le?(S(h,$,w,17),S(y,$,U,17)):(S(h,$,U,17),S(y,$,w,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:h=>{var y=$.length;if(h>>>=0,2147483648<h)return!1;for(var w=1;4>=w;w*=2){var U=y*(1+.2/w);U=Math.min(U,h+100663296);e:{U=(Math.min(2147483648,65536*Math.ceil(Math.max(h,U)/65536))-ce.buffer.byteLength+65535)/65536|0;try{ce.grow(U),_e();var Y=1;break e}catch{}Y=void 0}if(Y)return!0}return!1},E:(h,y)=>{var w=0;return Ti().forEach((U,Y)=>{var le=y+w;for(Y=we[h+4*Y>>2]=le,le=0;le<U.length;++le)K[Y++]=U.charCodeAt(le);K[Y]=0,w+=U.length+1}),0},F:(h,y)=>{var w=Ti();we[h>>2]=w.length;var U=0;return w.forEach(Y=>U+=Y.length+1),we[y>>2]=U,0},e:function(h){try{var y=tr(h);return vn(y),0}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return w.Pa}},p:function(h,y){try{var w=tr(h);return K[y]=w.tty?2:Jt(w.mode)?3:(w.mode&61440)===40960?7:4,me[y+2>>1]=0,P[y+8>>3]=BigInt(0),P[y+16>>3]=BigInt(0),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return U.Pa}},w:function(h,y,w,U){try{e:{var Y=tr(h);h=y;for(var le,ye=y=0;ye<w;ye++){var qe=we[h>>2],st=we[h+4>>2];h+=8;var at=Ha(Y,K,qe,st,le);if(0>at){var qt=-1;break e}if(y+=at,at<st)break;typeof le<"u"&&(le+=at)}qt=y}return we[U>>2]=qt,0}catch(vr){if(typeof ut>"u"||vr.name!=="ErrnoError")throw vr;return vr.Pa}},D:function(h,y,w,U){y=-9007199254740992>y||9007199254740992<y?NaN:Number(y);try{if(isNaN(y))return 61;var Y=tr(h);return $t(Y,y,w),P[U>>3]=BigInt(Y.position),Y.ob&&y===0&&w===0&&(Y.ob=null),0}catch(le){if(typeof ut>"u"||le.name!=="ErrnoError")throw le;return le.Pa}},I:function(h){var w;try{var y=tr(h);return(w=y.Ma)!=null&&w.fsync?y.Ma.fsync(y):0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return U.Pa}},t:function(h,y,w,U){try{e:{var Y=tr(h);h=y;for(var le,ye=y=0;ye<w;ye++){var qe=we[h>>2],st=we[h+4>>2];h+=8;var at=is(Y,K,qe,st,le);if(0>at){var qt=-1;break e}if(y+=at,at<st)break;typeof le<"u"&&(le+=at)}qt=y}return we[U>>2]=qt,0}catch(vr){if(typeof ut>"u"||vr.name!=="ErrnoError")throw vr;return vr.Pa}},k:ha},Oe;(async function(){var w;function h(U){var Y;return Oe=U.exports,ce=Oe.M,_e(),Be=Oe.O,G--,(Y=A.monitorRunDependencies)==null||Y.call(A,G),G==0&&ne&&(U=ne,ne=null,U()),Oe}G++,(w=A.monitorRunDependencies)==null||w.call(A,G);var y={a:vt};return A.instantiateWasm?new Promise(U=>{A.instantiateWasm(y,(Y,le)=>{h(Y),U(Y.exports)})}):(ke??(ke=A.locateFile?A.locateFile("sql-wasm.wasm",R):R+"sql-wasm.wasm"),h((await Ge(y)).instance))})(),A._sqlite3_free=h=>(A._sqlite3_free=Oe.P)(h),A._sqlite3_value_text=h=>(A._sqlite3_value_text=Oe.Q)(h),A._sqlite3_prepare_v2=(h,y,w,U,Y)=>(A._sqlite3_prepare_v2=Oe.R)(h,y,w,U,Y),A._sqlite3_step=h=>(A._sqlite3_step=Oe.S)(h),A._sqlite3_reset=h=>(A._sqlite3_reset=Oe.T)(h),A._sqlite3_exec=(h,y,w,U,Y)=>(A._sqlite3_exec=Oe.U)(h,y,w,U,Y),A._sqlite3_finalize=h=>(A._sqlite3_finalize=Oe.V)(h),A._sqlite3_column_name=(h,y)=>(A._sqlite3_column_name=Oe.W)(h,y),A._sqlite3_column_text=(h,y)=>(A._sqlite3_column_text=Oe.X)(h,y),A._sqlite3_column_type=(h,y)=>(A._sqlite3_column_type=Oe.Y)(h,y),A._sqlite3_errmsg=h=>(A._sqlite3_errmsg=Oe.Z)(h),A._sqlite3_clear_bindings=h=>(A._sqlite3_clear_bindings=Oe._)(h),A._sqlite3_value_blob=h=>(A._sqlite3_value_blob=Oe.$)(h),A._sqlite3_value_bytes=h=>(A._sqlite3_value_bytes=Oe.aa)(h),A._sqlite3_value_double=h=>(A._sqlite3_value_double=Oe.ba)(h),A._sqlite3_value_int=h=>(A._sqlite3_value_int=Oe.ca)(h),A._sqlite3_value_type=h=>(A._sqlite3_value_type=Oe.da)(h),A._sqlite3_result_blob=(h,y,w,U)=>(A._sqlite3_result_blob=Oe.ea)(h,y,w,U),A._sqlite3_result_double=(h,y)=>(A._sqlite3_result_double=Oe.fa)(h,y),A._sqlite3_result_error=(h,y,w)=>(A._sqlite3_result_error=Oe.ga)(h,y,w),A._sqlite3_result_int=(h,y)=>(A._sqlite3_result_int=Oe.ha)(h,y),A._sqlite3_result_int64=(h,y)=>(A._sqlite3_result_int64=Oe.ia)(h,y),A._sqlite3_result_null=h=>(A._sqlite3_result_null=Oe.ja)(h),A._sqlite3_result_text=(h,y,w,U)=>(A._sqlite3_result_text=Oe.ka)(h,y,w,U),A._sqlite3_aggregate_context=(h,y)=>(A._sqlite3_aggregate_context=Oe.la)(h,y),A._sqlite3_column_count=h=>(A._sqlite3_column_count=Oe.ma)(h),A._sqlite3_data_count=h=>(A._sqlite3_data_count=Oe.na)(h),A._sqlite3_column_blob=(h,y)=>(A._sqlite3_column_blob=Oe.oa)(h,y),A._sqlite3_column_bytes=(h,y)=>(A._sqlite3_column_bytes=Oe.pa)(h,y),A._sqlite3_column_double=(h,y)=>(A._sqlite3_column_double=Oe.qa)(h,y),A._sqlite3_bind_blob=(h,y,w,U,Y)=>(A._sqlite3_bind_blob=Oe.ra)(h,y,w,U,Y),A._sqlite3_bind_double=(h,y,w)=>(A._sqlite3_bind_double=Oe.sa)(h,y,w),A._sqlite3_bind_int=(h,y,w)=>(A._sqlite3_bind_int=Oe.ta)(h,y,w),A._sqlite3_bind_text=(h,y,w,U,Y)=>(A._sqlite3_bind_text=Oe.ua)(h,y,w,U,Y),A._sqlite3_bind_parameter_index=(h,y)=>(A._sqlite3_bind_parameter_index=Oe.va)(h,y),A._sqlite3_sql=h=>(A._sqlite3_sql=Oe.wa)(h),A._sqlite3_normalized_sql=h=>(A._sqlite3_normalized_sql=Oe.xa)(h),A._sqlite3_changes=h=>(A._sqlite3_changes=Oe.ya)(h),A._sqlite3_close_v2=h=>(A._sqlite3_close_v2=Oe.za)(h),A._sqlite3_create_function_v2=(h,y,w,U,Y,le,ye,qe,st)=>(A._sqlite3_create_function_v2=Oe.Aa)(h,y,w,U,Y,le,ye,qe,st),A._sqlite3_update_hook=(h,y,w)=>(A._sqlite3_update_hook=Oe.Ba)(h,y,w),A._sqlite3_open=(h,y)=>(A._sqlite3_open=Oe.Ca)(h,y);var Ar=A._malloc=h=>(Ar=A._malloc=Oe.Da)(h),Wt=A._free=h=>(Wt=A._free=Oe.Ea)(h);A._RegisterExtensionFunctions=h=>(A._RegisterExtensionFunctions=Oe.Fa)(h);var Vr=(h,y)=>(Vr=Oe.Ga)(h,y),ln=(h,y)=>(ln=Oe.Ha)(h,y),Ut=h=>(Ut=Oe.Ia)(h),Vt=h=>(Vt=Oe.Ja)(h),Ur=()=>(Ur=Oe.Ka)();A.stackSave=()=>Ur(),A.stackRestore=h=>Ut(h),A.stackAlloc=h=>Vt(h),A.cwrap=(h,y,w,U)=>{var Y=!w||w.every(le=>le==="number"||le==="boolean");return y!=="string"&&Y&&!U?A["_"+h]:(...le)=>I(h,y,w,le)},A.addFunction=je,A.removeFunction=Ue,A.UTF8ToString=Fe,A.ALLOC_NORMAL=D,A.allocate=F,A.allocateUTF8OnStack=ga;function nr(){function h(){var Y;if(A.calledRun=!0,!te){if(!A.noFSInit&&!Ma){var y,w;Ma=!0,U??(U=A.stdin),y??(y=A.stdout),w??(w=A.stderr),U?Ot("stdin",U):Fa("/dev/tty","/dev/stdin"),y?Ot("stdout",null,y):Fa("/dev/tty","/dev/stdout"),w?Ot("stderr",null,w):Fa("/dev/tty1","/dev/stderr"),Mn("/dev/stdin",0),Mn("/dev/stdout",1),Mn("/dev/stderr",1)}if(Oe.N(),Pn=!1,(Y=A.onRuntimeInitialized)==null||Y.call(A),A.postRun)for(typeof A.postRun=="function"&&(A.postRun=[A.postRun]);A.postRun.length;){var U=A.postRun.shift();Et.unshift(U)}We(Et)}}if(0<G)ne=nr;else{if(A.preRun)for(typeof A.preRun=="function"&&(A.preRun=[A.preRun]);A.preRun.length;)Sr();We(Kt),0<G?ne=nr:A.setStatus?(A.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>A.setStatus(""),1),h()},1)):h()}}if(A.preInit)for(typeof A.preInit=="function"&&(A.preInit=[A.preInit]);0<A.preInit.length;)A.preInit.pop()();return nr(),d}),a)};n.exports=s,n.exports.default=s}(kf)),kf.exports}var tw=ew();const rw=xi(tw);var Mm=`
\uFEFFCREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

BEGIN TRANSACTION;
CREATE TABLE "Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "Gender" VARCHAR NULL,
    "FirstName" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "BirthDate" TEXT NOT NULL,
    "AddressStreet" VARCHAR NULL,
    "AddressCity" VARCHAR NULL,
    "AddressState" VARCHAR NULL,
    "AddressZipCode" VARCHAR NULL,
    "AddressCountry" VARCHAR NULL,
    "Hobbies" TEXT NULL,
    "EmailPrefix" TEXT NULL,
    "PhoneMobile" TEXT NULL,
    "BankAccountIBAN" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

CREATE TABLE "Services" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Services" PRIMARY KEY,
    "Name" TEXT NULL,
    "Url" TEXT NULL,
    "Logo" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

CREATE TABLE "Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "Username" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "ServiceId" TEXT NOT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Attachment" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachment" PRIMARY KEY,
    "Filename" TEXT NOT NULL,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    CONSTRAINT "FK_Attachment_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Passwords" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passwords" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Attachment_CredentialId" ON "Attachment" ("CredentialId");

CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708094944_1.0.0-InitialMigration', '9.0.4');

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');

ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');

CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');

CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');

CREATE TABLE "ef_temp_Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "ef_temp_Aliases" ("Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt")
SELECT "Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt"
FROM "Aliases";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Aliases";

ALTER TABLE "ef_temp_Aliases" RENAME TO "Aliases";

COMMIT;

PRAGMA foreign_keys = 1;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');

BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Credentials" ("Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username")
SELECT "Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username"
FROM "Credentials";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Credentials";

ALTER TABLE "ef_temp_Credentials" RENAME TO "Credentials";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');

BEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Services" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Passwords" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "EncryptionKeys" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Credentials" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');

ALTER TABLE "Attachment" RENAME TO "Attachments";

CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt"
FROM "Attachments";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');

BEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');

COMMIT;
`,_m={1:`\uFEFFBEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');

COMMIT;`,2:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');

COMMIT;`,3:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');

COMMIT;`,4:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');

COMMIT;`,5:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "ef_temp_Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "ef_temp_Aliases" ("Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt")
SELECT "Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt"
FROM "Aliases";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Aliases";

ALTER TABLE "ef_temp_Aliases" RENAME TO "Aliases";

COMMIT;

PRAGMA foreign_keys = 1;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');`,6:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Credentials" ("Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username")
SELECT "Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username"
FROM "Credentials";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Credentials";

ALTER TABLE "ef_temp_Credentials" RENAME TO "Credentials";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');`,7:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Services" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Passwords" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "EncryptionKeys" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Credentials" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');

COMMIT;`,8:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Attachment" RENAME TO "Attachments";

CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt"
FROM "Attachments";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');`,9:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');

COMMIT;`},zr=[{revision:1,version:"1.0.0",description:"Initial Migration",releaseVersion:"0.1.0"},{revision:2,version:"1.0.1",description:"Empty Test Migration",releaseVersion:"0.2.0"},{revision:3,version:"1.0.2",description:"Change Email Column",releaseVersion:"0.3.0"},{revision:4,version:"1.1.0",description:"Add Pki Tables",releaseVersion:"0.4.0"},{revision:5,version:"1.2.0",description:"Add Settings Table",releaseVersion:"0.4.0"},{revision:6,version:"1.3.0",description:"Update Identity Structure",releaseVersion:"0.5.0"},{revision:7,version:"1.3.1",description:"Make Username Optional",releaseVersion:"0.5.0"},{revision:8,version:"1.4.0",description:"Add Sync Support",releaseVersion:"0.6.0"},{revision:9,version:"1.4.1",description:"Rename Attachments Plural",releaseVersion:"0.6.0"},{revision:10,version:"1.5.0",description:"Add 2FA Tokens to credentials",releaseVersion:"0.14.0"}],sA=class{getCreateVaultSql(){try{return{success:!0,sqlCommands:[Mm],version:zr[zr.length-1].version,migrationNumber:zr[zr.length-1].revision}}catch(n){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:n instanceof Error?n.message:"Unknown error creating vault SQL"}}}getUpgradeVaultSql(n,r){try{const a=r??zr[zr.length-1].revision,s=zr.find(c=>c.revision===a);if(!s)return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target migration number ${a} not found`};if(n>=a)return{success:!0,sqlCommands:[],version:s.version,migrationNumber:a};const o=zr.filter(c=>c.revision>n&&c.revision<=a),u=[];for(const c of o){const d=c.revision-1,m=_m[d];m&&u.push(m)}return{success:!0,sqlCommands:u,version:s.version,migrationNumber:a}}catch(a){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:a instanceof Error?a.message:"Unknown error generating upgrade SQL"}}}getUpgradeToLatestSql(n){return this.getUpgradeVaultSql(n)}getUpgradeToVersionSql(n,r){const a=zr.find(s=>s.version===r);return a?this.getUpgradeVaultSql(n,a.revision):{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target version ${r} not found`}}getVersionCheckSql(){return["SELECT name FROM sqlite_master WHERE type='table' AND name='Settings';","SELECT Value FROM Settings WHERE Key = 'vault_version' AND IsDeleted = 0 LIMIT 1;","SELECT Value FROM Settings WHERE Key = 'vault_migration_number' AND IsDeleted = 0 LIMIT 1;"]}getVaultValidationSql(){return`SELECT name FROM sqlite_master WHERE type='table' AND name IN
            ('Aliases', 'Services', 'Credentials', 'Passwords', 'Attachments', 'EncryptionKeys', 'Settings', 'TotpCodes');`}parseVaultVersionInfo(n,r,a){let s="0.0.0",o=0;n&&(r?s=r:(s="1.0.0",o=1),a&&(o=parseInt(a,10)));const u=zr[zr.length-1],c=o<u.revision,d=zr.filter(m=>m.revision>o);return{currentVersion:s,currentMigrationNumber:o,targetVersion:u.version,targetMigrationNumber:u.revision,needsUpgrade:c,availableUpgrades:d}}validateVaultStructure(n){const r=["Aliases","Services","Credentials","Passwords","Attachments","EncryptionKeys","Settings","TotpCodes"];return n.filter(s=>r.includes(s)).length>=5}getAllVersions(){return[...zr]}getLatestVersion(){return zr[zr.length-1]}getMigrationSql(n){return _m[n]}getCompleteSchemaSql(){return Mm}};const Om="UklGRjoEAABXRUJQVlA4IC4EAAAwFwCdASqAAIAAPpFCm0olo6Ihp5IraLASCWUA0eb/0s56RrLtCnYfLPiBshdXWMx8j1Ez65f169iA4xUDBTEV6ylMQeCIj2b7RngGi7gKZ9WjKdSoy9R8JcgOmjCMlDmLG20KhNo/i/Dc/Ah5GAvGfm8kfniV3AkR6fxN6eKwjDc6xrDgSfS48G5uGV6WzQt24YAVlLSK9BMwndzfHnePK1KFchFrL7O3ulB8cGNCeomu4o+l0SrS/JKblJ4WTzj0DAD++lCUEouSfgRKdiV2TiYCD+H+l3tANKSPQFPQuzi7rbvxqGeRmXB9kDwURaoSTTpYjA9REMUi9uA6aV7PWtBNXgUzMLowYMZeos6Xvyhb34GmufswMHA5ZyYpxzjTphOak4ZjNOiz8aScO5ygiTx99SqwX/uL+HSeVOSraHw8IymrMwm+jLxqN8BS8dGcItLlm/ioulqH2j4V8glDgSut+ExkxiD7m8TGPrrjCQNJbRDzpOFsyCyfBZupvp8QjGKW2KGziSZeIWes4aTB9tRmeEBhnUrmTDZQuXcc67Fg82KHrSfaeeOEq6jjuUjQ8wUnzM4Zz3dhrwSyslVz/WvnKqYkr4V/TTXPFF5EjF4rM1bHZ8bK63EfTnK41+n3n4gEFoYP4mXkNH0hntnYcdTqiE7Gn+q0BpRRxnkpBSZlA6Wa70jpW0FGqkw5e591A5/H+OV+60WAo+4Mi+NlsKrvLZ9EiVaPnoEFZlJQx1fA777AJ2MjXJ4KSsrWDWJi1lE8yPs8V6XvcC0chDTYt8456sKXAagCZyY+fzQriFMaddXyKQdG8qBqcdYjAsiIcjzaRFBBoOK9sU+sFY7N6B6+xtrlu3c37rQKkI3O2EoiJOris54EjJ5OFuumA0M6riNUuBf/MEPFBVx1JRcUEs+upEBsCnwYski7FT3TTqHrx7v5AjgFN97xhPTkmVpu6sxRnWBi1fxIRp8eWZeFM6mUcGgVk1WeVb1yhdV9hoMo2TsNEPE0tHo/wvuSJSzbZo7wibeXM9v/rRfKcx7X93rfiXVnyQ9f/5CaAQ4lxedPp/6uzLtOS4FyL0bCNeZ6L5w+AiuyWCTDFIYaUzhwfG+/YTQpWyeZCdQIKzhV+3GeXI2cxoP0ER/DlOKymf1gm+zRU3sqf1lBVQ0y+mK/Awl9bS3uaaQmI0FUyUwHUKP7PKuXnO+LcwDv4OfPT6hph8smc1EtMe5ib/apar/qZ9dyaEaElALJ1KKxnHziuvVl8atk1fINSQh7OtXDyqbPw9o/nGIpTnv5iFmwmWJLis2oyEgPkJqyx0vYI8rjkVEzKc8eQavAJBYSpjMwM193Swt+yJyjvaGYWPnqExxKiNarpB2WSO7soCAZXhS1uEYHryrK47BH6W1dRiruqT0xpLih3MXiwU3VDwAAAA==";class Hu{constructor(){Ir(this,"db",null);Ir(this,"isInTransaction",!1)}async initializeFromBase64(r){try{const a=atob(r),s=new Uint8Array(a.length);for(let u=0;u<a.length;u++)s[u]=a.charCodeAt(u);const o=await rw({locateFile:u=>`src/${u}`});this.db=new o.Database(s)}catch(a){throw console.error("Error initializing SQLite database:",a),a}}beginTransaction(){if(!this.db)throw new Error("Database not initialized");if(this.isInTransaction)throw new Error("Transaction already in progress");try{this.db.run("BEGIN TRANSACTION"),this.isInTransaction=!0}catch(r){throw console.error("Error beginning transaction:",r),r}}async commitTransaction(){if(!this.db)throw new Error("Database not initialized");if(!this.isInTransaction)throw new Error("No transaction in progress");try{this.db.run("COMMIT"),this.isInTransaction=!1}catch(r){throw console.error("Error committing transaction:",r),r}}rollbackTransaction(){if(!this.db)throw new Error("Database not initialized");if(!this.isInTransaction)throw new Error("No transaction in progress");try{this.db.run("ROLLBACK"),this.isInTransaction=!1}catch(r){throw console.error("Error rolling back transaction:",r),r}}exportToBase64(){if(!this.db)throw new Error("Database not initialized");try{const r=this.db.export();let a="";for(let s=0;s<r.length;s++)a+=String.fromCharCode(r[s]);return btoa(a)}catch(r){throw console.error("Error exporting SQLite database:",r),r}}executeQuery(r,a=[]){if(!this.db)throw new Error("Database not initialized");try{const s=this.db.prepare(r);s.bind(a);const o=[];for(;s.step();)o.push(s.getAsObject());return s.free(),o}catch(s){throw console.error("Error executing query:",s),s}}executeUpdate(r,a=[]){if(!this.db)throw new Error("Database not initialized");try{const s=this.db.prepare(r);s.bind(a),s.step();const o=this.db.getRowsModified();return s.free(),o}catch(s){throw console.error("Error executing update:",s),s}}close(){this.db&&(this.db.close(),this.db=null)}getCredentialById(r){const s=this.executeQuery(`
        SELECT DISTINCT
            c.Id,
            c.Username,
            c.Notes,
            c.ServiceId,
            s.Name as ServiceName,
            s.Url as ServiceUrl,
            s.Logo as Logo,
            a.FirstName,
            a.LastName,
            a.NickName,
            a.BirthDate,
            a.Gender,
            a.Email,
            p.Value as Password
        FROM Credentials c
        LEFT JOIN Services s ON c.ServiceId = s.Id
        LEFT JOIN Aliases a ON c.AliasId = a.Id
        LEFT JOIN Passwords p ON p.CredentialId = c.Id
        WHERE c.IsDeleted = 0
        AND c.Id = ?`,[r]);if(s.length===0)return null;const o=s[0];return{Id:o.Id,Username:o.Username,Password:o.Password,ServiceName:o.ServiceName,ServiceUrl:o.ServiceUrl,Logo:o.Logo,Notes:o.Notes,Alias:{FirstName:o.FirstName,LastName:o.LastName,NickName:o.NickName,BirthDate:o.BirthDate,Gender:o.Gender,Email:o.Email}}}getAllCredentials(){return this.executeQuery(`
            SELECT DISTINCT
                c.Id,
                c.Username,
                c.Notes,
                c.ServiceId,
                s.Name as ServiceName,
                s.Url as ServiceUrl,
                s.Logo as Logo,
                a.FirstName,
                a.LastName,
                a.NickName,
                a.BirthDate,
                a.Gender,
                a.Email,
                p.Value as Password
            FROM Credentials c
            LEFT JOIN Services s ON c.ServiceId = s.Id
            LEFT JOIN Aliases a ON c.AliasId = a.Id
            LEFT JOIN Passwords p ON p.CredentialId = c.Id
            WHERE c.IsDeleted = 0
            ORDER BY c.CreatedAt DESC`).map(s=>({Id:s.Id,Username:s.Username,Password:s.Password,ServiceName:s.ServiceName,ServiceUrl:s.ServiceUrl,Logo:s.Logo,Notes:s.Notes,Alias:{FirstName:s.FirstName,LastName:s.LastName,NickName:s.NickName,BirthDate:s.BirthDate,Gender:s.Gender,Email:s.Email}}))}getAllEmailAddresses(){return this.executeQuery(`
      SELECT DISTINCT
        a.Email
      FROM Credentials c
      LEFT JOIN Aliases a ON c.AliasId = a.Id
      WHERE a.Email IS NOT NULL AND a.Email != '' AND c.IsDeleted = 0
    `).map(s=>s.Email)}getAllEncryptionKeys(){return this.executeQuery(`SELECT
                x.PublicKey,
                x.PrivateKey,
                x.IsPrimary
            FROM EncryptionKeys x`)}getSetting(r,a=""){const s=this.executeQuery(`SELECT
                s.Value
            FROM Settings s
            WHERE s.Key = ?`,[r]);return s.length>0?s[0].Value:a}getDefaultEmailDomain(r,a){const s=this.getSetting("DefaultEmailDomain"),o=d=>!!(d&&d!=="DISABLED.TLD"&&(r.includes(d)||a.includes(d)));if(s&&o(s))return s;const u=r.find(o);if(u)return u;const c=a.find(o);return c||null}getDefaultIdentityLanguage(){return this.getSetting("DefaultIdentityLanguage","en")}getDefaultIdentityGender(){return this.getSetting("DefaultIdentityGender","random")}getPasswordSettings(){const r=this.getSetting("PasswordGenerationSettings"),a={Length:18,UseLowercase:!0,UseUppercase:!0,UseNumbers:!0,UseSpecialChars:!0,UseNonAmbiguousChars:!1};try{if(r)return{...a,...JSON.parse(r)}}catch(s){console.warn("Failed to parse password settings:",s)}return a}async createCredential(r,a){if(!this.db)throw new Error("Database not initialized");try{this.beginTransaction();let s=null;try{if(r.Logo)if(typeof r.Logo=="object"&&!ArrayBuffer.isView(r.Logo)){const v=Object.values(r.Logo);s=new Uint8Array(v)}else(Array.isArray(r.Logo)||r.Logo instanceof ArrayBuffer||r.Logo instanceof Uint8Array)&&(s=new Uint8Array(r.Logo))}catch(v){console.warn("Failed to convert logo to Uint8Array:",v),s=null}const o=`
                INSERT INTO Services (Id, Name, Url, Logo, CreatedAt, UpdatedAt, IsDeleted)
                VALUES (?, ?, ?, ?, ?, ?, ?)`,u=crypto.randomUUID().toUpperCase(),c=new Date().toISOString().replace("T"," ").replace("Z","").substring(0,23);this.executeUpdate(o,[u,r.ServiceName,r.ServiceUrl??null,s,c,c,0]);const d=`
                INSERT INTO Aliases (Id, FirstName, LastName, NickName, BirthDate, Gender, Email, CreatedAt, UpdatedAt, IsDeleted)
                VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,m=crypto.randomUUID().toUpperCase();this.executeUpdate(d,[m,r.Alias.FirstName??null,r.Alias.LastName??null,r.Alias.NickName??null,r.Alias.BirthDate??null,r.Alias.Gender??null,r.Alias.Email??null,c,c,0]);const A=`
                INSERT INTO Credentials (Id, Username, Notes, ServiceId, AliasId, CreatedAt, UpdatedAt, IsDeleted)
                VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,b=crypto.randomUUID().toUpperCase();if(this.executeUpdate(A,[b,r.Username??null,r.Notes??null,u,m,c,c,0]),r.Password){const v=`
                    INSERT INTO Passwords (Id, Value, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
                    VALUES (?, ?, ?, ?, ?, ?)`,B=crypto.randomUUID().toUpperCase();this.executeUpdate(v,[B,r.Password,b,c,c,0])}if(a)for(const v of a){const B=`
            INSERT INTO Attachments (Id, Filename, Blob, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
            VALUES (?, ?, ?, ?, ?, ?, ?)`,T=crypto.randomUUID().toUpperCase();this.executeUpdate(B,[T,v.Filename,v.Blob,b,c,c,0])}return await this.commitTransaction(),b}catch(s){throw this.rollbackTransaction(),console.error("Error creating credential:",s),s}}getDatabaseVersion(){if(!this.db)throw new Error("Database not initialized");try{const r=this.executeQuery(`
        SELECT MigrationId
        FROM __EFMigrationsHistory
        ORDER BY MigrationId DESC
        LIMIT 1`);if(r.length===0)throw new Error("No migrations found in the database.");const a=r[0].MigrationId,o=/_(\d+\.\d+\.\d+)-/.exec(a);let u=null;o!=null&&o[1]&&(u=o[1]);const m=new sA().getAllVersions().find(A=>A.version===u);if(!m)throw new Error("This browser extension is outdated and cannot be used to access this vault. Please update this browser extension to continue.");return m}catch(r){throw console.error("Error getting database version:",r),r}}async getLatestDatabaseVersion(){const a=new sA().getAllVersions();return a[a.length-1]}async hasPendingMigrations(){try{const r=this.getDatabaseVersion(),a=await this.getLatestDatabaseVersion();return r.revision<a.revision}catch(r){throw console.error("Error checking pending migrations:",r),r}}getTotpCodesForCredential(r){if(!this.db)throw new Error("Database not initialized");try{return this.tableExists("TotpCodes")?this.executeQuery(`
        SELECT
          Id,
          Name,
          SecretKey,
          CredentialId
        FROM TotpCodes
        WHERE CredentialId = ? AND IsDeleted = 0`,[r]):[]}catch(a){return console.error("Error getting TOTP codes:",a),[]}}getAttachmentsForCredential(r){if(!this.db)throw new Error("Database not initialized");try{return this.tableExists("Attachments")?this.executeQuery(`
        SELECT
          Id,
          Filename,
          Blob,
          CredentialId,
          CreatedAt,
          UpdatedAt,
          IsDeleted
        FROM Attachments
        WHERE CredentialId = ? AND IsDeleted = 0`,[r]):[]}catch(a){return console.error("Error getting attachments:",a),[]}}async deleteCredentialById(r){if(!this.db)throw new Error("Database not initialized");try{this.beginTransaction();const a=new Date().toISOString().replace("T"," ").replace("Z","").substring(0,23),s=`
        UPDATE Credentials
        SET IsDeleted = 1,
            UpdatedAt = ?
        WHERE Id = ?`,o=`
        UPDATE Aliases
        SET IsDeleted = 1,
            UpdatedAt = ?
        WHERE Id = (
          SELECT AliasId
          FROM Credentials
          WHERE Id = ?
        )`,u=`
        UPDATE Services
        SET IsDeleted = 1,
            UpdatedAt = ?
        WHERE Id = (
          SELECT ServiceId
          FROM Credentials
          WHERE Id = ?
        )`,c=this.executeUpdate(s,[a,r]);return this.executeUpdate(o,[a,r]),this.executeUpdate(u,[a,r]),await this.commitTransaction(),c}catch(a){throw this.rollbackTransaction(),console.error("Error deleting credential:",a),a}}async updateCredentialById(r,a,s){if(!this.db)throw new Error("Database not initialized");try{this.beginTransaction();const o=new Date().toISOString().replace("T"," ").replace("Z","").substring(0,23),u=this.getCredentialById(r.Id);if(!u)throw new Error("Credential not found");const c=`
        UPDATE Services
        SET Name = ?,
            Url = ?,
            Logo = COALESCE(?, Logo),
            UpdatedAt = ?
        WHERE Id = (
          SELECT ServiceId
          FROM Credentials
          WHERE Id = ?
        )`;let d=null;try{if(r.Logo)if(typeof r.Logo=="object"&&!ArrayBuffer.isView(r.Logo)){const v=Object.values(r.Logo);d=new Uint8Array(v)}else(Array.isArray(r.Logo)||r.Logo instanceof ArrayBuffer||r.Logo instanceof Uint8Array)&&(d=new Uint8Array(r.Logo))}catch(v){console.warn("Failed to convert logo to Uint8Array:",v),d=null}this.executeUpdate(c,[r.ServiceName,r.ServiceUrl??null,d,o,r.Id]);const m=`
        UPDATE Aliases
        SET FirstName = ?,
            LastName = ?,
            NickName = ?,
            BirthDate = ?,
            Gender = ?,
            Email = ?,
            UpdatedAt = ?
        WHERE Id = (
          SELECT AliasId
          FROM Credentials
          WHERE Id = ?
        )`;let A=r.Alias.BirthDate;if(A&&u.Alias.BirthDate){const v=new Date(A),B=new Date(u.Alias.BirthDate);v.getTime()===B.getTime()&&(A=u.Alias.BirthDate)}if(this.executeUpdate(m,[r.Alias.FirstName??null,r.Alias.LastName??null,r.Alias.NickName??null,A??null,r.Alias.Gender??null,r.Alias.Email??null,o,r.Id]),this.executeUpdate(`
        UPDATE Credentials
        SET Username = ?,
            Notes = ?,
            UpdatedAt = ?
        WHERE Id = ?`,[r.Username??null,r.Notes??null,o,r.Id]),r.Password!==u.Password&&(this.executeQuery(`
          SELECT Id
          FROM Passwords
          WHERE CredentialId = ?`,[r.Id]).length===0?this.executeUpdate(`
            INSERT INTO Passwords (Id, Value, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
            VALUES (?, ?, ?, ?, ?, ?)`,[crypto.randomUUID().toUpperCase(),r.Password,r.Id,o,o,0]):this.executeUpdate(`
            UPDATE Passwords
            SET Value = ?, UpdatedAt = ?
            WHERE CredentialId = ?`,[r.Password,o,r.Id])),s){const v=s.map(T=>T.Id),B=a.filter(T=>!v.includes(T));for(const T of B)this.executeUpdate(`
            UPDATE Attachments
            SET IsDeleted = 1,
                UpdatedAt = ?
            WHERE Id = ?`,[o,T]);for(const T of s)a.includes(T.Id)||this.executeUpdate(`
              INSERT INTO Attachments (Id, Filename, Blob, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
              VALUES (?, ?, ?, ?, ?, ?, ?)`,[T.Id,T.Filename,T.Blob,r.Id,o,o,0])}return await this.commitTransaction(),1}catch(o){throw this.rollbackTransaction(),console.error("Error updating credential:",o),o}}static imgSrcFromBytes(r){if(r)try{const a=this.toUint8Array(r),s=this.base64Encode(a);return`data:${this.detectMimeType(a)};base64,${s}`}catch(a){return console.error("Error setting logo:",a),`data:image/x-icon;base64,${Om}`}else return`data:image/x-icon;base64,${Om}`}static detectMimeType(r){const a=()=>{const u=new TextDecoder().decode(r.slice(0,5)).toLowerCase();return u.includes("<?xml")||u.includes("<svg")},s=()=>r[0]===0&&r[1]===0&&r[2]===1&&r[3]===0,o=()=>r[0]===137&&r[1]===80&&r[2]===78&&r[3]===71;return a()?"image/svg+xml":s()?"image/x-icon":o()?"image/png":"image/x-icon"}static toUint8Array(r){if(r instanceof Uint8Array)return r;if(Array.isArray(r))return new Uint8Array(r);const a=Object.keys(r).length,s=new Uint8Array(a);for(let o=0;o<a;o++)s[o]=r[o];return s}static base64Encode(r){try{const a=Array.from(this.toUint8Array(r));return btoa(a.reduce((s,o)=>s+String.fromCharCode(o),""))}catch(a){return console.error("Error encoding to base64:",a),null}}tableExists(r){if(!this.db)throw new Error("Database not initialized");try{return this.executeQuery(`
        SELECT name FROM sqlite_master
        WHERE type='table' AND name=?`,[r]).length>0}catch(a){return console.error(`Error checking if table ${r} exists:`,a),!1}}executeRaw(r){if(!this.db)throw new Error("Database not initialized");try{const a=r.split(";");for(const s of a){const o=s.trim();o.length===0||o.toUpperCase().startsWith("BEGIN TRANSACTION")||o.toUpperCase().startsWith("COMMIT")||o.toUpperCase().startsWith("ROLLBACK")||this.db.run(o)}}catch(a){throw console.error("Error executing raw SQL:",a),a}}}const uy=M.createContext(void 0),nw=({children:n})=>{const[r,a]=M.useState(null),[s,o]=M.useState(!1),[u,c]=M.useState(!1),[d,m]=M.useState(null),A=M.useCallback(async(R,N)=>{const O=await Yt.symmetricDecrypt(R.vault.blob,N),_=new Hu;await _.initializeFromBase64(O),a(_),o(!0),c(!0),m({publicEmailDomains:R.vault.publicEmailDomainList,privateEmailDomains:R.vault.privateEmailDomainList,vaultRevisionNumber:R.vault.currentRevisionNumber});const q={vaultBlob:R.vault.blob,derivedKey:N,publicEmailDomainList:R.vault.publicEmailDomainList,privateEmailDomainList:R.vault.privateEmailDomainList,vaultRevisionNumber:R.vault.currentRevisionNumber};return await Dn("STORE_VAULT",q,"background"),_},[]),b=M.useCallback(async()=>{try{const R=await Dn("GET_VAULT",{},"background");if(R!=null&&R.vault){const N=new Hu;await N.initializeFromBase64(R.vault),a(N),o(!0),c(!0),m({publicEmailDomains:R.publicEmailDomains??[],privateEmailDomains:R.privateEmailDomains??[],vaultRevisionNumber:R.vaultRevisionNumber??0})}else o(!0),c(!1)}catch(R){console.error("Error retrieving vault from background:",R),o(!0),c(!1)}},[]),v=M.useCallback(async()=>d,[d]),B=M.useCallback(async R=>{m({publicEmailDomains:(d==null?void 0:d.publicEmailDomains)??[],privateEmailDomains:(d==null?void 0:d.privateEmailDomains)??[],vaultRevisionNumber:R})},[d]),T=M.useCallback(async()=>r?await r.hasPendingMigrations():!1,[r]);M.useEffect(()=>{s||b()},[s,b]);const Q=M.useCallback(()=>{a(null),o(!1),c(!1),Dn("CLEAR_VAULT",{},"background")},[]),k=M.useMemo(()=>({sqliteClient:r,dbInitialized:s,dbAvailable:u,initializeDatabase:A,clearDatabase:Q,getVaultMetadata:v,setCurrentVaultRevisionNumber:B,hasPendingMigrations:T}),[r,s,u,A,Q,v,B,T]);return p.jsx(uy.Provider,{value:k,children:n})},kr=()=>{const n=M.useContext(uy);if(n===void 0)throw new Error("useDb must be used within a DbProvider");return n},Qu="local:aliasvault_disabled_sites",Gu="local:aliasvault_global_autofill_popup_enabled",Fm="local:aliasvault_global_context_menu_enabled",Vu="local:aliasvault_vault_locked_dismiss_until",Eu="local:aliasvault_temporary_disabled_sites",cy=M.createContext(void 0),aw=({children:n})=>{const[r,a]=M.useState(!1),[s,o]=M.useState(!1),[u,c]=M.useState(null),[d,m]=M.useState(null),A=kr(),b=M.useCallback(async()=>{let R=!1;const N=await Xe.getItem("local:accessToken"),O=await Xe.getItem("local:refreshToken"),_=await Xe.getItem("local:username");return N&&O&&_&&(c(_),a(!0),R=!0),o(!0),{isLoggedIn:R}},[c,a]);M.useEffect(()=>{b()},[b]);const v=M.useCallback(async(R,N,O)=>{await Xe.setItem("local:username",R),await Xe.setItem("local:accessToken",N),await Xe.setItem("local:refreshToken",O),c(R)},[]),B=M.useCallback(async()=>{a(!0),await Xe.setItem(Vu,0)},[]),T=M.useCallback(async R=>{await Dn("CLEAR_VAULT",{},"background"),await Xe.removeItems(["local:username","local:accessToken","local:refreshToken"]),A==null||A.clearDatabase(),R&&m(R),c(null),a(!1)},[A]),Q=M.useCallback(()=>{m(null)},[]),k=M.useMemo(()=>({isLoggedIn:r,isInitialized:s,username:u,initializeAuth:b,setAuthTokens:v,login:B,logout:T,globalMessage:d,clearGlobalMessage:Q}),[r,s,u,b,d,v,B,T,Q]);return p.jsx(cy.Provider,{value:k,children:n})},Yn=()=>{const n=M.useContext(cy);if(n===void 0)throw new Error("useAuth must be used within an AuthProvider");return n},iw=({routes:n=[],rightButtons:r})=>{const{t:a}=Bt(),s=Yn(),o=Rr(),u=zn(),c=n==null?void 0:n.find(A=>{const b=A.path.replace(/:\w+/g,"[^/]+");return new RegExp(`^${b}$`).test(u.pathname)}),d=()=>{o("/auth-settings")},m=()=>{u.pathname==="/upgrade"||u.pathname==="/login"||u.pathname==="/unlock"||(s.isLoggedIn?o("/credentials"):o("/"))};return p.jsx("header",{className:"fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700",children:p.jsxs("div",{className:"flex items-center h-16 px-4",children:[c!=null&&c.showBackButton?p.jsx("button",{id:"back",onClick:()=>o(-1),className:"flex items-center gap-2 hover:bg-gray-100 dark:hover:bg-gray-700 pr-2 pt-1.5 pb-1.5 rounded-lg group",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("svg",{className:"w-5 h-5 text-gray-500 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),c.title&&p.jsx("h1",{className:"text-lg font-medium text-gray-900 dark:text-white ml-2",children:c.title})]})}):p.jsx("div",{className:"flex items-center",children:p.jsxs("button",{onClick:()=>m(),className:"flex items-center hover:opacity-80 transition-opacity",children:[p.jsx("img",{src:"/assets/images/logo.svg",alt:"AliasVault",className:"h-8 w-8 mr-2"}),p.jsx("h1",{className:"text-gray-900 dark:text-white text-xl font-bold",children:a("common.appName")}),p.jsx("span",{className:"text-primary-500 text-[10px] ml-1 font-normal",children:"BETA"})]})}),p.jsx("div",{className:"flex-grow"}),p.jsx("div",{className:"flex items-center gap-2",children:s.isLoggedIn?r:p.jsxs(p.Fragment,{children:[r,p.jsxs("button",{id:"settings",onClick:d,className:"p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",children:[p.jsx("span",{className:"sr-only",children:a("common.settings")}),p.jsx("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})]})]})})]})})},Ps=()=>{const n={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},r=p.jsxs(p.Fragment,{children:[p.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),p.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:n})]});return p.jsx("div",{className:"inline-flex items-center",children:r})},dy=M.createContext(void 0),sw=({children:n})=>{const[r,a]=M.useState(null),s=M.useCallback(u=>{a(u)},[]),o=M.useMemo(()=>({setHeaderButtons:s,headerButtons:r}),[s,r]);return p.jsx(dy.Provider,{value:o,children:n})},ca=()=>{const n=M.useContext(dy);if(n===void 0)throw new Error("useHeaderButtons must be used within a HeaderButtonsProvider");return n},lw=()=>{const{isLoading:n}=yn();if(!n)return null;const r={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},a=p.jsxs(p.Fragment,{children:[p.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),p.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:r})]});return p.jsx("div",{className:"fixed inset-0 w-full h-full z-50 bg-gray-200 dark:bg-gray-500 bg-opacity-90 flex items-center justify-center",children:p.jsx("div",{className:"relative",children:a})})},fy=M.createContext(void 0),ow=({children:n})=>{const[r,a]=M.useState(!0),[s,o]=M.useState(!1),[u,c]=M.useState(void 0),d=b=>{o(!0),c(b)},m=()=>{o(!1),c(void 0)},A=M.useMemo(()=>({isLoading:s,loadingMessage:u,showLoading:d,hideLoading:m,isInitialLoading:r,setIsInitialLoading:a}),[s,u,r]);return p.jsxs(fy.Provider,{value:A,children:[p.jsx(lw,{message:u}),n]})},yn=()=>{const n=M.useContext(fy);if(n===void 0)throw new Error("useLoading must be used within a LoadingProvider");return n},uw="session:lastVisitedPage",cw="session:lastVisitedTime",dw="session:navigationHistory",Ay=M.createContext(void 0),fw=({children:n})=>{const r=zn(),{isInitialized:a,isLoggedIn:s}=Yn(),{dbInitialized:o,dbAvailable:u,upgradeRequired:c}=kr(),d=a&&o,m=d&&(!s||!u&&!c),A=M.useCallback(async()=>{if(d&&!m&&!["/","/reinitialize","/login","/unlock","/unlock-success","/auth-settings","/upgrade","/logout"].includes(r.pathname)){const B=r.pathname.split("/").filter(Boolean),T=[];let Q="";for(const k of B)Q+="/"+k,T.push({pathname:Q,search:r.search,hash:r.hash});await Promise.all([Xe.setItem(uw,r.pathname),Xe.setItem(cw,Date.now()),Xe.setItem(dw,T)])}},[r,d,m]);M.useEffect(()=>{d&&A()},[r.pathname,r.search,r.hash,d,A]);const b=M.useMemo(()=>({storeCurrentPage:A,isFullyInitialized:d,requiresAuth:m}),[A,d,m]);return p.jsx(Ay.Provider,{value:b,children:n})},Aw=()=>{const n=M.useContext(Ay);if(n===void 0)throw new Error("useNavigation must be used within a NavigationProvider");return n};var Lf,jm;function hw(){if(jm)return Lf;jm=1;function n(N){this._maxSize=N,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(N){return this._values[N]},n.prototype.set=function(N,O){return this._size>=this._maxSize&&this.clear(),N in this._values||this._size++,this._values[N]=O};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,a=/^\d+$/,s=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,u=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,d=new n(c),m=new n(c),A=new n(c);Lf={Cache:n,split:v,normalizePath:b,setter:function(N){var O=b(N);return m.get(N)||m.set(N,function(q,V){for(var ge=0,ce=O.length,te=q;ge<ce-1;){var J=O[ge];if(J==="__proto__"||J==="constructor"||J==="prototype")return q;te=te[O[ge++]]}te[O[ge]]=V})},getter:function(N,O){var _=b(N);return A.get(N)||A.set(N,function(V){for(var ge=0,ce=_.length;ge<ce;)if(V!=null||!O)V=V[_[ge++]];else return;return V})},join:function(N){return N.reduce(function(O,_){return O+(T(_)||a.test(_)?"["+_+"]":(O?".":"")+_)},"")},forEach:function(N,O,_){B(Array.isArray(N)?N:v(N),O,_)}};function b(N){return d.get(N)||d.set(N,v(N).map(function(O){return O.replace(u,"$2")}))}function v(N){return N.match(r)||[""]}function B(N,O,_){var q=N.length,V,ge,ce,te;for(ge=0;ge<q;ge++)V=N[ge],V&&(R(V)&&(V='"'+V+'"'),te=T(V),ce=!te&&/^\d+$/.test(V),O.call(_,V,te,ce,ge,N))}function T(N){return typeof N=="string"&&N&&["'",'"'].indexOf(N.charAt(0))!==-1}function Q(N){return N.match(s)&&!N.match(a)}function k(N){return o.test(N)}function R(N){return!T(N)&&(Q(N)||k(N))}return Lf}var $i=hw(),Uf,Hm;function gw(){if(Hm)return Uf;Hm=1;const n=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=b=>b.match(n)||[],a=b=>b[0].toUpperCase()+b.slice(1),s=(b,v)=>r(b).join(v).toLowerCase(),o=b=>r(b).reduce((v,B)=>`${v}${v?B[0].toUpperCase()+B.slice(1).toLowerCase():B.toLowerCase()}`,"");return Uf={words:r,upperFirst:a,camelCase:o,pascalCase:b=>a(o(b)),snakeCase:b=>s(b,"_"),kebabCase:b=>s(b,"-"),sentenceCase:b=>a(s(b," ")),titleCase:b=>r(b).map(a).join(" ")},Uf}var Mf=gw(),bu={exports:{}},Gm;function mw(){if(Gm)return bu.exports;Gm=1,bu.exports=function(o){return n(r(o),o)},bu.exports.array=n;function n(o,u){var c=o.length,d=new Array(c),m={},A=c,b=a(u),v=s(o);for(u.forEach(function(T){if(!v.has(T[0])||!v.has(T[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});A--;)m[A]||B(o[A],A,new Set);return d;function B(T,Q,k){if(k.has(T)){var R;try{R=", node was:"+JSON.stringify(T)}catch{R=""}throw new Error("Cyclic dependency"+R)}if(!v.has(T))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(T));if(!m[Q]){m[Q]=!0;var N=b.get(T)||new Set;if(N=Array.from(N),Q=N.length){k.add(T);do{var O=N[--Q];B(O,v.get(O),k)}while(Q);k.delete(T)}d[--c]=T}}}function r(o){for(var u=new Set,c=0,d=o.length;c<d;c++){var m=o[c];u.add(m[0]),u.add(m[1])}return Array.from(u)}function a(o){for(var u=new Map,c=0,d=o.length;c<d;c++){var m=o[c];u.has(m[0])||u.set(m[0],new Set),u.has(m[1])||u.set(m[1],new Set),u.get(m[0]).add(m[1])}return u}function s(o){for(var u=new Map,c=0,d=o.length;c<d;c++)u.set(o[c],c);return u}return bu.exports}var pw=mw();const yw=xi(pw),Ew=Object.prototype.toString,bw=Error.prototype.toString,vw=RegExp.prototype.toString,xw=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Cw=/^Symbol\((.*)\)(.*)$/;function ww(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function Vm(n,r=!1){if(n==null||n===!0||n===!1)return""+n;const a=typeof n;if(a==="number")return ww(n);if(a==="string")return r?`"${n}"`:n;if(a==="function")return"[Function "+(n.name||"anonymous")+"]";if(a==="symbol")return xw.call(n).replace(Cw,"Symbol($1)");const s=Ew.call(n).slice(8,-1);return s==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):s==="Error"||n instanceof Error?"["+bw.call(n)+"]":s==="RegExp"?vw.call(n):null}function vi(n,r){let a=Vm(n,r);return a!==null?a:JSON.stringify(n,function(s,o){let u=Vm(this[s],r);return u!==null?u:o},2)}function hy(n){return n==null?[]:[].concat(n)}let gy,my,py,Iw=/\$\{\s*(\w+)\s*\}/g;gy=Symbol.toStringTag;class qm{constructor(r,a,s,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[gy]="Error",this.name="ValidationError",this.value=a,this.path=s,this.type=o,this.errors=[],this.inner=[],hy(r).forEach(u=>{if(jr.isError(u)){this.errors.push(...u.errors);const c=u.inner.length?u.inner:[u];this.inner.push(...c)}else this.errors.push(u)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}my=Symbol.hasInstance;py=Symbol.toStringTag;class jr extends Error{static formatError(r,a){const s=a.label||a.path||"this";return a=Object.assign({},a,{path:s,originalPath:a.path}),typeof r=="string"?r.replace(Iw,(o,u)=>vi(a[u])):typeof r=="function"?r(a):r}static isError(r){return r&&r.name==="ValidationError"}constructor(r,a,s,o,u){const c=new qm(r,a,s,o);if(u)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[py]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,jr)}static[my](r){return qm[Symbol.hasInstance](r)||super[Symbol.hasInstance](r)}}let ia={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:r,value:a,originalValue:s})=>{const o=s!=null&&s!==a?` (cast from the value \`${vi(s,!0)}\`).`:".";return r!=="mixed"?`${n} must be a \`${r}\` type, but the final value was: \`${vi(a,!0)}\``+o:`${n} must match the configured type. The validated value was: \`${vi(a,!0)}\``+o}},rn={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Bw={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},lA={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Sw={isValue:"${path} field must be ${value}"},Du={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Nw={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Tw={notType:n=>{const{path:r,value:a,spec:s}=n,o=s.types.length;if(Array.isArray(a)){if(a.length<o)return`${r} tuple value has too few items, expected a length of ${o} but got ${a.length} for value: \`${vi(a,!0)}\``;if(a.length>o)return`${r} tuple value has too many items, expected a length of ${o} but got ${a.length} for value: \`${vi(a,!0)}\``}return jr.formatError(ia.notType,n)}};Object.assign(Object.create(null),{mixed:ia,string:rn,number:Bw,date:lA,object:Du,array:Nw,boolean:Sw,tuple:Tw});const wA=n=>n&&n.__isYupSchema__;class qu{static fromOptions(r,a){if(!a.then&&!a.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:o,otherwise:u}=a,c=typeof s=="function"?s:(...d)=>d.every(m=>m===s);return new qu(r,(d,m)=>{var A;let b=c(...d)?o:u;return(A=b==null?void 0:b(m))!=null?A:m})}constructor(r,a){this.fn=void 0,this.refs=r,this.refs=r,this.fn=a}resolve(r,a){let s=this.refs.map(u=>u.getValue(a==null?void 0:a.value,a==null?void 0:a.parent,a==null?void 0:a.context)),o=this.fn(s,r,a);if(o===void 0||o===r)return r;if(!wA(o))throw new TypeError("conditions must return a schema object");return o.resolve(a)}}const vu={context:"$",value:"."};class Zi{constructor(r,a={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof r!="string")throw new TypeError("ref must be a string, got: "+r);if(this.key=r.trim(),r==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===vu.context,this.isValue=this.key[0]===vu.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?vu.context:this.isValue?vu.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&$i.getter(this.path,!0),this.map=a.map}getValue(r,a,s){let o=this.isContext?s:this.isValue?r:a;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(r,a){return this.getValue(r,a==null?void 0:a.parent,a==null?void 0:a.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(r){return r&&r.__isYupRef}}Zi.prototype.__isYupRef=!0;const Pi=n=>n==null;function _s(n){function r({value:a,path:s="",options:o,originalValue:u,schema:c},d,m){const{name:A,test:b,params:v,message:B,skipAbsent:T}=n;let{parent:Q,context:k,abortEarly:R=c.spec.abortEarly,disableStackTrace:N=c.spec.disableStackTrace}=o;function O($){return Zi.isRef($)?$.getValue(a,Q,k):$}function _($={}){const me=Object.assign({value:a,originalValue:u,label:c.spec.label,path:$.path||s,spec:c.spec,disableStackTrace:$.disableStackTrace||N},v,$.params);for(const we of Object.keys(me))me[we]=O(me[we]);const he=new jr(jr.formatError($.message||B,me),a,me.path,$.type||A,me.disableStackTrace);return he.params=me,he}const q=R?d:m;let V={path:s,parent:Q,type:A,from:o.from,createError:_,resolve:O,options:o,originalValue:u,schema:c};const ge=$=>{jr.isError($)?q($):$?m(null):q(_())},ce=$=>{jr.isError($)?q($):d($)};if(T&&Pi(a))return ge(!0);let J;try{var K;if(J=b.call(V,a,V),typeof((K=J)==null?void 0:K.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${V.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(J).then(ge,ce)}}catch($){ce($);return}ge(J)}return r.OPTIONS=n,r}function Qw(n,r,a,s=a){let o,u,c;return r?($i.forEach(r,(d,m,A)=>{let b=m?d.slice(1,d.length-1):d;n=n.resolve({context:s,parent:o,value:a});let v=n.type==="tuple",B=A?parseInt(b,10):0;if(n.innerType||v){if(v&&!A)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(a&&B>=a.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${d}, in the path: ${r}. because there is no value at that index. `);o=a,a=a&&a[B],n=v?n.spec.types[B]:n.innerType}if(!A){if(!n.fields||!n.fields[b])throw new Error(`The schema does not contain the path: ${r}. (failed at: ${c} which is a type: "${n.type}")`);o=a,a=a&&a[b],n=n.fields[b]}u=b,c=m?"["+d+"]":"."+d}),{schema:n,parent:o,parentPath:u}):{parent:o,parentPath:r,schema:n}}class zu extends Set{describe(){const r=[];for(const a of this.values())r.push(Zi.isRef(a)?a.describe():a);return r}resolveAll(r){let a=[];for(const s of this.values())a.push(r(s));return a}clone(){return new zu(this.values())}merge(r,a){const s=this.clone();return r.forEach(o=>s.add(o)),a.forEach(o=>s.delete(o)),s}}function Gs(n,r=new Map){if(wA(n)||!n||typeof n!="object")return n;if(r.has(n))return r.get(n);let a;if(n instanceof Date)a=new Date(n.getTime()),r.set(n,a);else if(n instanceof RegExp)a=new RegExp(n),r.set(n,a);else if(Array.isArray(n)){a=new Array(n.length),r.set(n,a);for(let s=0;s<n.length;s++)a[s]=Gs(n[s],r)}else if(n instanceof Map){a=new Map,r.set(n,a);for(const[s,o]of n.entries())a.set(s,Gs(o,r))}else if(n instanceof Set){a=new Set,r.set(n,a);for(const s of n)a.add(Gs(s,r))}else if(n instanceof Object){a={},r.set(n,a);for(const[s,o]of Object.entries(n))a[s]=Gs(o,r)}else throw Error(`Unable to clone ${n}`);return a}class ua{constructor(r){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new zu,this._blacklist=new zu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ia.notType)}),this.type=r.type,this._typeCheck=r.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},r==null?void 0:r.spec),this.withMutation(a=>{a.nonNullable()})}get _type(){return this.type}clone(r){if(this._mutate)return r&&Object.assign(this.spec,r),this;const a=Object.create(Object.getPrototypeOf(this));return a.type=this.type,a._typeCheck=this._typeCheck,a._whitelist=this._whitelist.clone(),a._blacklist=this._blacklist.clone(),a.internalTests=Object.assign({},this.internalTests),a.exclusiveTests=Object.assign({},this.exclusiveTests),a.deps=[...this.deps],a.conditions=[...this.conditions],a.tests=[...this.tests],a.transforms=[...this.transforms],a.spec=Gs(Object.assign({},this.spec,r)),a}label(r){let a=this.clone();return a.spec.label=r,a}meta(...r){if(r.length===0)return this.spec.meta;let a=this.clone();return a.spec.meta=Object.assign(a.spec.meta||{},r[0]),a}withMutation(r){let a=this._mutate;this._mutate=!0;let s=r(this);return this._mutate=a,s}concat(r){if(!r||r===this)return this;if(r.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${r.type}`);let a=this,s=r.clone();const o=Object.assign({},a.spec,s.spec);return s.spec=o,s.internalTests=Object.assign({},a.internalTests,s.internalTests),s._whitelist=a._whitelist.merge(r._whitelist,r._blacklist),s._blacklist=a._blacklist.merge(r._blacklist,r._whitelist),s.tests=a.tests,s.exclusiveTests=a.exclusiveTests,s.withMutation(u=>{r.tests.forEach(c=>{u.test(c.OPTIONS)})}),s.transforms=[...a.transforms,...s.transforms],s}isType(r){return r==null?!!(this.spec.nullable&&r===null||this.spec.optional&&r===void 0):this._typeCheck(r)}resolve(r){let a=this;if(a.conditions.length){let s=a.conditions;a=a.clone(),a.conditions=[],a=s.reduce((o,u)=>u.resolve(o,r),a),a=a.resolve(r)}return a}resolveOptions(r){var a,s,o,u;return Object.assign({},r,{from:r.from||[],strict:(a=r.strict)!=null?a:this.spec.strict,abortEarly:(s=r.abortEarly)!=null?s:this.spec.abortEarly,recursive:(o=r.recursive)!=null?o:this.spec.recursive,disableStackTrace:(u=r.disableStackTrace)!=null?u:this.spec.disableStackTrace})}cast(r,a={}){let s=this.resolve(Object.assign({value:r},a)),o=a.assert==="ignore-optionality",u=s._cast(r,a);if(a.assert!==!1&&!s.isType(u)){if(o&&Pi(u))return u;let c=vi(r),d=vi(u);throw new TypeError(`The value of ${a.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}". 

attempted value: ${c} 
`+(d!==c?`result of cast: ${d}`:""))}return u}_cast(r,a){let s=r===void 0?r:this.transforms.reduce((o,u)=>u.call(this,o,r,this),r);return s===void 0&&(s=this.getDefault(a)),s}_validate(r,a={},s,o){let{path:u,originalValue:c=r,strict:d=this.spec.strict}=a,m=r;d||(m=this._cast(m,Object.assign({assert:!1},a)));let A=[];for(let b of Object.values(this.internalTests))b&&A.push(b);this.runTests({path:u,value:m,originalValue:c,options:a,tests:A},s,b=>{if(b.length)return o(b,m);this.runTests({path:u,value:m,originalValue:c,options:a,tests:this.tests},s,o)})}runTests(r,a,s){let o=!1,{tests:u,value:c,originalValue:d,path:m,options:A}=r,b=k=>{o||(o=!0,a(k,c))},v=k=>{o||(o=!0,s(k,c))},B=u.length,T=[];if(!B)return v([]);let Q={value:c,originalValue:d,path:m,options:A,schema:this};for(let k=0;k<u.length;k++){const R=u[k];R(Q,b,function(O){O&&(Array.isArray(O)?T.push(...O):T.push(O)),--B<=0&&v(T)})}}asNestedTest({key:r,index:a,parent:s,parentPath:o,originalParent:u,options:c}){const d=r??a;if(d==null)throw TypeError("Must include `key` or `index` for nested validations");const m=typeof d=="number";let A=s[d];const b=Object.assign({},c,{strict:!0,parent:s,value:A,originalValue:u[d],key:void 0,[m?"index":"key"]:d,path:m||d.includes(".")?`${o||""}[${m?d:`"${d}"`}]`:(o?`${o}.`:"")+r});return(v,B,T)=>this.resolve(b)._validate(A,b,B,T)}validate(r,a){var s;let o=this.resolve(Object.assign({},a,{value:r})),u=(s=a==null?void 0:a.disableStackTrace)!=null?s:o.spec.disableStackTrace;return new Promise((c,d)=>o._validate(r,a,(m,A)=>{jr.isError(m)&&(m.value=A),d(m)},(m,A)=>{m.length?d(new jr(m,A,void 0,void 0,u)):c(A)}))}validateSync(r,a){var s;let o=this.resolve(Object.assign({},a,{value:r})),u,c=(s=a==null?void 0:a.disableStackTrace)!=null?s:o.spec.disableStackTrace;return o._validate(r,Object.assign({},a,{sync:!0}),(d,m)=>{throw jr.isError(d)&&(d.value=m),d},(d,m)=>{if(d.length)throw new jr(d,r,void 0,void 0,c);u=m}),u}isValid(r,a){return this.validate(r,a).then(()=>!0,s=>{if(jr.isError(s))return!1;throw s})}isValidSync(r,a){try{return this.validateSync(r,a),!0}catch(s){if(jr.isError(s))return!1;throw s}}_getDefault(r){let a=this.spec.default;return a==null?a:typeof a=="function"?a.call(this,r):Gs(a)}getDefault(r){return this.resolve(r||{})._getDefault(r)}default(r){return arguments.length===0?this._getDefault():this.clone({default:r})}strict(r=!0){return this.clone({strict:r})}nullability(r,a){const s=this.clone({nullable:r});return s.internalTests.nullable=_s({message:a,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),s}optionality(r,a){const s=this.clone({optional:r});return s.internalTests.optionality=_s({message:a,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(r=ia.defined){return this.optionality(!1,r)}nullable(){return this.nullability(!0)}nonNullable(r=ia.notNull){return this.nullability(!1,r)}required(r=ia.required){return this.clone().withMutation(a=>a.nonNullable(r).defined(r))}notRequired(){return this.clone().withMutation(r=>r.nullable().optional())}transform(r){let a=this.clone();return a.transforms.push(r),a}test(...r){let a;if(r.length===1?typeof r[0]=="function"?a={test:r[0]}:a=r[0]:r.length===2?a={name:r[0],test:r[1]}:a={name:r[0],message:r[1],test:r[2]},a.message===void 0&&(a.message=ia.default),typeof a.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),o=_s(a),u=a.exclusive||a.name&&s.exclusiveTests[a.name]===!0;if(a.exclusive&&!a.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return a.name&&(s.exclusiveTests[a.name]=!!a.exclusive),s.tests=s.tests.filter(c=>!(c.OPTIONS.name===a.name&&(u||c.OPTIONS.test===o.OPTIONS.test))),s.tests.push(o),s}when(r,a){!Array.isArray(r)&&typeof r!="string"&&(a=r,r=".");let s=this.clone(),o=hy(r).map(u=>new Zi(u));return o.forEach(u=>{u.isSibling&&s.deps.push(u.key)}),s.conditions.push(typeof a=="function"?new qu(o,a):qu.fromOptions(o,a)),s}typeError(r){let a=this.clone();return a.internalTests.typeError=_s({message:r,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),a}oneOf(r,a=ia.oneOf){let s=this.clone();return r.forEach(o=>{s._whitelist.add(o),s._blacklist.delete(o)}),s.internalTests.whiteList=_s({message:a,name:"oneOf",skipAbsent:!0,test(o){let u=this.schema._whitelist,c=u.resolveAll(this.resolve);return c.includes(o)?!0:this.createError({params:{values:Array.from(u).join(", "),resolved:c}})}}),s}notOneOf(r,a=ia.notOneOf){let s=this.clone();return r.forEach(o=>{s._blacklist.add(o),s._whitelist.delete(o)}),s.internalTests.blacklist=_s({message:a,name:"notOneOf",test(o){let u=this.schema._blacklist,c=u.resolveAll(this.resolve);return c.includes(o)?this.createError({params:{values:Array.from(u).join(", "),resolved:c}}):!0}}),s}strip(r=!0){let a=this.clone();return a.spec.strip=r,a}describe(r){const a=(r?this.resolve(r):this).clone(),{label:s,meta:o,optional:u,nullable:c}=a.spec;return{meta:o,label:s,optional:u,nullable:c,default:a.getDefault(r),type:a.type,oneOf:a._whitelist.describe(),notOneOf:a._blacklist.describe(),tests:a.tests.map(m=>({name:m.OPTIONS.name,params:m.OPTIONS.params})).filter((m,A,b)=>b.findIndex(v=>v.name===m.name)===A)}}}ua.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])ua.prototype[`${n}At`]=function(r,a,s={}){const{parent:o,parentPath:u,schema:c}=Qw(this,r,a,s.context);return c[n](o&&o[u],Object.assign({},s,{parent:o,path:r}))};for(const n of["equals","is"])ua.prototype[n]=ua.prototype.oneOf;for(const n of["not","nope"])ua.prototype[n]=ua.prototype.notOneOf;const Dw=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Rw(n){const r=oA(n);if(!r)return Date.parse?Date.parse(n):Number.NaN;if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let a=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(a=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(a=0-a)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+a,r.second,r.millisecond)}function oA(n){var r,a;const s=Dw.exec(n);return s?{year:Qa(s[1]),month:Qa(s[2],1)-1,day:Qa(s[3],1),hour:Qa(s[4]),minute:Qa(s[5]),second:Qa(s[6]),millisecond:s[7]?Qa(s[7].substring(0,3)):0,precision:(r=(a=s[7])==null?void 0:a.length)!=null?r:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Qa(s[10]),minuteOffset:Qa(s[11])}:null}function Qa(n,r=0){return Number(n)||r}let kw=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Lw=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Uw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Mw="^\\d{4}-\\d{2}-\\d{2}",_w="\\d{2}:\\d{2}:\\d{2}",Ow="(([+-]\\d{2}(:?\\d{2})?)|Z)",Fw=new RegExp(`${Mw}T${_w}(\\.\\d+)?${Ow}$`),jw=n=>Pi(n)||n===n.trim(),Hw={}.toString();function Yr(){return new yy}class yy extends ua{constructor(){super({type:"string",check(r){return r instanceof String&&(r=r.valueOf()),typeof r=="string"}}),this.withMutation(()=>{this.transform((r,a,s)=>{if(!s.spec.coerce||s.isType(r)||Array.isArray(r))return r;const o=r!=null&&r.toString?r.toString():r;return o===Hw?r:o})})}required(r){return super.required(r).withMutation(a=>a.test({message:r||ia.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(r=>(r.tests=r.tests.filter(a=>a.OPTIONS.name!=="required"),r))}length(r,a=rn.length){return this.test({message:a,name:"length",exclusive:!0,params:{length:r},skipAbsent:!0,test(s){return s.length===this.resolve(r)}})}min(r,a=rn.min){return this.test({message:a,name:"min",exclusive:!0,params:{min:r},skipAbsent:!0,test(s){return s.length>=this.resolve(r)}})}max(r,a=rn.max){return this.test({name:"max",exclusive:!0,message:a,params:{max:r},skipAbsent:!0,test(s){return s.length<=this.resolve(r)}})}matches(r,a){let s=!1,o,u;return a&&(typeof a=="object"?{excludeEmptyString:s=!1,message:o,name:u}=a:o=a),this.test({name:u||"matches",message:o||rn.matches,params:{regex:r},skipAbsent:!0,test:c=>c===""&&s||c.search(r)!==-1})}email(r=rn.email){return this.matches(kw,{name:"email",message:r,excludeEmptyString:!0})}url(r=rn.url){return this.matches(Lw,{name:"url",message:r,excludeEmptyString:!0})}uuid(r=rn.uuid){return this.matches(Uw,{name:"uuid",message:r,excludeEmptyString:!1})}datetime(r){let a="",s,o;return r&&(typeof r=="object"?{message:a="",allowOffset:s=!1,precision:o=void 0}=r:a=r),this.matches(Fw,{name:"datetime",message:a||rn.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:a||rn.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:u=>{if(!u||s)return!0;const c=oA(u);return c?!!c.z:!1}}).test({name:"datetime_precision",message:a||rn.datetime_precision,params:{precision:o},skipAbsent:!0,test:u=>{if(!u||o==null)return!0;const c=oA(u);return c?c.precision===o:!1}})}ensure(){return this.default("").transform(r=>r===null?"":r)}trim(r=rn.trim){return this.transform(a=>a!=null?a.trim():a).test({message:r,name:"trim",test:jw})}lowercase(r=rn.lowercase){return this.transform(a=>Pi(a)?a:a.toLowerCase()).test({message:r,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>Pi(a)||a===a.toLowerCase()})}uppercase(r=rn.uppercase){return this.transform(a=>Pi(a)?a:a.toUpperCase()).test({message:r,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>Pi(a)||a===a.toUpperCase()})}}Yr.prototype=yy.prototype;let Gw=new Date(""),Vw=n=>Object.prototype.toString.call(n)==="[object Date]";class IA extends ua{constructor(){super({type:"date",check(r){return Vw(r)&&!isNaN(r.getTime())}}),this.withMutation(()=>{this.transform((r,a,s)=>!s.spec.coerce||s.isType(r)||r===null?r:(r=Rw(r),isNaN(r)?IA.INVALID_DATE:new Date(r)))})}prepareParam(r,a){let s;if(Zi.isRef(r))s=r;else{let o=this.cast(r);if(!this._typeCheck(o))throw new TypeError(`\`${a}\` must be a Date or a value that can be \`cast()\` to a Date`);s=o}return s}min(r,a=lA.min){let s=this.prepareParam(r,"min");return this.test({message:a,name:"min",exclusive:!0,params:{min:r},skipAbsent:!0,test(o){return o>=this.resolve(s)}})}max(r,a=lA.max){let s=this.prepareParam(r,"max");return this.test({message:a,name:"max",exclusive:!0,params:{max:r},skipAbsent:!0,test(o){return o<=this.resolve(s)}})}}IA.INVALID_DATE=Gw;function qw(n,r=[]){let a=[],s=new Set,o=new Set(r.map(([c,d])=>`${c}-${d}`));function u(c,d){let m=$i.split(c)[0];s.add(m),o.has(`${d}-${m}`)||a.push([d,m])}for(const c of Object.keys(n)){let d=n[c];s.add(c),Zi.isRef(d)&&d.isSibling?u(d.path,c):wA(d)&&"deps"in d&&d.deps.forEach(m=>u(m,c))}return yw.array(Array.from(s),a).reverse()}function zm(n,r){let a=1/0;return n.some((s,o)=>{var u;if((u=r.path)!=null&&u.includes(s))return a=o,!0}),a}function Ey(n){return(r,a)=>zm(n,r)-zm(n,a)}const zw=(n,r,a)=>{if(typeof n!="string")return n;let s=n;try{s=JSON.parse(n)}catch{}return a.isType(s)?s:n};function Ru(n){if("fields"in n){const r={};for(const[a,s]of Object.entries(n.fields))r[a]=Ru(s);return n.setFields(r)}if(n.type==="array"){const r=n.optional();return r.innerType&&(r.innerType=Ru(r.innerType)),r}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(Ru)}):"optional"in n?n.optional():n}const Yw=(n,r)=>{const a=[...$i.normalizePath(r)];if(a.length===1)return a[0]in n;let s=a.pop(),o=$i.getter($i.join(a),!0)(n);return!!(o&&s in o)};let Ym=n=>Object.prototype.toString.call(n)==="[object Object]";function Pm(n,r){let a=Object.keys(n.fields);return Object.keys(r).filter(s=>a.indexOf(s)===-1)}const Pw=Ey([]);function Yu(n){return new by(n)}class by extends ua{constructor(r){super({type:"object",check(a){return Ym(a)||typeof a=="function"}}),this.fields=Object.create(null),this._sortErrors=Pw,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{r&&this.shape(r)})}_cast(r,a={}){var s;let o=super._cast(r,a);if(o===void 0)return this.getDefault(a);if(!this._typeCheck(o))return o;let u=this.fields,c=(s=a.stripUnknown)!=null?s:this.spec.noUnknown,d=[].concat(this._nodes,Object.keys(o).filter(v=>!this._nodes.includes(v))),m={},A=Object.assign({},a,{parent:m,__validating:a.__validating||!1}),b=!1;for(const v of d){let B=u[v],T=v in o;if(B){let Q,k=o[v];A.path=(a.path?`${a.path}.`:"")+v,B=B.resolve({value:k,context:a.context,parent:m});let R=B instanceof ua?B.spec:void 0,N=R==null?void 0:R.strict;if(R!=null&&R.strip){b=b||v in o;continue}Q=!a.__validating||!N?B.cast(o[v],A):o[v],Q!==void 0&&(m[v]=Q)}else T&&!c&&(m[v]=o[v]);(T!==v in m||m[v]!==o[v])&&(b=!0)}return b?m:o}_validate(r,a={},s,o){let{from:u=[],originalValue:c=r,recursive:d=this.spec.recursive}=a;a.from=[{schema:this,value:c},...u],a.__validating=!0,a.originalValue=c,super._validate(r,a,s,(m,A)=>{if(!d||!Ym(A)){o(m,A);return}c=c||A;let b=[];for(let v of this._nodes){let B=this.fields[v];!B||Zi.isRef(B)||b.push(B.asNestedTest({options:a,key:v,parent:A,parentPath:a.path,originalParent:c}))}this.runTests({tests:b,value:A,originalValue:c,options:a},s,v=>{o(v.sort(this._sortErrors).concat(m),A)})})}clone(r){const a=super.clone(r);return a.fields=Object.assign({},this.fields),a._nodes=this._nodes,a._excludedEdges=this._excludedEdges,a._sortErrors=this._sortErrors,a}concat(r){let a=super.concat(r),s=a.fields;for(let[o,u]of Object.entries(this.fields)){const c=s[o];s[o]=c===void 0?u:c}return a.withMutation(o=>o.setFields(s,[...this._excludedEdges,...r._excludedEdges]))}_getDefault(r){if("default"in this.spec)return super._getDefault(r);if(!this._nodes.length)return;let a={};return this._nodes.forEach(s=>{var o;const u=this.fields[s];let c=r;(o=c)!=null&&o.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[s]})),a[s]=u&&"getDefault"in u?u.getDefault(c):void 0}),a}setFields(r,a){let s=this.clone();return s.fields=r,s._nodes=qw(r,a),s._sortErrors=Ey(Object.keys(r)),a&&(s._excludedEdges=a),s}shape(r,a=[]){return this.clone().withMutation(s=>{let o=s._excludedEdges;return a.length&&(Array.isArray(a[0])||(a=[a]),o=[...s._excludedEdges,...a]),s.setFields(Object.assign(s.fields,r),o)})}partial(){const r={};for(const[a,s]of Object.entries(this.fields))r[a]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(r)}deepPartial(){return Ru(this)}pick(r){const a={};for(const s of r)this.fields[s]&&(a[s]=this.fields[s]);return this.setFields(a,this._excludedEdges.filter(([s,o])=>r.includes(s)&&r.includes(o)))}omit(r){const a=[];for(const s of Object.keys(this.fields))r.includes(s)||a.push(s);return this.pick(a)}from(r,a,s){let o=$i.getter(r,!0);return this.transform(u=>{if(!u)return u;let c=u;return Yw(u,r)&&(c=Object.assign({},u),s||delete c[r],c[a]=o(u)),c})}json(){return this.transform(zw)}exact(r){return this.test({name:"exact",exclusive:!0,message:r||Du.exact,test(a){if(a==null)return!0;const s=Pm(this.schema,a);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(r=!0,a=Du.noUnknown){typeof r!="boolean"&&(a=r,r=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:a,test(o){if(o==null)return!0;const u=Pm(this.schema,o);return!r||u.length===0||this.createError({params:{unknown:u.join(", ")}})}});return s.spec.noUnknown=r,s}unknown(r=!0,a=Du.noUnknown){return this.noUnknown(!r,a)}transformKeys(r){return this.transform(a=>{if(!a)return a;const s={};for(const o of Object.keys(a))s[r(o)]=a[o];return s})}camelCase(){return this.transformKeys(Mf.camelCase)}snakeCase(){return this.transformKeys(Mf.snakeCase)}constantCase(){return this.transformKeys(r=>Mf.snakeCase(r).toUpperCase())}describe(r){const a=(r?this.resolve(r):this).clone(),s=super.describe(r);s.fields={};for(const[u,c]of Object.entries(a.fields)){var o;let d=r;(o=d)!=null&&o.value&&(d=Object.assign({},d,{parent:d.value,value:d.value[u]})),s.fields[u]=c.describe(d)}return s}}Yu.prototype=by.prototype;const vy=({variant:n="dropdown",size:r="md"})=>{const{i18n:a}=Bt(),[s,o]=M.useState(!1),u=M.useRef(null),c=Kv(a.language)||Jl[0];M.useEffect(()=>{const m=A=>{u.current&&!u.current.contains(A.target)&&o(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[]);const d=async m=>{await a.changeLanguage(m),await Xe.setItem("local:language",m),o(!1),a.emit("languageChanged",m)};return n==="buttons"?p.jsx("div",{className:"flex space-x-2",children:Jl.map(m=>p.jsxs("button",{onClick:()=>d(m.code),className:`flex items-center space-x-1 px-2 py-1 text-xs rounded transition-colors ${a.language===m.code?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-500"}`,title:m.nativeName,children:[p.jsx("span",{className:"text-sm",children:m.flag}),p.jsx("span",{children:m.code.toUpperCase()})]},m.code))}):p.jsxs("div",{className:"relative",ref:u,children:[p.jsxs("button",{onClick:()=>o(!s),className:`w-full flex items-center justify-between px-3 py-1.5 rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors ${r==="sm"?"text-sm":"text-base"}`,children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("span",{className:"text-lg",children:c.flag}),p.jsx("span",{children:c.nativeName})]}),p.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${s?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),s&&p.jsx("div",{className:"absolute top-full left-0 mt-1 w-full bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg z-50",children:Jl.map(m=>p.jsxs("button",{onClick:()=>d(m.code),className:`w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors first:rounded-t-lg last:rounded-b-lg ${r==="sm"?"text-sm":"text-base"}`,children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("span",{className:"text-lg",children:m.flag}),p.jsx("span",{className:"text-gray-700 dark:text-gray-200",children:m.nativeName})]}),a.language===m.code&&p.jsx("svg",{className:"w-4 h-4 text-primary-500",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},m.code))})]})};class cr{constructor(){}static isServerVersionSupported(r){return this.versionGreaterThanOrEqualTo(r,this.MIN_SERVER_VERSION)}static versionGreaterThanOrEqualTo(r,a){const[s,o]=r.split("-"),[u,c]=a.split("-"),d=s.split(".").map(Number),m=u.split(".").map(Number);for(let A=0;A<Math.max(d.length,m.length);A++){const b=d[A]??0,v=m[A]??0;if(b>v)return!0;if(b<v)return!1}return!o&&c?!0:o&&!c?!1:!o&&!c?!0:o>=c}}Ir(cr,"VERSION","0.21.0"),Ir(cr,"MIN_SERVER_VERSION","0.12.0-dev"),Ir(cr,"CLIENT_NAME","chrome"),Ir(cr,"DEFAULT_CLIENT_URL","https://app.aliasvault.net"),Ir(cr,"DEFAULT_API_URL","https://app.aliasvault.net/api");const _f=[{label:"Aliasvault.net",value:cr.DEFAULT_API_URL},{label:"Self-hosted",value:"custom"}],Kw=n=>Yu().shape({apiUrl:Yr().required(n("validation.apiUrlRequired")).test("is-valid-api-url",n("settings.validation.apiUrlInvalid"),r=>{if(!r)return!0;try{const a=new URL(r);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}}),clientUrl:Yr().required(n("validation.clientUrlRequired")).test("is-valid-client-url",n("settings.validation.clientUrlInvalid"),r=>{if(!r)return!0;try{const a=new URL(r);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}})}),Jw=()=>{const{t:n}=Bt(),[r,a]=M.useState(""),[s,o]=M.useState(""),[u,c]=M.useState(""),[d,m]=M.useState(!0),[A,b]=M.useState({}),{setIsInitialLoading:v}=yn(),B=Kw(n);M.useEffect(()=>{(async()=>{const O=await Xe.getItem("local:apiUrl"),_=await Xe.getItem("local:clientUrl"),q=await Xe.getItem(Gu)!==!1,V=await Xe.getItem(Vu);m(V?!1:q);const ge=_f.find(ce=>ce.value===O);ge?a(ge.value):O?(a("custom"),o(O),c(_??"")):a(_f[0].value),v(!1)})()},[v]);const T=async N=>{const O=N.target.value;a(O),O!=="custom"&&(await Xe.setItem("local:apiUrl",""),await Xe.setItem("local:clientUrl",""),o(""),c(""),b({}))},Q=async N=>{const O=N.target.value;o(O);try{await B.validateAt("apiUrl",{apiUrl:O}),b(_=>({..._,apiUrl:void 0})),await Xe.setItem("local:apiUrl",O)}catch(_){_ instanceof jr&&(b(q=>({...q,apiUrl:_.message})),await Xe.setItem("local:apiUrl",cr.DEFAULT_API_URL),await Xe.setItem("local:clientUrl",cr.DEFAULT_CLIENT_URL))}},k=async N=>{const O=N.target.value;c(O);try{await B.validateAt("clientUrl",{clientUrl:O}),b(_=>({..._,clientUrl:void 0})),await Xe.setItem("local:clientUrl",O)}catch(_){_ instanceof jr&&b(q=>({...q,clientUrl:_.message}))}},R=async()=>{const N=!d;await Xe.setItem(Gu,N),N&&(await Xe.setItem(Qu,[]),await Xe.setItem(Vu,0)),m(N)};return p.jsxs("div",{className:"p-4",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("common.language")}),p.jsx(vy,{variant:"dropdown",size:"sm"})]})}),p.jsxs("div",{className:"mb-6",children:[p.jsx("label",{htmlFor:"api-connection",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:n("settings.serverUrl")}),p.jsx("select",{value:r,onChange:T,className:"w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white",children:_f.map(N=>p.jsx("option",{value:N.value,children:N.label},N.value))})]}),r==="custom"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mb-6",children:[p.jsx("label",{htmlFor:"custom-client-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:"Custom client URL"}),p.jsx("input",{id:"custom-client-url",type:"text",value:u,onChange:k,placeholder:"https://my-aliasvault-instance.com",className:`w-full bg-gray-50 border ${A.clientUrl?"border-red-500":"border-gray-300"} text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white`}),A.clientUrl&&p.jsx("p",{className:"mt-1 text-sm text-red-500",children:A.clientUrl})]}),p.jsxs("div",{className:"mb-6",children:[p.jsx("label",{htmlFor:"custom-api-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:"Custom API URL"}),p.jsx("input",{id:"custom-api-url",type:"text",value:s,onChange:Q,placeholder:"https://my-aliasvault-instance.com/api",className:`w-full bg-gray-50 border ${A.apiUrl?"border-red-500":"border-gray-300"} text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white`}),A.apiUrl&&p.jsx("p",{className:"mt-1 text-sm text-red-500",children:A.apiUrl})]})]}),p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.autofillEnabled")}),p.jsx("button",{onClick:R,className:`px-4 py-2 rounded-md transition-colors ${d?"bg-green-200 text-green-800 hover:bg-green-300 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50":"bg-red-200 text-red-800 hover:bg-red-300 dark:bg-red-900/30 dark:text-red-400 dark:hover:bg-red-900/50"}`,children:d?n("common.enabled","Enabled"):n("common.disabled","Disabled")})]})}),p.jsxs("div",{className:"text-center text-gray-400 dark:text-gray-600",children:[n("settings.version"),": ",cr.VERSION]})]})};var so=n=>n.type==="checkbox",Ki=n=>n instanceof Date,Pr=n=>n==null;const xy=n=>typeof n=="object";var sr=n=>!Pr(n)&&!Array.isArray(n)&&xy(n)&&!Ki(n),Xw=n=>sr(n)&&n.target?so(n.target)?n.target.checked:n.target.value:n,$w=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,Ww=(n,r)=>n.has($w(r)),Zw=n=>{const r=n.constructor&&n.constructor.prototype;return sr(r)&&r.hasOwnProperty("isPrototypeOf")},BA=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Fr(n){let r;const a=Array.isArray(n),s=typeof FileList<"u"?n instanceof FileList:!1;if(n instanceof Date)r=new Date(n);else if(n instanceof Set)r=new Set(n);else if(!(BA&&(n instanceof Blob||s))&&(a||sr(n)))if(r=a?[]:{},!a&&!Zw(n))r=n;else for(const o in n)n.hasOwnProperty(o)&&(r[o]=Fr(n[o]));else return n;return r}var nc=n=>Array.isArray(n)?n.filter(Boolean):[],ur=n=>n===void 0,Pe=(n,r,a)=>{if(!r||!sr(n))return a;const s=nc(r.split(/[,[\].]+?/)).reduce((o,u)=>Pr(o)?o:o[u],n);return ur(s)||s===n?ur(n[r])?a:n[r]:s},sa=n=>typeof n=="boolean",SA=n=>/^\w*$/.test(n),Cy=n=>nc(n.replace(/["|']|\]/g,"").split(/\.|\[/)),kt=(n,r,a)=>{let s=-1;const o=SA(r)?[r]:Cy(r),u=o.length,c=u-1;for(;++s<u;){const d=o[s];let m=a;if(s!==c){const A=n[d];m=sr(A)||Array.isArray(A)?A:isNaN(+o[s+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;n[d]=m,n=n[d]}};const Km={BLUR:"blur",FOCUS_OUT:"focusout"},Hn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Da={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};pn.createContext(null);var e1=(n,r,a,s=!0)=>{const o={defaultValues:r._defaultValues};for(const u in n)Object.defineProperty(o,u,{get:()=>{const c=u;return r._proxyFormState[c]!==Hn.all&&(r._proxyFormState[c]=!s||Hn.all),n[c]}});return o};const t1=typeof window<"u"?M.useLayoutEffect:M.useEffect;var oa=n=>typeof n=="string",r1=(n,r,a,s,o)=>oa(n)?(s&&r.watch.add(n),Pe(a,n,o)):Array.isArray(n)?n.map(u=>(s&&r.watch.add(u),Pe(a,u))):(s&&(r.watchAll=!0),a),wy=(n,r,a,s,o)=>r?{...a[n],types:{...a[n]&&a[n].types?a[n].types:{},[s]:o||!0}}:{},Xl=n=>Array.isArray(n)?n:[n],Jm=()=>{let n=[];return{get observers(){return n},next:o=>{for(const u of n)u.next&&u.next(o)},subscribe:o=>(n.push(o),{unsubscribe:()=>{n=n.filter(u=>u!==o)}}),unsubscribe:()=>{n=[]}}},uA=n=>Pr(n)||!xy(n);function Ei(n,r){if(uA(n)||uA(r))return n===r;if(Ki(n)&&Ki(r))return n.getTime()===r.getTime();const a=Object.keys(n),s=Object.keys(r);if(a.length!==s.length)return!1;for(const o of a){const u=n[o];if(!s.includes(o))return!1;if(o!=="ref"){const c=r[o];if(Ki(u)&&Ki(c)||sr(u)&&sr(c)||Array.isArray(u)&&Array.isArray(c)?!Ei(u,c):u!==c)return!1}}return!0}var nn=n=>sr(n)&&!Object.keys(n).length,NA=n=>n.type==="file",Gn=n=>typeof n=="function",Pu=n=>{if(!BA)return!1;const r=n?n.ownerDocument:0;return n instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Iy=n=>n.type==="select-multiple",TA=n=>n.type==="radio",n1=n=>TA(n)||so(n),Of=n=>Pu(n)&&n.isConnected;function a1(n,r){const a=r.slice(0,-1).length;let s=0;for(;s<a;)n=ur(n)?s++:n[r[s++]];return n}function i1(n){for(const r in n)if(n.hasOwnProperty(r)&&!ur(n[r]))return!1;return!0}function mr(n,r){const a=Array.isArray(r)?r:SA(r)?[r]:Cy(r),s=a.length===1?n:a1(n,a),o=a.length-1,u=a[o];return s&&delete s[u],o!==0&&(sr(s)&&nn(s)||Array.isArray(s)&&i1(s))&&mr(n,a.slice(0,-1)),n}var By=n=>{for(const r in n)if(Gn(n[r]))return!0;return!1};function Ku(n,r={}){const a=Array.isArray(n);if(sr(n)||a)for(const s in n)Array.isArray(n[s])||sr(n[s])&&!By(n[s])?(r[s]=Array.isArray(n[s])?[]:{},Ku(n[s],r[s])):Pr(n[s])||(r[s]=!0);return r}function Sy(n,r,a){const s=Array.isArray(n);if(sr(n)||s)for(const o in n)Array.isArray(n[o])||sr(n[o])&&!By(n[o])?ur(r)||uA(a[o])?a[o]=Array.isArray(n[o])?Ku(n[o],[]):{...Ku(n[o])}:Sy(n[o],Pr(r)?{}:r[o],a[o]):a[o]=!Ei(n[o],r[o]);return a}var ql=(n,r)=>Sy(n,r,Ku(r));const Xm={value:!1,isValid:!1},$m={value:!0,isValid:!0};var Ny=n=>{if(Array.isArray(n)){if(n.length>1){const r=n.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:r,isValid:!!r.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!ur(n[0].attributes.value)?ur(n[0].value)||n[0].value===""?$m:{value:n[0].value,isValid:!0}:$m:Xm}return Xm},Ty=(n,{valueAsNumber:r,valueAsDate:a,setValueAs:s})=>ur(n)?n:r?n===""?NaN:n&&+n:a&&oa(n)?new Date(n):s?s(n):n;const Wm={isValid:!1,value:null};var Qy=n=>Array.isArray(n)?n.reduce((r,a)=>a&&a.checked&&!a.disabled?{isValid:!0,value:a.value}:r,Wm):Wm;function Zm(n){const r=n.ref;return NA(r)?r.files:TA(r)?Qy(n.refs).value:Iy(r)?[...r.selectedOptions].map(({value:a})=>a):so(r)?Ny(n.refs).value:Ty(ur(r.value)?n.ref.value:r.value,n)}var s1=(n,r,a,s)=>{const o={};for(const u of n){const c=Pe(r,u);c&&kt(o,u,c._f)}return{criteriaMode:a,names:[...n],fields:o,shouldUseNativeValidation:s}},Ju=n=>n instanceof RegExp,zl=n=>ur(n)?n:Ju(n)?n.source:sr(n)?Ju(n.value)?n.value.source:n.value:n,ep=n=>({isOnSubmit:!n||n===Hn.onSubmit,isOnBlur:n===Hn.onBlur,isOnChange:n===Hn.onChange,isOnAll:n===Hn.all,isOnTouch:n===Hn.onTouched});const tp="AsyncFunction";var l1=n=>!!n&&!!n.validate&&!!(Gn(n.validate)&&n.validate.constructor.name===tp||sr(n.validate)&&Object.values(n.validate).find(r=>r.constructor.name===tp)),o1=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate),rp=(n,r,a)=>!a&&(r.watchAll||r.watch.has(n)||[...r.watch].some(s=>n.startsWith(s)&&/^\.\w+/.test(n.slice(s.length))));const $l=(n,r,a,s)=>{for(const o of a||Object.keys(n)){const u=Pe(n,o);if(u){const{_f:c,...d}=u;if(c){if(c.refs&&c.refs[0]&&r(c.refs[0],o)&&!s)return!0;if(c.ref&&r(c.ref,c.name)&&!s)return!0;if($l(d,r))break}else if(sr(d)&&$l(d,r))break}}};function np(n,r,a){const s=Pe(n,a);if(s||SA(a))return{error:s,name:a};const o=a.split(".");for(;o.length;){const u=o.join("."),c=Pe(r,u),d=Pe(n,u);if(c&&!Array.isArray(c)&&a!==u)return{name:a};if(d&&d.type)return{name:u,error:d};if(d&&d.root&&d.root.type)return{name:`${u}.root`,error:d.root};o.pop()}return{name:a}}var u1=(n,r,a,s)=>{a(n);const{name:o,...u}=n;return nn(u)||Object.keys(u).length>=Object.keys(r).length||Object.keys(u).find(c=>r[c]===(!s||Hn.all))},c1=(n,r,a)=>!n||!r||n===r||Xl(n).some(s=>s&&(a?s===r:s.startsWith(r)||r.startsWith(s))),d1=(n,r,a,s,o)=>o.isOnAll?!1:!a&&o.isOnTouch?!(r||n):(a?s.isOnBlur:o.isOnBlur)?!n:(a?s.isOnChange:o.isOnChange)?n:!0,f1=(n,r)=>!nc(Pe(n,r)).length&&mr(n,r),A1=(n,r,a)=>{const s=Xl(Pe(n,a));return kt(s,"root",r[a]),kt(n,a,s),n},ku=n=>oa(n);function ap(n,r,a="validate"){if(ku(n)||Array.isArray(n)&&n.every(ku)||sa(n)&&!n)return{type:a,message:ku(n)?n:"",ref:r}}var Os=n=>sr(n)&&!Ju(n)?n:{value:n,message:""},ip=async(n,r,a,s,o,u)=>{const{ref:c,refs:d,required:m,maxLength:A,minLength:b,min:v,max:B,pattern:T,validate:Q,name:k,valueAsNumber:R,mount:N}=n._f,O=Pe(a,k);if(!N||r.has(k))return{};const _=d?d[0]:c,q=me=>{o&&_.reportValidity&&(_.setCustomValidity(sa(me)?"":me||""),_.reportValidity())},V={},ge=TA(c),ce=so(c),te=ge||ce,J=(R||NA(c))&&ur(c.value)&&ur(O)||Pu(c)&&c.value===""||O===""||Array.isArray(O)&&!O.length,K=wy.bind(null,k,s,V),$=(me,he,we,pe=Da.maxLength,P=Da.minLength)=>{const ae=me?he:we;V[k]={type:me?pe:P,message:ae,ref:c,...K(me?pe:P,ae)}};if(u?!Array.isArray(O)||!O.length:m&&(!te&&(J||Pr(O))||sa(O)&&!O||ce&&!Ny(d).isValid||ge&&!Qy(d).isValid)){const{value:me,message:he}=ku(m)?{value:!!m,message:m}:Os(m);if(me&&(V[k]={type:Da.required,message:he,ref:_,...K(Da.required,he)},!s))return q(he),V}if(!J&&(!Pr(v)||!Pr(B))){let me,he;const we=Os(B),pe=Os(v);if(!Pr(O)&&!isNaN(O)){const P=c.valueAsNumber||O&&+O;Pr(we.value)||(me=P>we.value),Pr(pe.value)||(he=P<pe.value)}else{const P=c.valueAsDate||new Date(O),ae=G=>new Date(new Date().toDateString()+" "+G),Ne=c.type=="time",_e=c.type=="week";oa(we.value)&&O&&(me=Ne?ae(O)>ae(we.value):_e?O>we.value:P>new Date(we.value)),oa(pe.value)&&O&&(he=Ne?ae(O)<ae(pe.value):_e?O<pe.value:P<new Date(pe.value))}if((me||he)&&($(!!me,we.message,pe.message,Da.max,Da.min),!s))return q(V[k].message),V}if((A||b)&&!J&&(oa(O)||u&&Array.isArray(O))){const me=Os(A),he=Os(b),we=!Pr(me.value)&&O.length>+me.value,pe=!Pr(he.value)&&O.length<+he.value;if((we||pe)&&($(we,me.message,he.message),!s))return q(V[k].message),V}if(T&&!J&&oa(O)){const{value:me,message:he}=Os(T);if(Ju(me)&&!O.match(me)&&(V[k]={type:Da.pattern,message:he,ref:c,...K(Da.pattern,he)},!s))return q(he),V}if(Q){if(Gn(Q)){const me=await Q(O,a),he=ap(me,_);if(he&&(V[k]={...he,...K(Da.validate,he.message)},!s))return q(he.message),V}else if(sr(Q)){let me={};for(const he in Q){if(!nn(me)&&!s)break;const we=ap(await Q[he](O,a),_,he);we&&(me={...we,...K(he,we.message)},q(we.message),s&&(V[k]=me))}if(!nn(me)&&(V[k]={ref:_,...me},!s))return V}}return q(!0),V};const h1={mode:Hn.onSubmit,reValidateMode:Hn.onChange,shouldFocusError:!0};function g1(n={}){let r={...h1,...n},a={submitCount:0,isDirty:!1,isReady:!1,isLoading:Gn(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1};const s={};let o=sr(r.defaultValues)||sr(r.values)?Fr(r.defaultValues||r.values)||{}:{},u=r.shouldUnregister?{}:Fr(o),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},m,A=0;const b={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...b};const B={array:Jm(),state:Jm()},T=r.criteriaMode===Hn.all,Q=j=>X=>{clearTimeout(A),A=setTimeout(j,X)},k=async j=>{if(!r.disabled&&(b.isValid||v.isValid||j)){const X=r.resolver?nn((await ce()).errors):await J(s,!0);X!==a.isValid&&B.state.next({isValid:X})}},R=(j,X)=>{!r.disabled&&(b.isValidating||b.validatingFields||v.isValidating||v.validatingFields)&&((j||Array.from(d.mount)).forEach(se=>{se&&(X?kt(a.validatingFields,se,X):mr(a.validatingFields,se))}),B.state.next({validatingFields:a.validatingFields,isValidating:!nn(a.validatingFields)}))},N=(j,X=[],se,Te,Re=!0,xe=!0)=>{if(Te&&se&&!r.disabled){if(c.action=!0,xe&&Array.isArray(Pe(s,j))){const Ve=se(Pe(s,j),Te.argA,Te.argB);Re&&kt(s,j,Ve)}if(xe&&Array.isArray(Pe(a.errors,j))){const Ve=se(Pe(a.errors,j),Te.argA,Te.argB);Re&&kt(a.errors,j,Ve),f1(a.errors,j)}if((b.touchedFields||v.touchedFields)&&xe&&Array.isArray(Pe(a.touchedFields,j))){const Ve=se(Pe(a.touchedFields,j),Te.argA,Te.argB);Re&&kt(a.touchedFields,j,Ve)}(b.dirtyFields||v.dirtyFields)&&(a.dirtyFields=ql(o,u)),B.state.next({name:j,isDirty:$(j,X),dirtyFields:a.dirtyFields,errors:a.errors,isValid:a.isValid})}else kt(u,j,X)},O=(j,X)=>{kt(a.errors,j,X),B.state.next({errors:a.errors})},_=j=>{a.errors=j,B.state.next({errors:a.errors,isValid:!1})},q=(j,X,se,Te)=>{const Re=Pe(s,j);if(Re){const xe=Pe(u,j,ur(se)?Pe(o,j):se);ur(xe)||Te&&Te.defaultChecked||X?kt(u,j,X?xe:Zm(Re._f)):we(j,xe),c.mount&&k()}},V=(j,X,se,Te,Re)=>{let xe=!1,Ve=!1;const S={name:j};if(!r.disabled){if(!se||Te){(b.isDirty||v.isDirty)&&(Ve=a.isDirty,a.isDirty=S.isDirty=$(),xe=Ve!==S.isDirty);const E=Ei(Pe(o,j),X);Ve=!!Pe(a.dirtyFields,j),E?mr(a.dirtyFields,j):kt(a.dirtyFields,j,!0),S.dirtyFields=a.dirtyFields,xe=xe||(b.dirtyFields||v.dirtyFields)&&Ve!==!E}if(se){const E=Pe(a.touchedFields,j);E||(kt(a.touchedFields,j,se),S.touchedFields=a.touchedFields,xe=xe||(b.touchedFields||v.touchedFields)&&E!==se)}xe&&Re&&B.state.next(S)}return xe?S:{}},ge=(j,X,se,Te)=>{const Re=Pe(a.errors,j),xe=(b.isValid||v.isValid)&&sa(X)&&a.isValid!==X;if(r.delayError&&se?(m=Q(()=>O(j,se)),m(r.delayError)):(clearTimeout(A),m=null,se?kt(a.errors,j,se):mr(a.errors,j)),(se?!Ei(Re,se):Re)||!nn(Te)||xe){const Ve={...Te,...xe&&sa(X)?{isValid:X}:{},errors:a.errors,name:j};a={...a,...Ve},B.state.next(Ve)}},ce=async j=>{R(j,!0);const X=await r.resolver(u,r.context,s1(j||d.mount,s,r.criteriaMode,r.shouldUseNativeValidation));return R(j),X},te=async j=>{const{errors:X}=await ce(j);if(j)for(const se of j){const Te=Pe(X,se);Te?kt(a.errors,se,Te):mr(a.errors,se)}else a.errors=X;return X},J=async(j,X,se={valid:!0})=>{for(const Te in j){const Re=j[Te];if(Re){const{_f:xe,...Ve}=Re;if(xe){const S=d.array.has(xe.name),E=Re._f&&l1(Re._f);E&&b.validatingFields&&R([Te],!0);const x=await ip(Re,d.disabled,u,T,r.shouldUseNativeValidation&&!X,S);if(E&&b.validatingFields&&R([Te]),x[xe.name]&&(se.valid=!1,X))break;!X&&(Pe(x,xe.name)?S?A1(a.errors,x,xe.name):kt(a.errors,xe.name,x[xe.name]):mr(a.errors,xe.name))}!nn(Ve)&&await J(Ve,X,se)}}return se.valid},K=()=>{for(const j of d.unMount){const X=Pe(s,j);X&&(X._f.refs?X._f.refs.every(se=>!Of(se)):!Of(X._f.ref))&&yt(j)}d.unMount=new Set},$=(j,X)=>!r.disabled&&(j&&X&&kt(u,j,X),!Ei(G(),o)),me=(j,X,se)=>r1(j,d,{...c.mount?u:ur(X)?o:oa(j)?{[j]:X}:X},se,X),he=j=>nc(Pe(c.mount?u:o,j,r.shouldUnregister?Pe(o,j,[]):[])),we=(j,X,se={})=>{const Te=Pe(s,j);let Re=X;if(Te){const xe=Te._f;xe&&(!xe.disabled&&kt(u,j,Ty(X,xe)),Re=Pu(xe.ref)&&Pr(X)?"":X,Iy(xe.ref)?[...xe.ref.options].forEach(Ve=>Ve.selected=Re.includes(Ve.value)):xe.refs?so(xe.ref)?xe.refs.forEach(Ve=>{(!Ve.defaultChecked||!Ve.disabled)&&(Array.isArray(Re)?Ve.checked=!!Re.find(S=>S===Ve.value):Ve.checked=Re===Ve.value||!!Re)}):xe.refs.forEach(Ve=>Ve.checked=Ve.value===Re):NA(xe.ref)?xe.ref.value="":(xe.ref.value=Re,xe.ref.type||B.state.next({name:j,values:Fr(u)})))}(se.shouldDirty||se.shouldTouch)&&V(j,Re,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&_e(j)},pe=(j,X,se)=>{for(const Te in X){if(!X.hasOwnProperty(Te))return;const Re=X[Te],xe=j+"."+Te,Ve=Pe(s,xe);(d.array.has(j)||sr(Re)||Ve&&!Ve._f)&&!Ki(Re)?pe(xe,Re,se):we(xe,Re,se)}},P=(j,X,se={})=>{const Te=Pe(s,j),Re=d.array.has(j),xe=Fr(X);kt(u,j,xe),Re?(B.array.next({name:j,values:Fr(u)}),(b.isDirty||b.dirtyFields||v.isDirty||v.dirtyFields)&&se.shouldDirty&&B.state.next({name:j,dirtyFields:ql(o,u),isDirty:$(j,xe)})):Te&&!Te._f&&!Pr(xe)?pe(j,xe,se):we(j,xe,se),rp(j,d)&&B.state.next({...a}),B.state.next({name:c.mount?j:void 0,values:Fr(u)})},ae=async j=>{c.mount=!0;const X=j.target;let se=X.name,Te=!0;const Re=Pe(s,se),xe=E=>{Te=Number.isNaN(E)||Ki(E)&&isNaN(E.getTime())||Ei(E,Pe(u,se,E))},Ve=ep(r.mode),S=ep(r.reValidateMode);if(Re){let E,x;const H=X.type?Zm(Re._f):Xw(j),W=j.type===Km.BLUR||j.type===Km.FOCUS_OUT,fe=!o1(Re._f)&&!r.resolver&&!Pe(a.errors,se)&&!Re._f.deps||d1(W,Pe(a.touchedFields,se),a.isSubmitted,S,Ve),be=rp(se,d,W);kt(u,se,H),W?(Re._f.onBlur&&Re._f.onBlur(j),m&&m(0)):Re._f.onChange&&Re._f.onChange(j);const Le=V(se,H,W),gt=!nn(Le)||be;if(!W&&B.state.next({name:se,type:j.type,values:Fr(u)}),fe)return(b.isValid||v.isValid)&&(r.mode==="onBlur"?W&&k():W||k()),gt&&B.state.next({name:se,...be?{}:Le});if(!W&&be&&B.state.next({...a}),r.resolver){const{errors:ft}=await ce([se]);if(xe(H),Te){const bt=np(a.errors,s,se),ot=np(ft,s,bt.name||se);E=ot.error,se=ot.name,x=nn(ft)}}else R([se],!0),E=(await ip(Re,d.disabled,u,T,r.shouldUseNativeValidation))[se],R([se]),xe(H),Te&&(E?x=!1:(b.isValid||v.isValid)&&(x=await J(s,!0)));Te&&(Re._f.deps&&_e(Re._f.deps),ge(se,x,E,Le))}},Ne=(j,X)=>{if(Pe(a.errors,X)&&j.focus)return j.focus(),1},_e=async(j,X={})=>{let se,Te;const Re=Xl(j);if(r.resolver){const xe=await te(ur(j)?j:Re);se=nn(xe),Te=j?!Re.some(Ve=>Pe(xe,Ve)):se}else j?(Te=(await Promise.all(Re.map(async xe=>{const Ve=Pe(s,xe);return await J(Ve&&Ve._f?{[xe]:Ve}:Ve)}))).every(Boolean),!(!Te&&!a.isValid)&&k()):Te=se=await J(s);return B.state.next({...!oa(j)||(b.isValid||v.isValid)&&se!==a.isValid?{}:{name:j},...r.resolver||!j?{isValid:se}:{},errors:a.errors}),X.shouldFocus&&!Te&&$l(s,Ne,j?Re:d.mount),Te},G=j=>{const X={...c.mount?u:o};return ur(j)?X:oa(j)?Pe(X,j):j.map(se=>Pe(X,se))},ne=(j,X)=>({invalid:!!Pe((X||a).errors,j),isDirty:!!Pe((X||a).dirtyFields,j),error:Pe((X||a).errors,j),isValidating:!!Pe(a.validatingFields,j),isTouched:!!Pe((X||a).touchedFields,j)}),Ee=j=>{j&&Xl(j).forEach(X=>mr(a.errors,X)),B.state.next({errors:j?a.errors:{}})},ke=(j,X,se)=>{const Te=(Pe(s,j,{_f:{}})._f||{}).ref,Re=Pe(a.errors,j)||{},{ref:xe,message:Ve,type:S,...E}=Re;kt(a.errors,j,{...E,...X,ref:Te}),B.state.next({name:j,errors:a.errors,isValid:!1}),se&&se.shouldFocus&&Te&&Te.focus&&Te.focus()},He=(j,X)=>Gn(j)?B.state.subscribe({next:se=>j(me(void 0,X),se)}):me(j,X,!0),Ke=j=>B.state.subscribe({next:X=>{c1(j.name,X.name,j.exact)&&u1(X,j.formState||b,Fe,j.reRenderRoot)&&j.callback({values:{...u},...a,...X})}}).unsubscribe,Ge=j=>(c.mount=!0,v={...v,...j.formState},Ke({...j,formState:v})),yt=(j,X={})=>{for(const se of j?Xl(j):d.mount)d.mount.delete(se),d.array.delete(se),X.keepValue||(mr(s,se),mr(u,se)),!X.keepError&&mr(a.errors,se),!X.keepDirty&&mr(a.dirtyFields,se),!X.keepTouched&&mr(a.touchedFields,se),!X.keepIsValidating&&mr(a.validatingFields,se),!r.shouldUnregister&&!X.keepDefaultValue&&mr(o,se);B.state.next({values:Fr(u)}),B.state.next({...a,...X.keepDirty?{isDirty:$()}:{}}),!X.keepIsValid&&k()},We=({disabled:j,name:X})=>{(sa(j)&&c.mount||j||d.disabled.has(X))&&(j?d.disabled.add(X):d.disabled.delete(X))},Et=(j,X={})=>{let se=Pe(s,j);const Te=sa(X.disabled)||sa(r.disabled);return kt(s,j,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:j}},name:j,mount:!0,...X}}),d.mount.add(j),se?We({disabled:sa(X.disabled)?X.disabled:r.disabled,name:j}):q(j,!0,X.value),{...Te?{disabled:X.disabled||r.disabled}:{},...r.progressive?{required:!!X.required,min:zl(X.min),max:zl(X.max),minLength:zl(X.minLength),maxLength:zl(X.maxLength),pattern:zl(X.pattern)}:{},name:j,onChange:ae,onBlur:ae,ref:Re=>{if(Re){Et(j,X),se=Pe(s,j);const xe=ur(Re.value)&&Re.querySelectorAll&&Re.querySelectorAll("input,select,textarea")[0]||Re,Ve=n1(xe),S=se._f.refs||[];if(Ve?S.find(E=>E===xe):xe===se._f.ref)return;kt(s,j,{_f:{...se._f,...Ve?{refs:[...S.filter(Of),xe,...Array.isArray(Pe(o,j))?[{}]:[]],ref:{type:xe.type,name:j}}:{ref:xe}}}),q(j,!1,void 0,xe)}else se=Pe(s,j,{}),se._f&&(se._f.mount=!1),(r.shouldUnregister||X.shouldUnregister)&&!(Ww(d.array,j)&&c.action)&&d.unMount.add(j)}}},Kt=()=>r.shouldFocusError&&$l(s,Ne,d.mount),Sr=j=>{sa(j)&&(B.state.next({disabled:j}),$l(s,(X,se)=>{const Te=Pe(s,se);Te&&(X.disabled=Te._f.disabled||j,Array.isArray(Te._f.refs)&&Te._f.refs.forEach(Re=>{Re.disabled=Te._f.disabled||j}))},0,!1))},Lt=(j,X)=>async se=>{let Te;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let Re=Fr(u);if(B.state.next({isSubmitting:!0}),r.resolver){const{errors:xe,values:Ve}=await ce();a.errors=xe,Re=Ve}else await J(s);if(d.disabled.size)for(const xe of d.disabled)kt(Re,xe,void 0);if(mr(a.errors,"root"),nn(a.errors)){B.state.next({errors:{}});try{await j(Re,se)}catch(xe){Te=xe}}else X&&await X({...a.errors},se),Kt(),setTimeout(Kt);if(B.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nn(a.errors)&&!Te,submitCount:a.submitCount+1,errors:a.errors}),Te)throw Te},Ht=(j,X={})=>{Pe(s,j)&&(ur(X.defaultValue)?P(j,Fr(Pe(o,j))):(P(j,X.defaultValue),kt(o,j,Fr(X.defaultValue))),X.keepTouched||mr(a.touchedFields,j),X.keepDirty||(mr(a.dirtyFields,j),a.isDirty=X.defaultValue?$(j,Fr(Pe(o,j))):$()),X.keepError||(mr(a.errors,j),b.isValid&&k()),B.state.next({...a}))},jt=(j,X={})=>{const se=j?Fr(j):o,Te=Fr(se),Re=nn(j),xe=Re?o:Te;if(X.keepDefaultValues||(o=se),!X.keepValues){if(X.keepDirtyValues){const Ve=new Set([...d.mount,...Object.keys(ql(o,u))]);for(const S of Array.from(Ve))Pe(a.dirtyFields,S)?kt(xe,S,Pe(u,S)):P(S,Pe(xe,S))}else{if(BA&&ur(j))for(const Ve of d.mount){const S=Pe(s,Ve);if(S&&S._f){const E=Array.isArray(S._f.refs)?S._f.refs[0]:S._f.ref;if(Pu(E)){const x=E.closest("form");if(x){x.reset();break}}}}for(const Ve of d.mount)P(Ve,Pe(xe,Ve))}u=Fr(xe),B.array.next({values:{...xe}}),B.state.next({values:{...xe}})}d={mount:X.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!b.isValid||!!X.keepIsValid||!!X.keepDirtyValues,c.watch=!!r.shouldUnregister,B.state.next({submitCount:X.keepSubmitCount?a.submitCount:0,isDirty:Re?!1:X.keepDirty?a.isDirty:!!(X.keepDefaultValues&&!Ei(j,o)),isSubmitted:X.keepIsSubmitted?a.isSubmitted:!1,dirtyFields:Re?{}:X.keepDirtyValues?X.keepDefaultValues&&u?ql(o,u):a.dirtyFields:X.keepDefaultValues&&j?ql(o,j):X.keepDirty?a.dirtyFields:{},touchedFields:X.keepTouched?a.touchedFields:{},errors:X.keepErrors?a.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?a.isSubmitSuccessful:!1,isSubmitting:!1})},Er=(j,X)=>jt(Gn(j)?j(u):j,X),Qe=(j,X={})=>{const se=Pe(s,j),Te=se&&se._f;if(Te){const Re=Te.refs?Te.refs[0]:Te.ref;Re.focus&&(Re.focus(),X.shouldSelect&&Gn(Re.select)&&Re.select())}},Fe=j=>{a={...a,...j}},lt={control:{register:Et,unregister:yt,getFieldState:ne,handleSubmit:Lt,setError:ke,_subscribe:Ke,_runSchema:ce,_focusError:Kt,_getWatch:me,_getDirty:$,_setValid:k,_setFieldArray:N,_setDisabledField:We,_setErrors:_,_getFieldArray:he,_reset:jt,_resetDefaultValues:()=>Gn(r.defaultValues)&&r.defaultValues().then(j=>{Er(j,r.resetOptions),B.state.next({isLoading:!1})}),_removeUnmounted:K,_disableForm:Sr,_subjects:B,_proxyFormState:b,get _fields(){return s},get _formValues(){return u},get _state(){return c},set _state(j){c=j},get _defaultValues(){return o},get _names(){return d},set _names(j){d=j},get _formState(){return a},get _options(){return r},set _options(j){r={...r,...j}}},subscribe:Ge,trigger:_e,register:Et,handleSubmit:Lt,watch:He,setValue:P,getValues:G,reset:Er,resetField:Ht,clearErrors:Ee,unregister:yt,setError:ke,setFocus:Qe,getFieldState:ne};return{...lt,formControl:lt}}function m1(n={}){const r=pn.useRef(void 0),a=pn.useRef(void 0),[s,o]=pn.useState({isDirty:!1,isValidating:!1,isLoading:Gn(n.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1,isReady:!1,defaultValues:Gn(n.defaultValues)?void 0:n.defaultValues});r.current||(r.current={...n.formControl?n.formControl:g1(n),formState:s},n.formControl&&n.defaultValues&&!Gn(n.defaultValues)&&n.formControl.reset(n.defaultValues,n.resetOptions));const u=r.current.control;return u._options=n,t1(()=>{const c=u._subscribe({formState:u._proxyFormState,callback:()=>o({...u._formState}),reRenderRoot:!0});return o(d=>({...d,isReady:!0})),u._formState.isReady=!0,c},[u]),pn.useEffect(()=>u._disableForm(n.disabled),[u,n.disabled]),pn.useEffect(()=>{n.mode&&(u._options.mode=n.mode),n.reValidateMode&&(u._options.reValidateMode=n.reValidateMode)},[u,n.mode,n.reValidateMode]),pn.useEffect(()=>{n.errors&&(u._setErrors(n.errors),u._focusError())},[u,n.errors]),pn.useEffect(()=>{n.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,n.shouldUnregister]),pn.useEffect(()=>{if(u._proxyFormState.isDirty){const c=u._getDirty();c!==s.isDirty&&u._subjects.state.next({isDirty:c})}},[u,s.isDirty]),pn.useEffect(()=>{n.values&&!Ei(n.values,a.current)?(u._reset(n.values,u._options.resetOptions),a.current=n.values,o(c=>({...c}))):u._resetDefaultValues()},[u,n.values]),pn.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),r.current.formState=e1(s,u),r.current}const sp=(n,r,a)=>{if(n&&"reportValidity"in n){const s=Pe(a,r);n.setCustomValidity(s&&s.message||""),n.reportValidity()}},Dy=(n,r)=>{for(const a in r.fields){const s=r.fields[a];s&&s.ref&&"reportValidity"in s.ref?sp(s.ref,a,n):s&&s.refs&&s.refs.forEach(o=>sp(o,a,n))}},p1=(n,r)=>{r.shouldUseNativeValidation&&Dy(n,r);const a={};for(const s in n){const o=Pe(r.fields,s),u=Object.assign(n[s]||{},{ref:o&&o.ref});if(y1(r.names||Object.keys(n),s)){const c=Object.assign({},Pe(a,s));kt(c,"root",u),kt(a,s,c)}else kt(a,s,u)}return a},y1=(n,r)=>{const a=lp(r);return n.some(s=>lp(s).match(`^${a}\\.\\d+`))};function lp(n){return n.replace(/\]|\[/g,"")}function E1(n,r,a){return a===void 0&&(a={}),function(s,o,u){try{return Promise.resolve(function(c,d){try{var m=(r!=null&&r.context,Promise.resolve(n[a.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},r,{context:o}))).then(function(A){return u.shouldUseNativeValidation&&Dy({},u),{values:a.raw?Object.assign({},s):A,errors:{}}}))}catch(A){return d(A)}return m&&m.then?m.then(void 0,d):m}(0,function(c){if(!c.inner)throw c;return{values:{},errors:p1((d=c,m=!u.shouldUseNativeValidation&&u.criteriaMode==="all",(d.inner||[]).reduce(function(A,b){if(A[b.path]||(A[b.path]={message:b.message,type:b.type}),m){var v=A[b.path].types,B=v&&v[b.type];A[b.path]=wy(b.path,m,A,b.type,B?[].concat(B,b.message):b.message)}return A},{})),u)};var d,m}))}catch(c){return Promise.reject(c)}}}const b1=({attachments:n,onAttachmentsChange:r})=>{const{t:a}=Bt(),[s,o]=M.useState(""),u=async m=>{const A=m.target.files;if(!(!A||A.length===0)){o("Uploading...");try{const b=[...n];for(const v of Array.from(A)){const B=await v.arrayBuffer(),T=new Uint8Array(B),Q={Id:crypto.randomUUID(),Filename:v.name,Blob:T,CredentialId:"",CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString(),IsDeleted:!1};b.push(Q)}r(b),o("Files uploaded successfully."),setTimeout(()=>o(""),3e3)}catch(b){console.error("Error uploading files:",b),o("Error uploading files."),setTimeout(()=>o(""),3e3)}m.target.value=""}},c=m=>{try{const A=[...n],b=A.findIndex(v=>v.Id===m.Id);b!==-1&&A.splice(b,1),r(A),o("Attachment deleted successfully."),setTimeout(()=>o(""),3e3)}catch(A){console.error("Error deleting attachment:",A),o("Error deleting attachment."),setTimeout(()=>o(""),3e3)}},d=n.filter(m=>!m.IsDeleted);return p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:a("common.attachments")}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("input",{type:"file",multiple:!0,onChange:u,className:"block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"}),s&&p.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:s})]}),d.length>0&&p.jsxs("div",{children:[p.jsx("h4",{className:"mb-2 text-md font-medium text-gray-900 dark:text-white",children:"Current attachments:"}),p.jsx("div",{className:"space-y-2",children:d.map(m=>p.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded border border-gray-200 dark:border-gray-600",children:[p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:m.Filename}),p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(m.CreatedAt).toLocaleDateString()})]}),p.jsx("button",{type:"button",onClick:()=>c(m),className:"text-red-500 hover:text-red-700 focus:outline-none","aria-label":`Delete ${m.Filename}`,children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},m.Id))})]})]})]})},v1=({name:n})=>{switch(n){case"visibility":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"refresh":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M23 4v6h-6"}),p.jsx("path",{d:"M1 20v-6h6"}),p.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]});case"settings":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});default:return null}},aa=M.forwardRef(({id:n,label:r,value:a,onChange:s,type:o="text",placeholder:u,required:c=!1,multiline:d=!1,rows:m=1,error:A,buttons:b=[],showPassword:v,onShowPasswordChange:B},T)=>{const{t:Q}=Bt(),[k,R]=pn.useState(!1),N=v!==void 0?v:k,O=V=>{v!==void 0?B==null||B(V):R(V)},_=`mt-1 block w-full rounded-md ${A?"border-red-500":"border-gray-300 dark:border-gray-600"} text-gray-900 sm:text-sm rounded-lg shadow-sm border focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400 py-2 px-3`,q=o==="password"?[...b,{icon:N?"visibility-off":"visibility",onClick:()=>O(!N),title:Q(N?"common.hidePassword":"common.showPassword")}]:b;return p.jsxs("div",{children:[p.jsxs("label",{htmlFor:n,className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:[r,c&&p.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),p.jsxs("div",{className:"relative",children:[d?p.jsx("textarea",{id:n,value:a,onChange:V=>s(V.target.value),rows:m,placeholder:u,className:_}):p.jsx("input",{ref:T,type:o==="password"&&!N?"password":"text",id:n,value:a,onChange:V=>s(V.target.value),placeholder:u,className:_}),q.length>0&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:q.map((V,ge)=>p.jsx("button",{type:"button",onClick:V.onClick,title:V.title,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(v1,{name:V.icon})})},ge))})]}),A&&p.jsx("p",{className:"mt-1 text-sm text-red-500",children:A})]})});aa.displayName="FormInput";var Kr=(n=>(n.EXPAND="expand",n.EDIT="edit",n.DELETE="delete",n.SETTINGS="settings",n.RELOAD="reload",n.EXTERNAL_LINK="external_link",n.SAVE="save",n.PLUS="plus",n.TAB="tab",n))(Kr||{});const x1=({type:n,className:r="w-5 h-5"})=>({expand:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})}),edit:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),delete:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),settings:p.jsxs("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),reload:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),external_link:p.jsxs("svg",{className:r,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),p.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]}),save:p.jsxs("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V7l-4-4z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 3v5h10"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 12a2 2 0 100 4 2 2 0 000-4z"})]}),plus:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),tab:p.jsxs("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"})]})})[n]||null,an=({onClick:n,title:r,iconType:a,variant:s="default"})=>{const o={default:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",primary:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 hover:bg-primary-100 dark:hover:bg-primary-900/20",danger:"text-red-500 hover:text-red-600 hover:bg-red-100 dark:hover:bg-red-900/20"};return p.jsx("button",{onClick:n,className:`p-2 rounded-lg ${o[s]}`,title:r,children:p.jsx(x1,{type:a})})},Xu=({isOpen:n,onClose:r,onConfirm:a,title:s,message:o,confirmText:u="",cancelText:c="",variant:d="default"})=>{const{t:m}=Bt();if(!n)return null;const A=d==="danger"?"bg-red-600 hover:bg-red-700 focus:ring-red-500":"bg-primary-600 hover:bg-primary-700 focus:ring-primary-500";return p.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-60 transition-opacity",onClick:r}),p.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:p.jsxs("div",{className:"relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 px-4 pb-4 pt-5 text-left shadow-xl transition-all w-full max-w-lg",children:[p.jsxs("button",{type:"button",className:"absolute right-4 top-4 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:r,children:[p.jsx("span",{className:"sr-only",children:m("common.close")}),p.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]}),p.jsxs("div",{className:"sm:flex sm:items-start",children:[d==="danger"&&p.jsx("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900 sm:mx-0 sm:h-10 sm:w-10",children:p.jsx("svg",{className:"h-6 w-6 text-red-600 dark:text-red-200",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}),p.jsxs("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[p.jsx("h3",{className:"text-lg font-semibold leading-6 text-gray-900 dark:text-white",children:s}),p.jsx("div",{className:"mt-2",children:p.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:o})})]})]}),p.jsxs("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[u&&p.jsx("button",{type:"button",className:`inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 sm:ml-3 sm:w-auto ${A}`,onClick:a,children:u}),c&&p.jsx("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-200 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 sm:mt-0 sm:w-auto",onClick:r,children:c})]})]})})]})};var C1=class{constructor(n){this.lowercaseChars="abcdefghijklmnopqrstuvwxyz",this.uppercaseChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.numberChars="0123456789",this.specialChars="!@#$%^&*()_+-=[]{}|;:,.<>?",this.ambiguousChars="Il1O0o",this.length=18,this.useLowercase=!0,this.useUppercase=!0,this.useNumbers=!0,this.useSpecial=!0,this.useNonAmbiguous=!1,n&&this.applySettings(n)}applySettings(n){return this.length=n.Length,this.useLowercase=n.UseLowercase,this.useUppercase=n.UseUppercase,this.useNumbers=n.UseNumbers,this.useSpecial=n.UseSpecialChars,this.useNonAmbiguous=n.UseNonAmbiguousChars,this}setLength(n){return this.length=n,this}useLowercaseLetters(n){return this.useLowercase=n,this}useUppercaseLetters(n){return this.useUppercase=n,this}useNumericCharacters(n){return this.useNumbers=n,this}useSpecialCharacters(n){return this.useSpecial=n,this}useNonAmbiguousCharacters(n){return this.useNonAmbiguous=n,this}getUnbiasedRandomIndex(n){const r=Math.floor(4294967296/n)*n;for(;;){const a=new Uint32Array(1);crypto.getRandomValues(a);const s=a[0];if(s<r)return s%n}}generateRandomPassword(){const n=this.buildCharacterSet();let r=this.generateInitialPassword(n);return r=this.ensureRequirements(r),r}buildCharacterSet(){let n="";return this.useLowercase&&(n+=this.lowercaseChars),this.useUppercase&&(n+=this.uppercaseChars),this.useNumbers&&(n+=this.numberChars),this.useSpecial&&(n+=this.specialChars),n.length===0&&(n=this.lowercaseChars),this.useNonAmbiguous&&(n=this.removeAmbiguousCharacters(n)),n}removeAmbiguousCharacters(n){for(const r of this.ambiguousChars)n=n.replace(r,"");return n}generateInitialPassword(n){let r="";for(let a=0;a<this.length;a++)r+=n[this.getUnbiasedRandomIndex(n.length)];return r}ensureRequirements(n){return this.useLowercase&&!/[a-z]/.exec(n)&&(n=this.addCharacterFromSet(n,this.getSafeCharacterSet(this.lowercaseChars,!0))),this.useUppercase&&!/[A-Z]/.exec(n)&&(n=this.addCharacterFromSet(n,this.getSafeCharacterSet(this.uppercaseChars,!0))),this.useNumbers&&!/\d/.exec(n)&&(n=this.addCharacterFromSet(n,this.getSafeCharacterSet(this.numberChars,!1))),this.useSpecial&&!/[!@#$%^&*()_+\-=[\]{}|;:,.<>?]/.exec(n)&&(n=this.addCharacterFromSet(n,this.specialChars)),n}getSafeCharacterSet(n,r){if(!this.useNonAmbiguous)return n;let a=n;for(const s of this.ambiguousChars){if(!r&&!/\d/.test(s))continue;let o=s;r&&(n===this.lowercaseChars?o=s.toLowerCase():o=s.toUpperCase()),a=a.replace(o,"")}return a}addCharacterFromSet(n,r){const a=this.getUnbiasedRandomIndex(this.length),s=r[this.getUnbiasedRandomIndex(r.length)];return n.substring(0,a)+s+n.substring(a+1)}},$u=n=>new C1(n);const w1=({isOpen:n,onClose:r,onSave:a,onSettingsChange:s,initialSettings:o})=>{const{t:u}=Bt(),[c,d]=M.useState(o),[m,A]=M.useState(""),b=M.useCallback(k=>{try{const N=$u(k).generateRandomPassword();A(N)}catch(R){console.error("Error generating preview password:",R),A("")}},[]);M.useEffect(()=>{n&&(d({...o}),b({...o}))},[n,o,b]);const v=M.useCallback((k,R)=>{const N={...c,[k]:R};d(N),b(N),s==null||s(N)},[c,b,s]),B=M.useCallback(()=>{b(c)},[c,b]),T=M.useCallback(()=>{a(m),r()},[m,a,r]),Q=M.useCallback(()=>{r()},[r]);return n?p.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-60 transition-opacity",onClick:Q}),p.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:p.jsxs("div",{className:"relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 px-4 pb-4 pt-5 text-left shadow-xl transition-all w-full max-w-lg",children:[p.jsx("button",{type:"button",className:"absolute right-4 top-4 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:Q,children:p.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),p.jsx("div",{className:"sm:flex sm:items-start",children:p.jsxs("div",{className:"w-full mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[p.jsx("h3",{className:"text-lg font-medium leading-6 text-gray-900 dark:text-white mb-4",children:u("credentials.changePasswordComplexity")}),p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"mt-4",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("input",{type:"text",value:m,readOnly:!0,className:"flex-1 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white font-mono"}),p.jsx("button",{type:"button",onClick:B,className:"px-3 py-2 text-sm text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:u("credentials.generateNewPreview"),children:p.jsx("svg",{className:"w-4 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("button",{type:"button",onClick:()=>v("UseLowercase",!c.UseLowercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseLowercase?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeLowercase"),children:p.jsx("span",{className:"font-mono text-base",children:"a-z"})}),p.jsx("button",{type:"button",onClick:()=>v("UseUppercase",!c.UseUppercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseUppercase?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeUppercase"),children:p.jsx("span",{className:"font-mono text-base",children:"A-Z"})}),p.jsx("button",{type:"button",onClick:()=>v("UseNumbers",!c.UseNumbers),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseNumbers?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeNumbers"),children:p.jsx("span",{className:"font-mono text-base",children:"0-9"})}),p.jsx("button",{type:"button",onClick:()=>v("UseSpecialChars",!c.UseSpecialChars),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseSpecialChars?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeSpecialChars"),children:p.jsx("span",{className:"font-mono text-base",children:"!@#"})})]}),p.jsxs("div",{className:"flex items-center",children:[p.jsx("input",{id:"use-non-ambiguous",type:"checkbox",checked:c.UseNonAmbiguousChars,onChange:k=>v("UseNonAmbiguousChars",k.target.checked),className:"h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded dark:bg-gray-700 dark:border-gray-600"}),p.jsx("label",{htmlFor:"use-non-ambiguous",className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:u("credentials.avoidAmbiguousChars")})]})]})]}),p.jsx("div",{className:"mt-5 sm:mt-6 sm:flex sm:flex-row-reverse",children:p.jsxs("button",{type:"button",className:"inline-flex w-full justify-center items-center gap-1 rounded-md bg-gray-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-500 sm:ml-3 sm:w-auto",onClick:T,children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z"})}),u("common.use")]})})]})})]})})]}):null},I1=({id:n,label:r,value:a,onChange:s,placeholder:o,error:u,showPassword:c,onShowPasswordChange:d,initialSettings:m})=>{const{t:A}=Bt(),[b,v]=M.useState(!1),[B,T]=M.useState(!1),[Q,k]=M.useState(m),R=c!==void 0?c:b,N=M.useCallback(J=>{c!==void 0?d==null||d(J):v(J)},[c,d]);M.useEffect(()=>{k({...m})},[]);const O=M.useCallback(J=>{try{const $=$u(J).generateRandomPassword();s($),N(!0)}catch(K){console.error("Error generating password:",K)}},[s,N]),_=M.useCallback(J=>{const K=parseInt(J.target.value,10),$={...Q,Length:K};k($),O($)},[Q,O]),q=M.useCallback(()=>{O(Q)},[O,Q]),V=M.useCallback(J=>{s(J),N(!0)},[s,N]),ge=M.useCallback(J=>{k(J)},[]),ce=M.useCallback(()=>{N(!R)},[R,N]),te=M.useCallback(()=>{T(!0)},[]);return p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{htmlFor:n,className:"block text-sm font-medium text-gray-900 dark:text-white",children:r}),p.jsxs("div",{className:"flex",children:[p.jsx("div",{className:"relative flex-grow",children:p.jsx("input",{type:R?"text":"password",id:n,value:a,onChange:J=>s(J.target.value),placeholder:o,className:"outline-0 shadow-sm border border-gray-300 bg-gray-50 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),p.jsxs("div",{className:"flex",children:[p.jsx("button",{type:"button",onClick:ce,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:A(R?"common.hidePassword":"common.showPassword"),children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:R?p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}):p.jsxs(p.Fragment,{children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})}),p.jsx("button",{type:"button",onClick:q,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:A("credentials.generateRandomPassword"),children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),p.jsxs("div",{className:"pt-2",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("label",{htmlFor:`${n}-length`,className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:A("credentials.passwordLength")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:Q.Length}),p.jsx("button",{type:"button",onClick:te,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",title:A("credentials.changePasswordComplexity"),children:p.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]})]}),p.jsx("input",{type:"range",id:`${n}-length`,min:"8",max:"64",value:Q.Length,onChange:_,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),u&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u}),p.jsx(w1,{isOpen:B,onClose:()=>T(!1),onSave:V,onSettingsChange:ge,initialSettings:Q})]})},B1=({id:n,label:r,value:a,onChange:s,placeholder:o,error:u,onRegenerate:c})=>{const{t:d}=Bt(),m=M.useCallback(b=>{s(b.target.value)},[s]),A=M.useCallback(()=>{c()},[c]);return p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{htmlFor:n,className:"block text-sm font-medium text-gray-900 dark:text-white",children:r}),p.jsxs("div",{className:"flex",children:[p.jsx("div",{className:"relative flex-grow",children:p.jsx("input",{type:"text",id:n,value:a,onChange:m,placeholder:o,className:"outline-0 shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),p.jsx("div",{className:"flex",children:p.jsx("button",{type:"button",onClick:A,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:d("credentials.generateRandomUsername"),children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})})]}),u&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u})]})};class S1{constructor(r){this.authContextLogout=r}async getBaseUrl(){return(await this.getApiUrl()).replace(/\/$/,"")+"/v1/"}async isSelfHosted(){return await this.getApiUrl()!==cr.DEFAULT_API_URL}async authFetch(r,a={},s=!0,o=!0){const u=new Headers(a.headers??{}),c=await this.getAccessToken();c&&u.set("Authorization",`Bearer ${c}`);const d={...a,headers:u};try{const m=await this.rawFetch(r,d);if(m.status===401){const A=await this.refreshAccessToken();if(A){u.set("Authorization",`Bearer ${A}`);const b=await this.rawFetch(r,{...d,headers:u});if(!b.ok)throw new Error("Request failed after token refresh");return s?b.json():b}else throw this.authContextLogout(null),new Error("Session expired")}if(!m.ok&&o)throw new Error(`HTTP error! status: ${m.status}`);return s?m.json():m}catch(m){throw console.error("API request failed:",m),m}}async rawFetch(r,a={}){const o=await this.getBaseUrl()+r,u=new Headers(a.headers??{});u.set("X-AliasVault-Client",`${cr.CLIENT_NAME}-${cr.VERSION}`);const c={...a,headers:u};try{return await fetch(o,c)}catch(d){throw console.error("API request failed:",d),d}}async refreshAccessToken(){const r=await this.getRefreshToken();if(!r)return null;try{const a=await this.rawFetch("Auth/refresh",{method:"POST",headers:{"Content-Type":"application/json","X-Ignore-Failure":"true"},body:JSON.stringify({token:await this.getAccessToken(),refreshToken:r})});if(!a.ok)throw new Error("Failed to refresh token");const s=await a.json();return this.updateTokens(s.token,s.refreshToken),s.token}catch{return this.authContextLogout("Your session has expired. Please login again."),null}}async get(r){return this.authFetch(r,{method:"GET"})}async downloadBlob(r){try{const s=await(await this.authFetch(r,{method:"GET",headers:{Accept:"application/octet-stream"}},!1)).arrayBuffer();return new Uint8Array(s)}catch(a){throw console.error("Error downloading blob:",a),a}}async post(r,a,s=!0){return this.authFetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},s)}async put(r,a){return this.authFetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}async delete(r){return this.authFetch(r,{method:"DELETE"},!1)}async logout(r=null){try{const a=await this.getRefreshToken();a&&await this.post("Auth/revoke",{token:await this.getAccessToken(),refreshToken:a},!1)}catch(a){console.error("WebApi logout error:",a)}this.authContextLogout(r)}async getStatus(){try{return await this.get("Auth/status")}catch{return{clientVersionSupported:!0,serverVersion:"0.0.0",vaultRevision:0}}}validateStatusResponse(r){return r.serverVersion==="0.0.0"?"errors.serverNotAvailable":r.clientVersionSupported?cr.isServerVersionSupported(r.serverVersion)?null:"errors.serverVersionNotSupported":"errors.clientVersionNotSupported"}validateVaultResponse(r,a){var s;return r.status===1?a("errors.VaultMergeRequired"):r.status===2?a("errors.VaultOutdated"):(s=r.vault)!=null&&s.blob?null:a("errors.NoVaultFound")}async getAccessToken(){return await Xe.getItem("local:accessToken")??null}async getRefreshToken(){return await Xe.getItem("local:refreshToken")??null}async updateTokens(r,a){await Xe.setItem("local:accessToken",r),await Xe.setItem("local:refreshToken",a)}async getApiUrl(){const r=await Xe.getItem("local:apiUrl");return!r||r.length===0?cr.DEFAULT_API_URL:r}}const Ry=M.createContext(null),N1=({children:n})=>{const{logout:r}=Yn(),[a,s]=M.useState(null);return M.useEffect(()=>{const o=new S1(u=>{u?r(u):r()});s(o)},[r]),a?p.jsx(Ry.Provider,{value:a,children:n}):null},da=()=>{const n=M.useContext(Ry);if(!n)throw new Error("useWebApi must be used within a WebApiProvider");return n},Ff=async(n,r,a=!0)=>{if(!a)return n();const s=Date.now(),o=await n(),u=Date.now()-s;return u<r&&await new Promise(c=>setTimeout(c,r-u)),o},ac=()=>{const{t:n}=Bt(),r=Yn(),a=kr(),s=da();return{syncVault:M.useCallback(async(u={})=>{const{initialSync:c=!1,onSuccess:d,onError:m,onStatus:A,_onOffline:b,onUpgradeRequired:v}=u,B=c;try{const{isLoggedIn:T}=await r.initializeAuth();if(!T)return!1;A==null||A(n("common.checkingVaultUpdates"));const Q=await Ff(()=>s.getStatus(),300,B);Q.serverVersion;const k=s.validateStatusResponse(Q);if(k)return m==null||m(n("common.errors."+k)),!1;const R=await a.getVaultMetadata(),N=(R==null?void 0:R.vaultRevisionNumber)??0;if(Q.vaultRevision>N){A==null||A(n("common.syncingUpdatedVault"));const O=await Ff(()=>s.get("Vault"),1e3,B),_=s.validateVaultResponse(O,n);if(_)return(_.includes("authentication")||_.includes("unauthorized"))&&(await s.logout(_),m==null||m(_)),!1;try{const q=await Dn("GET_DERIVED_KEY",{},"background");return await(await a.initializeDatabase(O,q)).hasPendingMigrations()?(v==null||v(),!1):(d==null||d(!0),!0)}catch(q){if(q instanceof Error&&q.message.includes("This browser extension is outdated"))return await s.logout(q.message),m==null||m(q.message),!1;throw new Error("Vault could not be decrypted, if the problem persists please logout and login again.")}}return await a.hasPendingMigrations()?(v==null||v(),!1):(await Ff(()=>Promise.resolve(d==null?void 0:d(!1)),300,B),!1)}catch(T){const Q=T instanceof Error?T.message:"Unknown error during vault sync";return console.error("Vault sync error:",T),Q.includes("This browser extension is outdated")?(await s.logout(Q),m==null||m(Q),!1):(m==null||m(Q),!1)}},[r,a,s,n])}};function ky(){const{t:n}=Bt(),[r,a]=M.useState(!1),[s,o]=M.useState(n("common.syncingVault")),u=kr(),{syncVault:c}=ac(),d=M.useCallback(async(A,b)=>{var v,B;o(n("common.savingChangesToVault")),await A(),o(n("common.uploadingVaultToServer"));try{const T=u.sqliteClient.exportToBase64(),Q=await Dn("GET_DERIVED_KEY",{},"background"),R={vaultBlob:await Yt.symmetricEncrypt(T,Q)},N=await Dn("UPLOAD_VAULT",R,"background");if(N.status===0&&N.newRevisionNumber)await u.setCurrentVaultRevisionNumber(N.newRevisionNumber),(v=b.onSuccess)==null||v.call(b);else throw N.status===1?new Error("Vault merge required. Please login via the web app to merge the multiple pending updates to your vault."):N.status===2?new Error("Your vault is outdated. Please login on the AliasVault website and follow the steps."):new Error("Failed to upload vault to server. Please try again by re-opening the app.")}catch(T){if(T instanceof Error&&(T.message.includes("network")||T.message.includes("timeout"))){(B=b.onError)==null||B.call(b,new Error("Network error"));return}throw T}},[u,n]);return{executeVaultMutation:M.useCallback(async(A,b={})=>{var v;try{if(a(!0),o(n("common.checkingVaultUpdates")),b.skipSyncCheck){o(n("common.executingOperation")),await d(A,b);return}await c({onStatus:B=>o(B),onSuccess:async B=>{await d(A,b)},onError:B=>{var T;(T=b.onError)==null||T.call(b,new Error(B))}})}catch(B){console.error("Error during vault mutation:",B),(v=b.onError)==null||v.call(b,B instanceof Error?B:new Error("Unknown error"))}finally{a(!1),o("")}},[c,d,n]),isLoading:r,syncStatus:s}}var Ly=(n=>(n.Male="Male",n.Female="Female",n.Other="Other",n))(Ly||{}),QA=class Ra{constructor(){this.symbols=[".","-"]}generateUsername(r){let a=this.generateEmailPrefix(r);return a=a.replace(/[^a-zA-Z0-9]/g,""),a.length<Ra.MIN_LENGTH?a+=this.generateRandomString(Ra.MIN_LENGTH-a.length):a.length>Ra.MAX_LENGTH&&(a=a.substring(0,Ra.MAX_LENGTH)),a}generateEmailPrefix(r){const a=[];switch(typeof r.birthDate=="string"&&(r.birthDate=new Date(r.birthDate)),this.getSecureRandom(4)){case 0:a.push(r.firstName.substring(0,1).toLowerCase()+r.lastName.toLowerCase());break;case 1:a.push((r.firstName+r.lastName).toLowerCase());break;case 2:a.push(r.firstName.toLowerCase()+r.lastName.substring(0,1).toLowerCase());break;case 3:a.push(r.firstName.substring(0,Math.min(3,r.firstName.length)).toLowerCase()+r.lastName.toLowerCase());break}if(this.getSecureRandom(3)!==0)switch(this.getSecureRandom(2)){case 0:a.push(r.birthDate.getFullYear().toString().substring(2));break;case 1:a.push(r.birthDate.getFullYear().toString());break}else this.getSecureRandom(2)===0&&a.push((this.getSecureRandom(990)+10).toString());let s=a.join(this.getRandomSymbol());if(this.getSecureRandom(2)===0){const o=this.getSecureRandom(s.length);s=s.slice(0,o)+this.getRandomSymbol()+s.slice(o)}return s=this.sanitizeEmailPrefix(s),s.length<Ra.MIN_LENGTH?s+=this.generateRandomString(Ra.MIN_LENGTH-s.length):s.length>Ra.MAX_LENGTH&&(s=s.substring(0,Ra.MAX_LENGTH)),s}sanitizeEmailPrefix(r){let a=r.replace(/[^a-zA-Z0-9._-]/g,"");return a=a.replace(/[-_.]{2,}/g,s=>s[0]),a=a.replace(/^[-._]+/,""),a=a.replace(/[-._]*$/,""),a}getRandomSymbol(){return this.getSecureRandom(3)===0?this.symbols[this.getSecureRandom(this.symbols.length)]:""}generateRandomString(r){const a="abcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:r},()=>a.charAt(this.getSecureRandom(a.length))).join("")}getSecureRandom(r){const a=new Uint32Array(1);return crypto.getRandomValues(a),a[0]%r}};QA.MIN_LENGTH=6;QA.MAX_LENGTH=20;var Uy=QA,My=class{constructor(){this.firstNamesMale=[],this.firstNamesFemale=[],this.lastNames=[],this.random=Math.random,this.firstNamesMale=this.getFirstNamesMaleJson(),this.firstNamesFemale=this.getFirstNamesFemaleJson(),this.lastNames=this.getLastNamesJson()}generateRandomDateOfBirth(){const n=new Date,r=21,a=65,s=new Date(n.getFullYear()-a,n.getMonth(),n.getDate()),o=new Date(n.getFullYear()-r,n.getMonth(),n.getDate()),u=s.getTime()+this.random()*(o.getTime()-s.getTime());return new Date(u)}generateRandomIdentity(n){const r={firstName:"",lastName:"",gender:"Male",birthDate:new Date,emailPrefix:"",nickName:""};let a;if(n==="random"||n===void 0?a=this.random()<.5?"Male":"Female":n==="male"?a="Male":n==="female"?a="Female":a="Male",r.gender=a,a==="Male")r.firstName=this.firstNamesMale[Math.floor(this.random()*this.firstNamesMale.length)];else if(a==="Female")r.firstName=this.firstNamesFemale[Math.floor(this.random()*this.firstNamesFemale.length)];else{const o=this.random()<.5;r.firstName=o?this.firstNamesMale[Math.floor(this.random()*this.firstNamesMale.length)]:this.firstNamesFemale[Math.floor(this.random()*this.firstNamesFemale.length)]}r.lastName=this.lastNames[Math.floor(this.random()*this.lastNames.length)],r.birthDate=this.generateRandomDateOfBirth();const s=new Uy;return r.emailPrefix=s.generateEmailPrefix(r),r.nickName=s.generateUsername(r),r}},T1=["Michael","Christopher","Matthew","Joshua","Daniel","David","Andrew","Joseph","James","John","Robert","William","Ryan","Jason","Nicholas","Jonathan","Jacob","Brandon","Tyler","Zachary","Kevin","Justin","Benjamin","Anthony","Samuel","Thomas","Alexander","Ethan","Noah","Dylan","Nathan","Christian","Austin","Adam","Caleb","Cody","Jordan","Logan","Aaron","Kyle","Jose","Brian","Gabriel","Timothy","Luke","Jared","Connor","Sean","Evan","Isaac","Jack","Cameron","Hunter","Jackson","Charles","Devin","Stephen","Patrick","Steven","Elijah","Scott","Mark","Jeffrey","Corey","Juan","Luis","Derek","Chase","Travis","Alex","Spencer","Ian","Trevor","Bryan","Tanner","Marcus","Jeremy","Eric","Jaden","Garrett","Isaiah","Dustin","Jesse","Seth","Blake","Nathaniel","Mason","Liam","Paul","Carlos","Mitchell","Parker","Lucas","Richard","Cole","Adrian","Colin","Bradley","Jesus","Peter","Kenneth","Joel","Victor","Bryce","Casey","Vincent","Edward","Henry","Dominic","Riley","Shane","Dalton","Grant","Shawn","Braden","Caden","Max","Hayden","Owen","Brett","Trevor","Philip","Brendan","Wesley","Aidan","Brady","Colton","Tristan","George","Gavin","Dawson","Miguel","Antonio","Nolan","Dakota","Jace","Collin","Preston","Levi","Alan","Jorge","Carson","Felix","Oliver","Theodore","Harrison","Maxwell","Sebastian","Xavier","Dominick","Lincoln","Elliott","Walter","Simon","Dean","Hugo","Malcolm","Leon","Oscar","Calvin","Raymond","Edgar","Franklin","Arthur","Lawrence","Dennis","Russell","Douglas","Leonard","Gregory","Harold","Frederick","Martin","Curtis","Stanley","Gilbert","Harvey","Francis","Eugene","Ralph","Roy","Albert","Bruce","Ronald","Keith","Craig","Roger","Randy","Gary","Dennis","Edwin","Don","Glen","Gordon","Howard","Earl","Leo","Lloyd","Milton","Norman","Roland","Vernon","Warren","Alfred","Bernard","Chester","Clarence","Clifford","Clyde","Dale","Dan","Darrell","Floyd","Herman","Jerome","Maurice","Neil","Ray","Rodney","Roland","Stuart","Wallace","Wayne","Wendell","Barry","Cecil","Claude","Daryl","Edmund","Everett","Ferdinand","Forrest","Gerald","Hugh","Irving","Leslie","Marvin","Morris","Nelson","Perry","Phillip","Roderick","Ross","Terrence","Wade","Winston","Zachariah"],Q1=["Emily","Emma","Olivia","Ava","Sophia","Isabella","Mia","Charlotte","Amelia","Harper","Evelyn","Abigail","Elizabeth","Sofia","Avery","Ella","Madison","Scarlett","Victoria","Aria","Grace","Chloe","Camila","Penelope","Riley","Layla","Zoey","Nora","Lily","Eleanor","Hannah","Lillian","Addison","Aubrey","Ellie","Stella","Natalie","Zoe","Leah","Hazel","Violet","Aurora","Savannah","Audrey","Brooklyn","Bella","Claire","Skylar","Lucy","Paisley","Everly","Anna","Caroline","Nova","Genesis","Emilia","Kennedy","Samantha","Maya","Willow","Kinsley","Naomi","Aaliyah","Elena","Sarah","Ariana","Allison","Gabriella","Alice","Madelyn","Cora","Ruby","Eva","Serenity","Autumn","Adeline","Hailey","Gianna","Valentina","Isla","Eliana","Quinn","Nevaeh","Ivy","Sadie","Piper","Lydia","Alexa","Josephine","Emery","Julia","Delilah","Arianna","Vivian","Kaylee","Sophie","Brielle","Madeline","Peyton","Rylee","Clara","Hadley","Melanie","Mackenzie","Reagan","Adalyn","Liliana","Aubree","Jade","Katherine","Isabelle","Natalia","Raelynn","Maria","Athena","Ximena","Arya","Leilani","Taylor","Faith","Rose","Kylie","Alexandra","Mary","Margaret","Lyla","Ashley","Amaya","Eliza","Brianna","Bailey","Andrea","Khloe","Jasmine","Melody","Iris","Isabel","Norah","Annabelle","Valeria","Emerson","Adalynn","Ryleigh","Eden","Emersyn","Anastasia","Kayla","Alyssa","Anna","Juliana","Charlie","Lucia","Stella","Adriana","Beatrice","Bianca","Calliope","Carmen","Celeste","Dakota","Diana","Esther","Florence","Francesca","Georgia","Harlow","Haven","Holly","Hope","India","Indie","Iris","Juniper","Kaia","Keira","Lara","Laura","Laurel","Luna","Magnolia","Maeve","Marina","Marlowe","Nina","Noelle","Octavia","Olive","Ophelia","Phoenix","Poppy","Primrose","Ramona","River","Rosalie","Rosemary","Sage","Salem","Selena","Sienna","Summer","Sylvie","Thea","Tessa","Wren","Winter","Willa","Ada","Aspen","Blair","Brynn","Cassidy","Cecilia","Daisy","Dawn","Daphne","Ember","Fiona","Flora","Freya","Gemma","Giselle","Harmony","Heidi","Imogen","Indie","Jessie","June","Kaia","Lena","Lola","Mabel","Maisie","Margot","Matilda","Mira","Morgan","Nell","Nadia","Odette","Opal","Pearl","Phoebe","Raven","Reese","Robin","Rowan","Ruth","Sabrina","Sasha","Sierra","Skye","Sloane","Talia","Thora","Vera","Willa","Winnie","Yara","Zara"],D1=["Smith","Johnson","Williams","Brown","Jones","Garcia","Miller","Davis","Rodriguez","Martinez","Hernandez","Lopez","Gonzalez","Wilson","Anderson","Thomas","Taylor","Moore","Jackson","Martin","Lee","Perez","Thompson","White","Harris","Sanchez","Clark","Ramirez","Lewis","Robinson","Walker","Young","Allen","King","Wright","Scott","Torres","Nguyen","Hill","Flores","Green","Adams","Nelson","Baker","Hall","Rivera","Campbell","Mitchell","Carter","Roberts","Gomez","Phillips","Evans","Turner","Diaz","Parker","Cruz","Edwards","Collins","Reyes","Stewart","Morris","Morales","Murphy","Cook","Rogers","Gutierrez","Ortiz","Morgan","Cooper","Peterson","Bailey","Reed","Kelly","Howard","Ramos","Kim","Cox","Ward","Richardson","Watson","Brooks","Chavez","Wood","James","Bennett","Gray","Mendoza","Ruiz","Hughes","Price","Alvarez","Castillo","Sanders","Patel","Myers","Long","Ross","Foster","Jimenez","Powell","Jenkins","Perry","Russell","Sullivan","Bell","Coleman","Butler","Henderson","Barnes","Gonzales","Fisher","Vasquez","Simmons","Romero","Jordan","Patterson","Alexander","Hamilton","Graham","Reynolds","Griffin","Wallace","Moreno","West","Cole","Hayes","Bryant","Herrera","Gibson","Ellis","Tran","Medina","Aguilar","Stevens","Murray","Ford","Castro","Marshall","Owens","Harrison","Fernandez","McDonald","Woods","Washington","Kennedy","Wells","Vargas","Henry","Chen","Freeman","Webb","Tucker","Guzman","Burns","Crawford","Olson","Simpson","Porter","Hunter","Gordon","Mendez","Silva","Shaw","Snyder","Mason","Dixon","Blackwood","Shepherd","Frost","Hawkins","Pearson","Fleming","Dawson","Palmer","Nash","Barker","Thornton","Fitzgerald","Winters","Mckenzie","Chandler","Griffith","Cunningham","Doyle","Fletcher","Hicks","Walton","Briggs","Pearce","Nichols","Blake","Hodges","Benson","Marsh","Whitaker","Skinner","Robbins","Goodwin","Kirby","Savage","Hensley","Hancock","Pratt","Gallagher","Yates","Dennis","Swanson","Steele","Bauer","Holt","Barber","Schultz","Foley","Fowler","Wise","Malone","Cannon","Tate","Stark","Welch","Dyer","Booth","Payne","Shannon","Harmon","Woodward","Morse","Jacobson","Knowles","Blanchard","Dillon","Stokes","Buckley","Dickerson","Middleton","Sellers","Cobb","Stephenson","Roach","Moody","Beard","Mccarthy","Garner","Mcguire","Sloan","Ballard","Shields","Orr","Savage","Graves","Dempsey","Weeks","Mckay","Cooke","Riddle","Gates","Atkins","Farrell","Lowery","Huffman","Livingston","Davenport","Hendricks","Kerr","Pollard","Hoover","Wolfe","Bowman","Underwood","Frazier"],R1=class extends My{getFirstNamesMaleJson(){return T1}getFirstNamesFemaleJson(){return Q1}getLastNamesJson(){return D1}},k1=["Daan","Luuk","Sem","Finn","Milan","Levi","Noah","Lucas","Jesse","Thijs","Jayden","Bram","Lars","Ruben","Thomas","Tim","Sam","Liam","Julian","Mees","Ties","Sven","Max","Gijs","David","Stijn","Jasper","Niels","Jens","Timo","Cas","Joep","Roan","Tom","Tygo","Teun","Siem","Mats","Thijmen","Rens","Niek","Tobias","Dex","Hugo","Robin","Nick","Floris","Pepijn","Boaz","Olivier","Luca","Jurre","Jelle","Guus","Koen","Bart","Olaf","Wessel","Daniël","Job","Sander","Tijmen","Kai","Quinten","Owen","Morris","Fedde","Joris","Jesper","Mick","Ryan","Milo","Stan","Benjamin","Melle","Jip","Dylan","Brent","Mick","Dean","Otis","Abel","Luc","Sepp","Vince","Rayan","Noud","Hidde","Fabian","Jort","Damian","Boris","Sil","Moos","Aiden","Sep","Mika","Mijs","Mika","Felix","Merlijn","Alexander","Aron","Arthur","Axel","Bas","Bastiaan","Berend","Björn","Casper","Cees","Chris","Christian","Christiaan","Colin","Cornelis","Dani","Dennis","Dirk","Dominic","Eduard","Eelco","Erik","Erwin","Ezra","Faas","Filip","Florian","Frank","Frederik","Freek","Gerard","Gerrit","Giel","Gijs","Glenn","Govert","Harm","Harold","Hendrik","Henrik","Huub","Ian","Ivo","Jacob","Jake","Jan","Jarno","Jason","Jeffrey","Jeremy","Jim","Jimmy","Johan","Johannes","Jonas","Jonathan","Jos","Joshua","Justin","Kay","Kevin","Kjeld","Klaas","Lennard","Lennart","Leon","Lex","Liam","Loek","Lorenzo","Louis","Lowie","Maarten","Magnus","Maikel","Marc","Marcel","Marco","Martijn","Mathias","Matthijs","Maurits","Menno","Michiel","Nathan","Nico","Oscar","Pascal","Patrick","Paul","Peter","Philip","Pieter","Pim","Quincy","Remco","Rick","Rik","Robert","Rogier","Rowan","Ruud","Simon","Stefan","Steven","Thom","Victor","Vincent","Willem","Wouter","Yannick"],L1=["Emma","Sophie","Julia","Mila","Tess","Sara","Anna","Noor","Lotte","Liv","Eva","Nora","Zoë","Evi","Yara","Saar","Nina","Fenna","Lieke","Fleur","Isa","Roos","Lynn","Sofie","Sarah","Milou","Olivia","Maud","Lisa","Vera","Luna","Lina","Noa","Feline","Loïs","Lena","Floor","Charlotte","Esmee","Julie","Iris","Lara","Amber","Hailey","Mia","Lize","Isabelle","Cato","Fenne","Sanne","Norah","Sophia","Ella","Nova","Elin","Femke","Lizzy","Linde","Lauren","Rosalie","Lana","Emily","Elise","Esmée","Anne","Isabelle","Demi","Hannah","Liva","Suze","Fay","Isabel","Benthe","Evi","Amy","Jasmijn","Niene","Sterre","Fenna","Fiene","Liz","Ise","Mara","Nienke","Indy","Romy","Lola","Puck","Nora","Merel","Bente","Eline","Lily","Leah","Naomi","Mirthe","Valerie","Noor","Liva","Jade","Juul","Lise","Myrthe","Veerle","Aafke","Alicia","Amira","Aniek","Annabel","Annelies","Anouk","Astrid","Babette","Bianca","Britt","Carlijn","Chantal","Claire","Dagmar","Danique","Daphne","Denise","Dominique","Doris","Eefje","Elena","Eline","Elisa","Elisabeth","Ellen","Esther","Eveline","Fabienne","Felice","Fleur","Frederique","Gwen","Hanna","Heleen","Helena","Ilona","Imke","Inge","Irene","Iris","Janna","Janneke","Jasmine","Jennifer","Jessica","Joelle","Judith","Julia","Karin","Karlijn","Kim","Kirsten","Kyra","Laura","Lena","Lianne","Liesbeth","Linda","Lisanne","Lisette","Louise","Maartje","Manon","Margot","Marieke","Marijke","Marlies","Marloes","Marthe","Melissa","Michelle","Nadine","Natalie","Nicole","Nina","Noortje","Paulien","Petra","Rachel","Renee","Robin","Rosa","Roxanne","Sabine","Sandra","Saskia","Silke","Simone","Suzanne","Sylvie","Tamara","Tanja","Tara","Thea","Thirza","Tina","Tineke","Ursula","Victoria","Wendy","Wilma","Xandra","Yasmin","Yvette","Yvonne","Zara"],U1=["de Jong","Jansen","de Vries","van den Berg","van Dijk","Bakker","Janssen","Visser","Smit","Meijer","de Boer","Mulder","de Groot","Bos","Vos","Peters","Hendriks","van Leeuwen","Dekker","Brouwer","de Wit","Dijkstra","Smits","de Graaf","van der Meer","van der Linden","Kok","Jacobs","de Haan","Vermeulen","van den Heuvel","van der Veen","van den Broek","de Bruijn","de Bruin","van der Heijden","Schouten","van Beek","Willems","van Vliet","van de Ven","Hoekstra","Maas","Verhoeven","Koster","van Dam","van der Wal","Prins","Blom","Huisman","Peeters","Kuipers","van Veen","van Dongen","Veenstra","Kramer","van den Bosch","van der Meulen","Mol","Zwart","van der Laan","Martens","van de Pol","Postma","Tromp","Borst","Boon","van Doorn","Jonker","van der Velden","Willemsen","van Wijk","Groen","Gerritsen","Bosch","van Loon","van der Ploeg","de Ruiter","Molenaar","Boer","Klein","de Koning","van de Kamp","van der Horst","Verbeek","Vink","Goossens","Scholten","Hartman","van Dalen","van Elst","Brink","Boekel","van de Berg","Berends","van der Hoek","Kuiper","Kooijman","de Lange","van der Sluis","van Gelder","Martens","van Asselt","Timmermans","van Vliet","van Rijn","van Schaik","Bosman","Wolters","van Hout","Hermans","van Rooij","de Vos","van Donselaar","Evers","van den Brink","Verkerk","Groeneveld","van Duijn","Schuurman","Hoogendoorn","van Zanten","Koopman","Cornelissen","van Driel","Teunissen","Versteeg","van Deursen","Schipper","van Kempen","Bouwman","van der Valk","Nijhuis","van der Werf","van den Akker","Verhoef","Wessels","van der Poel","Driessen","van Oosten","Lambrechts","van der Vlist","Hoogeveen","van Gils","Rietveld","Barendrecht","van der Spek","Stam","van der Linde","Boersma","van Dijk","Schepers","van der Kolk","Roelofs","van der Velden","van den Burg","Westra","van der Steen","Pronk","van der Veer","Rozendaal","van den Bos","Konings","van der Wiel","Noordam","van der Laan","Schut","van der Vlugt","Witteveen","van der Zwan","Boogaard","van der Waal","Stolk","van der Windt","Rutten","van der Zanden","Spaans","van der Zwaan","Roos","van der Zijl","Schoenmaker","van Diepen","Romeijn","van Doesburg","Schippers","van Eck","Rijken","van Egmond","Schrama","van Eijk","Ruijter","van Engelen","Sanders","van Es","Schenk","van Essen","van Gaal","van Geenen","van Gent","van Gestel","van Gool","van Grinsven","van Gurp","van Haaften","van Haren","van Hattem","van Hees"],M1=class extends My{getFirstNamesMaleJson(){return k1}getFirstNamesFemaleJson(){return L1}getLastNamesJson(){return U1}},Wl=class{static normalizeBirthDateForDisplay(n){return!n||n.startsWith("0001-01-01")?"":n.split(/[T ]/)[0]}static normalizeBirthDateForDb(n){if(!n||n.trim()==="")return"0001-01-01T00:00:00.000Z";const r=n.trim().replace(" ","T"),a=r.match(/^(\d{4})-(\d{2})-(\d{2})[T ]?(\d{2}):?(\d{2}):?(\d{2})?$/);if(a){const[o,u,c,d,m="00",A="00",b="00"]=a;return`${u}-${c}-${d}T${m}:${A}:${b}.000Z`}const s=new Date(r);return isNaN(s.getTime())?"0001-01-01T00:00:00.000Z":s.toISOString()}static isValidBirthDate(n){if(!n||n.trim()===""||n.startsWith("0001-01-01"))return!1;const r=new Date(n);return isNaN(r.getTime())?!1:r.getFullYear()>1&&r.getFullYear()<9999}},_1=n=>{switch(n){case"en":return new R1;case"nl":return new M1}throw new Error(`Unsupported language: ${n}`)},O1=()=>new Uy;const op=()=>{var ke,He,Ke,Ge,yt,We,Et,Kt,Sr,Lt,Ht,jt,Er,Qe,Fe,nt,lt;const{t:n}=Bt(),{id:r}=yA(),a=Rr(),s=kr(),o=r!==void 0&&r.length>0,u=M.useMemo(()=>Yu().shape({Id:Yr(),ServiceName:Yr().required(n("credentials.validation.serviceNameRequired")),ServiceUrl:Yr().url(n("credentials.validation.invalidUrl")).nullable().optional(),Alias:Yu().shape({FirstName:Yr().nullable().optional(),LastName:Yr().nullable().optional(),NickName:Yr().nullable().optional(),BirthDate:Yr().nullable().optional().test("is-valid-date-format",n("credentials.validation.invalidDateFormat"),j=>j?/^\d{4}-\d{2}-\d{2}$/.test(j):!0),Gender:Yr().nullable().optional(),Email:Yr().email(n("credentials.validation.invalidEmail")).nullable().optional()}),Username:Yr().nullable().optional(),Password:Yr().nullable().optional(),Notes:Yr().nullable().optional()}),[n]),{executeVaultMutation:c,isLoading:d,syncStatus:m}=ky(),[A,b]=M.useState("random"),{setHeaderButtons:v}=ca(),{setIsInitialLoading:B}=yn(),[T,Q]=M.useState(!0),[k,R]=M.useState(!o),[N,O]=M.useState(!1),[_,q]=M.useState([]),[V,ge]=M.useState([]),ce=da(),te=M.useRef(null),{handleSubmit:J,setValue:K,watch:$,formState:{errors:me}}=m1({resolver:E1(u),defaultValues:{Id:"",Username:"",Password:"",ServiceName:"",ServiceUrl:"",Notes:"",Alias:{FirstName:"",LastName:"",NickName:"",BirthDate:"",Gender:void 0,Email:""}}}),he=M.useCallback(async()=>{if(T)return;const j=$(),X={credentialId:r||null,mode:A,formValues:{...j,Logo:null}};await Dn("PERSIST_FORM_VALUES",JSON.stringify(X),"background")},[$,r,A,T]);M.useEffect(()=>{T||he()},[A,he,T]),M.useEffect(()=>{const j=$(()=>{he()});return()=>j.unsubscribe()},[$,he]);const we=M.useCallback(async()=>{const j=await Dn("GET_PERSISTED_FORM_VALUES",null,"background");try{let X=null;try{j&&(X=JSON.parse(j))}catch(Re){console.error("Error parsing persisted data:",Re)}if(X==null){Q(!1);return}const Te=(X==null?void 0:X.credentialId)==r;X&&Te?(b(X.mode),Object.entries(X.formValues).forEach(([Re,xe])=>{K(Re,xe)})):console.error("Persisted values do not match current page")}catch(X){console.error("Error loading persisted data:",X)}Q(!1)},[K,r,b,Q]),pe=M.useCallback(async()=>{await Dn("CLEAR_PERSISTED_FORM_VALUES",null,"background")},[]);M.useEffect(()=>()=>{pe()},[pe]),M.useEffect(()=>{if(s!=null&&s.sqliteClient){if(!r){setTimeout(()=>{var j;(j=te.current)==null||j.focus()},100),B(!1),we().then(()=>{if(!$("Password")){const j=s.sqliteClient.getPasswordSettings(),se=$u(j).generateRandomPassword();K("Password",se)}});return}try{const j=s.sqliteClient.getCredentialById(r);if(j){j.Alias.BirthDate=Wl.normalizeBirthDateForDisplay(j.Alias.BirthDate),Object.entries(j).forEach(([se,Te])=>{K(se,Te)});const X=s.sqliteClient.getAttachmentsForCredential(r);q(X),ge(X.map(se=>se.Id)),b("manual"),B(!1),we()}else console.error("Credential not found"),a("/credentials")}catch(j){console.error("Error loading credential:",j),B(!1)}}},[s.sqliteClient,r,a,B,K,we,$]);const P=M.useCallback(async()=>{r&&c(async()=>{s.sqliteClient.deleteCredentialById(r)},{onSuccess:()=>{pe(),a("/credentials")}})},[r,c,s.sqliteClient,a,pe]),ae=M.useCallback(async()=>{const j=s.sqliteClient.getDefaultIdentityLanguage(),X=_1(j),se=s.sqliteClient.getPasswordSettings(),Te=$u(se);return{identityGenerator:X,passwordGenerator:Te}},[s.sqliteClient]),Ne=M.useCallback(async()=>{const{identityGenerator:j,passwordGenerator:X}=await ae(),se=s.sqliteClient.getDefaultIdentityGender(),Te=j.generateRandomIdentity(se),Re=X.generateRandomPassword(),xe=await s.getVaultMetadata(),Ve=(xe==null?void 0:xe.privateEmailDomains)??[],S=(xe==null?void 0:xe.publicEmailDomains)??[],E=s.sqliteClient.getDefaultEmailDomain(Ve,S),x=E?`${Te.emailPrefix}@${E}`:Te.emailPrefix;K("Alias.Email",x),K("Alias.FirstName",Te.firstName),K("Alias.LastName",Te.lastName),K("Alias.NickName",Te.nickName),K("Alias.Gender",Te.gender),K("Alias.BirthDate",Wl.normalizeBirthDateForDisplay(Te.birthDate.toISOString())),o&&$("Username")||K("Username",Te.nickName),o&&$("Password")||K("Password",Re)},[o,$,K,ae,s]),_e=M.useCallback(()=>{Ne()},[Ne]),G=M.useCallback(async()=>{try{const j=O1();let X=Ly.Other;try{X=$("Alias.Gender")}catch{}const se={firstName:$("Alias.FirstName")??"",lastName:$("Alias.LastName")??"",nickName:$("Alias.NickName")??"",gender:X,birthDate:new Date($("Alias.BirthDate")??""),emailPrefix:$("Alias.Email")??""},Te=j.generateUsername(se);K("Username",Te)}catch(j){console.error("Error generating random username:",j)}},[K,$]),ne=M.useMemo(()=>{var j;return(j=s.sqliteClient)==null?void 0:j.getPasswordSettings()},[s.sqliteClient]),Ee=M.useCallback(async j=>{let X=j.Alias.BirthDate;if(X&&(X=Wl.normalizeBirthDateForDb(X)),!o&&A==="random"&&(await Ne(),j.Username=$("Username"),j.Password=$("Password"),j.Alias.FirstName=$("Alias.FirstName"),j.Alias.LastName=$("Alias.LastName"),j.Alias.NickName=$("Alias.NickName"),j.Alias.BirthDate=X,j.Alias.Gender=$("Alias.Gender"),j.Alias.Email=$("Alias.Email")),j.ServiceUrl){Q(!0);try{const se=new Promise((xe,Ve)=>setTimeout(()=>Ve(new Error("Favicon extraction timed out")),5e3)),Te=ce.get("Favicon/Extract?url="+j.ServiceUrl),Re=await Promise.race([Te,se]);if(Re!=null&&Re.image){const xe=Uint8Array.from(Xi.Buffer.from(Re.image,"base64"));j.Logo=xe}}catch{}}c(async()=>{if(Q(!1),o)await s.sqliteClient.updateCredentialById(j,V,_);else{const se=await s.sqliteClient.createCredential(j,_);j.Id=se.toString()}},{onSuccess:()=>{pe(),o?a(-1):a(`/credentials/${j.Id}`,{replace:!0})}})},[o,s.sqliteClient,c,a,A,$,Ne,ce,pe,V,_]);return M.useEffect(()=>{const j=p.jsxs("div",{className:"flex items-center gap-2",children:[o&&p.jsx(an,{onClick:()=>O(!0),title:n("credentials.deleteCredential"),iconType:Kr.DELETE,variant:"danger"}),p.jsx(an,{onClick:J(Ee),title:n("credentials.saveCredential"),iconType:Kr.SAVE})]});return v(j),()=>{}},[v,J,Ee,o,n]),M.useEffect(()=>()=>v(null),[v]),o&&!$("ServiceName")?p.jsx("div",{children:n("common.loading")}):p.jsxs("form",{onSubmit:J(Ee),children:[p.jsx("button",{type:"submit",style:{display:"none"}}),(T||d)&&p.jsxs("div",{className:"fixed inset-0 flex flex-col justify-center items-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-50",children:[p.jsx(Ps,{}),p.jsx("div",{className:"text-sm text-gray-500 mt-2",children:m})]}),p.jsx(Xu,{isOpen:N,onClose:()=>O(!1),onConfirm:()=>{O(!1),P()},title:n("credentials.deleteCredentialTitle"),message:n("credentials.deleteCredentialConfirm"),confirmText:n("common.delete"),cancelText:n("common.cancel"),variant:"danger"}),!o&&p.jsxs("div",{className:"flex space-x-2 mb-4",children:[p.jsxs("button",{type:"button",onClick:()=>b("random"),className:`flex-1 py-2 px-4 rounded flex items-center justify-center gap-2 ${A==="random"?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:[p.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),p.jsx("circle",{cx:"8",cy:"8",r:"1"}),p.jsx("circle",{cx:"16",cy:"8",r:"1"}),p.jsx("circle",{cx:"12",cy:"12",r:"1"}),p.jsx("circle",{cx:"8",cy:"16",r:"1"}),p.jsx("circle",{cx:"16",cy:"16",r:"1"})]}),n("credentials.randomAlias")]}),p.jsxs("button",{type:"button",onClick:()=>b("manual"),className:`flex-1 py-2 px-4 rounded flex items-center justify-center gap-2 ${A==="manual"?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:[p.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"7",r:"4"}),p.jsx("path",{d:"M5.5 20a6.5 6.5 0 0 1 13 0"})]}),n("credentials.manual")]})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.service")}),p.jsxs("div",{className:"space-y-4",children:[p.jsx(aa,{id:"serviceName",label:n("credentials.serviceName"),ref:te,value:$("ServiceName")??"",onChange:j=>K("ServiceName",j),required:!0,error:(ke=me.ServiceName)==null?void 0:ke.message}),p.jsx(aa,{id:"serviceUrl",label:n("credentials.serviceUrl"),value:$("ServiceUrl")??"",onChange:j=>K("ServiceUrl",j),error:(He=me.ServiceUrl)==null?void 0:He.message})]})]}),(A==="manual"||o)&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.loginCredentials")}),p.jsxs("div",{className:"space-y-4",children:[p.jsx(aa,{id:"email",label:n("common.email"),value:$("Alias.Email")??"",onChange:j=>K("Alias.Email",j),error:(Ge=(Ke=me.Alias)==null?void 0:Ke.Email)==null?void 0:Ge.message}),p.jsx(B1,{id:"username",label:n("common.username"),value:$("Username")??"",onChange:j=>K("Username",j),error:(yt=me.Username)==null?void 0:yt.message,onRegenerate:G}),ne&&p.jsx(I1,{id:"password",label:n("common.password"),value:$("Password")??"",onChange:j=>K("Password",j),error:(We=me.Password)==null?void 0:We.message,showPassword:k,onShowPasswordChange:R,initialSettings:ne})]})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.alias")}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("button",{type:"button",onClick:_e,className:"w-full bg-primary-500 text-white py-2 px-4 rounded hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 flex items-center justify-center gap-2",children:[p.jsxs("svg",{className:"w-5 h-5 inline-block",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),p.jsx("circle",{cx:"8",cy:"8",r:"1"}),p.jsx("circle",{cx:"16",cy:"8",r:"1"}),p.jsx("circle",{cx:"12",cy:"12",r:"1"}),p.jsx("circle",{cx:"8",cy:"16",r:"1"}),p.jsx("circle",{cx:"16",cy:"16",r:"1"})]}),p.jsx("span",{children:n("credentials.generateRandomAlias")})]}),p.jsx(aa,{id:"firstName",label:n("credentials.firstName"),value:$("Alias.FirstName")??"",onChange:j=>K("Alias.FirstName",j),error:(Kt=(Et=me.Alias)==null?void 0:Et.FirstName)==null?void 0:Kt.message}),p.jsx(aa,{id:"lastName",label:n("credentials.lastName"),value:$("Alias.LastName")??"",onChange:j=>K("Alias.LastName",j),error:(Lt=(Sr=me.Alias)==null?void 0:Sr.LastName)==null?void 0:Lt.message}),p.jsx(aa,{id:"nickName",label:n("credentials.nickName"),value:$("Alias.NickName")??"",onChange:j=>K("Alias.NickName",j),error:(jt=(Ht=me.Alias)==null?void 0:Ht.NickName)==null?void 0:jt.message}),p.jsx(aa,{id:"gender",label:n("credentials.gender"),value:$("Alias.Gender")??"",onChange:j=>K("Alias.Gender",j),error:(Qe=(Er=me.Alias)==null?void 0:Er.Gender)==null?void 0:Qe.message}),p.jsx(aa,{id:"birthDate",label:n("credentials.birthDate"),placeholder:n("credentials.birthDatePlaceholder"),value:$("Alias.BirthDate")??"",onChange:j=>K("Alias.BirthDate",j),error:(nt=(Fe=me.Alias)==null?void 0:Fe.BirthDate)==null?void 0:nt.message})]})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.metadata")}),p.jsx("div",{className:"space-y-4",children:p.jsx(aa,{id:"notes",label:n("credentials.notes"),value:$("Notes")??"",onChange:j=>K("Notes",j),multiline:!0,rows:4,error:(lt=me.Notes)==null?void 0:lt.message})})]}),p.jsx(b1,{attachments:_,onAttachmentsChange:q,originalAttachmentIds:V})]})]})]})};class F1{constructor(){Ir(this,"currentCopiedId","");Ir(this,"onCopyCallbacks",[])}setCopied(r){this.currentCopiedId=r,this.notifySubscribers()}getCopiedId(){return this.currentCopiedId}subscribe(r){return this.onCopyCallbacks.push(r),()=>{this.onCopyCallbacks=this.onCopyCallbacks.filter(a=>a!==r)}}notifySubscribers(){this.onCopyCallbacks.forEach(r=>r(this.currentCopiedId))}}const xu=new F1,jf=({name:n})=>{switch(n){case"visibility":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"copy":return p.jsxs(p.Fragment,{children:[p.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),p.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]});case"check":return p.jsx(p.Fragment,{children:p.jsx("polyline",{points:"20 6 9 17 4 12"})});default:return null}},bi=({id:n,label:r,value:a,type:s="text"})=>{const{t:o}=Bt(),[u,c]=M.useState(!1),[d,m]=M.useState(!1);M.useEffect(()=>{const b=xu.subscribe(v=>{m(v===n)});return()=>{b()}},[n]);const A=async()=>{try{await navigator.clipboard.writeText(a),xu.setCopied(n),setTimeout(()=>{xu.getCopiedId()===n&&xu.setCopied("")},2e3)}catch(b){console.error("Failed to copy text:",b)}};return p.jsxs("div",{children:[p.jsx("label",{htmlFor:n,className:"block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:r}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:s==="password"&&!u?"password":"text",id:n,readOnly:!0,value:a,onClick:A,className:`w-full px-3 py-2.5 bg-white border ${d?"border-green-500 border-2":"border-gray-300"} text-gray-900 sm:text-sm rounded-lg shadow-sm focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400`}),p.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[d?p.jsx("button",{type:"button",className:"p-1 text-green-500 dark:text-green-400 transition-colors duration-200",title:o("common.copied"),children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(jf,{name:"check"})})}):p.jsx("button",{type:"button",onClick:A,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:o("common.copyToClipboard"),children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(jf,{name:"copy"})})}),s==="password"&&p.jsx("button",{type:"button",onClick:()=>c(!u),className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:o(u?"common.hidePassword":"common.showPassword"),children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(jf,{name:u?"visibility-off":"visibility"})})})]})]})]})},j1=({credential:n})=>{var c,d,m,A,b,v,B,T,Q,k,R,N,O;const{t:r}=Bt(),a=!!((d=(c=n.Alias)==null?void 0:c.FirstName)!=null&&d.trim()),s=!!((A=(m=n.Alias)==null?void 0:m.LastName)!=null&&A.trim()),o=!!((v=(b=n.Alias)==null?void 0:b.NickName)!=null&&v.trim()),u=Wl.isValidBirthDate((B=n.Alias)==null?void 0:B.BirthDate);return!a&&!s&&!o&&!u?null:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("common.alias")}),(a||s)&&p.jsx(bi,{id:"fullName",label:r("common.fullName"),value:[(T=n.Alias)==null?void 0:T.FirstName,(Q=n.Alias)==null?void 0:Q.LastName].filter(Boolean).join(" ")}),a&&p.jsx(bi,{id:"firstName",label:r("common.firstName"),value:((k=n.Alias)==null?void 0:k.FirstName)??""}),s&&p.jsx(bi,{id:"lastName",label:r("common.lastName"),value:((R=n.Alias)==null?void 0:R.LastName)??""}),u&&p.jsx(bi,{id:"birthDate",label:r("common.birthDate"),value:Wl.normalizeBirthDateForDisplay((N=n.Alias)==null?void 0:N.BirthDate)}),o&&p.jsx(bi,{id:"nickName",label:r("common.nickname"),value:((O=n.Alias)==null?void 0:O.NickName)??""})]})},H1=({credentialId:n})=>{const{t:r}=Bt(),[a,s]=M.useState([]),[o,u]=M.useState(!0),c=kr(),d=m=>{try{const A=m.Blob instanceof Uint8Array?m.Blob:new Uint8Array(m.Blob),b=new Blob([A]),v=URL.createObjectURL(b),B=document.createElement("a");B.href=v,B.download=m.Filename,document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(v)}catch(A){console.error("Error downloading attachment:",A)}};return M.useEffect(()=>{(async()=>{if(c!=null&&c.sqliteClient)try{const A=c.sqliteClient.getAttachmentsForCredential(n);s(A)}catch(A){console.error("Error loading attachments:",A)}finally{u(!1)}})()},[n,c==null?void 0:c.sqliteClient]),o?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:r("common.attachments")}),r("common.loadingAttachments")]}):a.length===0?null:p.jsx("div",{className:"mb-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:r("common.attachments")}),p.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(m=>p.jsx("button",{className:"w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",onClick:()=>d(m),"aria-label":`Download ${m.Filename}`,children:p.jsxs("div",{className:"flex justify-between items-center gap-2",children:[p.jsx("div",{className:"flex items-center flex-1",children:p.jsxs("div",{className:"flex flex-col",children:[p.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:m.Filename}),p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(m.CreatedAt).toLocaleDateString()})]})}),p.jsx("div",{className:"flex items-center",children:p.jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V4"})})})]})},m.Id))})]})})},G1=({email:n})=>{const{t:r}=Bt(),[a,s]=M.useState([]),[o,u]=M.useState([]),[c,d]=M.useState(!0),[m,A]=M.useState(0),[b,v]=M.useState(!1),[B,T]=M.useState(null),[Q,k]=M.useState(!1),[R,N]=M.useState(2),O=da(),_=kr(),q=3,V=R<a.length,ge=(K,$)=>{const me=K.slice(0,$);u(me)},ce=()=>{const K=Math.min(R+q,a.length);N(K),ge(a,K)},te=async K=>(await Xe.getItem("session:publicEmailDomains")??[]).some(me=>K.toLowerCase().endsWith(me)),J=async K=>(await Xe.getItem("session:privateEmailDomains")??[]).some(me=>K.toLowerCase().endsWith(me));return M.useEffect(()=>{const K=async()=>{var me;try{T(null);const he=await te(n),we=await J(n),pe=he||we;if(v(he),k(pe),!pe)return;if(he){const P=n.split("@")[0],ae=await fetch(`https://api.spamok.com/v2/EmailBox/${P}`,{headers:{"X-Asdasd-Platform-Id":"av-chrome","X-Asdasd-Platform-Version":cr.VERSION}});if(!ae.ok){T(r("emails.errors.emailLoadError"));return}const Ne=await ae.json(),_e=((me=Ne==null?void 0:Ne.mails)==null?void 0:me.toSorted((G,ne)=>new Date(ne.dateSystem).getTime()-new Date(G.dateSystem).getTime()))??[];c&&_e.length>0&&A(_e[0].id),s(G=>JSON.stringify(G.map(Ee=>Ee.id))!==JSON.stringify(_e.map(Ee=>Ee.id))?(ge(_e,R),_e):G)}else if(we)try{const P=await O.authFetch(`EmailBox/${n}`,{method:"GET"},!0,!1);try{const Ne=P.mails.toSorted((_e,G)=>new Date(G.dateSystem).getTime()-new Date(_e.dateSystem).getTime());if(Ne){const _e=await Yt.decryptEmailList(Ne,_.sqliteClient.getAllEncryptionKeys());c&&_e.length>0&&A(_e[0].id),s(G=>JSON.stringify(G.map(Ee=>Ee.id))!==JSON.stringify(_e.map(Ee=>Ee.id))?(ge(_e,R),_e):G)}}catch{const ae=P;T(r("emails.apiErrors."+(ae==null?void 0:ae.code)));return}}catch{T(r("emails.errors.emailLoadError"));return}}catch(he){console.error("Error loading emails:",he),T(r("emails.errors.emailUnexpectedError"))}d(!1)};K();const $=setInterval(K,2e3);return()=>clearInterval($)},[n,c,O,_,r,R]),Q?B?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsx("div",{className:"flex items-center gap-2 mb-2",children:p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")})}),p.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded",children:p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:B})})]}):c?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),r("common.loadingEmails")]}):a.length===0?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),r("emails.noEmails")]}):p.jsxs("div",{className:"space-y-2 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),o.map(K=>b?p.jsxs("a",{href:`https://spamok.com/${n.split("@")[0]}/${K.id}`,target:"_blank",rel:"noopener noreferrer",className:`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${K.id>m?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[p.jsx("div",{className:"truncate flex-1",children:p.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[K.subject.substring(0,30),K.subject.length>30?"...":""]})}),p.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(K.dateSystem).toLocaleDateString()})]},K.id):p.jsxs(rc,{to:`/emails/${K.id}`,className:`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${K.id>m?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[p.jsx("span",{className:"truncate flex-1",children:p.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[K.subject.substring(0,30),K.subject.length>30?"...":""]})}),p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(K.dateSystem).toLocaleDateString()})]},K.id)),V&&p.jsxs("button",{onClick:ce,className:"w-full mt-2 py-1 px-3 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md transition-colors duration-200 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 flex items-center justify-center gap-1",children:[p.jsx("span",{children:r("common.loadMore")}),p.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}):null},V1=({email:n})=>{const r=kr();return(async s=>{var m;const o=(m=s.split("@")[1])==null?void 0:m.toLowerCase();if(!o)return!1;const u=await r.getVaultMetadata(),c=(u==null?void 0:u.publicEmailDomains)??[],d=(u==null?void 0:u.privateEmailDomains)??[];return[...c,...d].some(A=>o===A||o.endsWith(`.${A}`))})(n)?p.jsx(p.Fragment,{children:p.jsx(G1,{email:n})}):null},q1=({credential:n})=>p.jsx("div",{className:"flex items-center justify-between",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("img",{src:Hu.imgSrcFromBytes(n.Logo),alt:n.ServiceName,className:"w-12 h-12 rounded-lg mr-4"}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:n.ServiceName}),n.ServiceUrl&&p.jsx("a",{href:n.ServiceUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 break-all",children:n.ServiceUrl})]})]})}),z1=({credential:n})=>{var u,c,d,m;const{t:r}=Bt(),a=(c=(u=n.Alias)==null?void 0:u.Email)==null?void 0:c.trim(),s=(d=n.Username)==null?void 0:d.trim(),o=(m=n.Password)==null?void 0:m.trim();return!a&&!s&&!o?null:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("common.loginCredentials")}),a&&p.jsx(bi,{id:"email",label:r("common.email"),value:a}),s&&p.jsx(bi,{id:"username",label:r("common.username"),value:s}),o&&p.jsx(bi,{id:"password",label:r("common.password"),value:o,type:"password"})]})},Y1=n=>{const r=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g;return n.replace(r,a=>`<a href="${a.startsWith("http")?a:`http://${a}`}" target="_blank" rel="noopener noreferrer" class="text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300">${a}</a>`)},P1=({notes:n})=>{const{t:r}=Bt();if(!n)return null;const a=Y1(n);return p.jsxs("div",{children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("common.notes")}),p.jsx("div",{className:"p-4 bg-gray-50 rounded-lg dark:bg-gray-700",children:p.jsx("p",{className:"text-gray-900 dark:text-gray-100 whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:a}})})]})};//! otpauth 9.4.0 | (c) Héctor Molinero Fernández | MIT | https://github.com/hectorm/otpauth
//! noble-hashes 1.7.1 | (c) Paul Miller | MIT | https://github.com/paulmillr/noble-hashes
const K1=n=>{const r=new ArrayBuffer(8),a=new Uint8Array(r);let s=n;for(let o=7;o>=0&&s!==0;o--)a[o]=s&255,s-=a[o],s/=256;return a};function Wu(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function J1(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function ic(n,...r){if(!J1(n))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(n.length))throw new Error("Uint8Array expected of length "+r+", got length="+n.length)}function X1(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Wu(n.outputLen),Wu(n.blockLen)}function Vs(n,r=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(r&&n.finished)throw new Error("Hash#digest() has already been called")}function _y(n,r){ic(n);const a=r.outputLen;if(n.length<a)throw new Error("digestInto() expects output buffer of length at least "+a)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $1(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function Hf(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function na(n,r){return n<<32-r|n>>>r}function Gf(n,r){return n<<r|n>>>32-r>>>0}const up=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function W1(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}function cp(n){for(let r=0;r<n.length;r++)n[r]=W1(n[r])}function Z1(n){if(typeof n!="string")throw new Error("utf8ToBytes expected string, got "+typeof n);return new Uint8Array(new TextEncoder().encode(n))}function sc(n){return typeof n=="string"&&(n=Z1(n)),ic(n),n}class DA{clone(){return this._cloneInto()}}function Ks(n){const r=s=>n().update(sc(s)).digest(),a=n();return r.outputLen=a.outputLen,r.blockLen=a.blockLen,r.create=()=>n(),r}class Oy extends DA{update(r){return Vs(this),this.iHash.update(r),this}digestInto(r){Vs(this),ic(r,this.outputLen),this.finished=!0,this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){const r=new Uint8Array(this.oHash.outputLen);return this.digestInto(r),r}_cloneInto(r){r||(r=Object.create(Object.getPrototypeOf(this),{}));const{oHash:a,iHash:s,finished:o,destroyed:u,blockLen:c,outputLen:d}=this;return r=r,r.finished=o,r.destroyed=u,r.blockLen=c,r.outputLen=d,r.oHash=a._cloneInto(r.oHash),r.iHash=s._cloneInto(r.iHash),r}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(r,a){super(),this.finished=!1,this.destroyed=!1,X1(r);const s=sc(a);if(this.iHash=r.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,u=new Uint8Array(o);u.set(s.length>o?r.create().update(s).digest():s);for(let c=0;c<u.length;c++)u[c]^=54;this.iHash.update(u),this.oHash=r.create();for(let c=0;c<u.length;c++)u[c]^=106;this.oHash.update(u),u.fill(0)}}const cA=(n,r,a)=>new Oy(n,r).update(a).digest();cA.create=(n,r)=>new Oy(n,r);function eI(n,r,a,s){if(typeof n.setBigUint64=="function")return n.setBigUint64(r,a,s);const o=BigInt(32),u=BigInt(4294967295),c=Number(a>>o&u),d=Number(a&u),m=s?4:0,A=s?0:4;n.setUint32(r+m,c,s),n.setUint32(r+A,d,s)}function Fy(n,r,a){return n&r^~n&a}function jy(n,r,a){return n&r^n&a^r&a}class RA extends DA{update(r){Vs(this);const{view:a,buffer:s,blockLen:o}=this;r=sc(r);const u=r.length;for(let c=0;c<u;){const d=Math.min(o-this.pos,u-c);if(d===o){const m=Hf(r);for(;o<=u-c;c+=o)this.process(m,c);continue}s.set(r.subarray(c,c+d),this.pos),this.pos+=d,c+=d,this.pos===o&&(this.process(a,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(r){Vs(this),_y(r,this),this.finished=!0;const{buffer:a,view:s,blockLen:o,isLE:u}=this;let{pos:c}=this;a[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(s,0),c=0);for(let v=c;v<o;v++)a[v]=0;eI(s,o-8,BigInt(this.length*8),u),this.process(s,0);const d=Hf(r),m=this.outputLen;if(m%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const A=m/4,b=this.get();if(A>b.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<A;v++)d.setUint32(4*v,b[v],u)}digest(){const{buffer:r,outputLen:a}=this;this.digestInto(r);const s=r.slice(0,a);return this.destroy(),s}_cloneInto(r){r||(r=new this.constructor),r.set(...this.get());const{blockLen:a,buffer:s,length:o,finished:u,destroyed:c,pos:d}=this;return r.length=o,r.pos=d,r.finished=u,r.destroyed=c,o%a&&r.buffer.set(s),r}constructor(r,a,s,o){super(),this.blockLen=r,this.outputLen=a,this.padOffset=s,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(r),this.view=Hf(this.buffer)}}const Yl=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Ai=new Uint32Array(80);class tI extends RA{get(){const{A:r,B:a,C:s,D:o,E:u}=this;return[r,a,s,o,u]}set(r,a,s,o,u){this.A=r|0,this.B=a|0,this.C=s|0,this.D=o|0,this.E=u|0}process(r,a){for(let m=0;m<16;m++,a+=4)Ai[m]=r.getUint32(a,!1);for(let m=16;m<80;m++)Ai[m]=Gf(Ai[m-3]^Ai[m-8]^Ai[m-14]^Ai[m-16],1);let{A:s,B:o,C:u,D:c,E:d}=this;for(let m=0;m<80;m++){let A,b;m<20?(A=Fy(o,u,c),b=1518500249):m<40?(A=o^u^c,b=1859775393):m<60?(A=jy(o,u,c),b=2400959708):(A=o^u^c,b=3395469782);const v=Gf(s,5)+A+d+b+Ai[m]|0;d=c,c=u,u=Gf(o,30),o=s,s=v}s=s+this.A|0,o=o+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,this.set(s,o,u,c,d)}roundClean(){Ai.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,20,8,!1),this.A=Yl[0]|0,this.B=Yl[1]|0,this.C=Yl[2]|0,this.D=Yl[3]|0,this.E=Yl[4]|0}}const rI=Ks(()=>new tI),nI=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gi=new Uint32Array(64);class Hy extends RA{get(){const{A:r,B:a,C:s,D:o,E:u,F:c,G:d,H:m}=this;return[r,a,s,o,u,c,d,m]}set(r,a,s,o,u,c,d,m){this.A=r|0,this.B=a|0,this.C=s|0,this.D=o|0,this.E=u|0,this.F=c|0,this.G=d|0,this.H=m|0}process(r,a){for(let v=0;v<16;v++,a+=4)gi[v]=r.getUint32(a,!1);for(let v=16;v<64;v++){const B=gi[v-15],T=gi[v-2],Q=na(B,7)^na(B,18)^B>>>3,k=na(T,17)^na(T,19)^T>>>10;gi[v]=k+gi[v-7]+Q+gi[v-16]|0}let{A:s,B:o,C:u,D:c,E:d,F:m,G:A,H:b}=this;for(let v=0;v<64;v++){const B=na(d,6)^na(d,11)^na(d,25),T=b+B+Fy(d,m,A)+nI[v]+gi[v]|0,k=(na(s,2)^na(s,13)^na(s,22))+jy(s,o,u)|0;b=A,A=m,m=d,d=c+T|0,c=u,u=o,o=s,s=T+k|0}s=s+this.A|0,o=o+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,m=m+this.F|0,A=A+this.G|0,b=b+this.H|0,this.set(s,o,u,c,d,m,A,b)}roundClean(){gi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,32,8,!1),this.A=hi[0]|0,this.B=hi[1]|0,this.C=hi[2]|0,this.D=hi[3]|0,this.E=hi[4]|0,this.F=hi[5]|0,this.G=hi[6]|0,this.H=hi[7]|0}}class aI extends Hy{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const iI=Ks(()=>new Hy),sI=Ks(()=>new aI),Cu=BigInt(2**32-1),dA=BigInt(32);function Gy(n,r=!1){return r?{h:Number(n&Cu),l:Number(n>>dA&Cu)}:{h:Number(n>>dA&Cu)|0,l:Number(n&Cu)|0}}function Vy(n,r=!1){let a=new Uint32Array(n.length),s=new Uint32Array(n.length);for(let o=0;o<n.length;o++){const{h:u,l:c}=Gy(n[o],r);[a[o],s[o]]=[u,c]}return[a,s]}const lI=(n,r)=>BigInt(n>>>0)<<dA|BigInt(r>>>0),oI=(n,r,a)=>n>>>a,uI=(n,r,a)=>n<<32-a|r>>>a,cI=(n,r,a)=>n>>>a|r<<32-a,dI=(n,r,a)=>n<<32-a|r>>>a,fI=(n,r,a)=>n<<64-a|r>>>a-32,AI=(n,r,a)=>n>>>a-32|r<<64-a,hI=(n,r)=>r,gI=(n,r)=>n,qy=(n,r,a)=>n<<a|r>>>32-a,zy=(n,r,a)=>r<<a|n>>>32-a,Yy=(n,r,a)=>r<<a-32|n>>>64-a,Py=(n,r,a)=>n<<a-32|r>>>64-a;function mI(n,r,a,s){const o=(r>>>0)+(s>>>0);return{h:n+a+(o/2**32|0)|0,l:o|0}}const pI=(n,r,a)=>(n>>>0)+(r>>>0)+(a>>>0),yI=(n,r,a,s)=>r+a+s+(n/2**32|0)|0,EI=(n,r,a,s)=>(n>>>0)+(r>>>0)+(a>>>0)+(s>>>0),bI=(n,r,a,s,o)=>r+a+s+o+(n/2**32|0)|0,vI=(n,r,a,s,o)=>(n>>>0)+(r>>>0)+(a>>>0)+(s>>>0)+(o>>>0),xI=(n,r,a,s,o,u)=>r+a+s+o+u+(n/2**32|0)|0,dt={fromBig:Gy,split:Vy,toBig:lI,shrSH:oI,shrSL:uI,rotrSH:cI,rotrSL:dI,rotrBH:fI,rotrBL:AI,rotr32H:hI,rotr32L:gI,rotlSH:qy,rotlSL:zy,rotlBH:Yy,rotlBL:Py,add:mI,add3L:pI,add3H:yI,add4L:EI,add4H:bI,add5H:xI,add5L:vI},[CI,wI]=dt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),mi=new Uint32Array(80),pi=new Uint32Array(80);class Ky extends RA{get(){const{Ah:r,Al:a,Bh:s,Bl:o,Ch:u,Cl:c,Dh:d,Dl:m,Eh:A,El:b,Fh:v,Fl:B,Gh:T,Gl:Q,Hh:k,Hl:R}=this;return[r,a,s,o,u,c,d,m,A,b,v,B,T,Q,k,R]}set(r,a,s,o,u,c,d,m,A,b,v,B,T,Q,k,R){this.Ah=r|0,this.Al=a|0,this.Bh=s|0,this.Bl=o|0,this.Ch=u|0,this.Cl=c|0,this.Dh=d|0,this.Dl=m|0,this.Eh=A|0,this.El=b|0,this.Fh=v|0,this.Fl=B|0,this.Gh=T|0,this.Gl=Q|0,this.Hh=k|0,this.Hl=R|0}process(r,a){for(let _=0;_<16;_++,a+=4)mi[_]=r.getUint32(a),pi[_]=r.getUint32(a+=4);for(let _=16;_<80;_++){const q=mi[_-15]|0,V=pi[_-15]|0,ge=dt.rotrSH(q,V,1)^dt.rotrSH(q,V,8)^dt.shrSH(q,V,7),ce=dt.rotrSL(q,V,1)^dt.rotrSL(q,V,8)^dt.shrSL(q,V,7),te=mi[_-2]|0,J=pi[_-2]|0,K=dt.rotrSH(te,J,19)^dt.rotrBH(te,J,61)^dt.shrSH(te,J,6),$=dt.rotrSL(te,J,19)^dt.rotrBL(te,J,61)^dt.shrSL(te,J,6),me=dt.add4L(ce,$,pi[_-7],pi[_-16]),he=dt.add4H(me,ge,K,mi[_-7],mi[_-16]);mi[_]=he|0,pi[_]=me|0}let{Ah:s,Al:o,Bh:u,Bl:c,Ch:d,Cl:m,Dh:A,Dl:b,Eh:v,El:B,Fh:T,Fl:Q,Gh:k,Gl:R,Hh:N,Hl:O}=this;for(let _=0;_<80;_++){const q=dt.rotrSH(v,B,14)^dt.rotrSH(v,B,18)^dt.rotrBH(v,B,41),V=dt.rotrSL(v,B,14)^dt.rotrSL(v,B,18)^dt.rotrBL(v,B,41),ge=v&T^~v&k,ce=B&Q^~B&R,te=dt.add5L(O,V,ce,wI[_],pi[_]),J=dt.add5H(te,N,q,ge,CI[_],mi[_]),K=te|0,$=dt.rotrSH(s,o,28)^dt.rotrBH(s,o,34)^dt.rotrBH(s,o,39),me=dt.rotrSL(s,o,28)^dt.rotrBL(s,o,34)^dt.rotrBL(s,o,39),he=s&u^s&d^u&d,we=o&c^o&m^c&m;N=k|0,O=R|0,k=T|0,R=Q|0,T=v|0,Q=B|0,{h:v,l:B}=dt.add(A|0,b|0,J|0,K|0),A=d|0,b=m|0,d=u|0,m=c|0,u=s|0,c=o|0;const pe=dt.add3L(K,me,we);s=dt.add3H(pe,J,$,he),o=pe|0}({h:s,l:o}=dt.add(this.Ah|0,this.Al|0,s|0,o|0)),{h:u,l:c}=dt.add(this.Bh|0,this.Bl|0,u|0,c|0),{h:d,l:m}=dt.add(this.Ch|0,this.Cl|0,d|0,m|0),{h:A,l:b}=dt.add(this.Dh|0,this.Dl|0,A|0,b|0),{h:v,l:B}=dt.add(this.Eh|0,this.El|0,v|0,B|0),{h:T,l:Q}=dt.add(this.Fh|0,this.Fl|0,T|0,Q|0),{h:k,l:R}=dt.add(this.Gh|0,this.Gl|0,k|0,R|0),{h:N,l:O}=dt.add(this.Hh|0,this.Hl|0,N|0,O|0),this.set(s,o,u,c,d,m,A,b,v,B,T,Q,k,R,N,O)}roundClean(){mi.fill(0),pi.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}}class II extends Ky{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const BI=Ks(()=>new Ky),SI=Ks(()=>new II),Jy=[],Xy=[],$y=[],NI=BigInt(0),Pl=BigInt(1),TI=BigInt(2),QI=BigInt(7),DI=BigInt(256),RI=BigInt(113);for(let n=0,r=Pl,a=1,s=0;n<24;n++){[a,s]=[s,(2*a+3*s)%5],Jy.push(2*(5*s+a)),Xy.push((n+1)*(n+2)/2%64);let o=NI;for(let u=0;u<7;u++)r=(r<<Pl^(r>>QI)*RI)%DI,r&TI&&(o^=Pl<<(Pl<<BigInt(u))-Pl);$y.push(o)}const[kI,LI]=Vy($y,!0),dp=(n,r,a)=>a>32?Yy(n,r,a):qy(n,r,a),fp=(n,r,a)=>a>32?Py(n,r,a):zy(n,r,a);function UI(n,r=24){const a=new Uint32Array(10);for(let s=24-r;s<24;s++){for(let c=0;c<10;c++)a[c]=n[c]^n[c+10]^n[c+20]^n[c+30]^n[c+40];for(let c=0;c<10;c+=2){const d=(c+8)%10,m=(c+2)%10,A=a[m],b=a[m+1],v=dp(A,b,1)^a[d],B=fp(A,b,1)^a[d+1];for(let T=0;T<50;T+=10)n[c+T]^=v,n[c+T+1]^=B}let o=n[2],u=n[3];for(let c=0;c<24;c++){const d=Xy[c],m=dp(o,u,d),A=fp(o,u,d),b=Jy[c];o=n[b],u=n[b+1],n[b]=m,n[b+1]=A}for(let c=0;c<50;c+=10){for(let d=0;d<10;d++)a[d]=n[c+d];for(let d=0;d<10;d++)n[c+d]^=~a[(d+2)%10]&a[(d+4)%10]}n[0]^=kI[s],n[1]^=LI[s]}a.fill(0)}class kA extends DA{keccak(){up||cp(this.state32),UI(this.state32,this.rounds),up||cp(this.state32),this.posOut=0,this.pos=0}update(r){Vs(this);const{blockLen:a,state:s}=this;r=sc(r);const o=r.length;for(let u=0;u<o;){const c=Math.min(a-this.pos,o-u);for(let d=0;d<c;d++)s[this.pos++]^=r[u++];this.pos===a&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:r,suffix:a,pos:s,blockLen:o}=this;r[s]^=a,(a&128)!==0&&s===o-1&&this.keccak(),r[o-1]^=128,this.keccak()}writeInto(r){Vs(this,!1),ic(r),this.finish();const a=this.state,{blockLen:s}=this;for(let o=0,u=r.length;o<u;){this.posOut>=s&&this.keccak();const c=Math.min(s-this.posOut,u-o);r.set(a.subarray(this.posOut,this.posOut+c),o),this.posOut+=c,o+=c}return r}xofInto(r){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(r)}xof(r){return Wu(r),this.xofInto(new Uint8Array(r))}digestInto(r){if(_y(r,this),this.finished)throw new Error("digest() was already called");return this.writeInto(r),this.destroy(),r}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(r){const{blockLen:a,suffix:s,outputLen:o,rounds:u,enableXOF:c}=this;return r||(r=new kA(a,s,o,c,u)),r.state32.set(this.state32),r.pos=this.pos,r.posOut=this.posOut,r.finished=this.finished,r.rounds=u,r.suffix=s,r.outputLen=o,r.enableXOF=c,r.destroyed=this.destroyed,r}constructor(r,a,s,o=!1,u=24){if(super(),this.blockLen=r,this.suffix=a,this.outputLen=s,this.enableXOF=o,this.rounds=u,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Wu(s),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=$1(this.state)}}const lc=(n,r,a)=>Ks(()=>new kA(r,n,a)),MI=lc(6,144,224/8),_I=lc(6,136,256/8),OI=lc(6,104,384/8),FI=lc(6,72,512/8),qs=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__<"u")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global})(),Ap={SHA1:rI,SHA224:sI,SHA256:iI,SHA384:SI,SHA512:BI,"SHA3-224":MI,"SHA3-256":_I,"SHA3-384":OI,"SHA3-512":FI},LA=n=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(n):return"SHA1";case/^SHA(?:2?-)?224$/i.test(n):return"SHA224";case/^SHA(?:2?-)?256$/i.test(n):return"SHA256";case/^SHA(?:2?-)?384$/i.test(n):return"SHA384";case/^SHA(?:2?-)?512$/i.test(n):return"SHA512";case/^SHA3-224$/i.test(n):return"SHA3-224";case/^SHA3-256$/i.test(n):return"SHA3-256";case/^SHA3-384$/i.test(n):return"SHA3-384";case/^SHA3-512$/i.test(n):return"SHA3-512";default:throw new TypeError(`Unknown hash algorithm: ${n}`)}},jI=(n,r,a)=>{if(cA){const s=Ap[n]??Ap[LA(n)];return cA(s,r,a)}else throw new Error("Missing HMAC function")},fA="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",HI=n=>{n=n.replace(/ /g,"");let r=n.length;for(;n[r-1]==="=";)--r;n=(r<n.length?n.substring(0,r):n).toUpperCase();const a=new ArrayBuffer(n.length*5/8|0),s=new Uint8Array(a);let o=0,u=0,c=0;for(let d=0;d<n.length;d++){const m=fA.indexOf(n[d]);if(m===-1)throw new TypeError(`Invalid character found: ${n[d]}`);u=u<<5|m,o+=5,o>=8&&(o-=8,s[c++]=u>>>o)}return s},GI=n=>{let r=0,a=0,s="";for(let o=0;o<n.length;o++)for(a=a<<8|n[o],r+=8;r>=5;)s+=fA[a>>>r-5&31],r-=5;return r>0&&(s+=fA[a<<5-r&31]),s},VI=n=>{n=n.replace(/ /g,"");const r=new ArrayBuffer(n.length/2),a=new Uint8Array(r);for(let s=0;s<n.length;s+=2)a[s/2]=parseInt(n.substring(s,s+2),16);return a},qI=n=>{let r="";for(let a=0;a<n.length;a++){const s=n[a].toString(16);s.length===1&&(r+="0"),r+=s}return r.toUpperCase()},zI=n=>{const r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s)&255;return a},YI=n=>{let r="";for(let a=0;a<n.length;a++)r+=String.fromCharCode(n[a]);return r},hp=qs.TextEncoder?new qs.TextEncoder:null,gp=qs.TextDecoder?new qs.TextDecoder:null,PI=n=>{if(!hp)throw new Error("Encoding API not available");return hp.encode(n)},KI=n=>{if(!gp)throw new Error("Encoding API not available");return gp.decode(n)},JI=n=>{var r;if((r=qs.crypto)!=null&&r.getRandomValues)return qs.crypto.getRandomValues(new Uint8Array(n));throw new Error("Cryptography API not available")};class ka{static fromLatin1(r){return new ka({buffer:zI(r).buffer})}static fromUTF8(r){return new ka({buffer:PI(r).buffer})}static fromBase32(r){return new ka({buffer:HI(r).buffer})}static fromHex(r){return new ka({buffer:VI(r).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:YI(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:KI(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:GI(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:qI(this.bytes)}),this.hex}constructor({buffer:r,size:a=20}={}){this.bytes=typeof r>"u"?JI(a):new Uint8Array(r),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}}const XI=(n,r)=>{{if(n.length!==r.length)throw new TypeError("Input strings must have the same length");let a=-1,s=0;for(;++a<n.length;)s|=n.charCodeAt(a)^r.charCodeAt(a);return s===0}};class Br{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,counter:0,window:1}}static generate({secret:r,algorithm:a=Br.defaults.algorithm,digits:s=Br.defaults.digits,counter:o=Br.defaults.counter}){const u=jI(a,r.bytes,K1(o)),c=u[u.byteLength-1]&15;return(((u[c]&127)<<24|(u[c+1]&255)<<16|(u[c+2]&255)<<8|u[c+3]&255)%10**s).toString().padStart(s,"0")}generate({counter:r=this.counter++}={}){return Br.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:r})}static validate({token:r,secret:a,algorithm:s,digits:o=Br.defaults.digits,counter:u=Br.defaults.counter,window:c=Br.defaults.window}){if(r.length!==o)return null;let d=null;const m=A=>{const b=Br.generate({secret:a,algorithm:s,digits:o,counter:A});XI(r,b)&&(d=A-u)};m(u);for(let A=1;A<=c&&d===null&&(m(u-A),!(d!==null||(m(u+A),d!==null)));++A);return d}validate({token:r,counter:a=this.counter,window:s}){return Br.validate({token:r,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:a,window:s})}toString(){const r=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${r(this.issuer)}:${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?`}secret=${r(this.secret.base32)}&algorithm=${r(this.algorithm)}&digits=${r(this.digits)}&counter=${r(this.counter)}`}constructor({issuer:r=Br.defaults.issuer,label:a=Br.defaults.label,issuerInLabel:s=Br.defaults.issuerInLabel,secret:o=new ka,algorithm:u=Br.defaults.algorithm,digits:c=Br.defaults.digits,counter:d=Br.defaults.counter}={}){this.issuer=r,this.label=a,this.issuerInLabel=s,this.secret=typeof o=="string"?ka.fromBase32(o):o,this.algorithm=LA(u),this.digits=c,this.counter=d}}class pr{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}static counter({period:r=pr.defaults.period,timestamp:a=Date.now()}={}){return Math.floor(a/1e3/r)}counter({timestamp:r=Date.now()}={}){return pr.counter({period:this.period,timestamp:r})}static remaining({period:r=pr.defaults.period,timestamp:a=Date.now()}={}){return r*1e3-a%(r*1e3)}remaining({timestamp:r=Date.now()}={}){return pr.remaining({period:this.period,timestamp:r})}static generate({secret:r,algorithm:a,digits:s,period:o=pr.defaults.period,timestamp:u=Date.now()}){return Br.generate({secret:r,algorithm:a,digits:s,counter:pr.counter({period:o,timestamp:u})})}generate({timestamp:r=Date.now()}={}){return pr.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r})}static validate({token:r,secret:a,algorithm:s,digits:o,period:u=pr.defaults.period,timestamp:c=Date.now(),window:d}){return Br.validate({token:r,secret:a,algorithm:s,digits:o,counter:pr.counter({period:u,timestamp:c}),window:d})}validate({token:r,timestamp:a,window:s}){return pr.validate({token:r,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:a,window:s})}toString(){const r=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${r(this.issuer)}:${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?`}secret=${r(this.secret.base32)}&algorithm=${r(this.algorithm)}&digits=${r(this.digits)}&period=${r(this.period)}`}constructor({issuer:r=pr.defaults.issuer,label:a=pr.defaults.label,issuerInLabel:s=pr.defaults.issuerInLabel,secret:o=new ka,algorithm:u=pr.defaults.algorithm,digits:c=pr.defaults.digits,period:d=pr.defaults.period}={}){this.issuer=r,this.label=a,this.issuerInLabel=s,this.secret=typeof o=="string"?ka.fromBase32(o):o,this.algorithm=LA(u),this.digits=c,this.period=d}}const $I=({credentialId:n})=>{const{t:r}=Bt(),[a,s]=M.useState([]),[o,u]=M.useState(!0),[c,d]=M.useState({}),[m,A]=M.useState(null),b=kr(),v=(k=30)=>{const R=new pr({secret:"dummy",algorithm:"SHA1",digits:6,period:k});return R.period-Math.floor(Date.now()/1e3)%R.period},B=()=>{const k=v();return Math.floor((30-k)/30*100)},T=k=>{try{return new pr({secret:k,algorithm:"SHA1",digits:6,period:30}).generate()}catch(R){return console.error("Error generating TOTP code:",R),"Error"}},Q=async(k,R)=>{try{await navigator.clipboard.writeText(k),A(R),setTimeout(()=>{A(null)},2e3)}catch(N){console.error("Failed to copy:",N)}};return M.useEffect(()=>{(async()=>{if(b!=null&&b.sqliteClient)try{const R=b.sqliteClient.getTotpCodesForCredential(n);s(R)}catch(R){console.error("Error loading TOTP codes:",R)}finally{u(!1)}})()},[n,b==null?void 0:b.sqliteClient]),M.useEffect(()=>{const k=O=>{const _={};return a.forEach(q=>{const V=T(q.SecretKey);V!=="Error"?_[q.Id]=V:_[q.Id]=O[q.Id]??"Error"}),_},R={};a.forEach(O=>{R[O.Id]=T(O.SecretKey)}),d(R);const N=setInterval(()=>{d(k)},1e3);return()=>{clearInterval(N)}},[a]),o?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:r("common.twoFactorAuthentication")}),r("common.loadingTotpCodes")]}):a.length===0?null:p.jsx("div",{className:"mb-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:r("common.twoFactorAuthentication")}),p.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(k=>p.jsx("button",{className:"w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",onClick:()=>Q(c[k.Id],k.Id),"aria-label":`Copy ${k.Name} code`,children:p.jsxs("div",{className:"flex justify-between items-center gap-2",children:[p.jsx("div",{className:"flex items-center flex-1",children:p.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:k.Name})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"flex flex-col items-end",children:[p.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:c[k.Id]}),p.jsx("div",{className:"text-xs",children:m===k.Id?p.jsx("span",{className:"text-green-600 dark:text-green-400",children:r("common.copied")}):p.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[v(),"s"]})})]}),p.jsx("div",{className:"w-1 h-6 bg-gray-200 rounded-full dark:bg-gray-600",children:p.jsx("div",{className:"bg-blue-600 rounded-full transition-all",style:{height:`${B()}%`,width:"100%"}})})]})]})},k.Id))})]})})};class yr{static isPopup(){return new URLSearchParams(window.location.search).get("expanded")==="true"?!0:window.innerWidth>390}static openInNewPopup(r){const o=window.screen.width/2-400,u=window.screen.height/2-1e3/2,d=`popup.html?expanded=true#${r||window.location.hash.replace("#","")}`;window.open(d,"AliasVaultPopup",`width=800,height=1000,left=${o},top=${u},popup=true`),window.close()}}const WI=()=>{var b;const{t:n}=Bt(),{id:r}=yA(),a=Rr(),s=kr(),[o,u]=M.useState(null),{setIsInitialLoading:c}=yn(),{setHeaderButtons:d}=ca(),m=M.useCallback(()=>{yr.openInNewPopup(`/credentials/${r}`)},[r]),A=M.useCallback(()=>{a(`/credentials/${r}/edit`)},[r,a]);return M.useEffect(()=>{if(yr.isPopup()&&(window.history.replaceState({},"","popup.html#/credentials"),window.history.pushState({},"",`popup.html#/credentials/${r}`)),!(!(s!=null&&s.sqliteClient)||!r))try{const v=s.sqliteClient.getCredentialById(r);v?(u(v),c(!1)):(console.error("Credential not found"),a("/credentials"))}catch(v){console.error("Error loading credential:",v)}},[s.sqliteClient,r,a,c]),M.useEffect(()=>{const v=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(an,{onClick:m,title:n("common.openInNewWindow"),iconType:Kr.EXPAND}),p.jsx(an,{onClick:A,title:n("credentials.editCredential"),iconType:Kr.EDIT})]});return d(v),()=>{}},[d,A,m,n]),M.useEffect(()=>()=>d(null),[d]),o?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"flex justify-between items-center",children:p.jsx(q1,{credential:o})}),((b=o.Alias)==null?void 0:b.Email)&&p.jsx(V1,{email:o.Alias.Email}),p.jsx($I,{credentialId:o.Id}),p.jsx(z1,{credential:o}),p.jsx(j1,{credential:o}),p.jsx(P1,{notes:o.Notes}),p.jsx(H1,{credentialId:o.Id})]}):p.jsx("div",{children:n("common.loading")})},ZI=({credential:n})=>{const r=Rr(),a=o=>{var c;let u="";return o.Username&&(u=o.Username),(c=o.Alias)!=null&&c.Email&&(u=o.Alias.Email),u.length>33?u.slice(0,30)+"...":u},s=o=>{let u="Untitled";return o.ServiceName&&(u=o.ServiceName),u.length>33?u.slice(0,30)+"...":u};return p.jsx("li",{children:p.jsxs("button",{onClick:()=>r(`/credentials/${n.Id}`),className:"w-full p-2 border dark:border-gray-600 rounded flex items-center bg-white dark:bg-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[p.jsx("img",{src:Hu.imgSrcFromBytes(n.Logo),alt:n.ServiceName,className:"w-8 h-8 mr-2 flex-shrink-0",onError:o=>{const u=o.target;u.src="/assets/images/service-placeholder.webp"}}),p.jsxs("div",{className:"text-left",children:[p.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s(n)}),p.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a(n)})]})]})})},AA=({onClick:n})=>p.jsxs("div",{className:"px-2 items-center",children:[p.jsxs("div",{className:"relative inline-flex items-center",children:[p.jsx("button",{onClick:n,className:"absolute p-2 hover:bg-gray-200 rounded-2xl",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})})}),p.jsxs("svg",{"aria-hidden":"true",className:"inline w-8 h-8 text-gray-200 dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),p.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})]}),p.jsx("span",{className:"sr-only",children:"Loading..."})]}),oc=(n=!1,r=300)=>{const[a,s]=M.useState(n),o=M.useRef(null),u=M.useRef(null),c=M.useCallback(d=>{if(d)s(!0),u.current=Date.now();else{const m=u.current?Date.now()-u.current:0,A=Math.max(0,r-m);A===0?s(!1):(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s(!1)},A))}},[r]);return M.useEffect(()=>{n&&(s(!0),u.current=Date.now())},[n,s]),M.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),[a,c]},e2=()=>{const{t:n}=Bt(),r=kr(),a=da(),s=Rr(),{syncVault:o}=ac(),{setHeaderButtons:u}=ca(),[c,d]=M.useState([]),[m,A]=M.useState(""),{setIsInitialLoading:b}=yn(),[v,B]=oc(!0,100),T=M.useCallback(()=>{s("/credentials/add")},[s]),Q=M.useCallback(async()=>{if(r!=null&&r.sqliteClient)try{await o({onSuccess:async N=>{},_onOffline:()=>{},onError:async N=>{console.error("Error syncing vault:",N),await a.logout("Error while syncing vault, please re-authenticate."),s("/logout")}})}catch(N){console.error("Error refreshing credentials:",N),await a.logout("Error while syncing vault, please re-authenticate."),s("/logout")}},[r,a,o,s]),k=M.useCallback(async()=>{B(!0),await Q(),B(!1)},[Q,B]);M.useEffect(()=>{const N=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:"Open in new window",iconType:Kr.EXPAND}),p.jsx(an,{onClick:T,title:"Add new credential",iconType:Kr.PLUS})]});return u(N),()=>u(null)},[u,T]),M.useEffect(()=>{(async()=>{var O;if(r!=null&&r.sqliteClient){B(!0);const _=((O=r.sqliteClient)==null?void 0:O.getAllCredentials())??[];d(_),B(!1),b(!1)}})()},[r==null?void 0:r.sqliteClient,B,b]);const R=c.filter(N=>{var q,V,ge,ce,te,J;const O=m.toLowerCase();return[(q=N.ServiceName)==null?void 0:q.toLowerCase(),(V=N.Username)==null?void 0:V.toLowerCase(),(ce=(ge=N.Alias)==null?void 0:ge.Email)==null?void 0:ce.toLowerCase(),(te=N.ServiceUrl)==null?void 0:te.toLowerCase(),(J=N.Notes)==null?void 0:J.toLowerCase()].some(K=>K==null?void 0:K.includes(O))});return v?p.jsx("div",{className:"flex justify-center items-center p-8",children:p.jsx(Ps,{})}):p.jsxs("div",{children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("credentials.title")}),p.jsx(AA,{onClick:k})]}),c.length>0?p.jsx("input",{type:"text",placeholder:n("credentials.searchPlaceholder"),value:m,onChange:N=>A(N.target.value),autoFocus:!0,className:"w-full p-2 mb-4 border dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-blue-500 focus:border-blue-500"}):p.jsx(p.Fragment,{}),c.length===0?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-2 mb-10",children:[p.jsx("p",{className:"text-sm",children:n("credentials.welcomeTitle")}),p.jsx("p",{className:"text-sm",children:n("credentials.welcomeDescription")})]}):p.jsx("ul",{className:"space-y-2",children:R.map(N=>p.jsx(ZI,{credential:N},N.Id))})]})};class t2{convertAnchorTagsToOpenInNewTab(r){try{const s=new DOMParser().parseFromString(r,"text/html"),o=s.querySelectorAll("a[href]");return o.length>0&&o.forEach(u=>{if((!u.hasAttribute("target")||u.getAttribute("target")!=="_blank")&&u.setAttribute("target","_blank"),!u.hasAttribute("rel"))u.setAttribute("rel","noopener noreferrer");else{const c=u.getAttribute("rel")??"",d=new Set(c.split(" ").filter(m=>m.trim()!==""));d.add("noopener"),d.add("noreferrer"),u.setAttribute("rel",Array.from(d).join(" "))}}),s.documentElement.outerHTML}catch(a){return console.error(`Error in convertAnchorTagsToOpenInNewTab: ${a instanceof Error?a.message:String(a)}`),r}}normalizeUsername(r){return r.toLowerCase().trim()}}const Hs=new t2,r2=()=>{const{t:n}=Bt(),{id:r}=yA(),a=Rr(),s=kr(),o=da(),[u,c]=M.useState(null),[d,m]=M.useState(null),[A,b]=oc(!0,150),[v,B]=M.useState(!1),{setIsInitialLoading:T}=yn(),{setHeaderButtons:Q}=ca(),[k,R]=M.useState(!1);M.useEffect(()=>{yr.isPopup()&&(window.history.replaceState({},"","popup.html#/emails"),window.history.pushState({},"",`popup.html#/emails/${r}`)),(async()=>{try{if(b(!0),c(null),!(s!=null&&s.sqliteClient)||!r)return;const V=await o.get(`Email/${r}`),ge=s.sqliteClient.getAllEncryptionKeys(),ce=await Yt.decryptEmail(V,ge);m(ce)}catch(V){c(V instanceof Error?V.message:"An error occurred")}finally{b(!1),T(!1)}})()},[r,s==null?void 0:s.sqliteClient,o,b,T]);const N=M.useCallback(async()=>{try{await o.delete(`Email/${r}`),yr.isPopup()?window.close():a("/emails")}catch(q){c(q instanceof Error?q.message:"Failed to delete email")}},[r,o,a]),O=M.useCallback(()=>{yr.openInNewPopup(`/emails/${r}`)},[r]),_=async q=>{try{const V=await o.downloadBlob(`Email/${r}/attachments/${q.id}`);if(!(s!=null&&s.sqliteClient)||!d){c("Database context or email not available");return}const ge=s.sqliteClient.getAllEncryptionKeys(),ce=await Yt.decryptAttachment(V,d,ge);if(!ce){c("Failed to decrypt attachment");return}const te=new Blob([new Uint8Array(ce)],{type:q.mimeType??"application/octet-stream"}),J=window.URL.createObjectURL(te),K=document.createElement("a");K.href=J,K.download=q.filename,document.body.appendChild(K),K.click(),window.URL.revokeObjectURL(J),document.body.removeChild(K)}catch(V){console.error("handleDownloadAttachment error",V),c(V instanceof Error?V.message:"Failed to download attachment")}};return M.useEffect(()=>{if(!k){const q=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(an,{onClick:O,title:n("common.openInNewWindow"),iconType:Kr.EXPAND}),p.jsx(an,{onClick:()=>B(!0),title:n("emails.deleteEmail"),iconType:Kr.DELETE,variant:"danger"})]});Q(q),R(!0)}return()=>{}},[Q,k,O,n]),M.useEffect(()=>()=>Q(null),[Q]),A?p.jsx("div",{className:"flex justify-center items-center p-8",children:p.jsx(Ps,{})}):u?p.jsxs("div",{className:"text-red-500",children:[n("common.error")," ",u]}):d?p.jsxs("div",{className:"max-w-4xl mx-auto",children:[p.jsx(Xu,{isOpen:v,onClose:()=>B(!1),onConfirm:()=>{B(!1),N()},title:n("emails.deleteEmailTitle"),message:n("emails.deleteEmailConfirm"),confirmText:n("common.delete"),cancelText:n("common.cancel"),variant:"danger"}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[p.jsxs("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:[p.jsx("div",{className:"flex justify-between items-start mb-4",children:p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:d.subject})}),p.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-gray-400",children:[p.jsxs("p",{children:[n("emails.from")," ",d.fromDisplay," (",d.fromLocal,"@",d.fromDomain,")"]}),p.jsxs("p",{children:[n("emails.to")," ",d.toLocal,"@",d.toDomain]}),p.jsxs("p",{children:[n("emails.date")," ",new Date(d.dateSystem).toLocaleString()]})]})]}),p.jsx("div",{className:"bg-white",children:d.messageHtml?p.jsx("iframe",{srcDoc:Hs.convertAnchorTagsToOpenInNewTab(d.messageHtml),className:"w-full min-h-[500px] border-0",title:n("emails.emailContent")}):p.jsx("pre",{className:"whitespace-pre-wrap text-gray-700 dark:text-gray-300",children:d.messagePlain})}),d.attachments&&d.attachments.length>0&&p.jsxs("div",{className:"p-6 border-t border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("emails.attachments")}),p.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4",children:d.attachments.map(q=>p.jsxs("button",{onClick:()=>_(q),className:"flex items-center space-x-2 text-sm text-gray-600 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 text-left",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})}),p.jsxs("span",{children:[q.filename," (",Math.ceil(q.filesize/1024)," KB)"]})]},q.id))})]})]})]}):p.jsx("div",{className:"text-gray-500",children:n("emails.emailNotFound")})},n2=()=>{const{t:n}=Bt(),r=kr(),a=da(),{setHeaderButtons:s}=ca(),[o,u]=M.useState(null),[c,d]=M.useState([]),{setIsInitialLoading:m}=yn(),[A,b]=oc(!0,100),v=M.useCallback(async()=>{try{if(b(!0),u(null),!(r!=null&&r.sqliteClient))return;const T=r.sqliteClient.getAllEmailAddresses();try{const Q=await a.post("EmailBox/bulk",{addresses:T,page:1,pageSize:50}),k=r.sqliteClient.getAllEncryptionKeys(),R=await Yt.decryptEmailList(Q.mails,k);d(R)}catch(Q){throw console.error(Q),new Error(n("emails.errors.emailLoadError"))}}catch(T){u(T instanceof Error?T.message:n("common.errors.unknownError"))}finally{b(!1),m(!1)}},[r==null?void 0:r.sqliteClient,a,b,m,n]);M.useEffect(()=>{v()},[v]),M.useEffect(()=>{const T=yr.isPopup()?null:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("common.openInNewWindow"),iconType:Kr.EXPAND});return s(T),()=>{s(null)}},[s,n]);const B=T=>{const Q=new Date,k=new Date(T),R=Math.floor((Q.getTime()-k.getTime())/1e3);if(R<60)return n("emails.dateFormat.justNow");if(R<3600){const N=Math.floor(R/60);return N===1?n("emails.dateFormat.minutesAgo_single",{count:N}):n("emails.dateFormat.minutesAgo_plural",{count:N})}else if(R<86400){const N=Math.floor(R/3600);return N===1?n("emails.dateFormat.hoursAgo_single",{count:N}):n("emails.dateFormat.hoursAgo_plural",{count:N})}else return R<172800?n("emails.dateFormat.yesterday"):k.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit"})};return A?p.jsx("div",{className:"flex justify-center items-center p-8",children:p.jsx(Ps,{})}):o?p.jsxs("div",{className:"text-red-500",children:[n("common.error"),": ",o]}):c.length===0?p.jsxs("div",{children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("emails.title")}),p.jsx(AA,{onClick:v})]}),p.jsx("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:p.jsx("p",{className:"text-sm",children:n("emails.noEmailsDescription")})})]}):p.jsxs("div",{children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("emails.title")}),p.jsx(AA,{onClick:v})]}),p.jsx("div",{className:"space-y-2",children:c.map(T=>p.jsxs(rc,{to:`/emails/${T.id}`,className:"block p-4 bg-white dark:bg-gray-800 rounded-lg shadow hover:shadow-md transition-shadow border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",children:[p.jsxs("div",{className:"flex justify-between items-start mb-2",children:[p.jsx("div",{className:"text-sm text-gray-900 dark:text-white mb-1 font-bold",children:T.subject}),p.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:B(T.dateSystem)})]}),p.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 line-clamp-2",children:T.messagePreview})]},T.id))})]})},a2=()=>{const{isFullyInitialized:n}=Aw();return n?p.jsx(jx,{to:"/reinitialize",replace:!0}):null},Zl=({onClick:n,children:r,type:a="button",variant:s="primary"})=>{const o={primary:"bg-primary-500 hover:bg-primary-600",secondary:"bg-gray-500 hover:bg-gray-600"};return p.jsx("button",{className:`${o[s]} text-white font-medium rounded-lg px-4 py-2 text-sm w-full`,onClick:n,type:a,children:r})},Wy=()=>{const[n,r]=M.useState(cr.DEFAULT_API_URL);return{apiUrl:n,setApiUrl:r,loadApiUrl:async()=>{const o=await Xe.getItem("local:apiUrl");o&&o.length>0?r(o):r(cr.DEFAULT_API_URL)},getDisplayUrl:()=>{const o=n.replace("https://","").replace("http://","").replace(":443","").replace("/api","");return o==="app.aliasvault.net"?"aliasvault.net":o}}},i2=()=>{const{loadApiUrl:n,getDisplayUrl:r}=Wy(),a=Rr(),{t:s}=Bt();M.useEffect(()=>{n()},[n]);const o=()=>{a("/auth-settings")};return p.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 mb-4",children:["(",s("auth.connectingTo")," ",p.jsx("button",{onClick:o,type:"button",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500 underline",children:r()}),")"]})};var yi={},Vf={},qf,mp;function Zy(){return mp||(mp=1,qf=function(r){if(typeof r!="object"||r===null||typeof r.byteLength!="number")throw new TypeError("Expected input to be an ArrayBuffer");for(var a=new Uint8Array(r),s="",o,u=0;u<a.length;u++)o=a[u].toString(16),s+=o.length===1?"0"+o:o;return s}),qf}var zf,pp;function s2(){return pp||(pp=1,zf=function(r){for(var a=[],s=r.length,o=0;o<s;o++){var u=r.charCodeAt(o);if(u>=55296&&u<=56319&&s>o+1){var c=r.charCodeAt(o+1);c>=56320&&c<=57343&&(u=(u-55296)*1024+c-56320+65536,o+=1)}if(u<128){a.push(u);continue}if(u<2048){a.push(u>>6|192),a.push(u&63|128);continue}if(u<55296||u>=57344&&u<65536){a.push(u>>12|224),a.push(u>>6&63|128),a.push(u&63|128);continue}if(u>=65536&&u<=1114111){a.push(u>>18|240),a.push(u>>12&63|128),a.push(u>>6&63|128),a.push(u&63|128);continue}a.push(239,191,189)}return new Uint8Array(a).buffer}),zf}var Yf,yp;function l2(){return yp||(yp=1,Yf=function(r){if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r.length%2!==0)throw new RangeError("Expected string to be an even number of characters");for(var a=new Uint8Array(r.length/2),s=0;s<r.length;s+=2)a[s/2]=parseInt(r.substring(s,s+2),16);return a.buffer}),Yf}var Pf,Ep;function o2(){if(Ep)return Pf;Ep=1;const n=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(s,o,u){let c,d,m,A,b,v,B,T,Q,k,R,N,O,_=0,q=u.length;for(;q>=64;){for(c=o[0],d=o[1],m=o[2],A=o[3],b=o[4],v=o[5],B=o[6],T=o[7],k=0;k<16;k++)R=_+k*4,s[k]=(u[R]&255)<<24|(u[R+1]&255)<<16|(u[R+2]&255)<<8|u[R+3]&255;for(k=16;k<64;k++)Q=s[k-2],N=(Q>>>17|Q<<15)^(Q>>>19|Q<<13)^Q>>>10,Q=s[k-15],O=(Q>>>7|Q<<25)^(Q>>>18|Q<<14)^Q>>>3,s[k]=(N+s[k-7]|0)+(O+s[k-16]|0);for(k=0;k<64;k++)N=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&v^~b&B)|0)+(T+(n[k]+s[k]|0)|0)|0,O=((c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10))+(c&d^c&m^d&m)|0,T=B,B=v,v=b,b=A+N|0,A=m,m=d,d=c,c=N+O|0;o[0]+=c,o[1]+=d,o[2]+=m,o[3]+=A,o[4]+=b,o[5]+=v,o[6]+=B,o[7]+=T,_+=64,q-=64}}function a(s){const o=s.length,u=o%64,c=o%64<56?64:128,d=new Uint8Array(c),m=o/536870912|0,A=o<<3;return d.set(s.subarray(o-u)),d[u]=128,d[c-8]=m>>>24&255,d[c-7]=m>>>16&255,d[c-6]=m>>>8&255,d[c-5]=m>>>0&255,d[c-4]=A>>>24&255,d[c-3]=A>>>16&255,d[c-2]=A>>>8&255,d[c-1]=A>>>0&255,d}return Pf=function(o){const u=new Int32Array(8),c=new Int32Array(64);u[0]=1779033703,u[1]=3144134277,u[2]=1013904242,u[3]=2773480762,u[4]=1359893119,u[5]=2600822924,u[6]=528734635,u[7]=1541459225;const d=new Uint8Array(o),m=a(d);r(c,u,d),r(c,u,m);const A=new Uint8Array(32);for(let b=0;b<8;b++)A[b*4+0]=u[b]>>>24&255,A[b*4+1]=u[b]>>>16&255,A[b*4+2]=u[b]>>>8&255,A[b*4+3]=u[b]>>>0&255;return A.buffer},Pf}var Kf,bp;function u2(){return bp||(bp=1,Kf=function(n,r,a){if(n==null||r==null)return n;var s=String(n),o=typeof r=="number"?r:parseInt(r,10);if(isNaN(o)||!isFinite(o))return s;var u=s.length;if(u>=o)return s;var c=a==null?"":String(a);c===""&&(c=" ");for(var d=o-u;c.length<d;)c+=c;var m=c.length>d?c.substr(0,d):c;return m+s}),Kf}var Jf,vp;function c2(){if(vp)return Jf;vp=1;const n=Zy();return Jf=function(a){const s=new Uint8Array(a);if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(s);else if(typeof msCrypto=="object"&&typeof msCrypto.getRandomValues=="function")msCrypto.getRandomValues(s);else throw new Error("No secure random number generator available");return n(s.buffer)},Jf}var Lu={exports:{}},d2=Lu.exports,xp;function f2(){return xp||(xp=1,function(n,r){(function(){var a,s=0xdeadbeefcafe,o=(s&16777215)==15715070;function u(I,D,F){I!=null&&(typeof I=="number"?this.fromNumber(I,D,F):D==null&&typeof I!="string"?this.fromString(I,256):this.fromString(I,D))}function c(){return new u(null)}function d(I,D,F,ee,Ie,Be){for(;--Be>=0;){var Ue=D*this[I++]+F[ee]+Ie;Ie=Math.floor(Ue/67108864),F[ee++]=Ue&67108863}return Ie}function m(I,D,F,ee,Ie,Be){for(var Ue=D&32767,je=D>>15;--Be>=0;){var vt=this[I]&32767,Oe=this[I++]>>15,Ar=je*vt+Oe*Ue;vt=Ue*vt+((Ar&32767)<<15)+F[ee]+(Ie&1073741823),Ie=(vt>>>30)+(Ar>>>15)+je*Oe+(Ie>>>30),F[ee++]=vt&1073741823}return Ie}function A(I,D,F,ee,Ie,Be){for(var Ue=D&16383,je=D>>14;--Be>=0;){var vt=this[I]&16383,Oe=this[I++]>>14,Ar=je*vt+Oe*Ue;vt=Ue*vt+((Ar&16383)<<14)+F[ee]+Ie,Ie=(vt>>28)+(Ar>>14)+je*Oe,F[ee++]=vt&268435455}return Ie}var b=typeof navigator<"u";b&&o&&navigator.appName=="Microsoft Internet Explorer"?(u.prototype.am=m,a=30):b&&o&&navigator.appName!="Netscape"?(u.prototype.am=d,a=26):(u.prototype.am=A,a=28),u.prototype.DB=a,u.prototype.DM=(1<<a)-1,u.prototype.DV=1<<a;var v=52;u.prototype.FV=Math.pow(2,v),u.prototype.F1=v-a,u.prototype.F2=2*a-v;var B="0123456789abcdefghijklmnopqrstuvwxyz",T=new Array,Q,k;for(Q=48,k=0;k<=9;++k)T[Q++]=k;for(Q=97,k=10;k<36;++k)T[Q++]=k;for(Q=65,k=10;k<36;++k)T[Q++]=k;function R(I){return B.charAt(I)}function N(I,D){var F=T[I.charCodeAt(D)];return F??-1}function O(I){for(var D=this.t-1;D>=0;--D)I[D]=this[D];I.t=this.t,I.s=this.s}function _(I){this.t=1,this.s=I<0?-1:0,I>0?this[0]=I:I<-1?this[0]=I+this.DV:this.t=0}function q(I){var D=c();return D.fromInt(I),D}function V(I,D){var F;if(D==16)F=4;else if(D==8)F=3;else if(D==256)F=8;else if(D==2)F=1;else if(D==32)F=5;else if(D==4)F=2;else{this.fromRadix(I,D);return}this.t=0,this.s=0;for(var ee=I.length,Ie=!1,Be=0;--ee>=0;){var Ue=F==8?I[ee]&255:N(I,ee);if(Ue<0){I.charAt(ee)=="-"&&(Ie=!0);continue}Ie=!1,Be==0?this[this.t++]=Ue:Be+F>this.DB?(this[this.t-1]|=(Ue&(1<<this.DB-Be)-1)<<Be,this[this.t++]=Ue>>this.DB-Be):this[this.t-1]|=Ue<<Be,Be+=F,Be>=this.DB&&(Be-=this.DB)}F==8&&(I[0]&128)!=0&&(this.s=-1,Be>0&&(this[this.t-1]|=(1<<this.DB-Be)-1<<Be)),this.clamp(),Ie&&u.ZERO.subTo(this,this)}function ge(){for(var I=this.s&this.DM;this.t>0&&this[this.t-1]==I;)--this.t}function ce(I){if(this.s<0)return"-"+this.negate().toString(I);var D;if(I==16)D=4;else if(I==8)D=3;else if(I==2)D=1;else if(I==32)D=5;else if(I==4)D=2;else return this.toRadix(I);var F=(1<<D)-1,ee,Ie=!1,Be="",Ue=this.t,je=this.DB-Ue*this.DB%D;if(Ue-- >0)for(je<this.DB&&(ee=this[Ue]>>je)>0&&(Ie=!0,Be=R(ee));Ue>=0;)je<D?(ee=(this[Ue]&(1<<je)-1)<<D-je,ee|=this[--Ue]>>(je+=this.DB-D)):(ee=this[Ue]>>(je-=D)&F,je<=0&&(je+=this.DB,--Ue)),ee>0&&(Ie=!0),Ie&&(Be+=R(ee));return Ie?Be:"0"}function te(){var I=c();return u.ZERO.subTo(this,I),I}function J(){return this.s<0?this.negate():this}function K(I){var D=this.s-I.s;if(D!=0)return D;var F=this.t;if(D=F-I.t,D!=0)return this.s<0?-D:D;for(;--F>=0;)if((D=this[F]-I[F])!=0)return D;return 0}function $(I){var D=1,F;return(F=I>>>16)!=0&&(I=F,D+=16),(F=I>>8)!=0&&(I=F,D+=8),(F=I>>4)!=0&&(I=F,D+=4),(F=I>>2)!=0&&(I=F,D+=2),(F=I>>1)!=0&&(I=F,D+=1),D}function me(){return this.t<=0?0:this.DB*(this.t-1)+$(this[this.t-1]^this.s&this.DM)}function he(I,D){var F;for(F=this.t-1;F>=0;--F)D[F+I]=this[F];for(F=I-1;F>=0;--F)D[F]=0;D.t=this.t+I,D.s=this.s}function we(I,D){for(var F=I;F<this.t;++F)D[F-I]=this[F];D.t=Math.max(this.t-I,0),D.s=this.s}function pe(I,D){var F=I%this.DB,ee=this.DB-F,Ie=(1<<ee)-1,Be=Math.floor(I/this.DB),Ue=this.s<<F&this.DM,je;for(je=this.t-1;je>=0;--je)D[je+Be+1]=this[je]>>ee|Ue,Ue=(this[je]&Ie)<<F;for(je=Be-1;je>=0;--je)D[je]=0;D[Be]=Ue,D.t=this.t+Be+1,D.s=this.s,D.clamp()}function P(I,D){D.s=this.s;var F=Math.floor(I/this.DB);if(F>=this.t){D.t=0;return}var ee=I%this.DB,Ie=this.DB-ee,Be=(1<<ee)-1;D[0]=this[F]>>ee;for(var Ue=F+1;Ue<this.t;++Ue)D[Ue-F-1]|=(this[Ue]&Be)<<Ie,D[Ue-F]=this[Ue]>>ee;ee>0&&(D[this.t-F-1]|=(this.s&Be)<<Ie),D.t=this.t-F,D.clamp()}function ae(I,D){for(var F=0,ee=0,Ie=Math.min(I.t,this.t);F<Ie;)ee+=this[F]-I[F],D[F++]=ee&this.DM,ee>>=this.DB;if(I.t<this.t){for(ee-=I.s;F<this.t;)ee+=this[F],D[F++]=ee&this.DM,ee>>=this.DB;ee+=this.s}else{for(ee+=this.s;F<I.t;)ee-=I[F],D[F++]=ee&this.DM,ee>>=this.DB;ee-=I.s}D.s=ee<0?-1:0,ee<-1?D[F++]=this.DV+ee:ee>0&&(D[F++]=ee),D.t=F,D.clamp()}function Ne(I,D){var F=this.abs(),ee=I.abs(),Ie=F.t;for(D.t=Ie+ee.t;--Ie>=0;)D[Ie]=0;for(Ie=0;Ie<ee.t;++Ie)D[Ie+F.t]=F.am(0,ee[Ie],D,Ie,0,F.t);D.s=0,D.clamp(),this.s!=I.s&&u.ZERO.subTo(D,D)}function _e(I){for(var D=this.abs(),F=I.t=2*D.t;--F>=0;)I[F]=0;for(F=0;F<D.t-1;++F){var ee=D.am(F,D[F],I,2*F,0,1);(I[F+D.t]+=D.am(F+1,2*D[F],I,2*F+1,ee,D.t-F-1))>=D.DV&&(I[F+D.t]-=D.DV,I[F+D.t+1]=1)}I.t>0&&(I[I.t-1]+=D.am(F,D[F],I,2*F,0,1)),I.s=0,I.clamp()}function G(I,D,F){var ee=I.abs();if(!(ee.t<=0)){var Ie=this.abs();if(Ie.t<ee.t){D!=null&&D.fromInt(0),F!=null&&this.copyTo(F);return}F==null&&(F=c());var Be=c(),Ue=this.s,je=I.s,vt=this.DB-$(ee[ee.t-1]);vt>0?(ee.lShiftTo(vt,Be),Ie.lShiftTo(vt,F)):(ee.copyTo(Be),Ie.copyTo(F));var Oe=Be.t,Ar=Be[Oe-1];if(Ar!=0){var Wt=Ar*(1<<this.F1)+(Oe>1?Be[Oe-2]>>this.F2:0),Vr=this.FV/Wt,ln=(1<<this.F1)/Wt,Ut=1<<this.F2,Vt=F.t,Ur=Vt-Oe,nr=D??c();for(Be.dlShiftTo(Ur,nr),F.compareTo(nr)>=0&&(F[F.t++]=1,F.subTo(nr,F)),u.ONE.dlShiftTo(Oe,nr),nr.subTo(Be,Be);Be.t<Oe;)Be[Be.t++]=0;for(;--Ur>=0;){var h=F[--Vt]==Ar?this.DM:Math.floor(F[Vt]*Vr+(F[Vt-1]+Ut)*ln);if((F[Vt]+=Be.am(0,h,F,Ur,0,Oe))<h)for(Be.dlShiftTo(Ur,nr),F.subTo(nr,F);F[Vt]<--h;)F.subTo(nr,F)}D!=null&&(F.drShiftTo(Oe,D),Ue!=je&&u.ZERO.subTo(D,D)),F.t=Oe,F.clamp(),vt>0&&F.rShiftTo(vt,F),Ue<0&&u.ZERO.subTo(F,F)}}}function ne(I){var D=c();return this.abs().divRemTo(I,null,D),this.s<0&&D.compareTo(u.ZERO)>0&&I.subTo(D,D),D}function Ee(I){this.m=I}function ke(I){return I.s<0||I.compareTo(this.m)>=0?I.mod(this.m):I}function He(I){return I}function Ke(I){I.divRemTo(this.m,null,I)}function Ge(I,D,F){I.multiplyTo(D,F),this.reduce(F)}function yt(I,D){I.squareTo(D),this.reduce(D)}Ee.prototype.convert=ke,Ee.prototype.revert=He,Ee.prototype.reduce=Ke,Ee.prototype.mulTo=Ge,Ee.prototype.sqrTo=yt;function We(){if(this.t<1)return 0;var I=this[0];if((I&1)==0)return 0;var D=I&3;return D=D*(2-(I&15)*D)&15,D=D*(2-(I&255)*D)&255,D=D*(2-((I&65535)*D&65535))&65535,D=D*(2-I*D%this.DV)%this.DV,D>0?this.DV-D:-D}function Et(I){this.m=I,this.mp=I.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<I.DB-15)-1,this.mt2=2*I.t}function Kt(I){var D=c();return I.abs().dlShiftTo(this.m.t,D),D.divRemTo(this.m,null,D),I.s<0&&D.compareTo(u.ZERO)>0&&this.m.subTo(D,D),D}function Sr(I){var D=c();return I.copyTo(D),this.reduce(D),D}function Lt(I){for(;I.t<=this.mt2;)I[I.t++]=0;for(var D=0;D<this.m.t;++D){var F=I[D]&32767,ee=F*this.mpl+((F*this.mph+(I[D]>>15)*this.mpl&this.um)<<15)&I.DM;for(F=D+this.m.t,I[F]+=this.m.am(0,ee,I,D,0,this.m.t);I[F]>=I.DV;)I[F]-=I.DV,I[++F]++}I.clamp(),I.drShiftTo(this.m.t,I),I.compareTo(this.m)>=0&&I.subTo(this.m,I)}function Ht(I,D){I.squareTo(D),this.reduce(D)}function jt(I,D,F){I.multiplyTo(D,F),this.reduce(F)}Et.prototype.convert=Kt,Et.prototype.revert=Sr,Et.prototype.reduce=Lt,Et.prototype.mulTo=jt,Et.prototype.sqrTo=Ht;function Er(){return(this.t>0?this[0]&1:this.s)==0}function Qe(I,D){if(I>4294967295||I<1)return u.ONE;var F=c(),ee=c(),Ie=D.convert(this),Be=$(I)-1;for(Ie.copyTo(F);--Be>=0;)if(D.sqrTo(F,ee),(I&1<<Be)>0)D.mulTo(ee,Ie,F);else{var Ue=F;F=ee,ee=Ue}return D.revert(F)}function Fe(I,D){var F;return I<256||D.isEven()?F=new Ee(D):F=new Et(D),this.exp(I,F)}u.prototype.copyTo=O,u.prototype.fromInt=_,u.prototype.fromString=V,u.prototype.clamp=ge,u.prototype.dlShiftTo=he,u.prototype.drShiftTo=we,u.prototype.lShiftTo=pe,u.prototype.rShiftTo=P,u.prototype.subTo=ae,u.prototype.multiplyTo=Ne,u.prototype.squareTo=_e,u.prototype.divRemTo=G,u.prototype.invDigit=We,u.prototype.isEven=Er,u.prototype.exp=Qe,u.prototype.toString=ce,u.prototype.negate=te,u.prototype.abs=J,u.prototype.compareTo=K,u.prototype.bitLength=me,u.prototype.mod=ne,u.prototype.modPowInt=Fe,u.ZERO=q(0),u.ONE=q(1);function nt(){var I=c();return this.copyTo(I),I}function lt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function j(){return this.t==0?this.s:this[0]<<24>>24}function X(){return this.t==0?this.s:this[0]<<16>>16}function se(I){return Math.floor(Math.LN2*this.DB/Math.log(I))}function Te(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Re(I){if(I==null&&(I=10),this.signum()==0||I<2||I>36)return"0";var D=this.chunkSize(I),F=Math.pow(I,D),ee=q(F),Ie=c(),Be=c(),Ue="";for(this.divRemTo(ee,Ie,Be);Ie.signum()>0;)Ue=(F+Be.intValue()).toString(I).substr(1)+Ue,Ie.divRemTo(ee,Ie,Be);return Be.intValue().toString(I)+Ue}function xe(I,D){this.fromInt(0),D==null&&(D=10);for(var F=this.chunkSize(D),ee=Math.pow(D,F),Ie=!1,Be=0,Ue=0,je=0;je<I.length;++je){var vt=N(I,je);if(vt<0){I.charAt(je)=="-"&&this.signum()==0&&(Ie=!0);continue}Ue=D*Ue+vt,++Be>=F&&(this.dMultiply(ee),this.dAddOffset(Ue,0),Be=0,Ue=0)}Be>0&&(this.dMultiply(Math.pow(D,Be)),this.dAddOffset(Ue,0)),Ie&&u.ZERO.subTo(this,this)}function Ve(I,D,F){if(typeof D=="number")if(I<2)this.fromInt(1);else for(this.fromNumber(I,F),this.testBit(I-1)||this.bitwiseTo(u.ONE.shiftLeft(I-1),Le,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(D);)this.dAddOffset(2,0),this.bitLength()>I&&this.subTo(u.ONE.shiftLeft(I-1),this);else{var ee=new Array,Ie=I&7;ee.length=(I>>3)+1,D.nextBytes(ee),Ie>0?ee[0]&=(1<<Ie)-1:ee[0]=0,this.fromString(ee,256)}}function S(){var I=this.t,D=new Array;D[0]=this.s;var F=this.DB-I*this.DB%8,ee,Ie=0;if(I-- >0)for(F<this.DB&&(ee=this[I]>>F)!=(this.s&this.DM)>>F&&(D[Ie++]=ee|this.s<<this.DB-F);I>=0;)F<8?(ee=(this[I]&(1<<F)-1)<<8-F,ee|=this[--I]>>(F+=this.DB-8)):(ee=this[I]>>(F-=8)&255,F<=0&&(F+=this.DB,--I)),(ee&128)!=0&&(ee|=-256),Ie==0&&(this.s&128)!=(ee&128)&&++Ie,(Ie>0||ee!=this.s)&&(D[Ie++]=ee);return D}function E(I){return this.compareTo(I)==0}function x(I){return this.compareTo(I)<0?this:I}function H(I){return this.compareTo(I)>0?this:I}function W(I,D,F){var ee,Ie,Be=Math.min(I.t,this.t);for(ee=0;ee<Be;++ee)F[ee]=D(this[ee],I[ee]);if(I.t<this.t){for(Ie=I.s&this.DM,ee=Be;ee<this.t;++ee)F[ee]=D(this[ee],Ie);F.t=this.t}else{for(Ie=this.s&this.DM,ee=Be;ee<I.t;++ee)F[ee]=D(Ie,I[ee]);F.t=I.t}F.s=D(this.s,I.s),F.clamp()}function fe(I,D){return I&D}function be(I){var D=c();return this.bitwiseTo(I,fe,D),D}function Le(I,D){return I|D}function gt(I){var D=c();return this.bitwiseTo(I,Le,D),D}function ft(I,D){return I^D}function bt(I){var D=c();return this.bitwiseTo(I,ft,D),D}function ot(I,D){return I&~D}function es(I){var D=c();return this.bitwiseTo(I,ot,D),D}function sn(){for(var I=c(),D=0;D<this.t;++D)I[D]=this.DM&~this[D];return I.t=this.t,I.s=~this.s,I}function Ma(I){var D=c();return I<0?this.rShiftTo(-I,D):this.lShiftTo(I,D),D}function Pn(I){var D=c();return I<0?this.lShiftTo(-I,D):this.rShiftTo(I,D),D}function ts(I){if(I==0)return-1;var D=0;return(I&65535)==0&&(I>>=16,D+=16),(I&255)==0&&(I>>=8,D+=8),(I&15)==0&&(I>>=4,D+=4),(I&3)==0&&(I>>=2,D+=2),(I&1)==0&&++D,D}function Me(){for(var I=0;I<this.t;++I)if(this[I]!=0)return I*this.DB+ts(this[I]);return this.s<0?this.t*this.DB:-1}function rs(I){for(var D=0;I!=0;)I&=I-1,++D;return D}function Ci(){for(var I=0,D=this.s&this.DM,F=0;F<this.t;++F)I+=rs(this[F]^D);return I}function br(I){var D=Math.floor(I/this.DB);return D>=this.t?this.s!=0:(this[D]&1<<I%this.DB)!=0}function _a(I,D){var F=u.ONE.shiftLeft(I);return this.bitwiseTo(F,D,F),F}function wi(I){return this.changeBit(I,Le)}function Jr(I){return this.changeBit(I,ot)}function _t(I){return this.changeBit(I,ft)}function dr(I,D){for(var F=0,ee=0,Ie=Math.min(I.t,this.t);F<Ie;)ee+=this[F]+I[F],D[F++]=ee&this.DM,ee>>=this.DB;if(I.t<this.t){for(ee+=I.s;F<this.t;)ee+=this[F],D[F++]=ee&this.DM,ee>>=this.DB;ee+=this.s}else{for(ee+=this.s;F<I.t;)ee+=I[F],D[F++]=ee&this.DM,ee>>=this.DB;ee+=I.s}D.s=ee<0?-1:0,ee>0?D[F++]=ee:ee<-1&&(D[F++]=this.DV+ee),D.t=F,D.clamp()}function Jt(I){var D=c();return this.addTo(I,D),D}function Oa(I){var D=c();return this.subTo(I,D),D}function Kn(I){var D=c();return this.multiplyTo(I,D),D}function ns(){var I=c();return this.squareTo(I),I}function Ii(I){var D=c();return this.divRemTo(I,D,null),D}function En(I){var D=c();return this.divRemTo(I,null,D),D}function tr(I){var D=c(),F=c();return this.divRemTo(I,D,F),new Array(D,F)}function kn(I){this[this.t]=this.am(0,I-1,this,0,0,this.t),++this.t,this.clamp()}function Jn(I,D){if(I!=0){for(;this.t<=D;)this[this.t++]=0;for(this[D]+=I;this[D]>=this.DV;)this[D]-=this.DV,++D>=this.t&&(this[this.t++]=0),++this[D]}}function Gr(){}function Ln(I){return I}function Gt(I,D,F){I.multiplyTo(D,F)}function Bi(I,D){I.squareTo(D)}Gr.prototype.convert=Ln,Gr.prototype.revert=Ln,Gr.prototype.mulTo=Gt,Gr.prototype.sqrTo=Bi;function fa(I){return this.exp(I,new Gr)}function Un(I,D,F){var ee=Math.min(this.t+I.t,D);for(F.s=0,F.t=ee;ee>0;)F[--ee]=0;var Ie;for(Ie=F.t-this.t;ee<Ie;++ee)F[ee+this.t]=this.am(0,I[ee],F,ee,0,this.t);for(Ie=Math.min(I.t,D);ee<Ie;++ee)this.am(0,I[ee],F,ee,0,D-ee);F.clamp()}function fr(I,D,F){--D;var ee=F.t=this.t+I.t-D;for(F.s=0;--ee>=0;)F[ee]=0;for(ee=Math.max(D-this.t,0);ee<I.t;++ee)F[this.t+ee-D]=this.am(D-ee,I[ee],F,0,0,this.t+ee-D);F.clamp(),F.drShiftTo(1,F)}function Xr(I){this.r2=c(),this.q3=c(),u.ONE.dlShiftTo(2*I.t,this.r2),this.mu=this.r2.divide(I),this.m=I}function Fa(I){if(I.s<0||I.t>2*this.m.t)return I.mod(this.m);if(I.compareTo(this.m)<0)return I;var D=c();return I.copyTo(D),this.reduce(D),D}function Si(I){return I}function as(I){for(I.drShiftTo(this.m.t-1,this.r2),I.t>this.m.t+1&&(I.t=this.m.t+1,I.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);I.compareTo(this.r2)<0;)I.dAddOffset(1,this.m.t+1);for(I.subTo(this.r2,I);I.compareTo(this.m)>=0;)I.subTo(this.m,I)}function bn(I,D){I.squareTo(D),this.reduce(D)}function Aa(I,D,F){I.multiplyTo(D,F),this.reduce(F)}Xr.prototype.convert=Fa,Xr.prototype.revert=Si,Xr.prototype.reduce=as,Xr.prototype.mulTo=Aa,Xr.prototype.sqrTo=bn;function Lr(I,D){var F=I.bitLength(),ee,Ie=q(1),Be;if(F<=0)return Ie;F<18?ee=1:F<48?ee=3:F<144?ee=4:F<768?ee=5:ee=6,F<8?Be=new Ee(D):D.isEven()?Be=new Xr(D):Be=new Et(D);var Ue=new Array,je=3,vt=ee-1,Oe=(1<<ee)-1;if(Ue[1]=Be.convert(this),ee>1){var Ar=c();for(Be.sqrTo(Ue[1],Ar);je<=Oe;)Ue[je]=c(),Be.mulTo(Ar,Ue[je-2],Ue[je]),je+=2}var Wt=I.t-1,Vr,ln=!0,Ut=c(),Vt;for(F=$(I[Wt])-1;Wt>=0;){for(F>=vt?Vr=I[Wt]>>F-vt&Oe:(Vr=(I[Wt]&(1<<F+1)-1)<<vt-F,Wt>0&&(Vr|=I[Wt-1]>>this.DB+F-vt)),je=ee;(Vr&1)==0;)Vr>>=1,--je;if((F-=je)<0&&(F+=this.DB,--Wt),ln)Ue[Vr].copyTo(Ie),ln=!1;else{for(;je>1;)Be.sqrTo(Ie,Ut),Be.sqrTo(Ut,Ie),je-=2;je>0?Be.sqrTo(Ie,Ut):(Vt=Ie,Ie=Ut,Ut=Vt),Be.mulTo(Ut,Ue[Vr],Ie)}for(;Wt>=0&&(I[Wt]&1<<F)==0;)Be.sqrTo(Ie,Ut),Vt=Ie,Ie=Ut,Ut=Vt,--F<0&&(F=this.DB-1,--Wt)}return Be.revert(Ie)}function ja(I){var D=this.s<0?this.negate():this.clone(),F=I.s<0?I.negate():I.clone();if(D.compareTo(F)<0){var ee=D;D=F,F=ee}var Ie=D.getLowestSetBit(),Be=F.getLowestSetBit();if(Be<0)return D;for(Ie<Be&&(Be=Ie),Be>0&&(D.rShiftTo(Be,D),F.rShiftTo(Be,F));D.signum()>0;)(Ie=D.getLowestSetBit())>0&&D.rShiftTo(Ie,D),(Ie=F.getLowestSetBit())>0&&F.rShiftTo(Ie,F),D.compareTo(F)>=0?(D.subTo(F,D),D.rShiftTo(1,D)):(F.subTo(D,F),F.rShiftTo(1,F));return Be>0&&F.lShiftTo(Be,F),F}function Mn(I){if(I<=0)return 0;var D=this.DV%I,F=this.s<0?I-1:0;if(this.t>0)if(D==0)F=this[0]%I;else for(var ee=this.t-1;ee>=0;--ee)F=(D*F+this[ee])%I;return F}function vn(I){var D=I.isEven();if(this.isEven()&&D||I.signum()==0)return u.ZERO;for(var F=I.clone(),ee=this.clone(),Ie=q(1),Be=q(0),Ue=q(0),je=q(1);F.signum()!=0;){for(;F.isEven();)F.rShiftTo(1,F),D?((!Ie.isEven()||!Be.isEven())&&(Ie.addTo(this,Ie),Be.subTo(I,Be)),Ie.rShiftTo(1,Ie)):Be.isEven()||Be.subTo(I,Be),Be.rShiftTo(1,Be);for(;ee.isEven();)ee.rShiftTo(1,ee),D?((!Ue.isEven()||!je.isEven())&&(Ue.addTo(this,Ue),je.subTo(I,je)),Ue.rShiftTo(1,Ue)):je.isEven()||je.subTo(I,je),je.rShiftTo(1,je);F.compareTo(ee)>=0?(F.subTo(ee,F),D&&Ie.subTo(Ue,Ie),Be.subTo(je,Be)):(ee.subTo(F,ee),D&&Ue.subTo(Ie,Ue),je.subTo(Be,je))}if(ee.compareTo(u.ONE)!=0)return u.ZERO;if(je.compareTo(I)>=0)return je.subtract(I);if(je.signum()<0)je.addTo(I,je);else return je;return je.signum()<0?je.add(I):je}var $t=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ha=(1<<26)/$t[$t.length-1];function is(I){var D,F=this.abs();if(F.t==1&&F[0]<=$t[$t.length-1]){for(D=0;D<$t.length;++D)if(F[0]==$t[D])return!0;return!1}if(F.isEven())return!1;for(D=1;D<$t.length;){for(var ee=$t[D],Ie=D+1;Ie<$t.length&&ee<Ha;)ee*=$t[Ie++];for(ee=F.modInt(ee);D<Ie;)if(ee%$t[D++]==0)return!1}return F.millerRabin(I)}function ss(I){var D=this.subtract(u.ONE),F=D.getLowestSetBit();if(F<=0)return!1;var ee=D.shiftRight(F);I=I+1>>1,I>$t.length&&(I=$t.length);for(var Ie=c(),Be=0;Be<I;++Be){Ie.fromInt($t[Math.floor(Math.random()*$t.length)]);var Ue=Ie.modPow(ee,this);if(Ue.compareTo(u.ONE)!=0&&Ue.compareTo(D)!=0){for(var je=1;je++<F&&Ue.compareTo(D)!=0;)if(Ue=Ue.modPowInt(2,this),Ue.compareTo(u.ONE)==0)return!1;if(Ue.compareTo(D)!=0)return!1}}return!0}u.prototype.chunkSize=se,u.prototype.toRadix=Re,u.prototype.fromRadix=xe,u.prototype.fromNumber=Ve,u.prototype.bitwiseTo=W,u.prototype.changeBit=_a,u.prototype.addTo=dr,u.prototype.dMultiply=kn,u.prototype.dAddOffset=Jn,u.prototype.multiplyLowerTo=Un,u.prototype.multiplyUpperTo=fr,u.prototype.modInt=Mn,u.prototype.millerRabin=ss,u.prototype.clone=nt,u.prototype.intValue=lt,u.prototype.byteValue=j,u.prototype.shortValue=X,u.prototype.signum=Te,u.prototype.toByteArray=S,u.prototype.equals=E,u.prototype.min=x,u.prototype.max=H,u.prototype.and=be,u.prototype.or=gt,u.prototype.xor=bt,u.prototype.andNot=es,u.prototype.not=sn,u.prototype.shiftLeft=Ma,u.prototype.shiftRight=Pn,u.prototype.getLowestSetBit=Me,u.prototype.bitCount=Ci,u.prototype.testBit=br,u.prototype.setBit=wi,u.prototype.clearBit=Jr,u.prototype.flipBit=_t,u.prototype.add=Jt,u.prototype.subtract=Oa,u.prototype.multiply=Kn,u.prototype.divide=Ii,u.prototype.remainder=En,u.prototype.divideAndRemainder=tr,u.prototype.modPow=Lr,u.prototype.modInverse=vn,u.prototype.pow=fa,u.prototype.gcd=ja,u.prototype.isProbablePrime=is,u.prototype.square=ns,u.prototype.Barrett=Xr;var Ot,ut,Tt;function _n(I){ut[Tt++]^=I&255,ut[Tt++]^=I>>8&255,ut[Tt++]^=I>>16&255,ut[Tt++]^=I>>24&255,Tt>=ga&&(Tt-=ga)}function Xn(){_n(new Date().getTime())}if(ut==null){ut=new Array,Tt=0;var rr;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var Ga=new Uint8Array(32);for(window.crypto.getRandomValues(Ga),rr=0;rr<32;++rr)ut[Tt++]=Ga[rr]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Nr=window.crypto.random(32);for(rr=0;rr<Nr.length;++rr)ut[Tt++]=Nr.charCodeAt(rr)&255}}for(;Tt<ga;)rr=Math.floor(65536*Math.random()),ut[Tt++]=rr>>>8,ut[Tt++]=rr&255;Tt=0,Xn()}function Ni(){if(Ot==null){for(Xn(),Ot=Cn(),Ot.init(ut),Tt=0;Tt<ut.length;++Tt)ut[Tt]=0;Tt=0}return Ot.next()}function $n(I){var D;for(D=0;D<I.length;++D)I[D]=Ni()}function ha(){}ha.prototype.nextBytes=$n;function xn(){this.i=0,this.j=0,this.S=new Array}function Va(I){var D,F,ee;for(D=0;D<256;++D)this.S[D]=D;for(F=0,D=0;D<256;++D)F=F+this.S[D]+I[D%I.length]&255,ee=this.S[D],this.S[D]=this.S[F],this.S[F]=ee;this.i=0,this.j=0}function Ti(){var I;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,I=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=I,this.S[I+this.S[this.i]&255]}xn.prototype.init=Va,xn.prototype.next=Ti;function Cn(){return new xn}var ga=256;n.exports={default:u,BigInteger:u,SecureRandom:ha}}).call(d2)}(Lu)),Lu.exports}var Xf,Cp;function UA(){if(Cp)return Xf;Cp=1;const n=u2(),r=c2(),{BigInteger:a}=f2(),s=Symbol("big-integer"),o=Symbol("hex-length");class u{constructor(d,m){this[s]=d,this[o]=m}add(d){return new u(this[s].add(d[s]),null)}equals(d){return this[s].equals(d[s])}multiply(d){return new u(this[s].multiply(d[s]),null)}modPow(d,m){return new u(this[s].modPow(d[s],m[s]),m[o])}mod(d){return new u(this[s].mod(d[s]),d[o])}subtract(d){return new u(this[s].subtract(d[s]),this[o])}xor(d){return new u(this[s].xor(d[s]),this[o])}pad(d){if(d<this[o])throw new Error("Cannot pad to a shorter length");return new u(this[s],d)}inspect(){const d=this[s].toString(16);return`<SRPInteger ${d.slice(0,16)}${d.length>16?"...":""}>`}toHex(){if(this[o]===null)throw new Error("This SRPInteger has no specified length");return n(this[s].toString(16),this[o],"0")}}return u.fromHex=function(c){return new u(new a(c,16),c.length)},u.randomInteger=function(c){return u.fromHex(r(c))},u.ZERO=new u(new a("0"),null),Xf=u,Xf}var $f,wp;function A2(){if(wp)return $f;wp=1;const n=Zy(),r=s2(),a=l2(),s=o2(),o=UA();function u(c){const d=c.reduce((A,b)=>A+b.byteLength,0),m=new Uint8Array(d);return c.reduce((A,b)=>(m.set(new Uint8Array(b),A),A+b.byteLength),0),m.buffer}return $f=function(...d){const m=u(d.map(A=>{if(A instanceof o)return a(A.toHex());if(typeof A=="string")return r(A);throw new TypeError("Expected string or SRPInteger")}));return o.fromHex(n(s(m)))},$f}var Ip;function h2(){return Ip||(Ip=1,function(n){const r=A2(),a=UA(),s={largeSafePrime:`
    AC6BDB41 324A9A9B F166DE5E 1389582F AF72B665 1987EE07 FC319294
    3DB56050 A37329CB B4A099ED 8193E075 7767A13D D52312AB 4B03310D
    CD7F48A9 DA04FD50 E8083969 EDB767B0 CF609517 9A163AB3 661A05FB
    D5FAAAE8 2918A996 2F0B93B8 55F97993 EC975EEA A80D740A DBF4FF74
    7359D041 D5C33EA7 1D281E44 6B14773B CA97B43A 23FB8016 76BD207A
    436C6481 F1D2B907 8717461A 5B9D32E6 88F87748 544523B5 24B0D57D
    5EA77A27 75D2ECFA 032CFBDB F52FB378 61602790 04E57AE6 AF874E73
    03CE5329 9CCC041C 7BC308D8 2A5698F3 A8D0C382 71AE35F8 E9DBFBB6
    94B5C803 D89F7AE4 35DE236D 525F5475 9B65E372 FCD68EF2 0FA7111F
    9E4AFF73
  `,generatorModulo:"02",hashOutputBytes:256/8,paddedLength:512};function o(u){return u.pad(s.paddedLength)}n.N=a.fromHex(s.largeSafePrime.replace(/\s+/g,"")),n.g=a.fromHex(s.generatorModulo.replace(/\s+/g,"")),n.k=r(n.N,o(n.g)),n.H=r,n.PAD=o,n.hashOutputBytes=s.hashOutputBytes}(Vf)),Vf}var Bp;function g2(){if(Bp)return yi;Bp=1;const n=h2(),r=UA();return yi.generateSalt=function(){return r.randomInteger(n.hashOutputBytes).toHex()},yi.derivePrivateKey=function(a,s,o){const{H:u}=n,c=r.fromHex(a),d=String(s),m=String(o);return u(c,u(`${d}:${m}`)).toHex()},yi.deriveVerifier=function(a){const{N:s,g:o}=n,u=r.fromHex(a);return o.modPow(u,s).toHex()},yi.generateEphemeral=function(){const{N:a,g:s}=n,o=r.randomInteger(n.hashOutputBytes),u=s.modPow(o,a);return{secret:o.toHex(),public:u.toHex()}},yi.deriveSession=function(a,s,o,u,c){const{N:d,g:m,k:A,H:b,PAD:v}=n,B=r.fromHex(a),T=r.fromHex(s),Q=r.fromHex(o),k=String(u),R=r.fromHex(c),N=m.modPow(B,d);if(T.mod(d).equals(r.ZERO))throw new Error("The server sent an invalid public ephemeral");const O=b(v(N),v(T)),_=T.subtract(A.multiply(m.modPow(R,d))).modPow(B.add(O.multiply(R)),d),q=b(_),V=b(b(d).xor(b(m)),b(k),Q,N,T,q);return{key:q.toHex(),proof:V.toHex()}},yi.verifySession=function(a,s,o){const{H:u}=n,c=r.fromHex(a),d=r.fromHex(s.proof),m=r.fromHex(s.key),A=u(c,d,m);if(!r.fromHex(o).equals(A))throw new Error("Server provided session proof is invalid")},yi}var m2=g2();const Fs=xi(m2);class eo extends Error{constructor(r){super(r),this.name="ApiAuthError"}}class eE{constructor(r){Ir(this,"webApiService");this.webApiService=r}async initiateLogin(r){const a={username:r.toLowerCase().trim()},s=await this.webApiService.rawFetch("Auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(s.status===400){const u=await s.json();throw new eo(u.title)}return await s.json()}async validateLogin(r,a,s,o){const u=Fs.generateEphemeral(),c=Fs.derivePrivateKey(o.salt,r,a),d=Fs.deriveSession(u.secret,o.serverEphemeral,o.salt,r,c),m={username:r.toLowerCase().trim(),rememberMe:s,clientPublicEphemeral:u.public,clientSessionProof:d.proof},A=await this.webApiService.rawFetch("Auth/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(A.status===400){const v=await A.json();throw new eo(v.title)}return await A.json()}async validateLogin2Fa(r,a,s,o,u){const c=Fs.generateEphemeral(),d=Fs.derivePrivateKey(o.salt,r,a),m=Fs.deriveSession(c.secret,o.serverEphemeral,o.salt,r,d),A={username:r.toLowerCase().trim(),rememberMe:s,clientPublicEphemeral:c.public,clientSessionProof:m.proof,code2Fa:u},b=await this.webApiService.rawFetch("Auth/validate-2fa",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(b.status===400){const B=await b.json();throw new eo(B.title)}return await b.json()}}const p2=()=>{const{t:n}=Bt(),r=Rr(),a=Yn(),s=kr(),{setHeaderButtons:o}=ca(),[u,c]=M.useState({username:"",password:""}),{showLoading:d,hideLoading:m,setIsInitialLoading:A}=yn(),[b,v]=M.useState(!0),[B,T]=M.useState(null),[Q,k]=M.useState(null),[R,N]=M.useState(null),[O,_]=M.useState(!1),[q,V]=M.useState(""),[ge,ce]=M.useState(null),[te,J]=M.useState(null),K=da(),$=new eE(K);M.useEffect(()=>{(async()=>{const P=await Xe.getItem("local:clientUrl");let ae=cr.DEFAULT_CLIENT_URL;P&&P.length>0&&(ae=P),ce(ae),A(!1)})()},[A]),M.useEffect(()=>{const pe=yr.isPopup()?null:p.jsx(p.Fragment,{children:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:"Open in new window",iconType:Kr.EXPAND})});return o(pe),()=>{o(null)}},[o]);const me=async pe=>{pe.preventDefault(),J(null);try{d(),a.clearGlobalMessage();const P=await $.initiateLogin(Hs.normalizeUsername(u.username)),ae=await Yt.deriveKeyFromPassword(u.password,P.salt,P.encryptionType,P.encryptionSettings),Ne=Xi.Buffer.from(ae).toString("hex").toUpperCase(),_e=Xi.Buffer.from(ae).toString("base64"),G=await $.validateLogin(Hs.normalizeUsername(u.username),Ne,b,P);if(G.requiresTwoFactor){T(P),k(Ne),N(_e),_(!0),m();return}if(!G.token)throw new Error(n("auth.errors.noToken"));const ne=await K.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${G.token.token}`}}),Ee=K.validateVaultResponse(ne,n);if(Ee){J(Ee),m();return}await a.setAuthTokens(Hs.normalizeUsername(u.username),G.token.token,G.token.refreshToken);const ke=await s.initializeDatabase(ne,_e);await a.login();try{if(await ke.hasPendingMigrations()){r("/upgrade",{replace:!0}),m();return}}catch(He){await a.logout(),J(He instanceof Error?He.message:n("auth.errors.migrationError")),m();return}r("/reinitialize",{replace:!0}),m()}catch(P){P instanceof eo?J(n("common.apiErrors."+P.message)):J(n("auth.errors.serverError")),m()}},he=async pe=>{pe.preventDefault(),J(null);try{if(d(),!Q||!R||!B)throw new Error(n("auth.errors.loginDataMissing"));const P=q.trim();if(!/^\d{6}$/.test(P))throw new Error(n("auth.errors.invalidCode"));const ae=await $.validateLogin2Fa(Hs.normalizeUsername(u.username),Q,b,B,parseInt(q));if(!ae.token)throw new Error(n("auth.errors.noToken"));const Ne=await K.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${ae.token.token}`}}),_e=K.validateVaultResponse(Ne,n);if(_e){J(_e),m();return}await a.setAuthTokens(Hs.normalizeUsername(u.username),ae.token.token,ae.token.refreshToken);const G=await s.initializeDatabase(Ne,R);await a.login();try{if(await G.hasPendingMigrations()){r("/upgrade",{replace:!0}),m();return}}catch(ne){await a.logout(),J(ne instanceof Error?ne.message:n("auth.errors.migrationError")),m();return}r("/reinitialize",{replace:!0}),_(!1),V(""),k(null),N(null),T(null),m()}catch(P){console.error("2FA error:",P),P instanceof eo?J(n("common.apiErrors."+P.message)):J(n("auth.errors.serverError")),m()}},we=pe=>{const{name:P,value:ae}=pe.target;c(Ne=>({...Ne,[P]:ae}))};return O?p.jsx("div",{children:p.jsxs("form",{onSubmit:he,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[te&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:te}),p.jsxs("div",{className:"mb-6",children:[p.jsx("p",{className:"text-gray-700 dark:text-gray-200 mb-4",children:n("auth.twoFactorTitle")}),p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"twoFactorCode",children:n("auth.authCode")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 leading-tight focus:outline-none focus:shadow-outline",id:"twoFactorCode",type:"text",value:q,onChange:pe=>V(pe.target.value),placeholder:n("auth.authCodePlaceholder"),required:!0})]}),p.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[p.jsx(Zl,{type:"submit",children:n("auth.verify")}),p.jsx(Zl,{type:"button",onClick:()=>{c({username:"",password:""}),_(!1),V(""),k(null),N(null),T(null),J(null)},variant:"secondary",children:n("auth.cancel")})]}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4 text-center",children:n("auth.twoFactorNote")})]})}):p.jsxs("div",{children:[p.jsxs("form",{onSubmit:me,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[te&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:te}),p.jsx("h2",{className:"text-xl font-bold dark:text-gray-200",children:n("auth.loginTitle")}),p.jsx(i2,{}),p.jsxs("div",{className:"mb-4",children:[p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"username",children:n("auth.username")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 leading-tight focus:outline-none focus:shadow-outline",id:"username",type:"text",name:"username",placeholder:n("auth.usernamePlaceholder"),value:u.username,onChange:we,required:!0})]}),p.jsxs("div",{className:"mb-4",children:[p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"password",children:n("auth.password")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 mb-3 leading-tight focus:outline-none focus:shadow-outline",id:"password",type:"password",name:"password",placeholder:n("auth.passwordPlaceholder"),value:u.password,onChange:we,required:!0})]}),p.jsx("div",{className:"mb-6",children:p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"checkbox",checked:b,onChange:pe=>v(pe.target.checked),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-200",children:n("auth.rememberMe")})]})}),p.jsx("div",{className:"flex w-full",children:p.jsx(Zl,{type:"submit",children:n("auth.loginButton")})})]}),p.jsxs("div",{className:"text-center text-sm text-gray-600 dark:text-gray-400",children:[n("auth.noAccount")," ",p.jsx("a",{href:ge??"",target:"_blank",rel:"noopener noreferrer",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500",children:n("auth.createVault")})]})]})},y2=()=>{const n=Yn(),r=da(),a=Rr();return M.useEffect(()=>{(async()=>{await r.logout(),a("/login")})()},[n,a,r]),null},Sp="session:lastVisitedPage",Np="session:lastVisitedTime",Tp="session:navigationHistory",E2=120*1e3,b2=()=>{const n=Rr(),{setIsInitialLoading:r}=yn(),{syncVault:a}=ac(),s=M.useRef(!1),{isInitialized:o,isLoggedIn:u}=Yn(),{dbInitialized:c,dbAvailable:d}=kr(),m=o&&c,A=m&&(!u||!d),b=M.useCallback(async()=>{const[v,B,T]=await Promise.all([Xe.getItem(Sp),Xe.getItem(Np),Xe.getItem(Tp)]);if(v&&B&&Date.now()-B<=E2){if(T!=null&&T.length){n("/credentials",{replace:!0});for(const k of T)n(k.pathname+k.search+k.hash);return}n("/credentials",{replace:!0}),n(v,{replace:!0});return}await Promise.all([Xe.removeItem(Sp),Xe.removeItem(Np),Xe.removeItem(Tp),Dn("CLEAR_PERSISTED_FORM_VALUES",null,"background")]),n("/credentials",{replace:!0})},[n]);return M.useEffect(()=>{const B=new URLSearchParams(window.location.search).get("mode")==="inline_unlock";if(m){const T=!s.current;A?(r(!1),u?d||n("/unlock",{replace:!0}):n("/login",{replace:!0})):T?(s.current=!0,a({initialSync:!1,onSuccess:async()=>{B?(r(!1),n("/unlock-success",{replace:!0})):await b()},onError:Q=>{console.error("Vault sync error during initialization:",Q),b().then(()=>{r(!1)})},onUpgradeRequired:()=>{n("/upgrade",{replace:!0}),r(!1)}})):(r(!1),b())}},[m,A,u,d,n,r,a,b]),null};var kp,Lp;const v2=(Lp=(kp=globalThis.browser)==null?void 0:kp.runtime)!=null&&Lp.id?globalThis.browser:globalThis.chrome,wu=v2,Qp="local:theme",tE=M.createContext(void 0),x2=({children:n})=>{const[r,a]=M.useState("system"),[s,o]=M.useState(!1);M.useEffect(()=>{(async()=>{const b=await c();a(b)})()},[]);const u=M.useCallback(A=>{a(A),d(A)},[]),c=async()=>await Xe.getItem(Qp)||"system",d=async A=>{await Xe.setItem(Qp,A)};M.useEffect(()=>{const A=()=>{if(r==="system"){const b=window.matchMedia("(prefers-color-scheme: dark)").matches;o(b),document.documentElement.classList.toggle("dark",b)}else{const b=r==="dark";o(b),document.documentElement.classList.toggle("dark",b)}};if(A(),r==="system"){const b=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>A();return b.addEventListener("change",v),()=>b.removeEventListener("change",v)}},[r]);const m=M.useMemo(()=>({theme:r,setTheme:u,isDarkMode:s}),[r,s,u]);return p.jsx(tE.Provider,{value:m,children:n})},C2=()=>{const n=M.useContext(tE);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},w2=()=>{var V,ge;const{t:n}=Bt(),{theme:r,setTheme:a}=C2(),s=Yn(),{setHeaderButtons:o}=ca(),{setIsInitialLoading:u}=yn(),{loadApiUrl:c,getDisplayUrl:d}=Wy(),m=Rr(),[A,b]=M.useState({disabledUrls:[],temporaryDisabledUrls:{},currentUrl:"",isEnabled:!0,isGloballyEnabled:!0,isContextMenuEnabled:!0}),v=async()=>{const ce={active:!0,currentWindow:!0},[te]=await wu.tabs.query(ce);return te},B=async()=>{const ce=await Xe.getItem("local:clientUrl");let te=cr.DEFAULT_CLIENT_URL;ce&&ce.length>0&&(te=ce),window.open(te,"_blank")};M.useEffect(()=>{const ce=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(p.Fragment,{children:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("settings.openInNewWindow"),iconType:Kr.EXPAND})}),p.jsx(an,{onClick:B,title:n("settings.openWebApp"),iconType:Kr.EXTERNAL_LINK})]});return o(ce),()=>o(null)},[o,n]);const T=M.useCallback(async()=>{const ce=await v(),te=new URL(ce.url??"").hostname,J=await Xe.getItem(Qu)??[],K=await Xe.getItem(Eu)??{},$=await Xe.getItem(Gu)!==!1,me=await Xe.getItem(Fm)!==!1,he=Date.now(),we=Object.fromEntries(Object.entries(K).filter(([pe,P])=>P>he));Object.keys(we).length!==Object.keys(K).length&&await Xe.setItem(Eu,we),await c(),b({disabledUrls:J,temporaryDisabledUrls:we,currentUrl:te,isEnabled:!J.includes(te)&&!(te in we),isGloballyEnabled:$,isContextMenuEnabled:me}),u(!1)},[u,c]);M.useEffect(()=>{T()},[T]);const Q=async()=>{const{currentUrl:ce,disabledUrls:te,temporaryDisabledUrls:J,isEnabled:K}=A;let $=[...te],me={...J};K?($.includes(ce)||$.push(ce),delete me[ce]):($=$.filter(he=>he!==ce),delete me[ce]),await Xe.setItem(Qu,$),await Xe.setItem(Eu,me),b(he=>({...he,disabledUrls:$,temporaryDisabledUrls:me,isEnabled:!K}))},k=async()=>{await Xe.setItem(Qu,[]),await Xe.setItem(Eu,{}),b(ce=>({...ce,disabledUrls:[],temporaryDisabledUrls:{},isEnabled:!0}))},R=async()=>{const ce=!A.isGloballyEnabled;await Xe.setItem(Gu,ce),b(te=>({...te,isGloballyEnabled:ce}))},N=async()=>{const ce=!A.isContextMenuEnabled;await Xe.setItem(Fm,ce),await Dn("TOGGLE_CONTEXT_MENU",{enabled:ce},"background"),b(te=>({...te,isContextMenuEnabled:ce}))},O=async ce=>{a(ce),b(te=>({...te,theme:ce}))},_=async()=>{const ce=navigator.userAgent.toLowerCase(),te=ce.includes("firefox"),J=ce.includes("safari")&&!ce.includes("chrome");te?await wu.tabs.create({url:"about:addons"}):J?await wu.tabs.create({url:"safari-extension://shortcuts"}):await wu.tabs.create({url:"chrome://extensions/shortcuts"})},q=async()=>{m("/logout",{replace:!0})};return p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"flex justify-between items-center mb-4",children:p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("settings.title")})}),p.jsx("section",{children:p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"p-4",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center space-x-3",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:p.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((ge=(V=s.username)==null?void 0:V[0])==null?void 0:ge.toUpperCase())||"?"})})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:s.username}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("settings.loggedIn")})]})]}),p.jsx("button",{onClick:q,className:"px-4 py-2 text-sm font-medium text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:n("settings.logout")})]})})})}),p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.globalSettings")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.autofillPopup")}),p.jsx("p",{className:`text-sm mt-1 ${A.isGloballyEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:A.isGloballyEnabled?n("settings.activeOnAllSites"):n("settings.disabledOnAllSites")})]}),p.jsx("button",{onClick:R,className:`px-4 py-2 rounded-md transition-colors ${A.isGloballyEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:A.isGloballyEnabled?n("settings.enabled"):n("settings.disabled")})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.rightClickContextMenu")}),p.jsx("p",{className:`text-sm mt-1 ${A.isContextMenuEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:A.isContextMenuEnabled?n("settings.enabled"):n("settings.disabled")})]}),p.jsx("button",{onClick:N,className:`px-4 py-2 rounded-md transition-colors ${A.isContextMenuEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:A.isContextMenuEnabled?n("settings.enabled"):n("settings.disabled")})]})]})})]}),A.isGloballyEnabled&&p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.siteSpecificSettings")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:[n("settings.autofillPopupOn"),A.currentUrl]}),p.jsx("p",{className:`text-sm mt-1 ${A.isEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:A.isEnabled?n("settings.enabledForThisSite"):n("settings.disabledForThisSite")}),!A.isEnabled&&A.temporaryDisabledUrls[A.currentUrl]&&p.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:[n("settings.temporarilyDisabledUntil"),new Date(A.temporaryDisabledUrls[A.currentUrl]).toLocaleTimeString()]})]}),A.isGloballyEnabled&&p.jsx("button",{onClick:Q,className:`px-4 py-2 ml-1 rounded-md transition-colors ${A.isEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:A.isEnabled?n("settings.enabled"):n("settings.disabled")})]}),p.jsx("div",{className:"mt-4",children:p.jsx("button",{onClick:k,className:"w-full px-4 py-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-md text-gray-700 dark:text-gray-300 transition-colors text-sm",children:n("settings.resetAllSiteSettings")})})]})})]}),p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.appearance")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"p-4",children:[p.jsx("div",{className:"mb-4",children:p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white mb-3",children:n("settings.language")}),p.jsx(vy,{variant:"dropdown",size:"sm"})]})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:n("settings.theme")}),p.jsxs("div",{className:"flex flex-col space-y-2",children:[p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"radio",name:"theme",value:"system",checked:r==="system",onChange:()=>O("system"),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:n("settings.useDefault")})]}),p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"radio",name:"theme",value:"light",checked:r==="light",onChange:()=>O("light"),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:n("settings.light")})]}),p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"radio",name:"theme",value:"dark",checked:r==="dark",onChange:()=>O("dark"),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:n("settings.dark")})]})]})]})]})})]}),p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.keyboardShortcuts")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"p-4",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{children:p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.configureKeyboardShortcuts")})}),p.jsx("button",{onClick:_,className:"px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-md transition-colors",children:n("settings.configure")})]})})})]}),p.jsxs("div",{className:"text-center text-gray-400 dark:text-gray-600",children:[n("settings.versionPrefix"),cr.VERSION," (",d(),")"]})]})},I2=()=>{var R,N;const{t:n}=Bt(),r=Yn(),a=kr(),s=Rr(),{setHeaderButtons:o}=ca(),u=da(),c=new eE(u),[d,m]=M.useState(""),[A,b]=M.useState(null),{showLoading:v,hideLoading:B,setIsInitialLoading:T}=yn();M.useEffect(()=>{(async()=>{const _=await u.getStatus(),q=u.validateStatusResponse(_);q!==null&&(await u.logout(n("common.apiErrors."+q)),s("/logout")),T(!1)})()},[u,r,T,s,n]),M.useEffect(()=>{const O=yr.isPopup()?null:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("common.openInNewWindow"),iconType:Kr.EXPAND});return o(O),()=>{o(null)}},[o,n]);const Q=async O=>{O.preventDefault(),b(null),v();try{const _=await c.initiateLogin(r.username),q=await Yt.deriveKeyFromPassword(d,_.salt,_.encryptionType,_.encryptionSettings),V=await u.get("Vault"),ge=u.validateVaultResponse(V,n);if(ge){b(n("common.apiErrors."+ge)),B();return}const ce=Xi.Buffer.from(q).toString("base64");await a.initializeDatabase(V,ce),await Xe.setItem(Vu,0),s("/reinitialize",{replace:!0})}catch(_){b(n("auth.errors.wrongPassword")),console.error("Unlock error:",_)}finally{B()}},k=()=>{s("/logout",{replace:!0})};return p.jsx("div",{children:p.jsxs("form",{onSubmit:Q,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[p.jsxs("div",{className:"flex items-center space-x-3 mb-6",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:p.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((N=(R=r.username)==null?void 0:R[0])==null?void 0:N.toUpperCase())||"?"})})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.username}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("auth.loggedIn")})]})]}),p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:n("auth.unlockTitle")}),A&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:A}),p.jsxs("div",{className:"mb-2",children:[p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"password",children:n("auth.masterPassword")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 mb-3 leading-tight focus:outline-none focus:shadow-outline",id:"password",type:"password",value:d,onChange:O=>m(O.target.value),placeholder:n("auth.passwordPlaceholder"),required:!0})]}),p.jsx(Zl,{type:"submit",children:n("auth.unlockVault")}),p.jsxs("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-200 mt-6",children:[n("auth.switchAccounts")," ",p.jsx("button",{onClick:k,className:"text-primary-700 hover:underline dark:text-primary-500",children:n("auth.logout")})]})]})})},B2=()=>{const n=Rr(),{t:r}=Bt(),a=()=>{const s=new URL(window.location.href);s.searchParams.delete("mode"),window.history.replaceState({},"",s),n("/credentials")};return p.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[p.jsx("div",{className:"mb-4 text-green-600 dark:text-green-400",children:p.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),p.jsx("h2",{className:"text-xl font-semibold mb-4 text-gray-900 dark:text-white",children:r("auth.unlockSuccessTitle")}),p.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-400",children:r("auth.unlockSuccessDescription")}),p.jsxs("div",{className:"space-y-3 w-full",children:[p.jsx("button",{onClick:()=>window.close(),className:"w-full px-4 py-2 text-white bg-primary-600 rounded hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:r("auth.closePopup")}),p.jsx("button",{onClick:a,className:"w-full px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600",children:r("auth.browseVault")})]})]})},S2=()=>{var we;const{t:n}=Bt(),{username:r}=Yn(),a=kr(),{sqliteClient:s}=a,{setHeaderButtons:o}=ca(),[u,c]=M.useState(!1),[d,m]=M.useState(null),[A,b]=M.useState(null),[v,B]=M.useState(null),[T,Q]=M.useState(!1),[k,R]=M.useState(!1),{setIsInitialLoading:N}=yn(),O=da(),{executeVaultMutation:_,isLoading:q,syncStatus:V}=ky(),{syncVault:ge}=ac(),ce=Rr();M.useEffect(()=>{const pe=yr.isPopup()?null:p.jsx(p.Fragment,{children:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("common.openInNewWindow"),iconType:Kr.EXPAND})});return o(pe),()=>{o(null)}},[o,n]);const te=M.useCallback(async()=>{try{if(s){const pe=s.getDatabaseVersion(),P=await s.getLatestDatabaseVersion();m(pe),b(P)}N(!1)}catch(pe){console.error("Failed to load version information:",pe),B(n("upgrade.alerts.unableToGetVersionInfo"))}},[s,N,n]);M.useEffect(()=>{te()},[te]);const J=async()=>{if(!s||!d||!A){B(n("upgrade.alerts.unableToGetVersionInfo"));return}if(await O.isSelfHosted()){Q(!0);return}await K()},K=async()=>{if(!s||!d||!A){B(n("upgrade.alerts.unableToGetVersionInfo"));return}c(!0),B(null);try{const P=new sA().getUpgradeVaultSql(d.revision,A.revision);if(!P.success)throw new Error(P.error??n("upgrade.alerts.upgradeFailed"));if(P.sqlCommands.length===0){await $();return}await _(async()=>{s.beginTransaction();for(let ae=0;ae<P.sqlCommands.length;ae++){const Ne=P.sqlCommands[ae];try{s.executeRaw(Ne)}catch(_e){throw console.error(`Error executing SQL command ${ae+1}:`,Ne,_e),s.rollbackTransaction(),new Error(n("upgrade.alerts.failedToApplyMigration",{current:ae+1,total:P.sqlCommands.length}))}}s.commitTransaction()},{skipSyncCheck:!0,onSuccess:()=>{$()},onError:ae=>{console.error("Upgrade failed:",ae),B(ae.message)}}),console.debug("executeVaultMutation done?")}catch(pe){console.error("Upgrade failed:",pe),B(pe instanceof Error?pe.message:n("upgrade.alerts.unknownErrorDuringUpgrade"))}finally{c(!1)}},$=async()=>{try{await ge({onSuccess:()=>{ce("/credentials")},onError:pe=>{console.error("Sync error after upgrade:",pe),ce("/credentials")}})}catch(pe){console.error("Error during post-upgrade sync:",pe),ce("/credentials")}},me=async()=>{ce("/logout")},he=()=>{R(!0)};return p.jsxs("div",{children:[(u||q)&&p.jsxs("div",{className:"fixed inset-0 flex flex-col justify-center items-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-50",children:[p.jsx(Ps,{}),p.jsx("div",{className:"text-sm text-gray-500 mt-2",children:V||n("upgrade.upgrading")})]}),p.jsx(Xu,{isOpen:T,onClose:()=>Q(!1),onConfirm:()=>{Q(!1),K()},title:n("upgrade.alerts.selfHostedServer"),message:n("upgrade.alerts.selfHostedWarning"),confirmText:n("upgrade.alerts.continueUpgrade"),cancelText:n("upgrade.alerts.cancel")}),p.jsx(Xu,{isOpen:k,onClose:()=>R(!1),onConfirm:()=>R(!1),title:n("upgrade.whatsNew"),message:`${n("upgrade.whatsNewDescription")}

${(A==null?void 0:A.description)??n("upgrade.noDescriptionAvailable")}`}),p.jsxs("form",{className:"w-full px-2 pt-2 pb-2 mb-4",children:[v&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:v}),p.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:p.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((we=r==null?void 0:r[0])==null?void 0:we.toUpperCase())||"?"})})}),p.jsx("div",{children:p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r})})]}),p.jsx("h2",{className:"text-xl font-bold dark:text-gray-200 mb-4",children:n("upgrade.title")}),p.jsxs("div",{className:"mb-6",children:[p.jsx("p",{className:"text-gray-700 dark:text-gray-200 text-sm mb-4",children:n("upgrade.subtitle")}),p.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded p-4 mb-4",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:n("upgrade.versionInformation")}),p.jsx("button",{type:"button",onClick:he,className:"bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-gray-200 rounded-full w-6 h-6 flex items-center justify-center text-sm font-bold hover:bg-gray-300 dark:hover:bg-gray-500",title:n("upgrade.whatsNew"),children:"?"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex justify-between items-center",children:[p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("upgrade.yourVault")}),p.jsx("span",{className:"text-sm font-bold text-orange-600 dark:text-orange-400",children:(d==null?void 0:d.releaseVersion)??"..."})]}),p.jsxs("div",{className:"flex justify-between items-center",children:[p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("upgrade.newVersion")}),p.jsx("span",{className:"text-sm font-bold text-green-600 dark:text-green-400",children:(A==null?void 0:A.releaseVersion)??"..."})]})]})]})]}),p.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[p.jsx(Zl,{type:"button",onClick:J,children:u||q?V||n("upgrade.upgrading"):n("upgrade.upgrade")}),p.jsx("button",{type:"button",onClick:me,className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium py-2",disabled:u||q,children:n("upgrade.logout")})]})]})]})},N2=()=>{const{t:n}=Bt(),r=Yn(),{isInitialLoading:a}=yn(),[s,o]=oc(!0,150),[u,c]=M.useState(null),{headerButtons:d}=ca(),m=pn.useMemo(()=>[{path:"/",element:p.jsx(a2,{}),showBackButton:!1},{path:"/reinitialize",element:p.jsx(b2,{}),showBackButton:!1},{path:"/login",element:p.jsx(p2,{}),showBackButton:!1},{path:"/unlock",element:p.jsx(I2,{}),showBackButton:!1},{path:"/unlock-success",element:p.jsx(B2,{}),showBackButton:!1},{path:"/upgrade",element:p.jsx(S2,{}),showBackButton:!1},{path:"/auth-settings",element:p.jsx(Jw,{}),showBackButton:!0,title:n("settings.title")},{path:"/credentials",element:p.jsx(e2,{}),showBackButton:!1},{path:"/credentials/add",element:p.jsx(op,{}),showBackButton:!0,title:n("credentials.addCredential")},{path:"/credentials/:id",element:p.jsx(WI,{}),showBackButton:!0,title:n("credentials.credentialDetails")},{path:"/credentials/:id/edit",element:p.jsx(op,{}),showBackButton:!0,title:n("credentials.editCredential")},{path:"/emails",element:p.jsx(n2,{}),showBackButton:!1},{path:"/emails/:id",element:p.jsx(r2,{}),showBackButton:!0,title:n("emails.title")},{path:"/settings",element:p.jsx(w2,{}),showBackButton:!1},{path:"/logout",element:p.jsx(y2,{}),showBackButton:!1}],[n]);return M.useEffect(()=>{a||o(!1)},[a,o]),M.useEffect(()=>{r.globalMessage?c(r.globalMessage):c(null)},[r,r.globalMessage]),p.jsx(fC,{children:p.jsx(fw,{children:p.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[s&&p.jsx("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 z-50 flex items-center justify-center",children:p.jsx(Ps,{})}),p.jsx(iw,{routes:m,rightButtons:d}),p.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px",height:"calc(100% - 120px)"},children:p.jsxs("div",{className:"p-4 mb-16",children:[u&&p.jsx("p",{className:"text-red-500 mb-4",children:u}),p.jsx(Gx,{children:m.map(A=>p.jsx($p,{path:A.path,element:A.element},A.path))})]})}),p.jsx(xC,{})]})})})},T2=Fb.createRoot(document.getElementById("root"));T2.render(p.jsx(nw,{children:p.jsx(aw,{children:p.jsx(N1,{children:p.jsx(ow,{children:p.jsx(sw,{children:p.jsx(x2,{children:p.jsx(N2,{})})})})})})}));
