morpheus-cli 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/channels/discord.js +3 -2
- package/dist/channels/telegram.js +3 -2
- package/dist/cli/commands/start.js +30 -0
- package/dist/config/manager.js +117 -1
- package/dist/config/precedence.js +107 -0
- package/dist/http/api.js +29 -0
- package/dist/runtime/providers/factory.js +7 -5
- package/dist/runtime/tools/morpheus-tools.js +99 -26
- package/dist/runtime/trinity-crypto.js +51 -0
- package/dist/ui/assets/index-B9ngtbja.css +1 -0
- package/dist/ui/assets/index-CfCRfIwg.js +111 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/sw.js +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/index-BDWWF6gM.css +0 -1
- package/dist/ui/assets/index-DTUgtIcM.js +0 -111
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function Ip(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $h={exports:{}},el={};var s0;function EN(){if(s0)return el;s0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,u){var l=null;if(u!==void 0&&(l=""+u),s.key!==void 0&&(l=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:u}}return el.Fragment=t,el.jsx=n,el.jsxs=n,el}var o0;function TN(){return o0||(o0=1,$h.exports=EN()),$h.exports}var f=TN(),Lh={exports:{}},Te={};var l0;function AN(){if(l0)return Te;l0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function N(T,G,w){this.props=T,this.context=G,this.refs=E,this.updater=w||S}N.prototype.isReactComponent={},N.prototype.setState=function(T,G){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,G,"setState")},N.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function O(){}O.prototype=N.prototype;function C(T,G,w){this.props=T,this.context=G,this.refs=E,this.updater=w||S}var P=C.prototype=new O;P.constructor=C,j(P,N.prototype),P.isPureReactComponent=!0;var U=Array.isArray;function R(){}var F={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function K(T,G,w){var X=w.ref;return{$$typeof:e,type:T,key:G,ref:X!==void 0?X:null,props:w}}function fe(T,G){return K(T.type,G,T.props)}function ae(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function le(T){var G={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(w){return G[w]})}var ne=/\/+/g;function oe(T,G){return typeof T=="object"&&T!==null&&T.key!=null?le(""+T.key):G.toString(36)}function ie(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(R,R):(T.status="pending",T.then(function(G){T.status==="pending"&&(T.status="fulfilled",T.value=G)},function(G){T.status==="pending"&&(T.status="rejected",T.reason=G)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function L(T,G,w,X,me){var D=typeof T;(D==="undefined"||D==="boolean")&&(T=null);var ce=!1;if(T===null)ce=!0;else switch(D){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(T.$$typeof){case e:case t:ce=!0;break;case g:return ce=T._init,L(ce(T._payload),G,w,X,me)}}if(ce)return me=me(T),ce=X===""?"."+oe(T,0):X,U(me)?(w="",ce!=null&&(w=ce.replace(ne,"$&/")+"/"),L(me,G,w,"",function(Ye){return Ye})):me!=null&&(ae(me)&&(me=fe(me,w+(me.key==null||T&&T.key===me.key?"":(""+me.key).replace(ne,"$&/")+"/")+ce)),G.push(me)),1;ce=0;var Ae=X===""?".":X+":";if(U(T))for(var je=0;je<T.length;je++)X=T[je],D=Ae+oe(X,je),ce+=L(X,G,w,D,me);else if(je=v(T),typeof je=="function")for(T=je.call(T),je=0;!(X=T.next()).done;)X=X.value,D=Ae+oe(X,je++),ce+=L(X,G,w,D,me);else if(D==="object"){if(typeof T.then=="function")return L(ie(T),G,w,X,me);throw G=String(T),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ce}function J(T,G,w){if(T==null)return T;var X=[],me=0;return L(T,X,"","",function(D){return G.call(w,D,me++)}),X}function Z(T){if(T._status===-1){var G=T._result;G=G(),G.then(function(w){(T._status===0||T._status===-1)&&(T._status=1,T._result=w)},function(w){(T._status===0||T._status===-1)&&(T._status=2,T._result=w)}),T._status===-1&&(T._status=0,T._result=G)}if(T._status===1)return T._result.default;throw T._result}var he=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},A={map:J,forEach:function(T,G,w){J(T,function(){G.apply(this,arguments)},w)},count:function(T){var G=0;return J(T,function(){G++}),G},toArray:function(T){return J(T,function(G){return G})||[]},only:function(T){if(!ae(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Te.Activity=y,Te.Children=A,Te.Component=N,Te.Fragment=n,Te.Profiler=s,Te.PureComponent=C,Te.StrictMode=a,Te.Suspense=h,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Te.__COMPILER_RUNTIME={__proto__:null,c:function(T){return F.H.useMemoCache(T)}},Te.cache=function(T){return function(){return T.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(T,G,w){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var X=j({},T.props),me=T.key;if(G!=null)for(D in G.key!==void 0&&(me=""+G.key),G)!B.call(G,D)||D==="key"||D==="__self"||D==="__source"||D==="ref"&&G.ref===void 0||(X[D]=G[D]);var D=arguments.length-2;if(D===1)X.children=w;else if(1<D){for(var ce=Array(D),Ae=0;Ae<D;Ae++)ce[Ae]=arguments[Ae+2];X.children=ce}return K(T.type,me,X)},Te.createContext=function(T){return T={$$typeof:l,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:u,_context:T},T},Te.createElement=function(T,G,w){var X,me={},D=null;if(G!=null)for(X in G.key!==void 0&&(D=""+G.key),G)B.call(G,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(me[X]=G[X]);var ce=arguments.length-2;if(ce===1)me.children=w;else if(1<ce){for(var Ae=Array(ce),je=0;je<ce;je++)Ae[je]=arguments[je+2];me.children=Ae}if(T&&T.defaultProps)for(X in ce=T.defaultProps,ce)me[X]===void 0&&(me[X]=ce[X]);return K(T,D,me)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(T){return{$$typeof:d,render:T}},Te.isValidElement=ae,Te.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:Z}},Te.memo=function(T,G){return{$$typeof:m,type:T,compare:G===void 0?null:G}},Te.startTransition=function(T){var G=F.T,w={};F.T=w;try{var X=T(),me=F.S;me!==null&&me(w,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(R,he)}catch(D){he(D)}finally{G!==null&&w.types!==null&&(G.types=w.types),F.T=G}},Te.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Te.use=function(T){return F.H.use(T)},Te.useActionState=function(T,G,w){return F.H.useActionState(T,G,w)},Te.useCallback=function(T,G){return F.H.useCallback(T,G)},Te.useContext=function(T){return F.H.useContext(T)},Te.useDebugValue=function(){},Te.useDeferredValue=function(T,G){return F.H.useDeferredValue(T,G)},Te.useEffect=function(T,G){return F.H.useEffect(T,G)},Te.useEffectEvent=function(T){return F.H.useEffectEvent(T)},Te.useId=function(){return F.H.useId()},Te.useImperativeHandle=function(T,G,w){return F.H.useImperativeHandle(T,G,w)},Te.useInsertionEffect=function(T,G){return F.H.useInsertionEffect(T,G)},Te.useLayoutEffect=function(T,G){return F.H.useLayoutEffect(T,G)},Te.useMemo=function(T,G){return F.H.useMemo(T,G)},Te.useOptimistic=function(T,G){return F.H.useOptimistic(T,G)},Te.useReducer=function(T,G,w){return F.H.useReducer(T,G,w)},Te.useRef=function(T){return F.H.useRef(T)},Te.useState=function(T){return F.H.useState(T)},Te.useSyncExternalStore=function(T,G,w){return F.H.useSyncExternalStore(T,G,w)},Te.useTransition=function(){return F.H.useTransition()},Te.version="19.2.4",Te}var u0;function rd(){return u0||(u0=1,Lh.exports=AN()),Lh.exports}var z=rd();const Hp=Ip(z);var Ph={exports:{}},tl={},Uh={exports:{}},Vh={};var c0;function ON(){return c0||(c0=1,(function(e){function t(L,J){var Z=L.length;L.push(J);e:for(;0<Z;){var he=Z-1>>>1,A=L[he];if(0<s(A,J))L[he]=J,L[Z]=A,Z=he;else break e}}function n(L){return L.length===0?null:L[0]}function a(L){if(L.length===0)return null;var J=L[0],Z=L.pop();if(Z!==J){L[0]=Z;e:for(var he=0,A=L.length,T=A>>>1;he<T;){var G=2*(he+1)-1,w=L[G],X=G+1,me=L[X];if(0>s(w,Z))X<A&&0>s(me,w)?(L[he]=me,L[X]=Z,he=X):(L[he]=w,L[G]=Z,he=G);else if(X<A&&0>s(me,Z))L[he]=me,L[X]=Z,he=X;else break e}}return J}function s(L,J){var Z=L.sortIndex-J.sortIndex;return Z!==0?Z:L.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var h=[],m=[],g=1,y=null,b=3,v=!1,S=!1,j=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function P(L){for(var J=n(m);J!==null;){if(J.callback===null)a(m);else if(J.startTime<=L)a(m),J.sortIndex=J.expirationTime,t(h,J);else break;J=n(m)}}function U(L){if(j=!1,P(L),!S)if(n(h)!==null)S=!0,R||(R=!0,le());else{var J=n(m);J!==null&&ie(U,J.startTime-L)}}var R=!1,F=-1,B=5,K=-1;function fe(){return E?!0:!(e.unstable_now()-K<B)}function ae(){if(E=!1,R){var L=e.unstable_now();K=L;var J=!0;try{e:{S=!1,j&&(j=!1,O(F),F=-1),v=!0;var Z=b;try{t:{for(P(L),y=n(h);y!==null&&!(y.expirationTime>L&&fe());){var he=y.callback;if(typeof he=="function"){y.callback=null,b=y.priorityLevel;var A=he(y.expirationTime<=L);if(L=e.unstable_now(),typeof A=="function"){y.callback=A,P(L),J=!0;break t}y===n(h)&&a(h),P(L)}else a(h);y=n(h)}if(y!==null)J=!0;else{var T=n(m);T!==null&&ie(U,T.startTime-L),J=!1}}break e}finally{y=null,b=Z,v=!1}J=void 0}}finally{J?le():R=!1}}}var le;if(typeof C=="function")le=function(){C(ae)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,oe=ne.port2;ne.port1.onmessage=ae,le=function(){oe.postMessage(null)}}else le=function(){N(ae,0)};function ie(L,J){F=N(function(){L(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(L){switch(b){case 1:case 2:case 3:var J=3;break;default:J=b}var Z=b;b=J;try{return L()}finally{b=Z}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(L,J){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var Z=b;b=L;try{return J()}finally{b=Z}},e.unstable_scheduleCallback=function(L,J,Z){var he=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?he+Z:he):Z=he,L){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=Z+A,L={id:g++,callback:J,priorityLevel:L,startTime:Z,expirationTime:A,sortIndex:-1},Z>he?(L.sortIndex=Z,t(m,L),n(h)===null&&L===n(m)&&(j?(O(F),F=-1):j=!0,ie(U,Z-he))):(L.sortIndex=A,t(h,L),S||v||(S=!0,R||(R=!0,le()))),L},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(L){var J=b;return function(){var Z=b;b=J;try{return L.apply(this,arguments)}finally{b=Z}}}})(Vh)),Vh}var d0;function RN(){return d0||(d0=1,Uh.exports=ON()),Uh.exports}var Bh={exports:{}},un={};var f0;function MN(){if(f0)return un;f0=1;var e=rd();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function u(h,m,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:""+y,children:h,containerInfo:m,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,un.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return u(h,m,null,g)},un.flushSync=function(h){var m=l.T,g=a.p;try{if(l.T=null,a.p=2,h)return h()}finally{l.T=m,a.p=g,a.d.f()}},un.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},un.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},un.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=d(g,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:v}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:b,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},un.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},un.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=d(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},un.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},un.requestFormReset=function(h){a.d.r(h)},un.unstable_batchedUpdates=function(h,m){return h(m)},un.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},un.useFormStatus=function(){return l.H.useHostTransitionStatus()},un.version="19.2.4",un}var h0;function DN(){if(h0)return Bh.exports;h0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bh.exports=MN(),Bh.exports}var m0;function $N(){if(m0)return tl;m0=1;var e=RN(),t=rd(),n=DN();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,o=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(o=i.return),r=i.return;while(r)}return i.tag===3?o:null}function l(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(u(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(a(188));return i!==r?null:r}for(var o=r,c=i;;){var p=o.return;if(p===null)break;var x=p.alternate;if(x===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===o)return h(p),r;if(x===c)return h(p),i;x=x.sibling}throw Error(a(188))}if(o.return!==c.return)o=p,c=x;else{for(var k=!1,_=p.child;_;){if(_===o){k=!0,o=p,c=x;break}if(_===c){k=!0,c=p,o=x;break}_=_.sibling}if(!k){for(_=x.child;_;){if(_===o){k=!0,o=x,c=p;break}if(_===c){k=!0,c=x,o=p;break}_=_.sibling}if(!k)throw Error(a(189))}}if(o.alternate!==c)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),C=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=ae&&r[ae]||r["@@iterator"],typeof r=="function"?r:null)}var ne=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ne?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case U:return"Suspense";case R:return"SuspenseList";case K:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case C:return r.displayName||"Context";case O:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case F:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case B:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ie=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},he=[],A=-1;function T(r){return{current:r}}function G(r){0>A||(r.current=he[A],he[A]=null,A--)}function w(r,i){A++,he[A]=r.current,r.current=i}var X=T(null),me=T(null),D=T(null),ce=T(null);function Ae(r,i){switch(w(D,i),w(me,r),w(X,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Ev(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Ev(i),r=Tv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(X),w(X,r)}function je(){G(X),G(me),G(D)}function Ye(r){r.memoizedState!==null&&w(ce,r);var i=X.current,o=Tv(i,r.type);i!==o&&(w(me,r),w(X,o))}function Nt(r){me.current===r&&(G(X),G(me)),ce.current===r&&(G(ce),Jo._currentValue=Z)}var Jt,et;function wt(r){if(Jt===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);Jt=i&&i[1]||"",et=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Jt+r+et}var qn=!1;function Ie(r,i){if(!r||qn)return"";qn=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Y){var q=Y}Reflect.construct(r,[],re)}else{try{re.call()}catch(Y){q=Y}r.call(re.prototype)}}else{try{throw Error()}catch(Y){q=Y}(re=r())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Y){if(Y&&q&&typeof Y.stack=="string")return[Y.stack,q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),k=x[0],_=x[1];if(k&&_){var M=k.split(`
|
|
4
|
-
`),H=_.split(`
|
|
5
|
-
`);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<H.length&&!H[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===H.length)for(c=M.length-1,p=H.length-1;1<=c&&0<=p&&M[c]!==H[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==H[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==H[p]){var Q=`
|
|
6
|
-
`+M[c].replace(" at new "," at ");return r.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",r.displayName)),Q}while(1<=c&&0<=p);break}}}finally{qn=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?wt(o):""}function st(r,i){switch(r.tag){case 26:case 27:case 5:return wt(r.type);case 16:return wt("Lazy");case 13:return r.child!==i&&i!==null?wt("Suspense Fallback"):wt("Suspense");case 19:return wt("SuspenseList");case 0:case 15:return Ie(r.type,!1);case 11:return Ie(r.type.render,!1);case 1:return Ie(r.type,!0);case 31:return wt("Activity");default:return""}}function ht(r){try{var i="",o=null;do i+=st(r,o),o=r,r=r.return;while(r);return i}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var tt=Object.prototype.hasOwnProperty,Kt=e.unstable_scheduleCallback,Gn=e.unstable_cancelCallback,Ot=e.unstable_shouldYield,Ft=e.unstable_requestPaint,mt=e.unstable_now,$i=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Be=e.unstable_IdlePriority,mn=e.log,Dn=e.unstable_setDisableYieldValue,pn=null,qt=null;function wn(r){if(typeof mn=="function"&&Dn(r),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(pn,r)}catch{}}var ot=Math.clz32?Math.clz32:pj,ua=Math.log,fr=Math.LN2;function pj(r){return r>>>=0,r===0?32:31-(ua(r)/fr|0)|0}var ql=256,Gl=262144,Yl=4194304;function ei(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Xl(r,i,o){var c=r.pendingLanes;if(c===0)return 0;var p=0,x=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var _=c&134217727;return _!==0?(c=_&~x,c!==0?p=ei(c):(k&=_,k!==0?p=ei(k):o||(o=_&~r,o!==0&&(p=ei(o))))):(_=c&~x,_!==0?p=ei(_):k!==0?p=ei(k):o||(o=c&~r,o!==0&&(p=ei(o)))),p===0?0:i!==0&&i!==p&&(i&x)===0&&(x=p&-p,o=i&-i,x>=o||x===32&&(o&4194048)!==0)?i:p}function lo(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function gj(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 cy(){var r=Yl;return Yl<<=1,(Yl&62914560)===0&&(Yl=4194304),r}function Sd(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function uo(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function yj(r,i,o,c,p,x){var k=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var _=r.entanglements,M=r.expirationTimes,H=r.hiddenUpdates;for(o=k&~o;0<o;){var Q=31-ot(o),re=1<<Q;_[Q]=0,M[Q]=-1;var q=H[Q];if(q!==null)for(H[Q]=null,Q=0;Q<q.length;Q++){var Y=q[Q];Y!==null&&(Y.lane&=-536870913)}o&=~re}c!==0&&dy(r,c,0),x!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=x&~(k&~i))}function dy(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ot(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|o&261930}function fy(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var c=31-ot(o),p=1<<c;p&i|r[c]&i&&(r[c]|=i),o&=~p}}function hy(r,i){var o=i&-i;return o=(o&42)!==0?1:zd(o),(o&(r.suspendedLanes|i))!==0?0:o}function zd(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function _d(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function my(){var r=J.p;return r!==0?r:(r=window.event,r===void 0?32:Wv(r.type))}function py(r,i){var o=J.p;try{return J.p=r,i()}finally{J.p=o}}var ca=Math.random().toString(36).slice(2),en="__reactFiber$"+ca,Sn="__reactProps$"+ca,Li="__reactContainer$"+ca,jd="__reactEvents$"+ca,xj="__reactListeners$"+ca,bj="__reactHandles$"+ca,gy="__reactResources$"+ca,co="__reactMarker$"+ca;function Cd(r){delete r[en],delete r[Sn],delete r[jd],delete r[xj],delete r[bj]}function Pi(r){var i=r[en];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Li]||o[en]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Lv(r);r!==null;){if(o=r[en])return o;r=Lv(r)}return i}r=o,o=r.parentNode}return null}function Ui(r){if(r=r[en]||r[Li]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function fo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Vi(r){var i=r[gy];return i||(i=r[gy]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Qt(r){r[co]=!0}var yy=new Set,xy={};function ti(r,i){Bi(r,i),Bi(r+"Capture",i)}function Bi(r,i){for(xy[r]=i,r=0;r<i.length;r++)yy.add(i[r])}var vj=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]*$"),by={},vy={};function kj(r){return tt.call(vy,r)?!0:tt.call(by,r)?!1:vj.test(r)?vy[r]=!0:(by[r]=!0,!1)}function Jl(r,i,o){if(kj(i))if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+o)}}function Kl(r,i,o){if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+o)}}function Pr(r,i,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(i,o,""+c)}}function Yn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ky(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function wj(r,i,o){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,x=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(k){o=""+k,x.call(this,k)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(k){o=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Nd(r){if(!r._valueTracker){var i=ky(r)?"checked":"value";r._valueTracker=wj(r,i,""+r[i])}}function wy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),c="";return r&&(c=ky(r)?r.checked?"true":"false":r.value),r=c,r!==o?(i.setValue(r),!0):!1}function Ql(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Sj=/[\n"\\]/g;function Xn(r){return r.replace(Sj,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ed(r,i,o,c,p,x,k,_){r.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.type=k:r.removeAttribute("type"),i!=null?k==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Yn(i)):r.value!==""+Yn(i)&&(r.value=""+Yn(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?Td(r,k,Yn(i)):o!=null?Td(r,k,Yn(o)):c!=null&&r.removeAttribute("value"),p==null&&x!=null&&(r.defaultChecked=!!x),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+Yn(_):r.removeAttribute("name")}function Sy(r,i,o,c,p,x,k,_){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.type=x),i!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Nd(r);return}o=o!=null?""+Yn(o):"",i=i!=null?""+Yn(i):o,_||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=_?r.checked:!!c,r.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),Nd(r)}function Td(r,i,o){i==="number"&&Ql(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Zi(r,i,o,c){if(r=r.options,i){i={};for(var p=0;p<o.length;p++)i["$"+o[p]]=!0;for(o=0;o<r.length;o++)p=i.hasOwnProperty("$"+r[o].value),r[o].selected!==p&&(r[o].selected=p),p&&c&&(r[o].defaultSelected=!0)}else{for(o=""+Yn(o),i=null,p=0;p<r.length;p++){if(r[p].value===o){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function zy(r,i,o){if(i!=null&&(i=""+Yn(i),i!==r.value&&(r.value=i),o==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=o!=null?""+Yn(o):""}function _y(r,i,o,c){if(i==null){if(c!=null){if(o!=null)throw Error(a(92));if(ie(c)){if(1<c.length)throw Error(a(93));c=c[0]}o=c}o==null&&(o=""),i=o}o=Yn(i),r.defaultValue=o,c=r.textContent,c===o&&c!==""&&c!==null&&(r.value=c),Nd(r)}function Ii(r,i){if(i){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=i;return}}r.textContent=i}var zj=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 jy(r,i,o){var c=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,o):typeof o!="number"||o===0||zj.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Cy(r,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&o[p]!==c&&jy(r,p,c)}else for(var x in i)i.hasOwnProperty(x)&&jy(r,x,i[x])}function Ad(r){if(r.indexOf("-")===-1)return!1;switch(r){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 _j=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"]]),jj=/^[\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 Wl(r){return jj.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ur(){}var Od=null;function Rd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Hi=null,Fi=null;function Ny(r){var i=Ui(r);if(i&&(r=i.stateNode)){var o=r[Sn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Ed(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=r;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Xn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var c=o[i];if(c!==r&&c.form===r.form){var p=c[Sn]||null;if(!p)throw Error(a(90));Ed(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<o.length;i++)c=o[i],c.form===r.form&&wy(c)}break e;case"textarea":zy(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Zi(r,!!o.multiple,i,!1)}}}var Md=!1;function Ey(r,i,o){if(Md)return r(i,o);Md=!0;try{var c=r(i);return c}finally{if(Md=!1,(Hi!==null||Fi!==null)&&(Vu(),Hi&&(i=Hi,r=Fi,Fi=Hi=null,Ny(i),r)))for(i=0;i<r.length;i++)Ny(r[i])}}function ho(r,i){var o=r.stateNode;if(o===null)return null;var c=o[Sn]||null;if(c===null)return null;o=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dd=!1;if(Vr)try{var mo={};Object.defineProperty(mo,"passive",{get:function(){Dd=!0}}),window.addEventListener("test",mo,mo),window.removeEventListener("test",mo,mo)}catch{Dd=!1}var da=null,$d=null,eu=null;function Ty(){if(eu)return eu;var r,i=$d,o=i.length,c,p="value"in da?da.value:da.textContent,x=p.length;for(r=0;r<o&&i[r]===p[r];r++);var k=o-r;for(c=1;c<=k&&i[o-c]===p[x-c];c++);return eu=p.slice(r,1<c?1-c:void 0)}function tu(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function nu(){return!0}function Ay(){return!1}function zn(r){function i(o,c,p,x,k){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(o=r[_],this[_]=o?o(x):x[_]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?nu:Ay,this.isPropagationStopped=Ay,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=nu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=nu)},persist:function(){},isPersistent:nu}),i}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ru=zn(ni),po=y({},ni,{view:0,detail:0}),Cj=zn(po),Ld,Pd,go,au=y({},po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==go&&(go&&r.type==="mousemove"?(Ld=r.screenX-go.screenX,Pd=r.screenY-go.screenY):Pd=Ld=0,go=r),Ld)},movementY:function(r){return"movementY"in r?r.movementY:Pd}}),Oy=zn(au),Nj=y({},au,{dataTransfer:0}),Ej=zn(Nj),Tj=y({},po,{relatedTarget:0}),Ud=zn(Tj),Aj=y({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),Oj=zn(Aj),Rj=y({},ni,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Mj=zn(Rj),Dj=y({},ni,{data:0}),Ry=zn(Dj),$j={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lj={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"},Pj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uj(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Pj[r])?!!i[r]:!1}function Vd(){return Uj}var Vj=y({},po,{key:function(r){if(r.key){var i=$j[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=tu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Lj[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vd,charCode:function(r){return r.type==="keypress"?tu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?tu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Bj=zn(Vj),Zj=y({},au,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),My=zn(Zj),Ij=y({},po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vd}),Hj=zn(Ij),Fj=y({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),qj=zn(Fj),Gj=y({},au,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Yj=zn(Gj),Xj=y({},ni,{newState:0,oldState:0}),Jj=zn(Xj),Kj=[9,13,27,32],Bd=Vr&&"CompositionEvent"in window,yo=null;Vr&&"documentMode"in document&&(yo=document.documentMode);var Qj=Vr&&"TextEvent"in window&&!yo,Dy=Vr&&(!Bd||yo&&8<yo&&11>=yo),$y=" ",Ly=!1;function Py(r,i){switch(r){case"keyup":return Kj.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qi=!1;function Wj(r,i){switch(r){case"compositionend":return Uy(i);case"keypress":return i.which!==32?null:(Ly=!0,$y);case"textInput":return r=i.data,r===$y&&Ly?null:r;default:return null}}function eC(r,i){if(qi)return r==="compositionend"||!Bd&&Py(r,i)?(r=Ty(),eu=$d=da=null,qi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Dy&&i.locale!=="ko"?null:i.data;default:return null}}var tC={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 Vy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!tC[r.type]:i==="textarea"}function By(r,i,o,c){Hi?Fi?Fi.push(c):Fi=[c]:Hi=c,i=Gu(i,"onChange"),0<i.length&&(o=new ru("onChange","change",null,o,c),r.push({event:o,listeners:i}))}var xo=null,bo=null;function nC(r){Sv(r,0)}function iu(r){var i=fo(r);if(wy(i))return r}function Zy(r,i){if(r==="change")return i}var Iy=!1;if(Vr){var Zd;if(Vr){var Id="oninput"in document;if(!Id){var Hy=document.createElement("div");Hy.setAttribute("oninput","return;"),Id=typeof Hy.oninput=="function"}Zd=Id}else Zd=!1;Iy=Zd&&(!document.documentMode||9<document.documentMode)}function Fy(){xo&&(xo.detachEvent("onpropertychange",qy),bo=xo=null)}function qy(r){if(r.propertyName==="value"&&iu(bo)){var i=[];By(i,bo,r,Rd(r)),Ey(nC,i)}}function rC(r,i,o){r==="focusin"?(Fy(),xo=i,bo=o,xo.attachEvent("onpropertychange",qy)):r==="focusout"&&Fy()}function aC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return iu(bo)}function iC(r,i){if(r==="click")return iu(i)}function sC(r,i){if(r==="input"||r==="change")return iu(i)}function oC(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var $n=typeof Object.is=="function"?Object.is:oC;function vo(r,i){if($n(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var o=Object.keys(r),c=Object.keys(i);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!tt.call(i,p)||!$n(r[p],i[p]))return!1}return!0}function Gy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Yy(r,i){var o=Gy(r);r=0;for(var c;o;){if(o.nodeType===3){if(c=r+o.textContent.length,r<=i&&c>=i)return{node:o,offset:i-r};r=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Gy(o)}}function Xy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Xy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Jy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ql(r.document);i instanceof r.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)r=i.contentWindow;else break;i=Ql(r.document)}return i}function Hd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var lC=Vr&&"documentMode"in document&&11>=document.documentMode,Gi=null,Fd=null,ko=null,qd=!1;function Ky(r,i,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;qd||Gi==null||Gi!==Ql(c)||(c=Gi,"selectionStart"in c&&Hd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ko&&vo(ko,c)||(ko=c,c=Gu(Fd,"onSelect"),0<c.length&&(i=new ru("onSelect","select",null,i,o),r.push({event:i,listeners:c}),i.target=Gi)))}function ri(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var Yi={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")},Gd={},Qy={};Vr&&(Qy=document.createElement("div").style,"AnimationEvent"in window||(delete Yi.animationend.animation,delete Yi.animationiteration.animation,delete Yi.animationstart.animation),"TransitionEvent"in window||delete Yi.transitionend.transition);function ai(r){if(Gd[r])return Gd[r];if(!Yi[r])return r;var i=Yi[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in Qy)return Gd[r]=i[o];return r}var Wy=ai("animationend"),ex=ai("animationiteration"),tx=ai("animationstart"),uC=ai("transitionrun"),cC=ai("transitionstart"),dC=ai("transitioncancel"),nx=ai("transitionend"),rx=new Map,Yd="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(" ");Yd.push("scrollEnd");function hr(r,i){rx.set(r,i),ti(i,[r])}var su=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Jn=[],Xi=0,Xd=0;function ou(){for(var r=Xi,i=Xd=Xi=0;i<r;){var o=Jn[i];Jn[i++]=null;var c=Jn[i];Jn[i++]=null;var p=Jn[i];Jn[i++]=null;var x=Jn[i];if(Jn[i++]=null,c!==null&&p!==null){var k=c.pending;k===null?p.next=p:(p.next=k.next,k.next=p),c.pending=p}x!==0&&ax(o,p,x)}}function lu(r,i,o,c){Jn[Xi++]=r,Jn[Xi++]=i,Jn[Xi++]=o,Jn[Xi++]=c,Xd|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Jd(r,i,o,c){return lu(r,i,o,c),uu(r)}function ii(r,i){return lu(r,null,null,i),uu(r)}function ax(r,i,o){r.lanes|=o;var c=r.alternate;c!==null&&(c.lanes|=o);for(var p=!1,x=r.return;x!==null;)x.childLanes|=o,c=x.alternate,c!==null&&(c.childLanes|=o),x.tag===22&&(r=x.stateNode,r===null||r._visibility&1||(p=!0)),r=x,x=x.return;return r.tag===3?(x=r.stateNode,p&&i!==null&&(p=31-ot(o),r=x.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=o|536870912),x):null}function uu(r){if(50<Io)throw Io=0,sh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ji={};function fC(r,i,o,c){this.tag=r,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(r,i,o,c){return new fC(r,i,o,c)}function Kd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Br(r,i){var o=r.alternate;return o===null?(o=Ln(r.tag,i,r.key,r.mode),o.elementType=r.elementType,o.type=r.type,o.stateNode=r.stateNode,o.alternate=r,r.alternate=o):(o.pendingProps=i,o.type=r.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=r.flags&65011712,o.childLanes=r.childLanes,o.lanes=r.lanes,o.child=r.child,o.memoizedProps=r.memoizedProps,o.memoizedState=r.memoizedState,o.updateQueue=r.updateQueue,i=r.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=r.sibling,o.index=r.index,o.ref=r.ref,o.refCleanup=r.refCleanup,o}function ix(r,i){r.flags&=65011714;var o=r.alternate;return o===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function cu(r,i,o,c,p,x){var k=0;if(c=r,typeof r=="function")Kd(r)&&(k=1);else if(typeof r=="string")k=yN(r,o,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case K:return r=Ln(31,o,i,p),r.elementType=K,r.lanes=x,r;case j:return si(o.children,p,x,i);case E:k=8,p|=24;break;case N:return r=Ln(12,o,i,p|2),r.elementType=N,r.lanes=x,r;case U:return r=Ln(13,o,i,p),r.elementType=U,r.lanes=x,r;case R:return r=Ln(19,o,i,p),r.elementType=R,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:k=10;break e;case O:k=9;break e;case P:k=11;break e;case F:k=14;break e;case B:k=16,c=null;break e}k=29,o=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Ln(k,o,i,p),i.elementType=r,i.type=c,i.lanes=x,i}function si(r,i,o,c){return r=Ln(7,r,c,i),r.lanes=o,r}function Qd(r,i,o){return r=Ln(6,r,null,i),r.lanes=o,r}function sx(r){var i=Ln(18,null,null,0);return i.stateNode=r,i}function Wd(r,i,o){return i=Ln(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var ox=new WeakMap;function Kn(r,i){if(typeof r=="object"&&r!==null){var o=ox.get(r);return o!==void 0?o:(i={value:r,source:i,stack:ht(i)},ox.set(r,i),i)}return{value:r,source:i,stack:ht(i)}}var Ki=[],Qi=0,du=null,wo=0,Qn=[],Wn=0,fa=null,vr=1,kr="";function Zr(r,i){Ki[Qi++]=wo,Ki[Qi++]=du,du=r,wo=i}function lx(r,i,o){Qn[Wn++]=vr,Qn[Wn++]=kr,Qn[Wn++]=fa,fa=r;var c=vr;r=kr;var p=32-ot(c)-1;c&=~(1<<p),o+=1;var x=32-ot(i)+p;if(30<x){var k=p-p%5;x=(c&(1<<k)-1).toString(32),c>>=k,p-=k,vr=1<<32-ot(i)+p|o<<p|c,kr=x+r}else vr=1<<x|o<<p|c,kr=r}function ef(r){r.return!==null&&(Zr(r,1),lx(r,1,0))}function tf(r){for(;r===du;)du=Ki[--Qi],Ki[Qi]=null,wo=Ki[--Qi],Ki[Qi]=null;for(;r===fa;)fa=Qn[--Wn],Qn[Wn]=null,kr=Qn[--Wn],Qn[Wn]=null,vr=Qn[--Wn],Qn[Wn]=null}function ux(r,i){Qn[Wn++]=vr,Qn[Wn++]=kr,Qn[Wn++]=fa,vr=i.id,kr=i.overflow,fa=r}var tn=null,pt=null,Ve=!1,ha=null,er=!1,nf=Error(a(519));function ma(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw So(Kn(i,r)),nf}function cx(r){var i=r.stateNode,o=r.type,c=r.memoizedProps;switch(i[en]=r,i[Sn]=c,o){case"dialog":Le("cancel",i),Le("close",i);break;case"iframe":case"object":case"embed":Le("load",i);break;case"video":case"audio":for(o=0;o<Fo.length;o++)Le(Fo[o],i);break;case"source":Le("error",i);break;case"img":case"image":case"link":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"input":Le("invalid",i),Sy(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Le("invalid",i);break;case"textarea":Le("invalid",i),_y(i,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||c.suppressHydrationWarning===!0||Cv(i.textContent,o)?(c.popover!=null&&(Le("beforetoggle",i),Le("toggle",i)),c.onScroll!=null&&Le("scroll",i),c.onScrollEnd!=null&&Le("scrollend",i),c.onClick!=null&&(i.onclick=Ur),i=!0):i=!1,i||ma(r,!0)}function dx(r){for(tn=r.return;tn;)switch(tn.tag){case 5:case 31:case 13:er=!1;return;case 27:case 3:er=!0;return;default:tn=tn.return}}function Wi(r){if(r!==tn)return!1;if(!Ve)return dx(r),Ve=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||kh(r.type,r.memoizedProps)),o=!o),o&&pt&&ma(r),dx(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));pt=$v(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));pt=$v(r)}else i===27?(i=pt,Na(r.type)?(r=jh,jh=null,pt=r):pt=i):pt=tn?nr(r.stateNode.nextSibling):null;return!0}function oi(){pt=tn=null,Ve=!1}function rf(){var r=ha;return r!==null&&(Nn===null?Nn=r:Nn.push.apply(Nn,r),ha=null),r}function So(r){ha===null?ha=[r]:ha.push(r)}var af=T(null),li=null,Ir=null;function pa(r,i,o){w(af,i._currentValue),i._currentValue=o}function Hr(r){r._currentValue=af.current,G(af)}function sf(r,i,o){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===o)break;r=r.return}}function of(r,i,o,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var x=p.dependencies;if(x!==null){var k=p.child;x=x.firstContext;e:for(;x!==null;){var _=x;x=p;for(var M=0;M<i.length;M++)if(_.context===i[M]){x.lanes|=o,_=x.alternate,_!==null&&(_.lanes|=o),sf(x.return,o,r),c||(k=null);break e}x=_.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(a(341));k.lanes|=o,x=k.alternate,x!==null&&(x.lanes|=o),sf(k,o,r),k=null}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===r){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function es(r,i,o,c){r=null;for(var p=i,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(a(387));if(k=k.memoizedProps,k!==null){var _=p.type;$n(p.pendingProps.value,k.value)||(r!==null?r.push(_):r=[_])}}else if(p===ce.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&of(i,r,o,c),i.flags|=262144}function fu(r){for(r=r.firstContext;r!==null;){if(!$n(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ui(r){li=r,Ir=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function nn(r){return fx(li,r)}function hu(r,i){return li===null&&ui(r),fx(r,i)}function fx(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Ir===null){if(r===null)throw Error(a(308));Ir=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Ir=Ir.next=i;return o}var hC=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(o,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(o){return o()})}},mC=e.unstable_scheduleCallback,pC=e.unstable_NormalPriority,$t={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lf(){return{controller:new hC,data:new Map,refCount:0}}function zo(r){r.refCount--,r.refCount===0&&mC(pC,function(){r.controller.abort()})}var _o=null,uf=0,ts=0,ns=null;function gC(r,i){if(_o===null){var o=_o=[];uf=0,ts=fh(),ns={status:"pending",value:void 0,then:function(c){o.push(c)}}}return uf++,i.then(hx,hx),i}function hx(){if(--uf===0&&_o!==null){ns!==null&&(ns.status="fulfilled");var r=_o;_o=null,ts=0,ns=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function yC(r,i){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<o.length;p++)(0,o[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var mx=L.S;L.S=function(r,i){Kb=mt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&gC(r,i),mx!==null&&mx(r,i)};var ci=T(null);function cf(){var r=ci.current;return r!==null?r:lt.pooledCache}function mu(r,i){i===null?w(ci,ci.current):w(ci,i.pool)}function px(){var r=cf();return r===null?null:{parent:$t._currentValue,pool:r}}var rs=Error(a(460)),df=Error(a(474)),pu=Error(a(542)),gu={then:function(){}};function gx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function yx(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(Ur,Ur),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,bx(r),r;default:if(typeof i.status=="string")i.then(Ur,Ur);else{if(r=lt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,bx(r),r}throw fi=i,rs}}function di(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(fi=o,rs):o}}var fi=null;function xx(){if(fi===null)throw Error(a(459));var r=fi;return fi=null,r}function bx(r){if(r===rs||r===pu)throw Error(a(483))}var as=null,jo=0;function yu(r){var i=jo;return jo+=1,as===null&&(as=[]),yx(as,r,i)}function Co(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function xu(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function vx(r){function i(V,$){if(r){var I=V.deletions;I===null?(V.deletions=[$],V.flags|=16):I.push($)}}function o(V,$){if(!r)return null;for(;$!==null;)i(V,$),$=$.sibling;return null}function c(V){for(var $=new Map;V!==null;)V.key!==null?$.set(V.key,V):$.set(V.index,V),V=V.sibling;return $}function p(V,$){return V=Br(V,$),V.index=0,V.sibling=null,V}function x(V,$,I){return V.index=I,r?(I=V.alternate,I!==null?(I=I.index,I<$?(V.flags|=67108866,$):I):(V.flags|=67108866,$)):(V.flags|=1048576,$)}function k(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function _(V,$,I,te){return $===null||$.tag!==6?($=Qd(I,V.mode,te),$.return=V,$):($=p($,I),$.return=V,$)}function M(V,$,I,te){var ze=I.type;return ze===j?Q(V,$,I.props.children,te,I.key):$!==null&&($.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===B&&di(ze)===$.type)?($=p($,I.props),Co($,I),$.return=V,$):($=cu(I.type,I.key,I.props,null,V.mode,te),Co($,I),$.return=V,$)}function H(V,$,I,te){return $===null||$.tag!==4||$.stateNode.containerInfo!==I.containerInfo||$.stateNode.implementation!==I.implementation?($=Wd(I,V.mode,te),$.return=V,$):($=p($,I.children||[]),$.return=V,$)}function Q(V,$,I,te,ze){return $===null||$.tag!==7?($=si(I,V.mode,te,ze),$.return=V,$):($=p($,I),$.return=V,$)}function re(V,$,I){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Qd(""+$,V.mode,I),$.return=V,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case v:return I=cu($.type,$.key,$.props,null,V.mode,I),Co(I,$),I.return=V,I;case S:return $=Wd($,V.mode,I),$.return=V,$;case B:return $=di($),re(V,$,I)}if(ie($)||le($))return $=si($,V.mode,I,null),$.return=V,$;if(typeof $.then=="function")return re(V,yu($),I);if($.$$typeof===C)return re(V,hu(V,$),I);xu(V,$)}return null}function q(V,$,I,te){var ze=$!==null?$.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return ze!==null?null:_(V,$,""+I,te);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return I.key===ze?M(V,$,I,te):null;case S:return I.key===ze?H(V,$,I,te):null;case B:return I=di(I),q(V,$,I,te)}if(ie(I)||le(I))return ze!==null?null:Q(V,$,I,te,null);if(typeof I.then=="function")return q(V,$,yu(I),te);if(I.$$typeof===C)return q(V,$,hu(V,I),te);xu(V,I)}return null}function Y(V,$,I,te,ze){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return V=V.get(I)||null,_($,V,""+te,ze);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return V=V.get(te.key===null?I:te.key)||null,M($,V,te,ze);case S:return V=V.get(te.key===null?I:te.key)||null,H($,V,te,ze);case B:return te=di(te),Y(V,$,I,te,ze)}if(ie(te)||le(te))return V=V.get(I)||null,Q($,V,te,ze,null);if(typeof te.then=="function")return Y(V,$,I,yu(te),ze);if(te.$$typeof===C)return Y(V,$,I,hu($,te),ze);xu($,te)}return null}function pe(V,$,I,te){for(var ze=null,He=null,we=$,Re=$=0,Ue=null;we!==null&&Re<I.length;Re++){we.index>Re?(Ue=we,we=null):Ue=we.sibling;var Fe=q(V,we,I[Re],te);if(Fe===null){we===null&&(we=Ue);break}r&&we&&Fe.alternate===null&&i(V,we),$=x(Fe,$,Re),He===null?ze=Fe:He.sibling=Fe,He=Fe,we=Ue}if(Re===I.length)return o(V,we),Ve&&Zr(V,Re),ze;if(we===null){for(;Re<I.length;Re++)we=re(V,I[Re],te),we!==null&&($=x(we,$,Re),He===null?ze=we:He.sibling=we,He=we);return Ve&&Zr(V,Re),ze}for(we=c(we);Re<I.length;Re++)Ue=Y(we,V,Re,I[Re],te),Ue!==null&&(r&&Ue.alternate!==null&&we.delete(Ue.key===null?Re:Ue.key),$=x(Ue,$,Re),He===null?ze=Ue:He.sibling=Ue,He=Ue);return r&&we.forEach(function(Ra){return i(V,Ra)}),Ve&&Zr(V,Re),ze}function _e(V,$,I,te){if(I==null)throw Error(a(151));for(var ze=null,He=null,we=$,Re=$=0,Ue=null,Fe=I.next();we!==null&&!Fe.done;Re++,Fe=I.next()){we.index>Re?(Ue=we,we=null):Ue=we.sibling;var Ra=q(V,we,Fe.value,te);if(Ra===null){we===null&&(we=Ue);break}r&&we&&Ra.alternate===null&&i(V,we),$=x(Ra,$,Re),He===null?ze=Ra:He.sibling=Ra,He=Ra,we=Ue}if(Fe.done)return o(V,we),Ve&&Zr(V,Re),ze;if(we===null){for(;!Fe.done;Re++,Fe=I.next())Fe=re(V,Fe.value,te),Fe!==null&&($=x(Fe,$,Re),He===null?ze=Fe:He.sibling=Fe,He=Fe);return Ve&&Zr(V,Re),ze}for(we=c(we);!Fe.done;Re++,Fe=I.next())Fe=Y(we,V,Re,Fe.value,te),Fe!==null&&(r&&Fe.alternate!==null&&we.delete(Fe.key===null?Re:Fe.key),$=x(Fe,$,Re),He===null?ze=Fe:He.sibling=Fe,He=Fe);return r&&we.forEach(function(NN){return i(V,NN)}),Ve&&Zr(V,Re),ze}function at(V,$,I,te){if(typeof I=="object"&&I!==null&&I.type===j&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case v:e:{for(var ze=I.key;$!==null;){if($.key===ze){if(ze=I.type,ze===j){if($.tag===7){o(V,$.sibling),te=p($,I.props.children),te.return=V,V=te;break e}}else if($.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===B&&di(ze)===$.type){o(V,$.sibling),te=p($,I.props),Co(te,I),te.return=V,V=te;break e}o(V,$);break}else i(V,$);$=$.sibling}I.type===j?(te=si(I.props.children,V.mode,te,I.key),te.return=V,V=te):(te=cu(I.type,I.key,I.props,null,V.mode,te),Co(te,I),te.return=V,V=te)}return k(V);case S:e:{for(ze=I.key;$!==null;){if($.key===ze)if($.tag===4&&$.stateNode.containerInfo===I.containerInfo&&$.stateNode.implementation===I.implementation){o(V,$.sibling),te=p($,I.children||[]),te.return=V,V=te;break e}else{o(V,$);break}else i(V,$);$=$.sibling}te=Wd(I,V.mode,te),te.return=V,V=te}return k(V);case B:return I=di(I),at(V,$,I,te)}if(ie(I))return pe(V,$,I,te);if(le(I)){if(ze=le(I),typeof ze!="function")throw Error(a(150));return I=ze.call(I),_e(V,$,I,te)}if(typeof I.then=="function")return at(V,$,yu(I),te);if(I.$$typeof===C)return at(V,$,hu(V,I),te);xu(V,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,$!==null&&$.tag===6?(o(V,$.sibling),te=p($,I),te.return=V,V=te):(o(V,$),te=Qd(I,V.mode,te),te.return=V,V=te),k(V)):o(V,$)}return function(V,$,I,te){try{jo=0;var ze=at(V,$,I,te);return as=null,ze}catch(we){if(we===rs||we===pu)throw we;var He=Ln(29,we,null,V.mode);return He.lanes=te,He.return=V,He}}}var hi=vx(!0),kx=vx(!1),ga=!1;function ff(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hf(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ya(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function xa(r,i,o){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(qe&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=uu(r),ax(r,null,o),i}return lu(r,c,i,o),uu(r)}function No(r,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,fy(r,o)}}function mf(r,i){var o=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var k={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?p=x=k:x=x.next=k,o=o.next}while(o!==null);x===null?p=x=i:x=x.next=i}else p=x=i;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=i:r.next=i,o.lastBaseUpdate=i}var pf=!1;function Eo(){if(pf){var r=ns;if(r!==null)throw r}}function To(r,i,o,c){pf=!1;var p=r.updateQueue;ga=!1;var x=p.firstBaseUpdate,k=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var M=_,H=M.next;M.next=null,k===null?x=H:k.next=H,k=M;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,_=Q.lastBaseUpdate,_!==k&&(_===null?Q.firstBaseUpdate=H:_.next=H,Q.lastBaseUpdate=M))}if(x!==null){var re=p.baseState;k=0,Q=H=M=null,_=x;do{var q=_.lane&-536870913,Y=q!==_.lane;if(Y?(Pe&q)===q:(c&q)===q){q!==0&&q===ts&&(pf=!0),Q!==null&&(Q=Q.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var pe=r,_e=_;q=i;var at=o;switch(_e.tag){case 1:if(pe=_e.payload,typeof pe=="function"){re=pe.call(at,re,q);break e}re=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=_e.payload,q=typeof pe=="function"?pe.call(at,re,q):pe,q==null)break e;re=y({},re,q);break e;case 2:ga=!0}}q=_.callback,q!==null&&(r.flags|=64,Y&&(r.flags|=8192),Y=p.callbacks,Y===null?p.callbacks=[q]:Y.push(q))}else Y={lane:q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},Q===null?(H=Q=Y,M=re):Q=Q.next=Y,k|=q;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,p.lastBaseUpdate=Y,p.shared.pending=null}}while(!0);Q===null&&(M=re),p.baseState=M,p.firstBaseUpdate=H,p.lastBaseUpdate=Q,x===null&&(p.shared.lanes=0),Sa|=k,r.lanes=k,r.memoizedState=re}}function wx(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Sx(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)wx(o[r],i)}var is=T(null),bu=T(0);function zx(r,i){r=Wr,w(bu,r),w(is,i),Wr=r|i.baseLanes}function gf(){w(bu,Wr),w(is,is.current)}function yf(){Wr=bu.current,G(is),G(bu)}var Pn=T(null),tr=null;function ba(r){var i=r.alternate;w(Rt,Rt.current&1),w(Pn,r),tr===null&&(i===null||is.current!==null||i.memoizedState!==null)&&(tr=r)}function xf(r){w(Rt,Rt.current),w(Pn,r),tr===null&&(tr=r)}function _x(r){r.tag===22?(w(Rt,Rt.current),w(Pn,r),tr===null&&(tr=r)):va()}function va(){w(Rt,Rt.current),w(Pn,Pn.current)}function Un(r){G(Pn),tr===r&&(tr=null),G(Rt)}var Rt=T(0);function vu(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||zh(o)||_h(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Fr=0,Oe=null,nt=null,Lt=null,ku=!1,ss=!1,mi=!1,wu=0,Ao=0,os=null,xC=0;function Et(){throw Error(a(321))}function bf(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!$n(r[o],i[o]))return!1;return!0}function vf(r,i,o,c,p,x){return Fr=x,Oe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,L.H=r===null||r.memoizedState===null?lb:Df,mi=!1,x=o(c,p),mi=!1,ss&&(x=Cx(i,o,c,p)),jx(r),x}function jx(r){L.H=Mo;var i=nt!==null&&nt.next!==null;if(Fr=0,Lt=nt=Oe=null,ku=!1,Ao=0,os=null,i)throw Error(a(300));r===null||Pt||(r=r.dependencies,r!==null&&fu(r)&&(Pt=!0))}function Cx(r,i,o,c){Oe=r;var p=0;do{if(ss&&(os=null),Ao=0,ss=!1,25<=p)throw Error(a(301));if(p+=1,Lt=nt=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}L.H=ub,x=i(o,c)}while(ss);return x}function bC(){var r=L.H,i=r.useState()[0];return i=typeof i.then=="function"?Oo(i):i,r=r.useState()[0],(nt!==null?nt.memoizedState:null)!==r&&(Oe.flags|=1024),i}function kf(){var r=wu!==0;return wu=0,r}function wf(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function Sf(r){if(ku){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ku=!1}Fr=0,Lt=nt=Oe=null,ss=!1,Ao=wu=0,os=null}function gn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?Oe.memoizedState=Lt=r:Lt=Lt.next=r,Lt}function Mt(){if(nt===null){var r=Oe.alternate;r=r!==null?r.memoizedState:null}else r=nt.next;var i=Lt===null?Oe.memoizedState:Lt.next;if(i!==null)Lt=i,nt=r;else{if(r===null)throw Oe.alternate===null?Error(a(467)):Error(a(310));nt=r,r={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},Lt===null?Oe.memoizedState=Lt=r:Lt=Lt.next=r}return Lt}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(r){var i=Ao;return Ao+=1,os===null&&(os=[]),r=yx(os,r,i),i=Oe,(Lt===null?i.memoizedState:Lt.next)===null&&(i=i.alternate,L.H=i===null||i.memoizedState===null?lb:Df),r}function zu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Oo(r);if(r.$$typeof===C)return nn(r)}throw Error(a(438,String(r)))}function zf(r){var i=null,o=Oe.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var c=Oe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Su(),Oe.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(r),c=0;c<r;c++)o[c]=fe;return i.index++,o}function qr(r,i){return typeof i=="function"?i(r):i}function _u(r){var i=Mt();return _f(i,nt,r)}function _f(r,i,o){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=o;var p=r.baseQueue,x=c.pending;if(x!==null){if(p!==null){var k=p.next;p.next=x.next,x.next=k}i.baseQueue=p=x,c.pending=null}if(x=r.baseState,p===null)r.memoizedState=x;else{i=p.next;var _=k=null,M=null,H=i,Q=!1;do{var re=H.lane&-536870913;if(re!==H.lane?(Pe&re)===re:(Fr&re)===re){var q=H.revertLane;if(q===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),re===ts&&(Q=!0);else if((Fr&q)===q){H=H.next,q===ts&&(Q=!0);continue}else re={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},M===null?(_=M=re,k=x):M=M.next=re,Oe.lanes|=q,Sa|=q;re=H.action,mi&&o(x,re),x=H.hasEagerState?H.eagerState:o(x,re)}else q={lane:re,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},M===null?(_=M=q,k=x):M=M.next=q,Oe.lanes|=re,Sa|=re;H=H.next}while(H!==null&&H!==i);if(M===null?k=x:M.next=_,!$n(x,r.memoizedState)&&(Pt=!0,Q&&(o=ns,o!==null)))throw o;r.memoizedState=x,r.baseState=k,r.baseQueue=M,c.lastRenderedState=x}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function jf(r){var i=Mt(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=r;var c=o.dispatch,p=o.pending,x=i.memoizedState;if(p!==null){o.pending=null;var k=p=p.next;do x=r(x,k.action),k=k.next;while(k!==p);$n(x,i.memoizedState)||(Pt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,c]}function Nx(r,i,o){var c=Oe,p=Mt(),x=Ve;if(x){if(o===void 0)throw Error(a(407));o=o()}else o=i();var k=!$n((nt||p).memoizedState,o);if(k&&(p.memoizedState=o,Pt=!0),p=p.queue,Ef(Ax.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||Lt!==null&&Lt.memoizedState.tag&1){if(c.flags|=2048,ls(9,{destroy:void 0},Tx.bind(null,c,p,o,i),null),lt===null)throw Error(a(349));x||(Fr&127)!==0||Ex(c,i,o)}return o}function Ex(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=Oe.updateQueue,i===null?(i=Su(),Oe.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function Tx(r,i,o,c){i.value=o,i.getSnapshot=c,Ox(i)&&Rx(r)}function Ax(r,i,o){return o(function(){Ox(i)&&Rx(r)})}function Ox(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!$n(r,o)}catch{return!0}}function Rx(r){var i=ii(r,2);i!==null&&En(i,r,2)}function Cf(r){var i=gn();if(typeof r=="function"){var o=r;if(r=o(),mi){wn(!0);try{o()}finally{wn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:r},i}function Mx(r,i,o,c){return r.baseState=o,_f(r,nt,typeof c=="function"?c:qr)}function vC(r,i,o,c,p){if(Nu(r))throw Error(a(485));if(r=i.action,r!==null){var x={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};L.T!==null?o(!0):x.isTransition=!1,c(x),o=i.pending,o===null?(x.next=i.pending=x,Dx(i,x)):(x.next=o.next,i.pending=o.next=x)}}function Dx(r,i){var o=i.action,c=i.payload,p=r.state;if(i.isTransition){var x=L.T,k={};L.T=k;try{var _=o(p,c),M=L.S;M!==null&&M(k,_),$x(r,i,_)}catch(H){Nf(r,i,H)}finally{x!==null&&k.types!==null&&(x.types=k.types),L.T=x}}else try{x=o(p,c),$x(r,i,x)}catch(H){Nf(r,i,H)}}function $x(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Lx(r,i,c)},function(c){return Nf(r,i,c)}):Lx(r,i,o)}function Lx(r,i,o){i.status="fulfilled",i.value=o,Px(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,Dx(r,o)))}function Nf(r,i,o){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=o,Px(i),i=i.next;while(i!==c)}r.action=null}function Px(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Ux(r,i){return i}function Vx(r,i){if(Ve){var o=lt.formState;if(o!==null){e:{var c=Oe;if(Ve){if(pt){t:{for(var p=pt,x=er;p.nodeType!==8;){if(!x){p=null;break t}if(p=nr(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){pt=nr(p.nextSibling),c=p.data==="F!";break e}}ma(c)}c=!1}c&&(i=o[0])}}return o=gn(),o.memoizedState=o.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ux,lastRenderedState:i},o.queue=c,o=ib.bind(null,Oe,c),c.dispatch=o,c=Cf(!1),x=Mf.bind(null,Oe,!1,c.queue),c=gn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,o=vC.bind(null,Oe,p,x,o),p.dispatch=o,c.memoizedState=r,[i,o,!1]}function Bx(r){var i=Mt();return Zx(i,nt,r)}function Zx(r,i,o){if(i=_f(r,i,Ux)[0],r=_u(qr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Oo(i)}catch(k){throw k===rs?pu:k}else c=i;i=Mt();var p=i.queue,x=p.dispatch;return o!==i.memoizedState&&(Oe.flags|=2048,ls(9,{destroy:void 0},kC.bind(null,p,o),null)),[c,x,r]}function kC(r,i){r.action=i}function Ix(r){var i=Mt(),o=nt;if(o!==null)return Zx(i,o,r);Mt(),i=i.memoizedState,o=Mt();var c=o.queue.dispatch;return o.memoizedState=r,[i,c,!1]}function ls(r,i,o,c){return r={tag:r,create:o,deps:c,inst:i,next:null},i=Oe.updateQueue,i===null&&(i=Su(),Oe.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=r.next=r:(c=o.next,o.next=r,r.next=c,i.lastEffect=r),r}function Hx(){return Mt().memoizedState}function ju(r,i,o,c){var p=gn();Oe.flags|=r,p.memoizedState=ls(1|i,{destroy:void 0},o,c===void 0?null:c)}function Cu(r,i,o,c){var p=Mt();c=c===void 0?null:c;var x=p.memoizedState.inst;nt!==null&&c!==null&&bf(c,nt.memoizedState.deps)?p.memoizedState=ls(i,x,o,c):(Oe.flags|=r,p.memoizedState=ls(1|i,x,o,c))}function Fx(r,i){ju(8390656,8,r,i)}function Ef(r,i){Cu(2048,8,r,i)}function wC(r){Oe.flags|=4;var i=Oe.updateQueue;if(i===null)i=Su(),Oe.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function qx(r){var i=Mt().memoizedState;return wC({ref:i,nextImpl:r}),function(){if((qe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Gx(r,i){return Cu(4,2,r,i)}function Yx(r,i){return Cu(4,4,r,i)}function Xx(r,i){if(typeof i=="function"){r=r();var o=i(r);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Jx(r,i,o){o=o!=null?o.concat([r]):null,Cu(4,4,Xx.bind(null,i,r),o)}function Tf(){}function Kx(r,i){var o=Mt();i=i===void 0?null:i;var c=o.memoizedState;return i!==null&&bf(i,c[1])?c[0]:(o.memoizedState=[r,i],r)}function Qx(r,i){var o=Mt();i=i===void 0?null:i;var c=o.memoizedState;if(i!==null&&bf(i,c[1]))return c[0];if(c=r(),mi){wn(!0);try{r()}finally{wn(!1)}}return o.memoizedState=[c,i],c}function Af(r,i,o){return o===void 0||(Fr&1073741824)!==0&&(Pe&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=Wb(),Oe.lanes|=r,Sa|=r,o)}function Wx(r,i,o,c){return $n(o,i)?o:is.current!==null?(r=Af(r,o,c),$n(r,i)||(Pt=!0),r):(Fr&42)===0||(Fr&1073741824)!==0&&(Pe&261930)===0?(Pt=!0,r.memoizedState=o):(r=Wb(),Oe.lanes|=r,Sa|=r,i)}function eb(r,i,o,c,p){var x=J.p;J.p=x!==0&&8>x?x:8;var k=L.T,_={};L.T=_,Mf(r,!1,i,o);try{var M=p(),H=L.S;if(H!==null&&H(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var Q=yC(M,c);Ro(r,i,Q,Zn(r))}else Ro(r,i,c,Zn(r))}catch(re){Ro(r,i,{then:function(){},status:"rejected",reason:re},Zn())}finally{J.p=x,k!==null&&_.types!==null&&(k.types=_.types),L.T=k}}function SC(){}function Of(r,i,o,c){if(r.tag!==5)throw Error(a(476));var p=tb(r).queue;eb(r,p,i,Z,o===null?SC:function(){return nb(r),o(c)})}function tb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:Z},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:o},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function nb(r){var i=tb(r);i.next===null&&(i=r.alternate.memoizedState),Ro(r,i.next.queue,{},Zn())}function Rf(){return nn(Jo)}function rb(){return Mt().memoizedState}function ab(){return Mt().memoizedState}function zC(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=Zn();r=ya(o);var c=xa(i,r,o);c!==null&&(En(c,i,o),No(c,i,o)),i={cache:lf()},r.payload=i;return}i=i.return}}function _C(r,i,o){var c=Zn();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Nu(r)?sb(i,o):(o=Jd(r,i,o,c),o!==null&&(En(o,r,c),ob(o,i,c)))}function ib(r,i,o){var c=Zn();Ro(r,i,o,c)}function Ro(r,i,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Nu(r))sb(i,p);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var k=i.lastRenderedState,_=x(k,o);if(p.hasEagerState=!0,p.eagerState=_,$n(_,k))return lu(r,i,p,0),lt===null&&ou(),!1}catch{}if(o=Jd(r,i,p,c),o!==null)return En(o,r,c),ob(o,i,c),!0}return!1}function Mf(r,i,o,c){if(c={lane:2,revertLane:fh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Nu(r)){if(i)throw Error(a(479))}else i=Jd(r,o,c,2),i!==null&&En(i,r,2)}function Nu(r){var i=r.alternate;return r===Oe||i!==null&&i===Oe}function sb(r,i){ss=ku=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function ob(r,i,o){if((o&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,fy(r,o)}}var Mo={readContext:nn,use:zu,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};Mo.useEffectEvent=Et;var lb={readContext:nn,use:zu,useCallback:function(r,i){return gn().memoizedState=[r,i===void 0?null:i],r},useContext:nn,useEffect:Fx,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,ju(4194308,4,Xx.bind(null,i,r),o)},useLayoutEffect:function(r,i){return ju(4194308,4,r,i)},useInsertionEffect:function(r,i){ju(4,2,r,i)},useMemo:function(r,i){var o=gn();i=i===void 0?null:i;var c=r();if(mi){wn(!0);try{r()}finally{wn(!1)}}return o.memoizedState=[c,i],c},useReducer:function(r,i,o){var c=gn();if(o!==void 0){var p=o(i);if(mi){wn(!0);try{o(i)}finally{wn(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=_C.bind(null,Oe,r),[c.memoizedState,r]},useRef:function(r){var i=gn();return r={current:r},i.memoizedState=r},useState:function(r){r=Cf(r);var i=r.queue,o=ib.bind(null,Oe,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:Tf,useDeferredValue:function(r,i){var o=gn();return Af(o,r,i)},useTransition:function(){var r=Cf(!1);return r=eb.bind(null,Oe,r.queue,!0,!1),gn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var c=Oe,p=gn();if(Ve){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),lt===null)throw Error(a(349));(Pe&127)!==0||Ex(c,i,o)}p.memoizedState=o;var x={value:o,getSnapshot:i};return p.queue=x,Fx(Ax.bind(null,c,x,r),[r]),c.flags|=2048,ls(9,{destroy:void 0},Tx.bind(null,c,x,o,i),null),o},useId:function(){var r=gn(),i=lt.identifierPrefix;if(Ve){var o=kr,c=vr;o=(c&~(1<<32-ot(c)-1)).toString(32)+o,i="_"+i+"R_"+o,o=wu++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=xC++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Rf,useFormState:Vx,useActionState:Vx,useOptimistic:function(r){var i=gn();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=Mf.bind(null,Oe,!0,o),o.dispatch=i,[r,i]},useMemoCache:zf,useCacheRefresh:function(){return gn().memoizedState=zC.bind(null,Oe)},useEffectEvent:function(r){var i=gn(),o={impl:r};return i.memoizedState=o,function(){if((qe&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Df={readContext:nn,use:zu,useCallback:Kx,useContext:nn,useEffect:Ef,useImperativeHandle:Jx,useInsertionEffect:Gx,useLayoutEffect:Yx,useMemo:Qx,useReducer:_u,useRef:Hx,useState:function(){return _u(qr)},useDebugValue:Tf,useDeferredValue:function(r,i){var o=Mt();return Wx(o,nt.memoizedState,r,i)},useTransition:function(){var r=_u(qr)[0],i=Mt().memoizedState;return[typeof r=="boolean"?r:Oo(r),i]},useSyncExternalStore:Nx,useId:rb,useHostTransitionStatus:Rf,useFormState:Bx,useActionState:Bx,useOptimistic:function(r,i){var o=Mt();return Mx(o,nt,r,i)},useMemoCache:zf,useCacheRefresh:ab};Df.useEffectEvent=qx;var ub={readContext:nn,use:zu,useCallback:Kx,useContext:nn,useEffect:Ef,useImperativeHandle:Jx,useInsertionEffect:Gx,useLayoutEffect:Yx,useMemo:Qx,useReducer:jf,useRef:Hx,useState:function(){return jf(qr)},useDebugValue:Tf,useDeferredValue:function(r,i){var o=Mt();return nt===null?Af(o,r,i):Wx(o,nt.memoizedState,r,i)},useTransition:function(){var r=jf(qr)[0],i=Mt().memoizedState;return[typeof r=="boolean"?r:Oo(r),i]},useSyncExternalStore:Nx,useId:rb,useHostTransitionStatus:Rf,useFormState:Ix,useActionState:Ix,useOptimistic:function(r,i){var o=Mt();return nt!==null?Mx(o,nt,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:zf,useCacheRefresh:ab};ub.useEffectEvent=qx;function $f(r,i,o,c){i=r.memoizedState,o=o(c,i),o=o==null?i:y({},i,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var Lf={enqueueSetState:function(r,i,o){r=r._reactInternals;var c=Zn(),p=ya(c);p.payload=i,o!=null&&(p.callback=o),i=xa(r,p,c),i!==null&&(En(i,r,c),No(i,r,c))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var c=Zn(),p=ya(c);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=xa(r,p,c),i!==null&&(En(i,r,c),No(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=Zn(),c=ya(o);c.tag=2,i!=null&&(c.callback=i),i=xa(r,c,o),i!==null&&(En(i,r,o),No(i,r,o))}};function cb(r,i,o,c,p,x,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,x,k):i.prototype&&i.prototype.isPureReactComponent?!vo(o,c)||!vo(p,x):!0}function db(r,i,o,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,c),i.state!==r&&Lf.enqueueReplaceState(i,i.state,null)}function pi(r,i){var o=i;if("ref"in i){o={};for(var c in i)c!=="ref"&&(o[c]=i[c])}if(r=r.defaultProps){o===i&&(o=y({},o));for(var p in r)o[p]===void 0&&(o[p]=r[p])}return o}function fb(r){su(r)}function hb(r){console.error(r)}function mb(r){su(r)}function Eu(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function pb(r,i,o){try{var c=r.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Pf(r,i,o){return o=ya(o),o.tag=3,o.payload={element:null},o.callback=function(){Eu(r,i)},o}function gb(r){return r=ya(r),r.tag=3,r}function yb(r,i,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var x=c.value;r.payload=function(){return p(x)},r.callback=function(){pb(i,o,c)}}var k=o.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){pb(i,o,c),typeof p!="function"&&(za===null?za=new Set([this]):za.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function jC(r,i,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=o.alternate,i!==null&&es(i,o,p,!0),o=Pn.current,o!==null){switch(o.tag){case 31:case 13:return tr===null?Bu():o.alternate===null&&Tt===0&&(Tt=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===gu?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([c]):i.add(c),uh(r,c,p)),!1;case 22:return o.flags|=65536,c===gu?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([c]):o.add(c)),uh(r,c,p)),!1}throw Error(a(435,o.tag))}return uh(r,c,p),Bu(),!1}if(Ve)return i=Pn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==nf&&(r=Error(a(422),{cause:c}),So(Kn(r,o)))):(c!==nf&&(i=Error(a(423),{cause:c}),So(Kn(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=Kn(c,o),p=Pf(r.stateNode,c,p),mf(r,p),Tt!==4&&(Tt=2)),!1;var x=Error(a(520),{cause:c});if(x=Kn(x,o),Zo===null?Zo=[x]:Zo.push(x),Tt!==4&&(Tt=2),i===null)return!0;c=Kn(c,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=p&-p,o.lanes|=r,r=Pf(o.stateNode,c,r),mf(o,r),!1;case 1:if(i=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(za===null||!za.has(x))))return o.flags|=65536,p&=-p,o.lanes|=p,p=gb(p),yb(p,r,o,c),mf(o,p),!1}o=o.return}while(o!==null);return!1}var Uf=Error(a(461)),Pt=!1;function rn(r,i,o,c){i.child=r===null?kx(i,null,o,c):hi(i,r.child,o,c)}function xb(r,i,o,c,p){o=o.render;var x=i.ref;if("ref"in c){var k={};for(var _ in c)_!=="ref"&&(k[_]=c[_])}else k=c;return ui(i),c=vf(r,i,o,k,x,p),_=kf(),r!==null&&!Pt?(wf(r,i,p),Gr(r,i,p)):(Ve&&_&&ef(i),i.flags|=1,rn(r,i,c,p),i.child)}function bb(r,i,o,c,p){if(r===null){var x=o.type;return typeof x=="function"&&!Kd(x)&&x.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=x,vb(r,i,x,c,p)):(r=cu(o.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(x=r.child,!Gf(r,p)){var k=x.memoizedProps;if(o=o.compare,o=o!==null?o:vo,o(k,c)&&r.ref===i.ref)return Gr(r,i,p)}return i.flags|=1,r=Br(x,c),r.ref=i.ref,r.return=i,i.child=r}function vb(r,i,o,c,p){if(r!==null){var x=r.memoizedProps;if(vo(x,c)&&r.ref===i.ref)if(Pt=!1,i.pendingProps=c=x,Gf(r,p))(r.flags&131072)!==0&&(Pt=!0);else return i.lanes=r.lanes,Gr(r,i,p)}return Vf(r,i,o,c,p)}function kb(r,i,o,c){var p=c.children,x=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|o:o,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~x}else c=0,i.child=null;return wb(r,i,x,o,c)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&mu(i,x!==null?x.cachePool:null),x!==null?zx(i,x):gf(),_x(i);else return c=i.lanes=536870912,wb(r,i,x!==null?x.baseLanes|o:o,o,c)}else x!==null?(mu(i,x.cachePool),zx(i,x),va(),i.memoizedState=null):(r!==null&&mu(i,null),gf(),va());return rn(r,i,p,o),i.child}function Do(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function wb(r,i,o,c,p){var x=cf();return x=x===null?null:{parent:$t._currentValue,pool:x},i.memoizedState={baseLanes:o,cachePool:x},r!==null&&mu(i,null),gf(),_x(i),r!==null&&es(r,i,c,!0),i.childLanes=p,null}function Tu(r,i){return i=Ou({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Sb(r,i,o){return hi(i,r.child,null,o),r=Tu(i,i.pendingProps),r.flags|=2,Un(i),i.memoizedState=null,r}function CC(r,i,o){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ve){if(c.mode==="hidden")return r=Tu(i,c),i.lanes=536870912,Do(null,r);if(xf(i),(r=pt)?(r=Dv(r,er),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:fa!==null?{id:vr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},o=sx(r),o.return=i,i.child=o,tn=i,pt=null)):r=null,r===null)throw ma(i);return i.lanes=536870912,null}return Tu(i,c)}var x=r.memoizedState;if(x!==null){var k=x.dehydrated;if(xf(i),p)if(i.flags&256)i.flags&=-257,i=Sb(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||es(r,i,o,!1),p=(o&r.childLanes)!==0,Pt||p){if(c=lt,c!==null&&(k=hy(c,o),k!==0&&k!==x.retryLane))throw x.retryLane=k,ii(r,k),En(c,r,k),Uf;Bu(),i=Sb(r,i,o)}else r=x.treeContext,pt=nr(k.nextSibling),tn=i,Ve=!0,ha=null,er=!1,r!==null&&ux(i,r),i=Tu(i,c),i.flags|=4096;return i}return r=Br(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Au(r,i){var o=i.ref;if(o===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(r===null||r.ref!==o)&&(i.flags|=4194816)}}function Vf(r,i,o,c,p){return ui(i),o=vf(r,i,o,c,void 0,p),c=kf(),r!==null&&!Pt?(wf(r,i,p),Gr(r,i,p)):(Ve&&c&&ef(i),i.flags|=1,rn(r,i,o,p),i.child)}function zb(r,i,o,c,p,x){return ui(i),i.updateQueue=null,o=Cx(i,c,o,p),jx(r),c=kf(),r!==null&&!Pt?(wf(r,i,x),Gr(r,i,x)):(Ve&&c&&ef(i),i.flags|=1,rn(r,i,o,x),i.child)}function _b(r,i,o,c,p){if(ui(i),i.stateNode===null){var x=Ji,k=o.contextType;typeof k=="object"&&k!==null&&(x=nn(k)),x=new o(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Lf,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},ff(i),k=o.contextType,x.context=typeof k=="object"&&k!==null?nn(k):Ji,x.state=i.memoizedState,k=o.getDerivedStateFromProps,typeof k=="function"&&($f(i,o,k,c),x.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&Lf.enqueueReplaceState(x,x.state,null),To(i,c,x,p),Eo(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){x=i.stateNode;var _=i.memoizedProps,M=pi(o,_);x.props=M;var H=x.context,Q=o.contextType;k=Ji,typeof Q=="object"&&Q!==null&&(k=nn(Q));var re=o.getDerivedStateFromProps;Q=typeof re=="function"||typeof x.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,Q||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(_||H!==k)&&db(i,x,c,k),ga=!1;var q=i.memoizedState;x.state=q,To(i,c,x,p),Eo(),H=i.memoizedState,_||q!==H||ga?(typeof re=="function"&&($f(i,o,re,c),H=i.memoizedState),(M=ga||cb(i,o,M,c,q,H,k))?(Q||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=H),x.props=c,x.state=H,x.context=k,c=M):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,hf(r,i),k=i.memoizedProps,Q=pi(o,k),x.props=Q,re=i.pendingProps,q=x.context,H=o.contextType,M=Ji,typeof H=="object"&&H!==null&&(M=nn(H)),_=o.getDerivedStateFromProps,(H=typeof _=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==re||q!==M)&&db(i,x,c,M),ga=!1,q=i.memoizedState,x.state=q,To(i,c,x,p),Eo();var Y=i.memoizedState;k!==re||q!==Y||ga||r!==null&&r.dependencies!==null&&fu(r.dependencies)?(typeof _=="function"&&($f(i,o,_,c),Y=i.memoizedState),(Q=ga||cb(i,o,Q,c,q,Y,M)||r!==null&&r.dependencies!==null&&fu(r.dependencies))?(H||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,Y,M),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,Y,M)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=Y),x.props=c,x.state=Y,x.context=M,c=Q):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=1024),c=!1)}return x=c,Au(r,i),c=(i.flags&128)!==0,x||c?(x=i.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,r!==null&&c?(i.child=hi(i,r.child,null,p),i.child=hi(i,null,o,p)):rn(r,i,o,p),i.memoizedState=x.state,r=i.child):r=Gr(r,i,p),r}function jb(r,i,o,c){return oi(),i.flags|=256,rn(r,i,o,c),i.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(r){return{baseLanes:r,cachePool:px()}}function If(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Bn),r}function Cb(r,i,o){var c=i.pendingProps,p=!1,x=(i.flags&128)!==0,k;if((k=x)||(k=r!==null&&r.memoizedState===null?!1:(Rt.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ve){if(p?ba(i):va(),(r=pt)?(r=Dv(r,er),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:fa!==null?{id:vr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},o=sx(r),o.return=i,i.child=o,tn=i,pt=null)):r=null,r===null)throw ma(i);return _h(r)?i.lanes=32:i.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(va(),p=i.mode,_=Ou({mode:"hidden",children:_},p),c=si(c,p,o,null),_.return=i,c.return=i,_.sibling=c,i.child=_,c=i.child,c.memoizedState=Zf(o),c.childLanes=If(r,k,o),i.memoizedState=Bf,Do(null,c)):(ba(i),Hf(i,_))}var M=r.memoizedState;if(M!==null&&(_=M.dehydrated,_!==null)){if(x)i.flags&256?(ba(i),i.flags&=-257,i=Ff(r,i,o)):i.memoizedState!==null?(va(),i.child=r.child,i.flags|=128,i=null):(va(),_=c.fallback,p=i.mode,c=Ou({mode:"visible",children:c.children},p),_=si(_,p,o,null),_.flags|=2,c.return=i,_.return=i,c.sibling=_,i.child=c,hi(i,r.child,null,o),c=i.child,c.memoizedState=Zf(o),c.childLanes=If(r,k,o),i.memoizedState=Bf,i=Do(null,c));else if(ba(i),_h(_)){if(k=_.nextSibling&&_.nextSibling.dataset,k)var H=k.dgst;k=H,c=Error(a(419)),c.stack="",c.digest=k,So({value:c,source:null,stack:null}),i=Ff(r,i,o)}else if(Pt||es(r,i,o,!1),k=(o&r.childLanes)!==0,Pt||k){if(k=lt,k!==null&&(c=hy(k,o),c!==0&&c!==M.retryLane))throw M.retryLane=c,ii(r,c),En(k,r,c),Uf;zh(_)||Bu(),i=Ff(r,i,o)}else zh(_)?(i.flags|=192,i.child=r.child,i=null):(r=M.treeContext,pt=nr(_.nextSibling),tn=i,Ve=!0,ha=null,er=!1,r!==null&&ux(i,r),i=Hf(i,c.children),i.flags|=4096);return i}return p?(va(),_=c.fallback,p=i.mode,M=r.child,H=M.sibling,c=Br(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,H!==null?_=Br(H,_):(_=si(_,p,o,null),_.flags|=2),_.return=i,c.return=i,c.sibling=_,i.child=c,Do(null,c),c=i.child,_=r.child.memoizedState,_===null?_=Zf(o):(p=_.cachePool,p!==null?(M=$t._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=px(),_={baseLanes:_.baseLanes|o,cachePool:p}),c.memoizedState=_,c.childLanes=If(r,k,o),i.memoizedState=Bf,Do(r.child,c)):(ba(i),o=r.child,r=o.sibling,o=Br(o,{mode:"visible",children:c.children}),o.return=i,o.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=o,i.memoizedState=null,o)}function Hf(r,i){return i=Ou({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Ou(r,i){return r=Ln(22,r,null,i),r.lanes=0,r}function Ff(r,i,o){return hi(i,r.child,null,o),r=Hf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Nb(r,i,o){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),sf(r.return,i,o)}function qf(r,i,o,c,p,x){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:x}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=o,k.tailMode=p,k.treeForkCount=x)}function Eb(r,i,o){var c=i.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var k=Rt.current,_=(k&2)!==0;if(_?(k=k&1|2,i.flags|=128):k&=1,w(Rt,k),rn(r,i,c,o),c=Ve?wo:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Nb(r,o,i);else if(r.tag===19)Nb(r,o,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(o=i.child,p=null;o!==null;)r=o.alternate,r!==null&&vu(r)===null&&(p=o),o=o.sibling;o=p,o===null?(p=i.child,i.child=null):(p=o.sibling,o.sibling=null),qf(i,!1,p,o,x,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&vu(r)===null){i.child=p;break}r=p.sibling,p.sibling=o,o=p,p=r}qf(i,!0,o,null,x,c);break;case"together":qf(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Gr(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),Sa|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(es(r,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,o=Br(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=Br(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function Gf(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&fu(r)))}function NC(r,i,o){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),pa(i,$t,r.memoizedState.cache),oi();break;case 27:case 5:Ye(i);break;case 4:Ae(i,i.stateNode.containerInfo);break;case 10:pa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,xf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(ba(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Cb(r,i,o):(ba(i),r=Gr(r,i,o),r!==null?r.sibling:null);ba(i);break;case 19:var p=(r.flags&128)!==0;if(c=(o&i.childLanes)!==0,c||(es(r,i,o,!1),c=(o&i.childLanes)!==0),p){if(c)return Eb(r,i,o);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w(Rt,Rt.current),c)break;return null;case 22:return i.lanes=0,kb(r,i,o,i.pendingProps);case 24:pa(i,$t,r.memoizedState.cache)}return Gr(r,i,o)}function Tb(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Pt=!0;else{if(!Gf(r,o)&&(i.flags&128)===0)return Pt=!1,NC(r,i,o);Pt=(r.flags&131072)!==0}else Pt=!1,Ve&&(i.flags&1048576)!==0&&lx(i,wo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=di(i.elementType),i.type=r,typeof r=="function")Kd(r)?(c=pi(r,c),i.tag=1,i=_b(null,i,r,c,o)):(i.tag=0,i=Vf(null,i,r,c,o));else{if(r!=null){var p=r.$$typeof;if(p===P){i.tag=11,i=xb(null,i,r,c,o);break e}else if(p===F){i.tag=14,i=bb(null,i,r,c,o);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return Vf(r,i,i.type,i.pendingProps,o);case 1:return c=i.type,p=pi(c,i.pendingProps),_b(r,i,c,p,o);case 3:e:{if(Ae(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;p=x.element,hf(r,i),To(i,c,null,o);var k=i.memoizedState;if(c=k.cache,pa(i,$t,c),c!==x.cache&&of(i,[$t],o,!0),Eo(),c=k.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=jb(r,i,c,o);break e}else if(c!==p){p=Kn(Error(a(424)),i),So(p),i=jb(r,i,c,o);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,pt=nr(r.firstChild),tn=i,Ve=!0,ha=null,er=!0,o=kx(i,null,c,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(oi(),c===p){i=Gr(r,i,o);break e}rn(r,i,c,o)}i=i.child}return i;case 26:return Au(r,i),r===null?(o=Bv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Ve||(o=i.type,r=i.pendingProps,c=Yu(D.current).createElement(o),c[en]=i,c[Sn]=r,an(c,o,r),Qt(c),i.stateNode=c):i.memoizedState=Bv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ye(i),r===null&&Ve&&(c=i.stateNode=Pv(i.type,i.pendingProps,D.current),tn=i,er=!0,p=pt,Na(i.type)?(jh=p,pt=nr(c.firstChild)):pt=p),rn(r,i,i.pendingProps.children,o),Au(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ve&&((p=c=pt)&&(c=aN(c,i.type,i.pendingProps,er),c!==null?(i.stateNode=c,tn=i,pt=nr(c.firstChild),er=!1,p=!0):p=!1),p||ma(i)),Ye(i),p=i.type,x=i.pendingProps,k=r!==null?r.memoizedProps:null,c=x.children,kh(p,x)?c=null:k!==null&&kh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=vf(r,i,bC,null,null,o),Jo._currentValue=p),Au(r,i),rn(r,i,c,o),i.child;case 6:return r===null&&Ve&&((r=o=pt)&&(o=iN(o,i.pendingProps,er),o!==null?(i.stateNode=o,tn=i,pt=null,r=!0):r=!1),r||ma(i)),null;case 13:return Cb(r,i,o);case 4:return Ae(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=hi(i,null,c,o):rn(r,i,c,o),i.child;case 11:return xb(r,i,i.type,i.pendingProps,o);case 7:return rn(r,i,i.pendingProps,o),i.child;case 8:return rn(r,i,i.pendingProps.children,o),i.child;case 12:return rn(r,i,i.pendingProps.children,o),i.child;case 10:return c=i.pendingProps,pa(i,i.type,c.value),rn(r,i,c.children,o),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,ui(i),p=nn(p),c=c(p),i.flags|=1,rn(r,i,c,o),i.child;case 14:return bb(r,i,i.type,i.pendingProps,o);case 15:return vb(r,i,i.type,i.pendingProps,o);case 19:return Eb(r,i,o);case 31:return CC(r,i,o);case 22:return kb(r,i,o,i.pendingProps);case 24:return ui(i),c=nn($t),r===null?(p=cf(),p===null&&(p=lt,x=lf(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),i.memoizedState={parent:c,cache:p},ff(i),pa(i,$t,p)):((r.lanes&o)!==0&&(hf(r,i),To(i,null,null,o),Eo()),p=r.memoizedState,x=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),pa(i,$t,c)):(c=x.cache,pa(i,$t,c),c!==p.cache&&of(i,[$t],o,!0))),rn(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Yr(r){r.flags|=4}function Yf(r,i,o,c,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(rv())r.flags|=8192;else throw fi=gu,df}else r.flags&=-16777217}function Ab(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!qv(i))if(rv())r.flags|=8192;else throw fi=gu,df}function Ru(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?cy():536870912,r.lanes|=i,fs|=i)}function $o(r,i){if(!Ve)switch(r.tailMode){case"hidden":i=r.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?r.tail=null:o.sibling=null;break;case"collapsed":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function gt(r){var i=r.alternate!==null&&r.alternate.child===r.child,o=0,c=0;if(i)for(var p=r.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=o,i}function EC(r,i,o){var c=i.pendingProps;switch(tf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(i),null;case 1:return gt(i),null;case 3:return o=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Hr($t),je(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(Wi(i)?Yr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,rf())),gt(i),null;case 26:var p=i.type,x=i.memoizedState;return r===null?(Yr(i),x!==null?(gt(i),Ab(i,x)):(gt(i),Yf(i,p,null,c,o))):x?x!==r.memoizedState?(Yr(i),gt(i),Ab(i,x)):(gt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&Yr(i),gt(i),Yf(i,p,r,c,o)),null;case 27:if(Nt(i),o=D.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Yr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return gt(i),null}r=X.current,Wi(i)?cx(i):(r=Pv(p,c,o),i.stateNode=r,Yr(i))}return gt(i),null;case 5:if(Nt(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Yr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return gt(i),null}if(x=X.current,Wi(i))cx(i);else{var k=Yu(D.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?k.createElement(p,{is:c.is}):k.createElement(p)}}x[en]=i,x[Sn]=c;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===i)break e;for(;k.sibling===null;){if(k.return===null||k.return===i)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}i.stateNode=x;e:switch(an(x,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Yr(i)}}return gt(i),Yf(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&Yr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=D.current,Wi(i)){if(r=i.stateNode,o=i.memoizedProps,c=null,p=tn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[en]=i,r=!!(r.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Cv(r.nodeValue,o)),r||ma(i,!0)}else r=Yu(r).createTextNode(c),r[en]=i,i.stateNode=r}return gt(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(c=Wi(i),o!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[en]=i}else oi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;gt(i),r=!1}else o=rf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(Un(i),i):(Un(i),null);if((i.flags&128)!==0)throw Error(a(558))}return gt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Wi(i),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[en]=i}else oi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;gt(i),p=!1}else p=rf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Un(i),i):(Un(i),null)}return Un(i),(i.flags&128)!==0?(i.lanes=o,i):(o=c!==null,r=r!==null&&r.memoizedState!==null,o&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048)),o!==r&&o&&(i.child.flags|=8192),Ru(i,i.updateQueue),gt(i),null);case 4:return je(),r===null&&gh(i.stateNode.containerInfo),gt(i),null;case 10:return Hr(i.type),gt(i),null;case 19:if(G(Rt),c=i.memoizedState,c===null)return gt(i),null;if(p=(i.flags&128)!==0,x=c.rendering,x===null)if(p)$o(c,!1);else{if(Tt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(x=vu(r),x!==null){for(i.flags|=128,$o(c,!1),r=x.updateQueue,i.updateQueue=r,Ru(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)ix(o,r),o=o.sibling;return w(Rt,Rt.current&1|2),Ve&&Zr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&mt()>Pu&&(i.flags|=128,p=!0,$o(c,!1),i.lanes=4194304)}else{if(!p)if(r=vu(x),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Ru(i,r),$o(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Ve)return gt(i),null}else 2*mt()-c.renderingStartTime>Pu&&o!==536870912&&(i.flags|=128,p=!0,$o(c,!1),i.lanes=4194304);c.isBackwards?(x.sibling=i.child,i.child=x):(r=c.last,r!==null?r.sibling=x:i.child=x,c.last=x)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=mt(),r.sibling=null,o=Rt.current,w(Rt,p?o&1|2:o&1),Ve&&Zr(i,c.treeForkCount),r):(gt(i),null);case 22:case 23:return Un(i),yf(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(o&536870912)!==0&&(i.flags&128)===0&&(gt(i),i.subtreeFlags&6&&(i.flags|=8192)):gt(i),o=i.updateQueue,o!==null&&Ru(i,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048),r!==null&&G(ci),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Hr($t),gt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function TC(r,i){switch(tf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Hr($t),je(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Nt(i),null;case 31:if(i.memoizedState!==null){if(Un(i),i.alternate===null)throw Error(a(340));oi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Un(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));oi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return G(Rt),null;case 4:return je(),null;case 10:return Hr(i.type),null;case 22:case 23:return Un(i),yf(),r!==null&&G(ci),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Hr($t),null;case 25:return null;default:return null}}function Ob(r,i){switch(tf(i),i.tag){case 3:Hr($t),je();break;case 26:case 27:case 5:Nt(i);break;case 4:je();break;case 31:i.memoizedState!==null&&Un(i);break;case 13:Un(i);break;case 19:G(Rt);break;case 10:Hr(i.type);break;case 22:case 23:Un(i),yf(),r!==null&&G(ci);break;case 24:Hr($t)}}function Lo(r,i){try{var o=i.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&r)===r){c=void 0;var x=o.create,k=o.inst;c=x(),k.destroy=c}o=o.next}while(o!==p)}}catch(_){Qe(i,i.return,_)}}function ka(r,i,o){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var x=p.next;c=x;do{if((c.tag&r)===r){var k=c.inst,_=k.destroy;if(_!==void 0){k.destroy=void 0,p=i;var M=o,H=_;try{H()}catch(Q){Qe(p,M,Q)}}}c=c.next}while(c!==x)}}catch(Q){Qe(i,i.return,Q)}}function Rb(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{Sx(i,o)}catch(c){Qe(r,r.return,c)}}}function Mb(r,i,o){o.props=pi(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(c){Qe(r,i,c)}}function Po(r,i){try{var o=r.ref;if(o!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof o=="function"?r.refCleanup=o(c):o.current=c}}catch(p){Qe(r,i,p)}}function wr(r,i){var o=r.ref,c=r.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){Qe(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){Qe(r,i,p)}else o.current=null}function Db(r){var i=r.type,o=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){Qe(r,r.return,p)}}function Xf(r,i,o){try{var c=r.stateNode;QC(c,r.type,o,i),c[Sn]=i}catch(p){Qe(r,r.return,p)}}function $b(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Na(r.type)||r.tag===4}function Jf(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||$b(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Na(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Kf(r,i,o){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(r),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Ur));else if(c!==4&&(c===27&&Na(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(Kf(r,i,o),r=r.sibling;r!==null;)Kf(r,i,o),r=r.sibling}function Mu(r,i,o){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?o.insertBefore(r,i):o.appendChild(r);else if(c!==4&&(c===27&&Na(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Mu(r,i,o),r=r.sibling;r!==null;)Mu(r,i,o),r=r.sibling}function Lb(r){var i=r.stateNode,o=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);an(i,c,o),i[en]=r,i[Sn]=o}catch(x){Qe(r,r.return,x)}}var Xr=!1,Ut=!1,Qf=!1,Pb=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function AC(r,i){if(r=r.containerInfo,bh=tc,r=Jy(r),Hd(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var k=0,_=-1,M=-1,H=0,Q=0,re=r,q=null;t:for(;;){for(var Y;re!==o||p!==0&&re.nodeType!==3||(_=k+p),re!==x||c!==0&&re.nodeType!==3||(M=k+c),re.nodeType===3&&(k+=re.nodeValue.length),(Y=re.firstChild)!==null;)q=re,re=Y;for(;;){if(re===r)break t;if(q===o&&++H===p&&(_=k),q===x&&++Q===c&&(M=k),(Y=re.nextSibling)!==null)break;re=q,q=re.parentNode}re=Y}o=_===-1||M===-1?null:{start:_,end:M}}else o=null}o=o||{start:0,end:0}}else o=null;for(vh={focusedElem:r,selectionRange:o},tc=!1,Wt=i;Wt!==null;)if(i=Wt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Wt=r;else for(;Wt!==null;){switch(i=Wt,x=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(o=0;o<r.length;o++)p=r[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&x!==null){r=void 0,o=i,p=x.memoizedProps,x=x.memoizedState,c=o.stateNode;try{var pe=pi(o.type,p);r=c.getSnapshotBeforeUpdate(pe,x),c.__reactInternalSnapshotBeforeUpdate=r}catch(_e){Qe(o,o.return,_e)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)Sh(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Sh(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Wt=r;break}Wt=i.return}}function Ub(r,i,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Kr(r,o),c&4&&Lo(5,o);break;case 1:if(Kr(r,o),c&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(k){Qe(o,o.return,k)}else{var p=pi(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){Qe(o,o.return,k)}}c&64&&Rb(o),c&512&&Po(o,o.return);break;case 3:if(Kr(r,o),c&64&&(r=o.updateQueue,r!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{Sx(r,i)}catch(k){Qe(o,o.return,k)}}break;case 27:i===null&&c&4&&Lb(o);case 26:case 5:Kr(r,o),i===null&&c&4&&Db(o),c&512&&Po(o,o.return);break;case 12:Kr(r,o);break;case 31:Kr(r,o),c&4&&Zb(r,o);break;case 13:Kr(r,o),c&4&&Ib(r,o),c&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=VC.bind(null,o),sN(r,o))));break;case 22:if(c=o.memoizedState!==null||Xr,!c){i=i!==null&&i.memoizedState!==null||Ut,p=Xr;var x=Ut;Xr=c,(Ut=i)&&!x?Qr(r,o,(o.subtreeFlags&8772)!==0):Kr(r,o),Xr=p,Ut=x}break;case 30:break;default:Kr(r,o)}}function Vb(r){var i=r.alternate;i!==null&&(r.alternate=null,Vb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Cd(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var xt=null,_n=!1;function Jr(r,i,o){for(o=o.child;o!==null;)Bb(r,i,o),o=o.sibling}function Bb(r,i,o){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(pn,o)}catch{}switch(o.tag){case 26:Ut||wr(o,i),Jr(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Ut||wr(o,i);var c=xt,p=_n;Na(o.type)&&(xt=o.stateNode,_n=!1),Jr(r,i,o),Go(o.stateNode),xt=c,_n=p;break;case 5:Ut||wr(o,i);case 6:if(c=xt,p=_n,xt=null,Jr(r,i,o),xt=c,_n=p,xt!==null)if(_n)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(o.stateNode)}catch(x){Qe(o,i,x)}else try{xt.removeChild(o.stateNode)}catch(x){Qe(o,i,x)}break;case 18:xt!==null&&(_n?(r=xt,Rv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),vs(r)):Rv(xt,o.stateNode));break;case 4:c=xt,p=_n,xt=o.stateNode.containerInfo,_n=!0,Jr(r,i,o),xt=c,_n=p;break;case 0:case 11:case 14:case 15:ka(2,o,i),Ut||ka(4,o,i),Jr(r,i,o);break;case 1:Ut||(wr(o,i),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Mb(o,i,c)),Jr(r,i,o);break;case 21:Jr(r,i,o);break;case 22:Ut=(c=Ut)||o.memoizedState!==null,Jr(r,i,o),Ut=c;break;default:Jr(r,i,o)}}function Zb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{vs(r)}catch(o){Qe(i,i.return,o)}}}function Ib(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{vs(r)}catch(o){Qe(i,i.return,o)}}function OC(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Pb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Pb),i;default:throw Error(a(435,r.tag))}}function Du(r,i){var o=OC(r);i.forEach(function(c){if(!o.has(c)){o.add(c);var p=BC.bind(null,r,c);c.then(p,p)}})}function jn(r,i){var o=i.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],x=r,k=i,_=k;e:for(;_!==null;){switch(_.tag){case 27:if(Na(_.type)){xt=_.stateNode,_n=!1;break e}break;case 5:xt=_.stateNode,_n=!1;break e;case 3:case 4:xt=_.stateNode.containerInfo,_n=!0;break e}_=_.return}if(xt===null)throw Error(a(160));Bb(x,k,p),xt=null,_n=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Hb(i,r),i=i.sibling}var mr=null;function Hb(r,i){var o=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:jn(i,r),Cn(r),c&4&&(ka(3,r,r.return),Lo(3,r),ka(5,r,r.return));break;case 1:jn(i,r),Cn(r),c&512&&(Ut||o===null||wr(o,o.return)),c&64&&Xr&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=mr;if(jn(i,r),Cn(r),c&512&&(Ut||o===null||wr(o,o.return)),c&4){var x=o!==null?o.memoizedState:null;if(c=r.memoizedState,o===null)if(c===null)if(r.stateNode===null){e:{c=r.type,o=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":x=p.getElementsByTagName("title")[0],(!x||x[co]||x[en]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),an(x,c,o),x[en]=r,Qt(x),c=x;break e;case"link":var k=Hv("link","href",p).get(c+(o.href||""));if(k){for(var _=0;_<k.length;_++)if(x=k[_],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(_,1);break t}}x=p.createElement(c),an(x,c,o),p.head.appendChild(x);break;case"meta":if(k=Hv("meta","content",p).get(c+(o.content||""))){for(_=0;_<k.length;_++)if(x=k[_],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(_,1);break t}}x=p.createElement(c),an(x,c,o),p.head.appendChild(x);break;default:throw Error(a(468,c))}x[en]=r,Qt(x),c=x}r.stateNode=c}else Fv(p,r.type,r.stateNode);else r.stateNode=Iv(p,c,r.memoizedProps);else x!==c?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,c===null?Fv(p,r.type,r.stateNode):Iv(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Xf(r,r.memoizedProps,o.memoizedProps)}break;case 27:jn(i,r),Cn(r),c&512&&(Ut||o===null||wr(o,o.return)),o!==null&&c&4&&Xf(r,r.memoizedProps,o.memoizedProps);break;case 5:if(jn(i,r),Cn(r),c&512&&(Ut||o===null||wr(o,o.return)),r.flags&32){p=r.stateNode;try{Ii(p,"")}catch(pe){Qe(r,r.return,pe)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Xf(r,p,o!==null?o.memoizedProps:p)),c&1024&&(Qf=!0);break;case 6:if(jn(i,r),Cn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,o=r.stateNode;try{o.nodeValue=c}catch(pe){Qe(r,r.return,pe)}}break;case 3:if(Ku=null,p=mr,mr=Xu(i.containerInfo),jn(i,r),mr=p,Cn(r),c&4&&o!==null&&o.memoizedState.isDehydrated)try{vs(i.containerInfo)}catch(pe){Qe(r,r.return,pe)}Qf&&(Qf=!1,Fb(r));break;case 4:c=mr,mr=Xu(r.stateNode.containerInfo),jn(i,r),Cn(r),mr=c;break;case 12:jn(i,r),Cn(r);break;case 31:jn(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Du(r,c)));break;case 13:jn(i,r),Cn(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Lu=mt()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Du(r,c)));break;case 22:p=r.memoizedState!==null;var M=o!==null&&o.memoizedState!==null,H=Xr,Q=Ut;if(Xr=H||p,Ut=Q||M,jn(i,r),Ut=Q,Xr=H,Cn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||M||Xr||Ut||gi(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){M=o=i;try{if(x=M.stateNode,p)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{_=M.stateNode;var re=M.memoizedProps.style,q=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(pe){Qe(M,M.return,pe)}}}else if(i.tag===6){if(o===null){M=i;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(pe){Qe(M,M.return,pe)}}}else if(i.tag===18){if(o===null){M=i;try{var Y=M.stateNode;p?Mv(Y,!0):Mv(M.stateNode,!1)}catch(pe){Qe(M,M.return,pe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=r.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,Du(r,o))));break;case 19:jn(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Du(r,c)));break;case 30:break;case 21:break;default:jn(i,r),Cn(r)}}function Cn(r){var i=r.flags;if(i&2){try{for(var o,c=r.return;c!==null;){if($b(c)){o=c;break}c=c.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,x=Jf(r);Mu(r,x,p);break;case 5:var k=o.stateNode;o.flags&32&&(Ii(k,""),o.flags&=-33);var _=Jf(r);Mu(r,_,k);break;case 3:case 4:var M=o.stateNode.containerInfo,H=Jf(r);Kf(r,H,M);break;default:throw Error(a(161))}}catch(Q){Qe(r,r.return,Q)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Fb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Fb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Kr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ub(r,i.alternate,i),i=i.sibling}function gi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:ka(4,i,i.return),gi(i);break;case 1:wr(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&Mb(i,i.return,o),gi(i);break;case 27:Go(i.stateNode);case 26:case 5:wr(i,i.return),gi(i);break;case 22:i.memoizedState===null&&gi(i);break;case 30:gi(i);break;default:gi(i)}r=r.sibling}}function Qr(r,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,x=i,k=x.flags;switch(x.tag){case 0:case 11:case 15:Qr(p,x,o),Lo(4,x);break;case 1:if(Qr(p,x,o),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(H){Qe(c,c.return,H)}if(c=x,p=c.updateQueue,p!==null){var _=c.stateNode;try{var M=p.shared.hiddenCallbacks;if(M!==null)for(p.shared.hiddenCallbacks=null,p=0;p<M.length;p++)wx(M[p],_)}catch(H){Qe(c,c.return,H)}}o&&k&64&&Rb(x),Po(x,x.return);break;case 27:Lb(x);case 26:case 5:Qr(p,x,o),o&&c===null&&k&4&&Db(x),Po(x,x.return);break;case 12:Qr(p,x,o);break;case 31:Qr(p,x,o),o&&k&4&&Zb(p,x);break;case 13:Qr(p,x,o),o&&k&4&&Ib(p,x);break;case 22:x.memoizedState===null&&Qr(p,x,o),Po(x,x.return);break;case 30:break;default:Qr(p,x,o)}i=i.sibling}}function Wf(r,i){var o=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==o&&(r!=null&&r.refCount++,o!=null&&zo(o))}function eh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&zo(r))}function pr(r,i,o,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)qb(r,i,o,c),i=i.sibling}function qb(r,i,o,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:pr(r,i,o,c),p&2048&&Lo(9,i);break;case 1:pr(r,i,o,c);break;case 3:pr(r,i,o,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&zo(r)));break;case 12:if(p&2048){pr(r,i,o,c),r=i.stateNode;try{var x=i.memoizedProps,k=x.id,_=x.onPostCommit;typeof _=="function"&&_(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(M){Qe(i,i.return,M)}}else pr(r,i,o,c);break;case 31:pr(r,i,o,c);break;case 13:pr(r,i,o,c);break;case 23:break;case 22:x=i.stateNode,k=i.alternate,i.memoizedState!==null?x._visibility&2?pr(r,i,o,c):Uo(r,i):x._visibility&2?pr(r,i,o,c):(x._visibility|=2,us(r,i,o,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Wf(k,i);break;case 24:pr(r,i,o,c),p&2048&&eh(i.alternate,i);break;default:pr(r,i,o,c)}}function us(r,i,o,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=r,k=i,_=o,M=c,H=k.flags;switch(k.tag){case 0:case 11:case 15:us(x,k,_,M,p),Lo(8,k);break;case 23:break;case 22:var Q=k.stateNode;k.memoizedState!==null?Q._visibility&2?us(x,k,_,M,p):Uo(x,k):(Q._visibility|=2,us(x,k,_,M,p)),p&&H&2048&&Wf(k.alternate,k);break;case 24:us(x,k,_,M,p),p&&H&2048&&eh(k.alternate,k);break;default:us(x,k,_,M,p)}i=i.sibling}}function Uo(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=r,c=i,p=c.flags;switch(c.tag){case 22:Uo(o,c),p&2048&&Wf(c.alternate,c);break;case 24:Uo(o,c),p&2048&&eh(c.alternate,c);break;default:Uo(o,c)}i=i.sibling}}var Vo=8192;function cs(r,i,o){if(r.subtreeFlags&Vo)for(r=r.child;r!==null;)Gb(r,i,o),r=r.sibling}function Gb(r,i,o){switch(r.tag){case 26:cs(r,i,o),r.flags&Vo&&r.memoizedState!==null&&xN(o,mr,r.memoizedState,r.memoizedProps);break;case 5:cs(r,i,o);break;case 3:case 4:var c=mr;mr=Xu(r.stateNode.containerInfo),cs(r,i,o),mr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Vo,Vo=16777216,cs(r,i,o),Vo=c):cs(r,i,o));break;default:cs(r,i,o)}}function Yb(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Bo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];Wt=c,Jb(c,r)}Yb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Xb(r),r=r.sibling}function Xb(r){switch(r.tag){case 0:case 11:case 15:Bo(r),r.flags&2048&&ka(9,r,r.return);break;case 3:Bo(r);break;case 12:Bo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,$u(r)):Bo(r);break;default:Bo(r)}}function $u(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];Wt=c,Jb(c,r)}Yb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:ka(8,i,i.return),$u(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,$u(i));break;default:$u(i)}r=r.sibling}}function Jb(r,i){for(;Wt!==null;){var o=Wt;switch(o.tag){case 0:case 11:case 15:ka(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:zo(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,Wt=c;else e:for(o=r;Wt!==null;){c=Wt;var p=c.sibling,x=c.return;if(Vb(c),c===o){Wt=null;break e}if(p!==null){p.return=x,Wt=p;break e}Wt=x}}}var RC={getCacheForType:function(r){var i=nn($t),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return nn($t).controller.signal}},MC=typeof WeakMap=="function"?WeakMap:Map,qe=0,lt=null,$e=null,Pe=0,Ke=0,Vn=null,wa=!1,ds=!1,th=!1,Wr=0,Tt=0,Sa=0,yi=0,nh=0,Bn=0,fs=0,Zo=null,Nn=null,rh=!1,Lu=0,Kb=0,Pu=1/0,Uu=null,za=null,Gt=0,_a=null,hs=null,ea=0,ah=0,ih=null,Qb=null,Io=0,sh=null;function Zn(){return(qe&2)!==0&&Pe!==0?Pe&-Pe:L.T!==null?fh():my()}function Wb(){if(Bn===0)if((Pe&536870912)===0||Ve){var r=Gl;Gl<<=1,(Gl&3932160)===0&&(Gl=262144),Bn=r}else Bn=536870912;return r=Pn.current,r!==null&&(r.flags|=32),Bn}function En(r,i,o){(r===lt&&(Ke===2||Ke===9)||r.cancelPendingCommit!==null)&&(ms(r,0),ja(r,Pe,Bn,!1)),uo(r,o),((qe&2)===0||r!==lt)&&(r===lt&&((qe&2)===0&&(yi|=o),Tt===4&&ja(r,Pe,Bn,!1)),Sr(r))}function ev(r,i,o){if((qe&6)!==0)throw Error(a(327));var c=!o&&(i&127)===0&&(i&r.expiredLanes)===0||lo(r,i),p=c?LC(r,i):lh(r,i,!0),x=c;do{if(p===0){ds&&!c&&ja(r,i,0,!1);break}else{if(o=r.current.alternate,x&&!DC(o)){p=lh(r,i,!1),x=!1;continue}if(p===2){if(x=i,r.errorRecoveryDisabledLanes&x)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var _=r;p=Zo;var M=_.current.memoizedState.isDehydrated;if(M&&(ms(_,k).flags|=256),k=lh(_,k,!1),k!==2){if(th&&!M){_.errorRecoveryDisabledLanes|=x,yi|=x,p=4;break e}x=Nn,Nn=p,x!==null&&(Nn===null?Nn=x:Nn.push.apply(Nn,x))}p=k}if(x=!1,p!==2)continue}}if(p===1){ms(r,0),ja(r,i,0,!0);break}e:{switch(c=r,x=p,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ja(c,i,Bn,!wa);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Lu+300-mt(),10<p)){if(ja(c,i,Bn,!wa),Xl(c,0,!0)!==0)break e;ea=i,c.timeoutHandle=Av(tv.bind(null,c,o,Nn,Uu,rh,i,Bn,yi,fs,wa,x,"Throttled",-0,0),p);break e}tv(c,o,Nn,Uu,rh,i,Bn,yi,fs,wa,x,null,-0,0)}}break}while(!0);Sr(r)}function tv(r,i,o,c,p,x,k,_,M,H,Q,re,q,Y){if(r.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ur},Gb(i,x,re);var pe=(x&62914560)===x?Lu-mt():(x&4194048)===x?Kb-mt():0;if(pe=bN(re,pe),pe!==null){ea=x,r.cancelPendingCommit=pe(uv.bind(null,r,i,x,o,c,p,k,_,M,Q,re,null,q,Y)),ja(r,x,k,!H);return}}uv(r,i,x,o,c,p,k,_,M)}function DC(r){for(var i=r;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],x=p.getSnapshot;p=p.value;try{if(!$n(x(),p))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ja(r,i,o,c){i&=~nh,i&=~yi,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var x=31-ot(p),k=1<<x;c[x]=-1,p&=~k}o!==0&&dy(r,o,i)}function Vu(){return(qe&6)===0?(Ho(0),!1):!0}function oh(){if($e!==null){if(Ke===0)var r=$e.return;else r=$e,Ir=li=null,Sf(r),as=null,jo=0,r=$e;for(;r!==null;)Ob(r.alternate,r),r=r.return;$e=null}}function ms(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,tN(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),ea=0,oh(),lt=r,$e=o=Br(r.current,null),Pe=i,Ke=0,Vn=null,wa=!1,ds=lo(r,i),th=!1,fs=Bn=nh=yi=Sa=Tt=0,Nn=Zo=null,rh=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-ot(c),x=1<<p;i|=r[p],c&=~x}return Wr=i,ou(),o}function nv(r,i){Oe=null,L.H=Mo,i===rs||i===pu?(i=xx(),Ke=3):i===df?(i=xx(),Ke=4):Ke=i===Uf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Vn=i,$e===null&&(Tt=1,Eu(r,Kn(i,r.current)))}function rv(){var r=Pn.current;return r===null?!0:(Pe&4194048)===Pe?tr===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?r===tr:!1}function av(){var r=L.H;return L.H=Mo,r===null?Mo:r}function iv(){var r=L.A;return L.A=RC,r}function Bu(){Tt=4,wa||(Pe&4194048)!==Pe&&Pn.current!==null||(ds=!0),(Sa&134217727)===0&&(yi&134217727)===0||lt===null||ja(lt,Pe,Bn,!1)}function lh(r,i,o){var c=qe;qe|=2;var p=av(),x=iv();(lt!==r||Pe!==i)&&(Uu=null,ms(r,i)),i=!1;var k=Tt;e:do try{if(Ke!==0&&$e!==null){var _=$e,M=Vn;switch(Ke){case 8:oh(),k=6;break e;case 3:case 2:case 9:case 6:Pn.current===null&&(i=!0);var H=Ke;if(Ke=0,Vn=null,ps(r,_,M,H),o&&ds){k=0;break e}break;default:H=Ke,Ke=0,Vn=null,ps(r,_,M,H)}}$C(),k=Tt;break}catch(Q){nv(r,Q)}while(!0);return i&&r.shellSuspendCounter++,Ir=li=null,qe=c,L.H=p,L.A=x,$e===null&&(lt=null,Pe=0,ou()),k}function $C(){for(;$e!==null;)sv($e)}function LC(r,i){var o=qe;qe|=2;var c=av(),p=iv();lt!==r||Pe!==i?(Uu=null,Pu=mt()+500,ms(r,i)):ds=lo(r,i);e:do try{if(Ke!==0&&$e!==null){i=$e;var x=Vn;t:switch(Ke){case 1:Ke=0,Vn=null,ps(r,i,x,1);break;case 2:case 9:if(gx(x)){Ke=0,Vn=null,ov(i);break}i=function(){Ke!==2&&Ke!==9||lt!==r||(Ke=7),Sr(r)},x.then(i,i);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:gx(x)?(Ke=0,Vn=null,ov(i)):(Ke=0,Vn=null,ps(r,i,x,7));break;case 5:var k=null;switch($e.tag){case 26:k=$e.memoizedState;case 5:case 27:var _=$e;if(k?qv(k):_.stateNode.complete){Ke=0,Vn=null;var M=_.sibling;if(M!==null)$e=M;else{var H=_.return;H!==null?($e=H,Zu(H)):$e=null}break t}}Ke=0,Vn=null,ps(r,i,x,5);break;case 6:Ke=0,Vn=null,ps(r,i,x,6);break;case 8:oh(),Tt=6;break e;default:throw Error(a(462))}}PC();break}catch(Q){nv(r,Q)}while(!0);return Ir=li=null,L.H=c,L.A=p,qe=o,$e!==null?0:(lt=null,Pe=0,ou(),Tt)}function PC(){for(;$e!==null&&!Ot();)sv($e)}function sv(r){var i=Tb(r.alternate,r,Wr);r.memoizedProps=r.pendingProps,i===null?Zu(r):$e=i}function ov(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=zb(o,i,i.pendingProps,i.type,void 0,Pe);break;case 11:i=zb(o,i,i.pendingProps,i.type.render,i.ref,Pe);break;case 5:Sf(i);default:Ob(o,i),i=$e=ix(i,Wr),i=Tb(o,i,Wr)}r.memoizedProps=r.pendingProps,i===null?Zu(r):$e=i}function ps(r,i,o,c){Ir=li=null,Sf(i),as=null,jo=0;var p=i.return;try{if(jC(r,p,i,o,Pe)){Tt=1,Eu(r,Kn(o,r.current)),$e=null;return}}catch(x){if(p!==null)throw $e=p,x;Tt=1,Eu(r,Kn(o,r.current)),$e=null;return}i.flags&32768?(Ve||c===1?r=!0:ds||(Pe&536870912)!==0?r=!1:(wa=r=!0,(c===2||c===9||c===3||c===6)&&(c=Pn.current,c!==null&&c.tag===13&&(c.flags|=16384))),lv(i,r)):Zu(i)}function Zu(r){var i=r;do{if((i.flags&32768)!==0){lv(i,wa);return}r=i.return;var o=EC(i.alternate,i,Wr);if(o!==null){$e=o;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=r}while(i!==null);Tt===0&&(Tt=5)}function lv(r,i){do{var o=TC(r.alternate,r);if(o!==null){o.flags&=32767,$e=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){$e=r;return}$e=r=o}while(r!==null);Tt=6,$e=null}function uv(r,i,o,c,p,x,k,_,M){r.cancelPendingCommit=null;do Iu();while(Gt!==0);if((qe&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=Xd,yj(r,o,x,k,_,M),r===lt&&($e=lt=null,Pe=0),hs=i,_a=r,ea=o,ah=x,ih=p,Qb=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,ZC(ke,function(){return mv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=L.T,L.T=null,p=J.p,J.p=2,k=qe,qe|=4;try{AC(r,i,o)}finally{qe=k,J.p=p,L.T=c}}Gt=1,cv(),dv(),fv()}}function cv(){if(Gt===1){Gt=0;var r=_a,i=hs,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=L.T,L.T=null;var c=J.p;J.p=2;var p=qe;qe|=4;try{Hb(i,r);var x=vh,k=Jy(r.containerInfo),_=x.focusedElem,M=x.selectionRange;if(k!==_&&_&&_.ownerDocument&&Xy(_.ownerDocument.documentElement,_)){if(M!==null&&Hd(_)){var H=M.start,Q=M.end;if(Q===void 0&&(Q=H),"selectionStart"in _)_.selectionStart=H,_.selectionEnd=Math.min(Q,_.value.length);else{var re=_.ownerDocument||document,q=re&&re.defaultView||window;if(q.getSelection){var Y=q.getSelection(),pe=_.textContent.length,_e=Math.min(M.start,pe),at=M.end===void 0?_e:Math.min(M.end,pe);!Y.extend&&_e>at&&(k=at,at=_e,_e=k);var V=Yy(_,_e),$=Yy(_,at);if(V&&$&&(Y.rangeCount!==1||Y.anchorNode!==V.node||Y.anchorOffset!==V.offset||Y.focusNode!==$.node||Y.focusOffset!==$.offset)){var I=re.createRange();I.setStart(V.node,V.offset),Y.removeAllRanges(),_e>at?(Y.addRange(I),Y.extend($.node,$.offset)):(I.setEnd($.node,$.offset),Y.addRange(I))}}}}for(re=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var te=re[_];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}tc=!!bh,vh=bh=null}finally{qe=p,J.p=c,L.T=o}}r.current=i,Gt=2}}function dv(){if(Gt===2){Gt=0;var r=_a,i=hs,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=L.T,L.T=null;var c=J.p;J.p=2;var p=qe;qe|=4;try{Ub(r,i.alternate,i)}finally{qe=p,J.p=c,L.T=o}}Gt=3}}function fv(){if(Gt===4||Gt===3){Gt=0,Ft();var r=_a,i=hs,o=ea,c=Qb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gt=5:(Gt=0,hs=_a=null,hv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(za=null),_d(o),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(pn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=L.T,p=J.p,J.p=2,L.T=null;try{for(var x=r.onRecoverableError,k=0;k<c.length;k++){var _=c[k];x(_.value,{componentStack:_.stack})}}finally{L.T=i,J.p=p}}(ea&3)!==0&&Iu(),Sr(r),p=r.pendingLanes,(o&261930)!==0&&(p&42)!==0?r===sh?Io++:(Io=0,sh=r):Io=0,Ho(0)}}function hv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,zo(i)))}function Iu(){return cv(),dv(),fv(),mv()}function mv(){if(Gt!==5)return!1;var r=_a,i=ah;ah=0;var o=_d(ea),c=L.T,p=J.p;try{J.p=32>o?32:o,L.T=null,o=ih,ih=null;var x=_a,k=ea;if(Gt=0,hs=_a=null,ea=0,(qe&6)!==0)throw Error(a(331));var _=qe;if(qe|=4,Xb(x.current),qb(x,x.current,k,o),qe=_,Ho(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(pn,x)}catch{}return!0}finally{J.p=p,L.T=c,hv(r,i)}}function pv(r,i,o){i=Kn(o,i),i=Pf(r.stateNode,i,2),r=xa(r,i,2),r!==null&&(uo(r,2),Sr(r))}function Qe(r,i,o){if(r.tag===3)pv(r,r,o);else for(;i!==null;){if(i.tag===3){pv(i,r,o);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(za===null||!za.has(c))){r=Kn(o,r),o=gb(2),c=xa(i,o,2),c!==null&&(yb(o,c,i,r),uo(c,2),Sr(c));break}}i=i.return}}function uh(r,i,o){var c=r.pingCache;if(c===null){c=r.pingCache=new MC;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(o)||(th=!0,p.add(o),r=UC.bind(null,r,i,o),i.then(r,r))}function UC(r,i,o){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,lt===r&&(Pe&o)===o&&(Tt===4||Tt===3&&(Pe&62914560)===Pe&&300>mt()-Lu?(qe&2)===0&&ms(r,0):nh|=o,fs===Pe&&(fs=0)),Sr(r)}function gv(r,i){i===0&&(i=cy()),r=ii(r,i),r!==null&&(uo(r,i),Sr(r))}function VC(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),gv(r,o)}function BC(r,i){var o=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),gv(r,o)}function ZC(r,i){return Kt(r,i)}var Hu=null,gs=null,ch=!1,Fu=!1,dh=!1,Ca=0;function Sr(r){r!==gs&&r.next===null&&(gs===null?Hu=gs=r:gs=gs.next=r),Fu=!0,ch||(ch=!0,HC())}function Ho(r,i){if(!dh&&Fu){dh=!0;do for(var o=!1,c=Hu;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var x=0;else{var k=c.suspendedLanes,_=c.pingedLanes;x=(1<<31-ot(42|r)+1)-1,x&=p&~(k&~_),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,vv(c,x))}else x=Pe,x=Xl(c,c===lt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||lo(c,x)||(o=!0,vv(c,x));c=c.next}while(o);dh=!1}}function IC(){yv()}function yv(){Fu=ch=!1;var r=0;Ca!==0&&eN()&&(r=Ca);for(var i=mt(),o=null,c=Hu;c!==null;){var p=c.next,x=xv(c,i);x===0?(c.next=null,o===null?Hu=p:o.next=p,p===null&&(gs=o)):(o=c,(r!==0||(x&3)!==0)&&(Fu=!0)),c=p}Gt!==0&&Gt!==5||Ho(r),Ca!==0&&(Ca=0)}function xv(r,i){for(var o=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var k=31-ot(x),_=1<<k,M=p[k];M===-1?((_&o)===0||(_&c)!==0)&&(p[k]=gj(_,i)):M<=i&&(r.expiredLanes|=_),x&=~_}if(i=lt,o=Pe,o=Xl(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,o===0||r===i&&(Ke===2||Ke===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Gn(c),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||lo(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(c!==null&&Gn(c),_d(o)){case 2:case 8:o=de;break;case 32:o=ke;break;case 268435456:o=Be;break;default:o=ke}return c=bv.bind(null,r),o=Kt(o,c),r.callbackPriority=i,r.callbackNode=o,i}return c!==null&&c!==null&&Gn(c),r.callbackPriority=2,r.callbackNode=null,2}function bv(r,i){if(Gt!==0&&Gt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(Iu()&&r.callbackNode!==o)return null;var c=Pe;return c=Xl(r,r===lt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(ev(r,c,i),xv(r,mt()),r.callbackNode!=null&&r.callbackNode===o?bv.bind(null,r):null)}function vv(r,i){if(Iu())return null;ev(r,i,!0)}function HC(){nN(function(){(qe&6)!==0?Kt(W,IC):yv()})}function fh(){if(Ca===0){var r=ts;r===0&&(r=ql,ql<<=1,(ql&261888)===0&&(ql=256)),Ca=r}return Ca}function kv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Wl(""+r)}function wv(r,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,r.id&&o.setAttribute("form",r.id),i.parentNode.insertBefore(o,i),r=new FormData(r),o.parentNode.removeChild(o),r}function FC(r,i,o,c,p){if(i==="submit"&&o&&o.stateNode===p){var x=kv((p[Sn]||null).action),k=c.submitter;k&&(i=(i=k[Sn]||null)?kv(i.formAction):k.getAttribute("formAction"),i!==null&&(x=i,k=null));var _=new ru("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ca!==0){var M=k?wv(p,k):new FormData(p);Of(o,{pending:!0,data:M,method:p.method,action:x},null,M)}}else typeof x=="function"&&(_.preventDefault(),M=k?wv(p,k):new FormData(p),Of(o,{pending:!0,data:M,method:p.method,action:x},x,M))},currentTarget:p}]})}}for(var hh=0;hh<Yd.length;hh++){var mh=Yd[hh],qC=mh.toLowerCase(),GC=mh[0].toUpperCase()+mh.slice(1);hr(qC,"on"+GC)}hr(Wy,"onAnimationEnd"),hr(ex,"onAnimationIteration"),hr(tx,"onAnimationStart"),hr("dblclick","onDoubleClick"),hr("focusin","onFocus"),hr("focusout","onBlur"),hr(uC,"onTransitionRun"),hr(cC,"onTransitionStart"),hr(dC,"onTransitionCancel"),hr(nx,"onTransitionEnd"),Bi("onMouseEnter",["mouseout","mouseover"]),Bi("onMouseLeave",["mouseout","mouseover"]),Bi("onPointerEnter",["pointerout","pointerover"]),Bi("onPointerLeave",["pointerout","pointerover"]),ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),YC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fo));function Sv(r,i){i=(i&4)!==0;for(var o=0;o<r.length;o++){var c=r[o],p=c.event;c=c.listeners;e:{var x=void 0;if(i)for(var k=c.length-1;0<=k;k--){var _=c[k],M=_.instance,H=_.currentTarget;if(_=_.listener,M!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=H;try{x(p)}catch(Q){su(Q)}p.currentTarget=null,x=M}else for(k=0;k<c.length;k++){if(_=c[k],M=_.instance,H=_.currentTarget,_=_.listener,M!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=H;try{x(p)}catch(Q){su(Q)}p.currentTarget=null,x=M}}}}function Le(r,i){var o=i[jd];o===void 0&&(o=i[jd]=new Set);var c=r+"__bubble";o.has(c)||(zv(i,r,2,!1),o.add(c))}function ph(r,i,o){var c=0;i&&(c|=4),zv(o,r,c,i)}var qu="_reactListening"+Math.random().toString(36).slice(2);function gh(r){if(!r[qu]){r[qu]=!0,yy.forEach(function(o){o!=="selectionchange"&&(YC.has(o)||ph(o,!1,r),ph(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[qu]||(i[qu]=!0,ph("selectionchange",!1,i))}}function zv(r,i,o,c){switch(Wv(i)){case 2:var p=wN;break;case 8:p=SN;break;default:p=Ah}o=p.bind(null,i,o,r),p=void 0,!Dd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(i,o,{capture:!0,passive:p}):r.addEventListener(i,o,!0):p!==void 0?r.addEventListener(i,o,{passive:p}):r.addEventListener(i,o,!1)}function yh(r,i,o,c,p){var x=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var _=c.stateNode.containerInfo;if(_===p)break;if(k===4)for(k=c.return;k!==null;){var M=k.tag;if((M===3||M===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;_!==null;){if(k=Pi(_),k===null)return;if(M=k.tag,M===5||M===6||M===26||M===27){c=x=k;continue e}_=_.parentNode}}c=c.return}Ey(function(){var H=x,Q=Rd(o),re=[];e:{var q=rx.get(r);if(q!==void 0){var Y=ru,pe=r;switch(r){case"keypress":if(tu(o)===0)break e;case"keydown":case"keyup":Y=Bj;break;case"focusin":pe="focus",Y=Ud;break;case"focusout":pe="blur",Y=Ud;break;case"beforeblur":case"afterblur":Y=Ud;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Oy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ej;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Hj;break;case Wy:case ex:case tx:Y=Oj;break;case nx:Y=qj;break;case"scroll":case"scrollend":Y=Cj;break;case"wheel":Y=Yj;break;case"copy":case"cut":case"paste":Y=Mj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=My;break;case"toggle":case"beforetoggle":Y=Jj}var _e=(i&4)!==0,at=!_e&&(r==="scroll"||r==="scrollend"),V=_e?q!==null?q+"Capture":null:q;_e=[];for(var $=H,I;$!==null;){var te=$;if(I=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||I===null||V===null||(te=ho($,V),te!=null&&_e.push(qo($,te,I))),at)break;$=$.return}0<_e.length&&(q=new Y(q,pe,null,o,Q),re.push({event:q,listeners:_e}))}}if((i&7)===0){e:{if(q=r==="mouseover"||r==="pointerover",Y=r==="mouseout"||r==="pointerout",q&&o!==Od&&(pe=o.relatedTarget||o.fromElement)&&(Pi(pe)||pe[Li]))break e;if((Y||q)&&(q=Q.window===Q?Q:(q=Q.ownerDocument)?q.defaultView||q.parentWindow:window,Y?(pe=o.relatedTarget||o.toElement,Y=H,pe=pe?Pi(pe):null,pe!==null&&(at=u(pe),_e=pe.tag,pe!==at||_e!==5&&_e!==27&&_e!==6)&&(pe=null)):(Y=null,pe=H),Y!==pe)){if(_e=Oy,te="onMouseLeave",V="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(_e=My,te="onPointerLeave",V="onPointerEnter",$="pointer"),at=Y==null?q:fo(Y),I=pe==null?q:fo(pe),q=new _e(te,$+"leave",Y,o,Q),q.target=at,q.relatedTarget=I,te=null,Pi(Q)===H&&(_e=new _e(V,$+"enter",pe,o,Q),_e.target=I,_e.relatedTarget=at,te=_e),at=te,Y&&pe)t:{for(_e=XC,V=Y,$=pe,I=0,te=V;te;te=_e(te))I++;te=0;for(var ze=$;ze;ze=_e(ze))te++;for(;0<I-te;)V=_e(V),I--;for(;0<te-I;)$=_e($),te--;for(;I--;){if(V===$||$!==null&&V===$.alternate){_e=V;break t}V=_e(V),$=_e($)}_e=null}else _e=null;Y!==null&&_v(re,q,Y,_e,!1),pe!==null&&at!==null&&_v(re,at,pe,_e,!0)}}e:{if(q=H?fo(H):window,Y=q.nodeName&&q.nodeName.toLowerCase(),Y==="select"||Y==="input"&&q.type==="file")var He=Zy;else if(Vy(q))if(Iy)He=sC;else{He=aC;var we=rC}else Y=q.nodeName,!Y||Y.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?H&&Ad(H.elementType)&&(He=Zy):He=iC;if(He&&(He=He(r,H))){By(re,He,o,Q);break e}we&&we(r,q,H),r==="focusout"&&H&&q.type==="number"&&H.memoizedProps.value!=null&&Td(q,"number",q.value)}switch(we=H?fo(H):window,r){case"focusin":(Vy(we)||we.contentEditable==="true")&&(Gi=we,Fd=H,ko=null);break;case"focusout":ko=Fd=Gi=null;break;case"mousedown":qd=!0;break;case"contextmenu":case"mouseup":case"dragend":qd=!1,Ky(re,o,Q);break;case"selectionchange":if(lC)break;case"keydown":case"keyup":Ky(re,o,Q)}var Re;if(Bd)e:{switch(r){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else qi?Py(r,o)&&(Ue="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Ue="onCompositionStart");Ue&&(Dy&&o.locale!=="ko"&&(qi||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&qi&&(Re=Ty()):(da=Q,$d="value"in da?da.value:da.textContent,qi=!0)),we=Gu(H,Ue),0<we.length&&(Ue=new Ry(Ue,r,null,o,Q),re.push({event:Ue,listeners:we}),Re?Ue.data=Re:(Re=Uy(o),Re!==null&&(Ue.data=Re)))),(Re=Qj?Wj(r,o):eC(r,o))&&(Ue=Gu(H,"onBeforeInput"),0<Ue.length&&(we=new Ry("onBeforeInput","beforeinput",null,o,Q),re.push({event:we,listeners:Ue}),we.data=Re)),FC(re,r,H,o,Q)}Sv(re,i)})}function qo(r,i,o){return{instance:r,listener:i,currentTarget:o}}function Gu(r,i){for(var o=i+"Capture",c=[];r!==null;){var p=r,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=ho(r,o),p!=null&&c.unshift(qo(r,p,x)),p=ho(r,i),p!=null&&c.push(qo(r,p,x))),r.tag===3)return c;r=r.return}return[]}function XC(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function _v(r,i,o,c,p){for(var x=i._reactName,k=[];o!==null&&o!==c;){var _=o,M=_.alternate,H=_.stateNode;if(_=_.tag,M!==null&&M===c)break;_!==5&&_!==26&&_!==27||H===null||(M=H,p?(H=ho(o,x),H!=null&&k.unshift(qo(o,H,M))):p||(H=ho(o,x),H!=null&&k.push(qo(o,H,M)))),o=o.return}k.length!==0&&r.push({event:i,listeners:k})}var JC=/\r\n?/g,KC=/\u0000|\uFFFD/g;function jv(r){return(typeof r=="string"?r:""+r).replace(JC,`
|
|
9
|
-
`).replace(KC,"")}function Cv(r,i){return i=jv(i),jv(r)===i}function rt(r,i,o,c,p,x){switch(o){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Ii(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Ii(r,""+c);break;case"className":Kl(r,"class",c);break;case"tabIndex":Kl(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Kl(r,o,c);break;case"style":Cy(r,c,x);break;case"data":if(i!=="object"){Kl(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||o!=="href")){r.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=Wl(""+c),r.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(o,"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 x=="function"&&(o==="formAction"?(i!=="input"&&rt(r,i,"name",p.name,p,null),rt(r,i,"formEncType",p.formEncType,p,null),rt(r,i,"formMethod",p.formMethod,p,null),rt(r,i,"formTarget",p.formTarget,p,null)):(rt(r,i,"encType",p.encType,p,null),rt(r,i,"method",p.method,p,null),rt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=Wl(""+c),r.setAttribute(o,c);break;case"onClick":c!=null&&(r.onclick=Ur);break;case"onScroll":c!=null&&Le("scroll",r);break;case"onScrollEnd":c!=null&&Le("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}o=Wl(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(o,""+c):r.removeAttribute(o);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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(o,""):r.removeAttribute(o);break;case"capture":case"download":c===!0?r.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(o,c):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(o,c):r.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(o):r.setAttribute(o,c);break;case"popover":Le("beforetoggle",r),Le("toggle",r),Jl(r,"popover",c);break;case"xlinkActuate":Pr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Pr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Pr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Pr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Pr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Pr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Pr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Pr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Pr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Jl(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=_j.get(o)||o,Jl(r,o,c))}}function xh(r,i,o,c,p,x){switch(o){case"style":Cy(r,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"children":typeof c=="string"?Ii(r,c):(typeof c=="number"||typeof c=="bigint")&&Ii(r,""+c);break;case"onScroll":c!=null&&Le("scroll",r);break;case"onScrollEnd":c!=null&&Le("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Ur);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xy.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),i=o.slice(2,p?o.length-7:void 0),x=r[Sn]||null,x=x!=null?x[o]:null,typeof x=="function"&&r.removeEventListener(i,x,p),typeof c=="function")){typeof x!="function"&&x!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(i,c,p);break e}o in r?r[o]=c:c===!0?r.setAttribute(o,""):Jl(r,o,c)}}}function an(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",r),Le("load",r);var c=!1,p=!1,x;for(x in o)if(o.hasOwnProperty(x)){var k=o[x];if(k!=null)switch(x){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:rt(r,i,x,k,o,null)}}p&&rt(r,i,"srcSet",o.srcSet,o,null),c&&rt(r,i,"src",o.src,o,null);return;case"input":Le("invalid",r);var _=x=k=p=null,M=null,H=null;for(c in o)if(o.hasOwnProperty(c)){var Q=o[c];if(Q!=null)switch(c){case"name":p=Q;break;case"type":k=Q;break;case"checked":M=Q;break;case"defaultChecked":H=Q;break;case"value":x=Q;break;case"defaultValue":_=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:rt(r,i,c,Q,o,null)}}Sy(r,x,_,M,H,k,p,!1);return;case"select":Le("invalid",r),c=k=x=null;for(p in o)if(o.hasOwnProperty(p)&&(_=o[p],_!=null))switch(p){case"value":x=_;break;case"defaultValue":k=_;break;case"multiple":c=_;default:rt(r,i,p,_,o,null)}i=x,o=k,r.multiple=!!c,i!=null?Zi(r,!!c,i,!1):o!=null&&Zi(r,!!c,o,!0);return;case"textarea":Le("invalid",r),x=p=c=null;for(k in o)if(o.hasOwnProperty(k)&&(_=o[k],_!=null))switch(k){case"value":c=_;break;case"defaultValue":p=_;break;case"children":x=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:rt(r,i,k,_,o,null)}_y(r,c,p,x);return;case"option":for(M in o)o.hasOwnProperty(M)&&(c=o[M],c!=null)&&(M==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":rt(r,i,M,c,o,null));return;case"dialog":Le("beforetoggle",r),Le("toggle",r),Le("cancel",r),Le("close",r);break;case"iframe":case"object":Le("load",r);break;case"video":case"audio":for(c=0;c<Fo.length;c++)Le(Fo[c],r);break;case"image":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"embed":case"source":case"link":Le("error",r),Le("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in o)if(o.hasOwnProperty(H)&&(c=o[H],c!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:rt(r,i,H,c,o,null)}return;default:if(Ad(i)){for(Q in o)o.hasOwnProperty(Q)&&(c=o[Q],c!==void 0&&xh(r,i,Q,c,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(c=o[_],c!=null&&rt(r,i,_,c,o,null))}function QC(r,i,o,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,k=null,_=null,M=null,H=null,Q=null;for(Y in o){var re=o[Y];if(o.hasOwnProperty(Y)&&re!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":M=re;default:c.hasOwnProperty(Y)||rt(r,i,Y,null,c,re)}}for(var q in c){var Y=c[q];if(re=o[q],c.hasOwnProperty(q)&&(Y!=null||re!=null))switch(q){case"type":x=Y;break;case"name":p=Y;break;case"checked":H=Y;break;case"defaultChecked":Q=Y;break;case"value":k=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==re&&rt(r,i,q,Y,c,re)}}Ed(r,k,_,M,H,Q,x,p);return;case"select":Y=k=_=q=null;for(x in o)if(M=o[x],o.hasOwnProperty(x)&&M!=null)switch(x){case"value":break;case"multiple":Y=M;default:c.hasOwnProperty(x)||rt(r,i,x,null,c,M)}for(p in c)if(x=c[p],M=o[p],c.hasOwnProperty(p)&&(x!=null||M!=null))switch(p){case"value":q=x;break;case"defaultValue":_=x;break;case"multiple":k=x;default:x!==M&&rt(r,i,p,x,c,M)}i=_,o=k,c=Y,q!=null?Zi(r,!!o,q,!1):!!c!=!!o&&(i!=null?Zi(r,!!o,i,!0):Zi(r,!!o,o?[]:"",!1));return;case"textarea":Y=q=null;for(_ in o)if(p=o[_],o.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:rt(r,i,_,null,c,p)}for(k in c)if(p=c[k],x=o[k],c.hasOwnProperty(k)&&(p!=null||x!=null))switch(k){case"value":q=p;break;case"defaultValue":Y=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&&rt(r,i,k,p,c,x)}zy(r,q,Y);return;case"option":for(var pe in o)q=o[pe],o.hasOwnProperty(pe)&&q!=null&&!c.hasOwnProperty(pe)&&(pe==="selected"?r.selected=!1:rt(r,i,pe,null,c,q));for(M in c)q=c[M],Y=o[M],c.hasOwnProperty(M)&&q!==Y&&(q!=null||Y!=null)&&(M==="selected"?r.selected=q&&typeof q!="function"&&typeof q!="symbol":rt(r,i,M,q,c,Y));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 _e in o)q=o[_e],o.hasOwnProperty(_e)&&q!=null&&!c.hasOwnProperty(_e)&&rt(r,i,_e,null,c,q);for(H in c)if(q=c[H],Y=o[H],c.hasOwnProperty(H)&&q!==Y&&(q!=null||Y!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,i));break;default:rt(r,i,H,q,c,Y)}return;default:if(Ad(i)){for(var at in o)q=o[at],o.hasOwnProperty(at)&&q!==void 0&&!c.hasOwnProperty(at)&&xh(r,i,at,void 0,c,q);for(Q in c)q=c[Q],Y=o[Q],!c.hasOwnProperty(Q)||q===Y||q===void 0&&Y===void 0||xh(r,i,Q,q,c,Y);return}}for(var V in o)q=o[V],o.hasOwnProperty(V)&&q!=null&&!c.hasOwnProperty(V)&&rt(r,i,V,null,c,q);for(re in c)q=c[re],Y=o[re],!c.hasOwnProperty(re)||q===Y||q==null&&Y==null||rt(r,i,re,q,c,Y)}function Nv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function WC(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],x=p.transferSize,k=p.initiatorType,_=p.duration;if(x&&_&&Nv(k)){for(k=0,_=p.responseEnd,c+=1;c<o.length;c++){var M=o[c],H=M.startTime;if(H>_)break;var Q=M.transferSize,re=M.initiatorType;Q&&Nv(re)&&(M=M.responseEnd,k+=Q*(M<_?1:(_-H)/(M-H)))}if(--c,i+=8*(x+k)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var bh=null,vh=null;function Yu(r){return r.nodeType===9?r:r.ownerDocument}function Ev(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Tv(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function kh(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var wh=null;function eN(){var r=window.event;return r&&r.type==="popstate"?r===wh?!1:(wh=r,!0):(wh=null,!1)}var Av=typeof setTimeout=="function"?setTimeout:void 0,tN=typeof clearTimeout=="function"?clearTimeout:void 0,Ov=typeof Promise=="function"?Promise:void 0,nN=typeof queueMicrotask=="function"?queueMicrotask:typeof Ov<"u"?function(r){return Ov.resolve(null).then(r).catch(rN)}:Av;function rN(r){setTimeout(function(){throw r})}function Na(r){return r==="head"}function Rv(r,i){var o=i,c=0;do{var p=o.nextSibling;if(r.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){r.removeChild(p),vs(i);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")Go(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,Go(o);for(var x=o.firstChild;x;){var k=x.nextSibling,_=x.nodeName;x[co]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=k}}else o==="body"&&Go(r.ownerDocument.body);o=p}while(o);vs(i)}function Mv(r,i){var o=r;r=0;do{var c=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(r===0)break;r--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||r++;o=c}while(o)}function Sh(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Sh(o),Cd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function aN(r,i,o,c){for(;r.nodeType===1;){var p=o;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[co])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(x=r.getAttribute("rel"),x==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(x!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(x=r.getAttribute("src"),(x!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===x)return r}else return r;if(r=nr(r.nextSibling),r===null)break}return null}function iN(r,i,o){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=nr(r.nextSibling),r===null))return null;return r}function Dv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=nr(r.nextSibling),r===null))return null;return r}function zh(r){return r.data==="$?"||r.data==="$~"}function _h(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function sN(r,i){var o=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||o.readyState!=="loading")i();else{var c=function(){i(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function nr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var jh=null;function $v(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="/$"||o==="/&"){if(i===0)return nr(r.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}r=r.nextSibling}return null}function Lv(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return r;i--}else o!=="/$"&&o!=="/&"||i++}r=r.previousSibling}return null}function Pv(r,i,o){switch(i=Yu(o),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Go(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Cd(r)}var rr=new Map,Uv=new Set;function Xu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ta=J.d;J.d={f:oN,r:lN,D:uN,C:cN,L:dN,m:fN,X:mN,S:hN,M:pN};function oN(){var r=ta.f(),i=Vu();return r||i}function lN(r){var i=Ui(r);i!==null&&i.tag===5&&i.type==="form"?nb(i):ta.r(r)}var ys=typeof document>"u"?null:document;function Vv(r,i,o){var c=ys;if(c&&typeof i=="string"&&i){var p=Xn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Uv.has(p)||(Uv.add(p),r={rel:r,crossOrigin:o,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),an(i,"link",r),Qt(i),c.head.appendChild(i)))}}function uN(r){ta.D(r),Vv("dns-prefetch",r,null)}function cN(r,i){ta.C(r,i),Vv("preconnect",r,i)}function dN(r,i,o){ta.L(r,i,o);var c=ys;if(c&&r&&i){var p='link[rel="preload"][as="'+Xn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Xn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Xn(o.imageSizes)+'"]')):p+='[href="'+Xn(r)+'"]';var x=p;switch(i){case"style":x=xs(r);break;case"script":x=bs(r)}rr.has(x)||(r=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),rr.set(x,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Yo(x))||i==="script"&&c.querySelector(Xo(x))||(i=c.createElement("link"),an(i,"link",r),Qt(i),c.head.appendChild(i)))}}function fN(r,i){ta.m(r,i);var o=ys;if(o&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Xn(c)+'"][href="'+Xn(r)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=bs(r)}if(!rr.has(x)&&(r=y({rel:"modulepreload",href:r},i),rr.set(x,r),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Xo(x)))return}c=o.createElement("link"),an(c,"link",r),Qt(c),o.head.appendChild(c)}}}function hN(r,i,o){ta.S(r,i,o);var c=ys;if(c&&r){var p=Vi(c).hoistableStyles,x=xs(r);i=i||"default";var k=p.get(x);if(!k){var _={loading:0,preload:null};if(k=c.querySelector(Yo(x)))_.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},o),(o=rr.get(x))&&Ch(r,o);var M=k=c.createElement("link");Qt(M),an(M,"link",r),M._p=new Promise(function(H,Q){M.onload=H,M.onerror=Q}),M.addEventListener("load",function(){_.loading|=1}),M.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Ju(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:_},p.set(x,k)}}}function mN(r,i){ta.X(r,i);var o=ys;if(o&&r){var c=Vi(o).hoistableScripts,p=bs(r),x=c.get(p);x||(x=o.querySelector(Xo(p)),x||(r=y({src:r,async:!0},i),(i=rr.get(p))&&Nh(r,i),x=o.createElement("script"),Qt(x),an(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function pN(r,i){ta.M(r,i);var o=ys;if(o&&r){var c=Vi(o).hoistableScripts,p=bs(r),x=c.get(p);x||(x=o.querySelector(Xo(p)),x||(r=y({src:r,async:!0,type:"module"},i),(i=rr.get(p))&&Nh(r,i),x=o.createElement("script"),Qt(x),an(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Bv(r,i,o,c){var p=(p=D.current)?Xu(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=xs(o.href),o=Vi(p).hoistableStyles,c=o.get(i),c||(c={type:"style",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=xs(o.href);var x=Vi(p).hoistableStyles,k=x.get(r);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(r,k),(x=p.querySelector(Yo(r)))&&!x._p&&(k.instance=x,k.state.loading=5),rr.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},rr.set(r,o),x||gN(p,r,o,k.state))),i&&c===null)throw Error(a(528,""));return k}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=bs(o),o=Vi(p).hoistableScripts,c=o.get(i),c||(c={type:"script",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function xs(r){return'href="'+Xn(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function Zv(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function gN(r,i,o,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),an(i,"link",o),Qt(i),r.head.appendChild(i))}function bs(r){return'[src="'+Xn(r)+'"]'}function Xo(r){return"script[async]"+r}function Iv(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+Xn(o.href)+'"]');if(c)return i.instance=c,Qt(c),c;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Qt(c),an(c,"style",p),Ju(c,o.precedence,r),i.instance=c;case"stylesheet":p=xs(o.href);var x=r.querySelector(Yo(p));if(x)return i.state.loading|=4,i.instance=x,Qt(x),x;c=Zv(o),(p=rr.get(p))&&Ch(c,p),x=(r.ownerDocument||r).createElement("link"),Qt(x);var k=x;return k._p=new Promise(function(_,M){k.onload=_,k.onerror=M}),an(x,"link",c),i.state.loading|=4,Ju(x,o.precedence,r),i.instance=x;case"script":return x=bs(o.src),(p=r.querySelector(Xo(x)))?(i.instance=p,Qt(p),p):(c=o,(p=rr.get(x))&&(c=y({},o),Nh(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Qt(p),an(p,"link",c),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Ju(c,o.precedence,r));return i.instance}function Ju(r,i,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,x=p,k=0;k<c.length;k++){var _=c[k];if(_.dataset.precedence===i)x=_;else if(x!==p)break}x?x.parentNode.insertBefore(r,x.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(r,i.firstChild))}function Ch(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Nh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Ku=null;function Hv(r,i,o){if(Ku===null){var c=new Map,p=Ku=new Map;p.set(o,c)}else p=Ku,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(r))return c;for(c.set(r,null),o=o.getElementsByTagName(r),p=0;p<o.length;p++){var x=o[p];if(!(x[co]||x[en]||r==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(i)||"";k=r+k;var _=c.get(k);_?_.push(x):c.set(k,[x])}}return c}function Fv(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function yN(r,i,o){if(o===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function qv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function xN(r,i,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=xs(c.href),x=i.querySelector(Yo(p));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Qu.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=x,Qt(x);return}x=i.ownerDocument||i,c=Zv(c),(p=rr.get(p))&&Ch(c,p),x=x.createElement("link"),Qt(x);var k=x;k._p=new Promise(function(_,M){k.onload=_,k.onerror=M}),an(x,"link",c),o.instance=x}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=Qu.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var Eh=0;function bN(r,i){return r.stylesheets&&r.count===0&&ec(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var c=setTimeout(function(){if(r.stylesheets&&ec(r,r.stylesheets),r.unsuspend){var x=r.unsuspend;r.unsuspend=null,x()}},6e4+i);0<r.imgBytes&&Eh===0&&(Eh=62500*WC());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ec(r,r.stylesheets),r.unsuspend)){var x=r.unsuspend;r.unsuspend=null,x()}},(r.imgBytes>Eh?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ec(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Wu=null;function ec(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Wu=new Map,i.forEach(vN,r),Wu=null,Qu.call(r))}function vN(r,i){if(!(i.state.loading&4)){var o=Wu.get(r);if(o)var c=o.get(null);else{o=new Map,Wu.set(r,o);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var k=p[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(o.set(k.dataset.precedence,k),c=k)}c&&o.set(null,c)}p=i.instance,k=p.getAttribute("data-precedence"),x=o.get(k)||c,x===c&&o.set(null,p),o.set(k,p),this.count++,c=Qu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),x?x.parentNode.insertBefore(p,x.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Jo={$$typeof:C,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function kN(r,i,o,c,p,x,k,_,M){this.tag=1,this.containerInfo=r,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=Sd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sd(0),this.hiddenUpdates=Sd(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Gv(r,i,o,c,p,x,k,_,M,H,Q,re){return r=new kN(r,i,o,k,M,H,Q,re,_),i=1,x===!0&&(i|=24),x=Ln(3,null,null,i),r.current=x,x.stateNode=r,i=lf(),i.refCount++,r.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:o,cache:i},ff(x),r}function Yv(r){return r?(r=Ji,r):Ji}function Xv(r,i,o,c,p,x){p=Yv(p),c.context===null?c.context=p:c.pendingContext=p,c=ya(i),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=xa(r,c,i),o!==null&&(En(o,r,i),No(o,r,i))}function Jv(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function Th(r,i){Jv(r,i),(r=r.alternate)&&Jv(r,i)}function Kv(r){if(r.tag===13||r.tag===31){var i=ii(r,67108864);i!==null&&En(i,r,67108864),Th(r,67108864)}}function Qv(r){if(r.tag===13||r.tag===31){var i=Zn();i=zd(i);var o=ii(r,i);o!==null&&En(o,r,i),Th(r,i)}}var tc=!0;function wN(r,i,o,c){var p=L.T;L.T=null;var x=J.p;try{J.p=2,Ah(r,i,o,c)}finally{J.p=x,L.T=p}}function SN(r,i,o,c){var p=L.T;L.T=null;var x=J.p;try{J.p=8,Ah(r,i,o,c)}finally{J.p=x,L.T=p}}function Ah(r,i,o,c){if(tc){var p=Oh(c);if(p===null)yh(r,i,c,nc,o),e0(r,c);else if(_N(p,r,i,o,c))c.stopPropagation();else if(e0(r,c),i&4&&-1<zN.indexOf(r)){for(;p!==null;){var x=Ui(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=ei(x.pendingLanes);if(k!==0){var _=x;for(_.pendingLanes|=2,_.entangledLanes|=2;k;){var M=1<<31-ot(k);_.entanglements[1]|=M,k&=~M}Sr(x),(qe&6)===0&&(Pu=mt()+500,Ho(0))}}break;case 31:case 13:_=ii(x,2),_!==null&&En(_,x,2),Vu(),Th(x,2)}if(x=Oh(c),x===null&&yh(r,i,c,nc,o),x===p)break;p=x}p!==null&&c.stopPropagation()}else yh(r,i,c,null,o)}}function Oh(r){return r=Rd(r),Rh(r)}var nc=null;function Rh(r){if(nc=null,r=Pi(r),r!==null){var i=u(r);if(i===null)r=null;else{var o=i.tag;if(o===13){if(r=l(i),r!==null)return r;r=null}else if(o===31){if(r=d(i),r!==null)return r;r=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return nc=r,null}function Wv(r){switch(r){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($i()){case W:return 2;case de:return 8;case ke:case Ce:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Mh=!1,Ea=null,Ta=null,Aa=null,Ko=new Map,Qo=new Map,Oa=[],zN="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 e0(r,i){switch(r){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":Ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(i.pointerId)}}function Wo(r,i,o,c,p,x){return r===null||r.nativeEvent!==x?(r={blockedOn:i,domEventName:o,eventSystemFlags:c,nativeEvent:x,targetContainers:[p]},i!==null&&(i=Ui(i),i!==null&&Kv(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function _N(r,i,o,c,p){switch(i){case"focusin":return Ea=Wo(Ea,r,i,o,c,p),!0;case"dragenter":return Ta=Wo(Ta,r,i,o,c,p),!0;case"mouseover":return Aa=Wo(Aa,r,i,o,c,p),!0;case"pointerover":var x=p.pointerId;return Ko.set(x,Wo(Ko.get(x)||null,r,i,o,c,p)),!0;case"gotpointercapture":return x=p.pointerId,Qo.set(x,Wo(Qo.get(x)||null,r,i,o,c,p)),!0}return!1}function t0(r){var i=Pi(r.target);if(i!==null){var o=u(i);if(o!==null){if(i=o.tag,i===13){if(i=l(o),i!==null){r.blockedOn=i,py(r.priority,function(){Qv(o)});return}}else if(i===31){if(i=d(o),i!==null){r.blockedOn=i,py(r.priority,function(){Qv(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){r.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}r.blockedOn=null}function rc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=Oh(r.nativeEvent);if(o===null){o=r.nativeEvent;var c=new o.constructor(o.type,o);Od=c,o.target.dispatchEvent(c),Od=null}else return i=Ui(o),i!==null&&Kv(i),r.blockedOn=o,!1;i.shift()}return!0}function n0(r,i,o){rc(r)&&o.delete(i)}function jN(){Mh=!1,Ea!==null&&rc(Ea)&&(Ea=null),Ta!==null&&rc(Ta)&&(Ta=null),Aa!==null&&rc(Aa)&&(Aa=null),Ko.forEach(n0),Qo.forEach(n0)}function ac(r,i){r.blockedOn===i&&(r.blockedOn=null,Mh||(Mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jN)))}var ic=null;function r0(r){ic!==r&&(ic=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ic===r&&(ic=null);for(var i=0;i<r.length;i+=3){var o=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Rh(c||o)===null)continue;break}var x=Ui(o);x!==null&&(r.splice(i,3),i-=3,Of(x,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function vs(r){function i(M){return ac(M,r)}Ea!==null&&ac(Ea,r),Ta!==null&&ac(Ta,r),Aa!==null&&ac(Aa,r),Ko.forEach(i),Qo.forEach(i);for(var o=0;o<Oa.length;o++){var c=Oa[o];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Oa.length&&(o=Oa[0],o.blockedOn===null);)t0(o),o.blockedOn===null&&Oa.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],x=o[c+1],k=p[Sn]||null;if(typeof x=="function")k||r0(o);else if(k){var _=null;if(x&&x.hasAttribute("formAction")){if(p=x,k=x[Sn]||null)_=k.formAction;else if(Rh(p)!==null)continue}else _=k.action;typeof _=="function"?o[c+1]=_:(o.splice(c,3),c-=3),r0(o)}}}function a0(){function r(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Dh(r){this._internalRoot=r}sc.prototype.render=Dh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,c=Zn();Xv(o,c,r,i,null,null)},sc.prototype.unmount=Dh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Xv(r.current,2,null,r,null,null),Vu(),i[Li]=null}};function sc(r){this._internalRoot=r}sc.prototype.unstable_scheduleHydration=function(r){if(r){var i=my();r={blockedOn:null,target:r,priority:i};for(var o=0;o<Oa.length&&i!==0&&i<Oa[o].priority;o++);Oa.splice(o,0,r),o===0&&t0(r)}};var i0=t.version;if(i0!=="19.2.4")throw Error(a(527,i0,"19.2.4"));J.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var CN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{pn=oc.inject(CN),qt=oc}catch{}}return tl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var o=!1,c="",p=fb,x=hb,k=mb;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=Gv(r,1,!1,null,null,o,c,null,p,x,k,a0),r[Li]=i.current,gh(r),new Dh(i)},tl.hydrateRoot=function(r,i,o){if(!s(r))throw Error(a(299));var c=!1,p="",x=fb,k=hb,_=mb,M=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(x=o.onUncaughtError),o.onCaughtError!==void 0&&(k=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(M=o.formState)),i=Gv(r,1,!0,i,o??null,c,p,M,x,k,_,a0),i.context=Yv(null),o=i.current,c=Zn(),c=zd(c),p=ya(c),p.callback=null,xa(o,p,c),o=c,i.current.lanes=o,uo(i,o),Sr(i),r[Li]=i.current,gh(r),new sc(i)},tl.version="19.2.4",tl}var p0;function LN(){if(p0)return Ph.exports;p0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ph.exports=$N(),Ph.exports}var PN=LN();var g0="popstate";function UN(e={}){function t(a,s){let{pathname:u,search:l,hash:d}=a.location;return Vm("",{pathname:u,search:l,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:wl(s)}return BN(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function VN(){return Math.random().toString(36).substring(2,10)}function y0(e,t){return{usr:e.state,key:e.key,idx:t}}function Vm(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Js(t):t,state:n,key:t&&t.key||a||VN()}}function wl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Js(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function BN(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:u=!1}=a,l=s.history,d="POP",h=null,m=g();m==null&&(m=0,l.replaceState({...l.state,idx:m},""));function g(){return(l.state||{idx:null}).idx}function y(){d="POP";let E=g(),N=E==null?null:E-m;m=E,h&&h({action:d,location:j.location,delta:N})}function b(E,N){d="PUSH";let O=Vm(j.location,E,N);m=g()+1;let C=y0(O,m),P=j.createHref(O);try{l.pushState(C,"",P)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;s.location.assign(P)}u&&h&&h({action:d,location:j.location,delta:1})}function v(E,N){d="REPLACE";let O=Vm(j.location,E,N);m=g();let C=y0(O,m),P=j.createHref(O);l.replaceState(C,"",P),u&&h&&h({action:d,location:j.location,delta:0})}function S(E){return ZN(E)}let j={get action(){return d},get location(){return e(s,l)},listen(E){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(g0,y),h=E,()=>{s.removeEventListener(g0,y),h=null}},createHref(E){return t(s,E)},createURL:S,encodeLocation(E){let N=S(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:v,go(E){return l.go(E)}};return j}function ZN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:wl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function qw(e,t,n="/"){return IN(e,t,n,!1)}function IN(e,t,n,a){let s=typeof t=="string"?Js(t):t,u=oa(s.pathname||"/",n);if(u==null)return null;let l=Gw(e);HN(l);let d=null;for(let h=0;d==null&&h<l.length;++h){let m=tE(u);d=WN(l[h],m,a)}return d}function Gw(e,t=[],n=[],a="",s=!1){let u=(l,d,h=s,m)=>{let g={relativePath:m===void 0?l.path||"":m,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;bt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let y=ia([a,g.relativePath]),b=n.concat(g);l.children&&l.children.length>0&&(bt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Gw(l.children,t,b,y,h)),!(l.path==null&&!l.index)&&t.push({path:y,score:KN(y,l.index),routesMeta:b})};return e.forEach((l,d)=>{if(l.path===""||!l.path?.includes("?"))u(l,d);else for(let h of Yw(l.path))u(l,d,!0,h)}),t}function Yw(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),u=n.replace(/\?$/,"");if(a.length===0)return s?[u,""]:[u];let l=Yw(a.join("/")),d=[];return d.push(...l.map(h=>h===""?u:[u,h].join("/"))),s&&d.push(...l),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function HN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:QN(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var FN=/^:[\w-]+$/,qN=3,GN=2,YN=1,XN=10,JN=-2,x0=e=>e==="*";function KN(e,t){let n=e.split("/"),a=n.length;return n.some(x0)&&(a+=JN),t&&(a+=GN),n.filter(s=>!x0(s)).reduce((s,u)=>s+(FN.test(u)?qN:u===""?YN:XN),a)}function QN(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function WN(e,t,n=!1){let{routesMeta:a}=e,s={},u="/",l=[];for(let d=0;d<a.length;++d){let h=a[d],m=d===a.length-1,g=u==="/"?t:t.slice(u.length)||"/",y=Lc({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),b=h.route;if(!y&&m&&n&&!a[a.length-1].route.index&&(y=Lc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!y)return null;Object.assign(s,y.params),l.push({params:s,pathname:ia([u,y.pathname]),pathnameBase:iE(ia([u,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(u=ia([u,y.pathnameBase]))}return l}function Lc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=eE(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let u=s[0],l=u.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:y},b)=>{if(g==="*"){let S=d[b]||"";l=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const v=d[b];return y&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function eE(e,t=!1,n=!0){xr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,h)=>(a.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function tE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function oa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var nE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function rE(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Js(e):e,u;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?u=b0(n.substring(1),"/"):u=b0(n,t)):u=t,{pathname:u,search:sE(a),hash:oE(s)}}function b0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Zh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fp(e){let t=aE(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function qp(e,t,n,a=!1){let s;typeof e=="string"?s=Js(e):(s={...e},bt(!s.pathname||!s.pathname.includes("?"),Zh("?","pathname","search",s)),bt(!s.pathname||!s.pathname.includes("#"),Zh("#","pathname","hash",s)),bt(!s.search||!s.search.includes("#"),Zh("#","search","hash",s)));let u=e===""||s.pathname==="",l=u?"/":s.pathname,d;if(l==null)d=n;else{let y=t.length-1;if(!a&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),y-=1;s.pathname=b.join("/")}d=y>=0?t[y]:"/"}let h=rE(s,d),m=l&&l!=="/"&&l.endsWith("/"),g=(u||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var ia=e=>e.join("/").replace(/\/\/+/g,"/"),iE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,lE=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function cE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Xw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jw(e,t){let n=e;if(typeof n!="string"||!nE.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(Xw)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),d=oa(l.pathname,t);l.origin===u.origin&&d!=null?n=d+l.search+l.hash:s=!0}catch{xr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Kw=["POST","PUT","PATCH","DELETE"];new Set(Kw);var dE=["GET",...Kw];new Set(dE);var Ks=z.createContext(null);Ks.displayName="DataRouter";var ad=z.createContext(null);ad.displayName="DataRouterState";var fE=z.createContext(!1),Qw=z.createContext({isTransitioning:!1});Qw.displayName="ViewTransition";var hE=z.createContext(new Map);hE.displayName="Fetchers";var mE=z.createContext(null);mE.displayName="Await";var Fn=z.createContext(null);Fn.displayName="Navigation";var $l=z.createContext(null);$l.displayName="Location";var $r=z.createContext({outlet:null,matches:[],isDataRoute:!1});$r.displayName="Route";var Gp=z.createContext(null);Gp.displayName="RouteError";var Ww="REACT_ROUTER_ERROR",pE="REDIRECT",gE="ROUTE_ERROR_RESPONSE";function yE(e){if(e.startsWith(`${Ww}:${pE}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function xE(e){if(e.startsWith(`${Ww}:${gE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new lE(t.status,t.statusText,t.data)}catch{}}function bE(e,{relative:t}={}){bt(Qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=z.useContext(Fn),{hash:s,pathname:u,search:l}=Ll(e,{relative:t}),d=u;return n!=="/"&&(d=u==="/"?n:ia([n,u])),a.createHref({pathname:d,search:l,hash:s})}function Qs(){return z.useContext($l)!=null}function br(){return bt(Qs(),"useLocation() may be used only in the context of a <Router> component."),z.useContext($l).location}var eS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tS(e){z.useContext(Fn).static||z.useLayoutEffect(e)}function Yp(){let{isDataRoute:e}=z.useContext($r);return e?OE():vE()}function vE(){bt(Qs(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(Ks),{basename:t,navigator:n}=z.useContext(Fn),{matches:a}=z.useContext($r),{pathname:s}=br(),u=JSON.stringify(Fp(a)),l=z.useRef(!1);return tS(()=>{l.current=!0}),z.useCallback((h,m={})=>{if(xr(l.current,eS),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=qp(h,JSON.parse(u),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ia([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,u,s,e])}z.createContext(null);function Ll(e,{relative:t}={}){let{matches:n}=z.useContext($r),{pathname:a}=br(),s=JSON.stringify(Fp(n));return z.useMemo(()=>qp(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function kE(e,t){return nS(e,t)}function nS(e,t,n,a,s){bt(Qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=z.useContext(Fn),{matches:l}=z.useContext($r),d=l[l.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",y=d&&d.route;{let O=y&&y.path||"";aS(m,!y||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${O}">) 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.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let b=br(),v;if(t){let O=typeof t=="string"?Js(t):t;bt(g==="/"||O.pathname?.startsWith(g),`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 "${g}" but pathname "${O.pathname}" was given in the \`location\` prop.`),v=O}else v=b;let S=v.pathname||"/",j=S;if(g!=="/"){let O=g.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(O.length).join("/")}let E=qw(e,{pathname:j});xr(y||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),xr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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=jE(E&&E.map(O=>Object.assign({},O,{params:Object.assign({},h,O.params),pathname:ia([g,u.encodeLocation?u.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?g:ia([g,u.encodeLocation?u.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),l,n,a,s);return t&&N?z.createElement($l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},N):N}function wE(){let e=AE(),t=uE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:u},"ErrorBoundary")," or"," ",z.createElement("code",{style:u},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},t),n?z.createElement("pre",{style:s},n):null,l)}var SE=z.createElement(wE,null),rS=class extends z.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=xE(e.digest);n&&(e=n)}let t=e!==void 0?z.createElement($r.Provider,{value:this.props.routeContext},z.createElement(Gp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(zE,{error:e},t):t}};rS.contextType=fE;var Ih=new WeakMap;function zE({children:e,error:t}){let{basename:n}=z.useContext(Fn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=yE(t.digest);if(a){let s=Ih.get(t);if(s)throw s;let u=Jw(a.location,n);if(Xw&&!Ih.get(t))if(u.isExternal||a.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:a.replace}));throw Ih.set(t,l),l}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function _E({routeContext:e,match:t,children:n}){let a=z.useContext(Ks);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),z.createElement($r.Provider,{value:e},n)}function jE(e,t=[],n=null,a=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let u=e,l=n?.errors;if(l!=null){let g=u.findIndex(y=>y.route.id&&l?.[y.route.id]!==void 0);bt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let d=!1,h=-1;if(n)for(let g=0;g<u.length;g++){let y=u[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(h=g),y.route.id){let{loaderData:b,errors:v}=n,S=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!v||v[y.route.id]===void 0);if(y.route.lazy||S){d=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let m=n&&a?(g,y)=>{a(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:cE(n.matches),errorInfo:y})}:void 0;return u.reduceRight((g,y,b)=>{let v,S=!1,j=null,E=null;n&&(v=l&&y.route.id?l[y.route.id]:void 0,j=y.route.errorElement||SE,d&&(h<0&&b===0?(aS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):h===b&&(S=!0,E=y.route.hydrateFallbackElement||null)));let N=t.concat(u.slice(0,b+1)),O=()=>{let C;return v?C=j:S?C=E:y.route.Component?C=z.createElement(y.route.Component,null):y.route.element?C=y.route.element:C=g,z.createElement(_E,{match:y,routeContext:{outlet:g,matches:N,isDataRoute:n!=null},children:C})};return n&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?z.createElement(rS,{location:n.location,revalidation:n.revalidation,component:j,error:v,children:O(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:m}):O()},null)}function Xp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function CE(e){let t=z.useContext(Ks);return bt(t,Xp(e)),t}function NE(e){let t=z.useContext(ad);return bt(t,Xp(e)),t}function EE(e){let t=z.useContext($r);return bt(t,Xp(e)),t}function Jp(e){let t=EE(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function TE(){return Jp("useRouteId")}function AE(){let e=z.useContext(Gp),t=NE("useRouteError"),n=Jp("useRouteError");return e!==void 0?e:t.errors?.[n]}function OE(){let{router:e}=CE("useNavigate"),t=Jp("useNavigate"),n=z.useRef(!1);return tS(()=>{n.current=!0}),z.useCallback(async(s,u={})=>{xr(n.current,eS),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...u}))},[e,t])}var v0={};function aS(e,t,n){!t&&!v0[e]&&(v0[e]=!0,xr(!1,n))}z.memo(RE);function RE({routes:e,future:t,state:n,onError:a}){return nS(e,void 0,n,a,t)}function iS({to:e,replace:t,state:n,relative:a}){bt(Qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=z.useContext(Fn);xr(!s,"<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}=z.useContext($r),{pathname:l}=br(),d=Yp(),h=qp(e,Fp(u),l,a==="path"),m=JSON.stringify(h);return z.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:a})},[d,m,a,t,n]),null}function sn(e){bt(!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 ME({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:u=!1,unstable_useTransitions:l}){bt(!Qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=z.useMemo(()=>({basename:d,navigator:s,static:u,unstable_useTransitions:l,future:{}}),[d,s,u,l]);typeof n=="string"&&(n=Js(n));let{pathname:m="/",search:g="",hash:y="",state:b=null,key:v="default"}=n,S=z.useMemo(()=>{let j=oa(m,d);return j==null?null:{location:{pathname:j,search:g,hash:y,state:b,key:v},navigationType:a}},[d,m,g,y,b,v,a]);return xr(S!=null,`<Router basename="${d}"> is not able to match the URL "${m}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:z.createElement(Fn.Provider,{value:h},z.createElement($l.Provider,{children:t,value:S}))}function k0({children:e,location:t}){return kE(Bm(e),t)}function Bm(e,t=[]){let n=[];return z.Children.forEach(e,(a,s)=>{if(!z.isValidElement(a))return;let u=[...t,s];if(a.type===z.Fragment){n.push.apply(n,Bm(a.props.children,u));return}bt(a.type===sn,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(l.children=Bm(a.props.children,u)),n.push(l)}),n}var Ec="get",Tc="application/x-www-form-urlencoded";function id(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function DE(e){return id(e)&&e.tagName.toLowerCase()==="button"}function $E(e){return id(e)&&e.tagName.toLowerCase()==="form"}function LE(e){return id(e)&&e.tagName.toLowerCase()==="input"}function PE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function UE(e,t){return e.button===0&&(!t||t==="_self")&&!PE(e)}var lc=null;function VE(){if(lc===null)try{new FormData(document.createElement("form"),0),lc=!1}catch{lc=!0}return lc}var BE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hh(e){return e!=null&&!BE.has(e)?(xr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tc}"`),null):e}function ZE(e,t){let n,a,s,u,l;if($E(e)){let d=e.getAttribute("action");a=d?oa(d,t):null,n=e.getAttribute("method")||Ec,s=Hh(e.getAttribute("enctype"))||Tc,u=new FormData(e)}else if(DE(e)||LE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?oa(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Ec,s=Hh(e.getAttribute("formenctype"))||Hh(d.getAttribute("enctype"))||Tc,u=new FormData(d,e),!VE()){let{name:m,type:g,value:y}=e;if(g==="image"){let b=m?`${m}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else m&&u.append(m,y)}}else{if(id(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ec,a=null,s=Tc,l=e}return u&&s==="text/plain"&&(l=u,u=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:u,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Kp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function IE(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&oa(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function HE(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function FE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function qE(e,t,n){let a=await Promise.all(e.map(async s=>{let u=t.routes[s.route.id];if(u){let l=await HE(u,n);return l.links?l.links():[]}return[]}));return JE(a.flat(1).filter(FE).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function w0(e,t,n,a,s,u){let l=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return u==="assets"?t.filter((h,m)=>l(h,m)||d(h,m)):u==="data"?t.filter((h,m)=>{let g=a.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function GE(e,t,{includeHydrateFallback:n}={}){return YE(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let u=[s.module];return s.clientActionModule&&(u=u.concat(s.clientActionModule)),s.clientLoaderModule&&(u=u.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(u=u.concat(s.hydrateFallbackModule)),s.imports&&(u=u.concat(s.imports)),u}).flat(1))}function YE(e){return[...new Set(e)]}function XE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function JE(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let u=JSON.stringify(XE(s));return n.has(u)||(n.add(u),a.push({key:u,link:s})),a},[])}function sS(){let e=z.useContext(Ks);return Kp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function KE(){let e=z.useContext(ad);return Kp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qp=z.createContext(void 0);Qp.displayName="FrameworkContext";function oS(){let e=z.useContext(Qp);return Kp(e,"You must render this element inside a <HydratedRouter> element"),e}function QE(e,t){let n=z.useContext(Qp),[a,s]=z.useState(!1),[u,l]=z.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:y}=t,b=z.useRef(null);z.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let j=N=>{N.forEach(O=>{l(O.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),z.useEffect(()=>{if(a){let j=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(j)}}},[a]);let v=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[u,b,{}]:[u,b,{onFocus:nl(d,v),onBlur:nl(h,S),onMouseEnter:nl(m,v),onMouseLeave:nl(g,S),onTouchStart:nl(y,v)}]:[!1,b,{}]}function nl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function WE({page:e,...t}){let{router:n}=sS(),a=z.useMemo(()=>qw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?z.createElement(tT,{page:e,matches:a,...t}):null}function eT(e){let{manifest:t,routeModules:n}=oS(),[a,s]=z.useState([]);return z.useEffect(()=>{let u=!1;return qE(e,t,n).then(l=>{u||s(l)}),()=>{u=!0}},[e,t,n]),a}function tT({page:e,matches:t,...n}){let a=br(),{future:s,manifest:u,routeModules:l}=oS(),{basename:d}=sS(),{loaderData:h,matches:m}=KE(),g=z.useMemo(()=>w0(e,t,m,u,a,"data"),[e,t,m,u,a]),y=z.useMemo(()=>w0(e,t,m,u,a,"assets"),[e,t,m,u,a]),b=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(O=>{let C=u.routes[O.route.id];!C||!C.hasLoader||(!g.some(P=>P.route.id===O.route.id)&&O.route.id in h&&l[O.route.id]?.shouldRevalidate||C.hasClientLoader?E=!0:j.add(O.route.id))}),j.size===0)return[];let N=IE(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&N.searchParams.set("_routes",t.filter(O=>j.has(O.route.id)).map(O=>O.route.id).join(",")),[N.pathname+N.search]},[d,s.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),v=z.useMemo(()=>GE(y,u),[y,u]),S=eT(y);return z.createElement(z.Fragment,null,b.map(j=>z.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),v.map(j=>z.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),S.map(({key:j,link:E})=>z.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function nT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var rT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rT&&(window.__reactRouterVersion="7.13.0")}catch{}function aT({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=z.useRef();s.current==null&&(s.current=UN({window:a,v5Compat:!0}));let u=s.current,[l,d]=z.useState({action:u.action,location:u.location}),h=z.useCallback(m=>{n===!1?d(m):z.startTransition(()=>d(m))},[n]);return z.useLayoutEffect(()=>u.listen(h),[u,h]),z.createElement(ME,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:n})}var lS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Va=z.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:u,replace:l,state:d,target:h,to:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...v},S){let{basename:j,unstable_useTransitions:E}=z.useContext(Fn),N=typeof m=="string"&&lS.test(m),O=Jw(m,j);m=O.to;let C=bE(m,{relative:s}),[P,U,R]=QE(a,v),F=lT(m,{replace:l,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function B(fe){t&&t(fe),fe.defaultPrevented||F(fe)}let K=z.createElement("a",{...v,...R,href:O.absoluteURL||C,onClick:O.isExternal||u?t:B,ref:nT(S,U),target:h,"data-discover":!N&&n==="render"?"true":void 0});return P&&!N?z.createElement(z.Fragment,null,K,z.createElement(WE,{page:C})):K});Va.displayName="Link";var iT=z.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:u,to:l,viewTransition:d,children:h,...m},g){let y=Ll(l,{relative:m.relative}),b=br(),v=z.useContext(ad),{navigator:S,basename:j}=z.useContext(Fn),E=v!=null&&hT(y)&&d===!0,N=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,O=b.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(O=O.toLowerCase(),C=C?C.toLowerCase():null,N=N.toLowerCase()),C&&j&&(C=oa(C,j)||C);const P=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let U=O===N||!s&&O.startsWith(N)&&O.charAt(P)==="/",R=C!=null&&(C===N||!s&&C.startsWith(N)&&C.charAt(N.length)==="/"),F={isActive:U,isPending:R,isTransitioning:E},B=U?t:void 0,K;typeof a=="function"?K=a(F):K=[a,U?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(F):u;return z.createElement(Va,{...m,"aria-current":B,className:K,ref:g,style:fe,to:l,viewTransition:d},typeof h=="function"?h(F):h)});iT.displayName="NavLink";var sT=z.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:u,method:l=Ec,action:d,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...v},S)=>{let{unstable_useTransitions:j}=z.useContext(Fn),E=dT(),N=fT(d,{relative:m}),O=l.toLowerCase()==="get"?"get":"post",C=typeof d=="string"&&lS.test(d),P=U=>{if(h&&h(U),U.defaultPrevented)return;U.preventDefault();let R=U.nativeEvent.submitter,F=R?.getAttribute("formmethod")||l,B=()=>E(R||U.currentTarget,{fetcherKey:t,method:F,navigate:n,replace:s,state:u,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b});j&&n!==!1?z.startTransition(()=>B()):B()};return z.createElement("form",{ref:S,method:O,action:N,onSubmit:a?h:P,...v,"data-discover":!C&&e==="render"?"true":void 0})});sT.displayName="Form";function oT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uS(e){let t=z.useContext(Ks);return bt(t,oT(e)),t}function lT(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let m=Yp(),g=br(),y=Ll(e,{relative:u});return z.useCallback(b=>{if(UE(b,t)){b.preventDefault();let v=n!==void 0?n:wl(g)===wl(y),S=()=>m(e,{replace:v,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:d});h?z.startTransition(()=>S()):S()}},[g,m,y,n,a,t,e,s,u,l,d,h])}var uT=0,cT=()=>`__${String(++uT)}__`;function dT(){let{router:e}=uS("useSubmit"),{basename:t}=z.useContext(Fn),n=TE(),a=e.fetch,s=e.navigate;return z.useCallback(async(u,l={})=>{let{action:d,method:h,encType:m,formData:g,body:y}=ZE(u,t);if(l.navigate===!1){let b=l.fetcherKey||cT();await a(b,n,l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:y,formMethod:l.method||h,formEncType:l.encType||m,flushSync:l.flushSync})}else await s(l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:y,formMethod:l.method||h,formEncType:l.encType||m,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[a,s,t,n])}function fT(e,{relative:t}={}){let{basename:n}=z.useContext(Fn),a=z.useContext($r);bt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Ll(e||".",{relative:t})},l=br();if(e==null){u.search=l.search;let d=new URLSearchParams(u.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(y=>y).forEach(y=>d.append("index",y));let g=d.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:ia([n,u.pathname])),wl(u)}function hT(e,{relative:t}={}){let n=z.useContext(Qw);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=uS("useViewTransitionState"),s=Ll(e,{relative:t});if(!n.isTransitioning)return!1;let u=oa(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=oa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Lc(s.pathname,l)!=null||Lc(s.pathname,u)!=null}const cS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const mT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const pT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const S0=e=>{const t=pT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var gT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const yT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const xT=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:u,iconNode:l,...d},h)=>z.createElement("svg",{ref:h,...gT,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:cS("lucide",s),...!u&&!yT(d)&&{"aria-hidden":"true"},...d},[...l.map(([m,g])=>z.createElement(m,g)),...Array.isArray(u)?u:[u]]));const ve=(e,t)=>{const n=z.forwardRef(({className:a,...s},u)=>z.createElement(xT,{ref:u,iconNode:t,className:cS(`lucide-${mT(S0(e))}`,`lucide-${e}`,a),...s}));return n.displayName=S0(e),n};const bT=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ns=ve("activity",bT);const vT=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],kT=ve("archive",vT);const wT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],dS=ve("arrow-down",wT);const ST=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zT=ve("arrow-left",ST);const _T=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],fS=ve("arrow-up",_T);const jT=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],CT=ve("ban",jT);const NT=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Sl=ve("bell",NT);const ET=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],z0=ve("bot",ET);const TT=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],AT=ve("box",TT);const OT=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],RT=ve("brain",OT);const MT=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],hS=ve("calendar",MT);const DT=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Zm=ve("chart-column",DT);const $T=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],LT=ve("check-check",$T);const PT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Im=ve("check",PT);const UT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],VT=ve("chevron-down",UT);const BT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ZT=ve("chevron-right",BT);const IT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],HT=ve("chevron-up",IT);const FT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mS=ve("circle-check",FT);const qT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Hm=ve("circle-x",qT);const GT=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Za=ve("clock",GT);const YT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],XT=ve("copy",YT);const JT=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],pS=ve("cpu",JT);const KT=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$s=ve("database",KT);const QT=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Pc=ve("dollar-sign",QT);const WT=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sd=ve("eye",WT);const eA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],tA=ve("file-text",eA);const nA=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],rA=ve("funnel",nA);const aA=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],iA=ve("hash",aA);const sA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],oA=ve("history",sA);const lA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],uA=ve("info",lA);const cA=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_0=ve("layout-dashboard",cA);const dA=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Fm=ve("list-checks",dA);const fA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],hA=ve("loader-circle",fA);const mA=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],j0=ve("log-out",mA);const pA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],gA=ve("menu",pA);const yA=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],C0=ve("message-square-plus",yA);const xA=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],zl=ve("message-square",xA);const bA=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],gS=ve("moon",bA);const vA=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],kA=ve("pause",vA);const wA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],SA=ve("pen",wA);const zA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Wp=ve("pencil",zA);const _A=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],jA=ve("play",_A);const CA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],od=ve("plus",CA);const NA=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],N0=ve("puzzle",NA);const EA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],yS=ve("refresh-cw",EA);const TA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],E0=ve("rotate-ccw",TA);const AA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],OA=ve("search",AA);const RA=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],MA=ve("send",RA);const DA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],T0=ve("settings",DA);const $A=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],A0=ve("shield-check",$A);const LA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],xS=ve("sun",LA);const PA=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],UA=ve("tag",PA);const VA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],qm=ve("terminal",VA);const BA=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],ZA=ve("toggle-left",BA);const IA=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],HA=ve("toggle-right",IA);const FA=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ti=ve("trash-2",FA);const qA=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],GA=ve("trending-up",qA);const YA=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],XA=ve("user",YA);const JA=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Gm=ve("webhook",JA);const KA=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],QA=ve("wifi-off",KA);const WA=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Fh=ve("wifi",WA);const e4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],eg=ve("x",e4);var qh={exports:{}},Gh={};var O0;function t4(){if(O0)return Gh;O0=1;var e=rd();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function d(y,b){var v=b(),S=a({inst:{value:v,getSnapshot:b}}),j=S[0].inst,E=S[1];return u(function(){j.value=v,j.getSnapshot=b,h(j)&&E({inst:j})},[y,v,b]),s(function(){return h(j)&&E({inst:j}),y(function(){h(j)&&E({inst:j})})},[y]),l(v),v}function h(y){var b=y.getSnapshot;y=y.value;try{var v=b();return!n(y,v)}catch{return!0}}function m(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Gh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Gh}var R0;function n4(){return R0||(R0=1,qh.exports=t4()),qh.exports}var M0=n4();const bS=0,vS=1,kS=2,D0=3;var $0=Object.prototype.hasOwnProperty;function Ym(e,t){var n,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((a=e.length)===t.length)for(;a--&&Ym(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if($0.call(e,n)&&++a&&!$0.call(t,n)||!(n in t)||!Ym(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const ra=new WeakMap,aa=()=>{},dn=aa(),Xm=Object,Ze=e=>e===dn,Cr=e=>typeof e=="function",Ia=(e,t)=>({...e,...t}),wS=e=>Cr(e.then),Yh={},uc={},tg="undefined",Pl=typeof window!=tg,Jm=typeof document!=tg,r4=Pl&&"Deno"in window,a4=()=>Pl&&typeof window.requestAnimationFrame!=tg,SS=(e,t)=>{const n=ra.get(e);return[()=>!Ze(t)&&e.get(t)||Yh,a=>{if(!Ze(t)){const s=e.get(t);t in uc||(uc[t]=s),n[5](t,Ia(s,a),s||Yh)}},n[6],()=>!Ze(t)&&t in uc?uc[t]:!Ze(t)&&e.get(t)||Yh]};let Km=!0;const i4=()=>Km,[Qm,Wm]=Pl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[aa,aa],s4=()=>{const e=Jm&&document.visibilityState;return Ze(e)||e!=="hidden"},o4=e=>(Jm&&document.addEventListener("visibilitychange",e),Qm("focus",e),()=>{Jm&&document.removeEventListener("visibilitychange",e),Wm("focus",e)}),l4=e=>{const t=()=>{Km=!0,e()},n=()=>{Km=!1};return Qm("online",t),Qm("offline",n),()=>{Wm("online",t),Wm("offline",n)}},u4={isOnline:i4,isVisible:s4},c4={initFocus:o4,initReconnect:l4},L0=!Hp.useId,Ls=!Pl||r4,d4=e=>a4()?window.requestAnimationFrame(e):setTimeout(e,1),Xh=Ls?z.useEffect:z.useLayoutEffect,Jh=typeof navigator<"u"&&navigator.connection,P0=!Ls&&Jh&&(["slow-2g","2g"].includes(Jh.effectiveType)||Jh.saveData),cc=new WeakMap,f4=e=>Xm.prototype.toString.call(e),Kh=(e,t)=>e===`[object ${t}]`;let h4=0;const ep=e=>{const t=typeof e,n=f4(e),a=Kh(n,"Date"),s=Kh(n,"RegExp"),u=Kh(n,"Object");let l,d;if(Xm(e)===e&&!a&&!s){if(l=cc.get(e),l)return l;if(l=++h4+"~",cc.set(e,l),Array.isArray(e)){for(l="@",d=0;d<e.length;d++)l+=ep(e[d])+",";cc.set(e,l)}if(u){l="#";const h=Xm.keys(e).sort();for(;!Ze(d=h.pop());)Ze(e[d])||(l+=d+":"+ep(e[d])+",");cc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},ng=e=>{if(Cr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ep(e):"",[e,t]};let m4=0;const tp=()=>++m4;async function zS(...e){const[t,n,a,s]=e,u=Ia({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let l=u.populateCache;const d=u.rollbackOnError;let h=u.optimisticData;const m=b=>typeof d=="function"?d(b):d!==!1,g=u.throwOnError;if(Cr(n)){const b=n,v=[],S=t.keys();for(const j of S)!/^\$(inf|sub)\$/.test(j)&&b(t.get(j)._k)&&v.push(j);return Promise.all(v.map(y))}return y(n);async function y(b){const[v]=ng(b);if(!v)return;const[S,j]=SS(t,v),[E,N,O,C]=ra.get(t),P=()=>{const oe=E[v];return(Cr(u.revalidate)?u.revalidate(S().data,b):u.revalidate!==!1)&&(delete O[v],delete C[v],oe&&oe[0])?oe[0](kS).then(()=>S().data):S().data};if(e.length<3)return P();let U=a,R,F=!1;const B=tp();N[v]=[B,0];const K=!Ze(h),fe=S(),ae=fe.data,le=fe._c,ne=Ze(le)?ae:le;if(K&&(h=Cr(h)?h(ne,ae):h,j({data:h,_c:ne})),Cr(U))try{U=U(ne)}catch(oe){R=oe,F=!0}if(U&&wS(U))if(U=await U.catch(oe=>{R=oe,F=!0}),B!==N[v][0]){if(F)throw R;return U}else F&&K&&m(R)&&(l=!0,j({data:ne,_c:dn}));if(l&&!F)if(Cr(l)){const oe=l(U,ne);j({data:oe,error:dn,_c:dn})}else j({data:U,error:dn,_c:dn});if(N[v][1]=tp(),Promise.resolve(P()).then(()=>{j({_c:dn})}),F){if(g)throw R;return}return U}}const U0=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},p4=(e,t)=>{if(!ra.has(e)){const n=Ia(c4,t),a=Object.create(null),s=zS.bind(dn,e);let u=aa;const l=Object.create(null),d=(g,y)=>{const b=l[g]||[];return l[g]=b,b.push(y),()=>b.splice(b.indexOf(y),1)},h=(g,y,b)=>{e.set(g,y);const v=l[g];if(v)for(const S of v)S(y,b)},m=()=>{if(!ra.has(e)&&(ra.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,d]),!Ls)){const g=n.initFocus(setTimeout.bind(dn,U0.bind(dn,a,bS))),y=n.initReconnect(setTimeout.bind(dn,U0.bind(dn,a,vS)));u=()=>{g&&g(),y&&y(),ra.delete(e)}}};return m(),[e,s,m,u]}return[e,ra.get(e)[4]]},g4=(e,t,n,a,s)=>{const u=n.errorRetryCount,l=s.retryCount,d=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Ze(u)&&l>u||setTimeout(a,d,s)},y4=Ym,[_S,An]=p4(new Map),x4=Ia({onLoadingSlow:aa,onSuccess:aa,onError:aa,onErrorRetry:g4,onDiscarded:aa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:P0?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:P0?5e3:3e3,compare:y4,isPaused:()=>!1,cache:_S,mutate:An,fallback:{}},u4),b4=(e,t)=>{const n=Ia(e,t);if(t){const{use:a,fallback:s}=e,{use:u,fallback:l}=t;a&&u&&(n.use=a.concat(u)),s&&l&&(n.fallback=Ia(s,l))}return n},v4=z.createContext({}),k4="$inf$",jS=Pl&&window.__SWR_DEVTOOLS_USE__,w4=jS?window.__SWR_DEVTOOLS_USE__:[],S4=()=>{jS&&(window.__SWR_DEVTOOLS_REACT__=Hp)},z4=e=>Cr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_4=()=>{const e=z.useContext(v4);return z.useMemo(()=>Ia(x4,e),[e])},j4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=ng(t),[,,,d]=ra.get(_S);if(l.startsWith(k4))return n(...u);const h=d[l];return Ze(h)?n(...u):(delete d[l],h)}),a),C4=w4.concat(j4),N4=e=>function(...n){const a=_4(),[s,u,l]=z4(n),d=b4(a,l);let h=e;const{use:m}=d,g=(m||[]).concat(C4);for(let y=g.length;y--;)h=g[y](h);return h(s,u||d.fetcher||null,d)},E4=(e,t,n)=>{const a=t[e]||(t[e]=[]);return a.push(n),()=>{const s=a.indexOf(n);s>=0&&(a[s]=a[a.length-1],a.pop())}};S4();const Qh=Hp.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Wh={dedupe:!0},V0=Promise.resolve(dn),T4=(e,t,n)=>{const{cache:a,compare:s,suspense:u,fallbackData:l,revalidateOnMount:d,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[S,j,E,N]=ra.get(a),[O,C]=ng(e),P=z.useRef(!1),U=z.useRef(!1),R=z.useRef(O),F=z.useRef(t),B=z.useRef(n),K=()=>B.current,fe=()=>K().isVisible()&&K().isOnline(),[ae,le,ne,oe]=SS(a,O),ie=z.useRef({}).current,L=Ze(l)?Ze(n.fallback)?dn:n.fallback[O]:l,J=(Ie,st)=>{for(const ht in ie){const tt=ht;if(tt==="data"){if(!s(Ie[tt],st[tt])&&(!Ze(Ie[tt])||!s(D,st[tt])))return!1}else if(st[tt]!==Ie[tt])return!1}return!0},Z=z.useMemo(()=>{const Ie=!O||!t?!1:Ze(d)?K().isPaused()||u?!1:h!==!1:d,st=Ft=>{const mt=Ia(Ft);return delete mt._k,Ie?{isValidating:!0,isLoading:!0,...mt}:mt},ht=ae(),tt=oe(),Kt=st(ht),Gn=ht===tt?Kt:st(tt);let Ot=Kt;return[()=>{const Ft=st(ae());return J(Ft,Ot)?(Ot.data=Ft.data,Ot.isLoading=Ft.isLoading,Ot.isValidating=Ft.isValidating,Ot.error=Ft.error,Ot):(Ot=Ft,Ft)},()=>Gn]},[a,O]),he=M0.useSyncExternalStore(z.useCallback(Ie=>ne(O,(st,ht)=>{J(ht,st)||Ie()}),[a,O]),Z[0],Z[1]),A=!P.current,T=S[O]&&S[O].length>0,G=he.data,w=Ze(G)?L&&wS(L)?Qh(L):L:G,X=he.error,me=z.useRef(w),D=b?Ze(G)?Ze(me.current)?w:me.current:G:w,ce=O&&Ze(w),Ae=!Ls&&M0.useSyncExternalStore(()=>aa,()=>!1,()=>!0);v&&Ae&&!u&&ce&&console.warn(`Missing pre-initiated data for serialized key "${O}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const je=T&&!Ze(X)?!1:A&&!Ze(d)?d:K().isPaused()?!1:u?Ze(w)?!1:h:Ze(w)||h,Ye=!!(O&&t&&A&&je),Nt=Ze(he.isValidating)?Ye:he.isValidating,Jt=Ze(he.isLoading)?Ye:he.isLoading,et=z.useCallback(async Ie=>{const st=F.current;if(!O||!st||U.current||K().isPaused())return!1;let ht,tt,Kt=!0;const Gn=Ie||{},Ot=!E[O]||!Gn.dedupe,Ft=()=>L0?!U.current&&O===R.current&&P.current:O===R.current,mt={isValidating:!1,isLoading:!1},$i=()=>{le(mt)},W=()=>{const ke=E[O];ke&&ke[1]===tt&&delete E[O]},de={isValidating:!0};Ze(ae().data)&&(de.isLoading=!0);try{if(Ot&&(le(de),n.loadingTimeout&&Ze(ae().data)&&setTimeout(()=>{Kt&&Ft()&&K().onLoadingSlow(O,n)},n.loadingTimeout),E[O]=[st(C),tp()]),[ht,tt]=E[O],ht=await ht,Ot&&setTimeout(W,n.dedupingInterval),!E[O]||E[O][1]!==tt)return Ot&&Ft()&&K().onDiscarded(O),!1;mt.error=dn;const ke=j[O];if(!Ze(ke)&&(tt<=ke[0]||tt<=ke[1]||ke[1]===0))return $i(),Ot&&Ft()&&K().onDiscarded(O),!1;const Ce=ae().data;mt.data=s(Ce,ht)?Ce:ht,Ot&&Ft()&&K().onSuccess(ht,O,n)}catch(ke){W();const Ce=K(),{shouldRetryOnError:Be}=Ce;Ce.isPaused()||(mt.error=ke,Ot&&Ft()&&(Ce.onError(ke,O,Ce),(Be===!0||Cr(Be)&&Be(ke))&&(!K().revalidateOnFocus||!K().revalidateOnReconnect||fe())&&Ce.onErrorRetry(ke,O,Ce,mn=>{const Dn=S[O];Dn&&Dn[0]&&Dn[0](D0,mn)},{retryCount:(Gn.retryCount||0)+1,dedupe:!0})))}return Kt=!1,$i(),!0},[O,a]),wt=z.useCallback((...Ie)=>zS(a,R.current,...Ie),[]);if(Xh(()=>{F.current=t,B.current=n,Ze(G)||(me.current=G)}),Xh(()=>{if(!O)return;const Ie=et.bind(dn,Wh);let st=0;K().revalidateOnFocus&&(st=Date.now()+K().focusThrottleInterval);const tt=E4(O,S,(Kt,Gn={})=>{if(Kt==bS){const Ot=Date.now();K().revalidateOnFocus&&Ot>st&&fe()&&(st=Ot+K().focusThrottleInterval,Ie())}else if(Kt==vS)K().revalidateOnReconnect&&fe()&&Ie();else{if(Kt==kS)return et();if(Kt==D0)return et(Gn)}});return U.current=!1,R.current=O,P.current=!0,le({_k:C}),je&&(E[O]||(Ze(w)||Ls?Ie():d4(Ie))),()=>{U.current=!0,tt()}},[O]),Xh(()=>{let Ie;function st(){const tt=Cr(m)?m(ae().data):m;tt&&Ie!==-1&&(Ie=setTimeout(ht,tt))}function ht(){!ae().error&&(g||K().isVisible())&&(y||K().isOnline())?et(Wh).then(st):st()}return st(),()=>{Ie&&(clearTimeout(Ie),Ie=-1)}},[m,g,y,O]),z.useDebugValue(D),u){if(!L0&&Ls&&ce)throw new Error("Fallback data is required when using Suspense in SSR.");ce&&(F.current=t,B.current=n,U.current=!1);const Ie=N[O],st=!Ze(Ie)&&ce?wt(Ie):V0;if(Qh(st),!Ze(X)&&ce)throw X;const ht=ce?et(Wh):V0;!Ze(D)&&ce&&(ht.status="fulfilled",ht.value=!0),Qh(ht)}return{mutate:wt,get data(){return ie.data=!0,D},get error(){return ie.error=!0,X},get isValidating(){return ie.isValidating=!0,Nt},get isLoading(){return ie.isLoading=!0,Jt}}},Dt=N4(T4),A4="x-architect-pass",rl="/api";class _i{static instance;constructor(){}static getInstance(){return _i.instance||(_i.instance=new _i),_i.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[A4]=n),a}async handleResponse(t){if(t.status===401)throw localStorage.removeItem("morpheus.auth.token"),window.location.pathname.endsWith("/login")||(window.location.href="/login"),new Error("Unauthorized");if(!t.ok){const n=await t.json().catch(()=>({error:"Unknown error"})),a=new Error(n.error||`HTTP error! status: ${t.status}`);throw a.details=n.details,a}return t.json()}async get(t){const n=await fetch(`${rl}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${rl}${t}`,{method:"POST",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async put(t,n){const a=await fetch(`${rl}${t}`,{method:"PUT",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async patch(t,n){const a=await fetch(`${rl}${t}`,{method:"PATCH",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async delete(t){const n=await fetch(`${rl}${t}`,{method:"DELETE",headers:this.getHeaders()});return this.handleResponse(n)}}const be=_i.getInstance(),_l="/api",rg=e=>{const t=e.startsWith(_l)?e.substring(_l.length):e;return be.get(t)};function CS(){return Dt(`${_l}/status`,rg,{refreshInterval:5e3})}function O4(){return Dt(`${_l}/logs`,rg)}function R4(e){return Dt(e?`${_l}/logs/${e}?limit=1000`:null,rg,{refreshInterval:2e3})}function NS(e){const t=Math.floor(e/60);if(t>59){const n=Math.floor(t/60),a=t%60;return`${n}h ${a}m`}return`${t}m`}function M4(){const{data:e}=CS();return f.jsxs("footer",{className:"h-8 bg-azure-bg dark:bg-zinc-950 border-t border-azure-border dark:border-matrix-primary flex items-center px-4 text-xs justify-between select-none z-10 shrink-0",children:[f.jsxs("div",{className:"flex gap-4",children:[f.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),f.jsxs("span",{children:["PID: ",e?.pid||"-"]}),f.jsxs("span",{children:["UPTIME: ",e?NS(e.uptimeSeconds):"-"]})]}),f.jsxs("div",{className:"flex gap-4 opacity-70",children:[f.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),f.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const ag=z.createContext({});function ig(e){const t=z.useRef(null);return t.current===null&&(t.current=e()),t.current}const ES=typeof window<"u",TS=ES?z.useLayoutEffect:z.useEffect,ld=z.createContext(null);function sg(e,t){e.indexOf(t)===-1&&e.push(t)}function og(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ar=(e,t,n)=>n>t?t:n<e?e:n;let lg=()=>{};const la={},AS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function OS(e){return typeof e=="object"&&e!==null}const RS=e=>/^0[^.\s]+$/u.test(e);function ug(e){let t;return()=>(t===void 0&&(t=e()),t)}const ur=e=>e,D4=(e,t)=>n=>t(e(n)),Ul=(...e)=>e.reduce(D4),jl=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class cg{constructor(){this.subscriptions=[]}add(t){return sg(this.subscriptions,t),()=>og(this.subscriptions,t)}notify(t,n,a){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,a);else for(let u=0;u<s;u++){const l=this.subscriptions[u];l&&l(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const sa=e=>e*1e3,lr=e=>e/1e3;function MS(e,t){return t?e*(1e3/t):0}const DS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$4=1e-7,L4=12;function P4(e,t,n,a,s){let u,l,d=0;do l=t+(n-t)/2,u=DS(l,a,s)-e,u>0?n=l:t=l;while(Math.abs(u)>$4&&++d<L4);return l}function Vl(e,t,n,a){if(e===t&&n===a)return ur;const s=u=>P4(u,0,1,e,n);return u=>u===0||u===1?u:DS(s(u),t,a)}const $S=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,LS=e=>t=>1-e(1-t),PS=Vl(.33,1.53,.69,.99),dg=LS(PS),US=$S(dg),VS=e=>(e*=2)<1?.5*dg(e):.5*(2-Math.pow(2,-10*(e-1))),fg=e=>1-Math.sin(Math.acos(e)),BS=LS(fg),ZS=$S(fg),U4=Vl(.42,0,1,1),V4=Vl(0,0,.58,1),IS=Vl(.42,0,.58,1),B4=e=>Array.isArray(e)&&typeof e[0]!="number",HS=e=>Array.isArray(e)&&typeof e[0]=="number",Z4={linear:ur,easeIn:U4,easeInOut:IS,easeOut:V4,circIn:fg,circInOut:ZS,circOut:BS,backIn:dg,backInOut:US,backOut:PS,anticipate:VS},I4=e=>typeof e=="string",B0=e=>{if(HS(e)){lg(e.length===4);const[t,n,a,s]=e;return Vl(t,n,a,s)}else if(I4(e))return Z4[e];return e},dc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function H4(e,t){let n=new Set,a=new Set,s=!1,u=!1;const l=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(g){l.has(g)&&(m.schedule(g),e()),g(d)}const m={schedule:(g,y=!1,b=!1)=>{const S=b&&s?n:a;return y&&l.add(g),S.has(g)||S.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(d=g,s){u=!0;return}s=!0,[n,a]=[a,n],n.forEach(h),n.clear(),s=!1,u&&(u=!1,m.process(g))}};return m}const F4=40;function FS(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,l=dc.reduce((C,P)=>(C[P]=H4(u),C),{}),{setup:d,read:h,resolveKeyframes:m,preUpdate:g,update:y,preRender:b,render:v,postRender:S}=l,j=()=>{const C=la.useManualTiming?s.timestamp:performance.now();n=!1,la.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(C-s.timestamp,F4),1)),s.timestamp=C,s.isProcessing=!0,d.process(s),h.process(s),m.process(s),g.process(s),y.process(s),b.process(s),v.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(j))},E=()=>{n=!0,a=!0,s.isProcessing||e(j)};return{schedule:dc.reduce((C,P)=>{const U=l[P];return C[P]=(R,F=!1,B=!1)=>(n||E(),U.schedule(R,F,B)),C},{}),cancel:C=>{for(let P=0;P<dc.length;P++)l[dc[P]].cancel(C)},state:s,steps:l}}const{schedule:yt,cancel:Ha,state:on,steps:em}=FS(typeof requestAnimationFrame<"u"?requestAnimationFrame:ur,!0);let Ac;function q4(){Ac=void 0}const vn={now:()=>(Ac===void 0&&vn.set(on.isProcessing||la.useManualTiming?on.timestamp:performance.now()),Ac),set:e=>{Ac=e,queueMicrotask(q4)}},qS=e=>t=>typeof t=="string"&&t.startsWith(e),GS=qS("--"),G4=qS("var(--"),hg=e=>G4(e)?Y4.test(e.split("/*")[0].trim()):!1,Y4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Z0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ws={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Cl={...Ws,transform:e=>Ar(0,1,e)},fc={...Ws,default:1},pl=e=>Math.round(e*1e5)/1e5,mg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function X4(e){return e==null}const J4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pg=(e,t)=>n=>!!(typeof n=="string"&&J4.test(n)&&n.startsWith(e)||t&&!X4(n)&&Object.prototype.hasOwnProperty.call(n,t)),YS=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,u,l,d]=a.match(mg);return{[e]:parseFloat(s),[t]:parseFloat(u),[n]:parseFloat(l),alpha:d!==void 0?parseFloat(d):1}},K4=e=>Ar(0,255,e),tm={...Ws,transform:e=>Math.round(K4(e))},ji={test:pg("rgb","red"),parse:YS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+tm.transform(e)+", "+tm.transform(t)+", "+tm.transform(n)+", "+pl(Cl.transform(a))+")"};function Q4(e){let t="",n="",a="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,a+=a,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:s?parseInt(s,16)/255:1}}const np={test:pg("#"),parse:Q4,transform:ji.transform},Bl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),La=Bl("deg"),Er=Bl("%"),xe=Bl("px"),W4=Bl("vh"),eO=Bl("vw"),I0={...Er,parse:e=>Er.parse(e)/100,transform:e=>Er.transform(e*100)},Es={test:pg("hsl","hue"),parse:YS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Er.transform(pl(t))+", "+Er.transform(pl(n))+", "+pl(Cl.transform(a))+")"},Bt={test:e=>ji.test(e)||np.test(e)||Es.test(e),parse:e=>ji.test(e)?ji.parse(e):Es.test(e)?Es.parse(e):np.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ji.transform(e):Es.transform(e),getAnimatableNone:e=>{const t=Bt.parse(e);return t.alpha=0,Bt.transform(t)}},tO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nO(e){return isNaN(e)&&typeof e=="string"&&(e.match(mg)?.length||0)+(e.match(tO)?.length||0)>0}const XS="number",JS="color",rO="var",aO="var(",H0="${}",iO=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Nl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let u=0;const d=t.replace(iO,h=>(Bt.test(h)?(a.color.push(u),s.push(JS),n.push(Bt.parse(h))):h.startsWith(aO)?(a.var.push(u),s.push(rO),n.push(h)):(a.number.push(u),s.push(XS),n.push(parseFloat(h))),++u,H0)).split(H0);return{values:n,split:d,indexes:a,types:s}}function KS(e){return Nl(e).values}function QS(e){const{split:t,types:n}=Nl(e),a=t.length;return s=>{let u="";for(let l=0;l<a;l++)if(u+=t[l],s[l]!==void 0){const d=n[l];d===XS?u+=pl(s[l]):d===JS?u+=Bt.transform(s[l]):u+=s[l]}return u}}const sO=e=>typeof e=="number"?0:Bt.test(e)?Bt.getAnimatableNone(e):e;function oO(e){const t=KS(e);return QS(e)(t.map(sO))}const Fa={test:nO,parse:KS,createTransformer:QS,getAnimatableNone:oO};function nm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function lO({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,u=0,l=0;if(!t)s=u=l=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;s=nm(h,d,e+1/3),u=nm(h,d,e),l=nm(h,d,e-1/3)}return{red:Math.round(s*255),green:Math.round(u*255),blue:Math.round(l*255),alpha:a}}function Uc(e,t){return n=>n>0?t:e}const St=(e,t,n)=>e+(t-e)*n,rm=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},uO=[np,ji,Es],cO=e=>uO.find(t=>t.test(e));function F0(e){const t=cO(e);if(!t)return!1;let n=t.parse(e);return t===Es&&(n=lO(n)),n}const q0=(e,t)=>{const n=F0(e),a=F0(t);if(!n||!a)return Uc(e,t);const s={...n};return u=>(s.red=rm(n.red,a.red,u),s.green=rm(n.green,a.green,u),s.blue=rm(n.blue,a.blue,u),s.alpha=St(n.alpha,a.alpha,u),ji.transform(s))},rp=new Set(["none","hidden"]);function dO(e,t){return rp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function fO(e,t){return n=>St(e,t,n)}function gg(e){return typeof e=="number"?fO:typeof e=="string"?hg(e)?Uc:Bt.test(e)?q0:pO:Array.isArray(e)?WS:typeof e=="object"?Bt.test(e)?q0:hO:Uc}function WS(e,t){const n=[...e],a=n.length,s=e.map((u,l)=>gg(u)(u,t[l]));return u=>{for(let l=0;l<a;l++)n[l]=s[l](u);return n}}function hO(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=gg(e[s])(e[s],t[s]));return s=>{for(const u in a)n[u]=a[u](s);return n}}function mO(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const u=t.types[s],l=e.indexes[u][a[u]],d=e.values[l]??0;n[s]=d,a[u]++}return n}const pO=(e,t)=>{const n=Fa.createTransformer(t),a=Nl(e),s=Nl(t);return a.indexes.var.length===s.indexes.var.length&&a.indexes.color.length===s.indexes.color.length&&a.indexes.number.length>=s.indexes.number.length?rp.has(e)&&!s.values.length||rp.has(t)&&!a.values.length?dO(e,t):Ul(WS(mO(a,s),s.values),n):Uc(e,t)};function ez(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?St(e,t,n):gg(e)(e,t)}const gO=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>yt.update(t,n),stop:()=>Ha(t),now:()=>on.isProcessing?on.timestamp:vn.now()}},tz=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let u=0;u<s;u++)a+=Math.round(e(u/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},Vc=2e4;function yg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<Vc;)t+=n,a=e.next(t);return t>=Vc?1/0:t}function yO(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(yg(a),Vc);return{type:"keyframes",ease:u=>a.next(s*u).value/t,duration:lr(s)}}const xO=5;function nz(e,t,n){const a=Math.max(t-xO,0);return MS(n-e(a),t-a)}const At={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},am=.001;function bO({duration:e=At.duration,bounce:t=At.bounce,velocity:n=At.velocity,mass:a=At.mass}){let s,u,l=1-t;l=Ar(At.minDamping,At.maxDamping,l),e=Ar(At.minDuration,At.maxDuration,lr(e)),l<1?(s=m=>{const g=m*l,y=g*e,b=g-n,v=ap(m,l),S=Math.exp(-y);return am-b/v*S},u=m=>{const y=m*l*e,b=y*n+n,v=Math.pow(l,2)*Math.pow(m,2)*e,S=Math.exp(-y),j=ap(Math.pow(m,2),l);return(-s(m)+am>0?-1:1)*((b-v)*S)/j}):(s=m=>{const g=Math.exp(-m*e),y=(m-n)*e+1;return-am+g*y},u=m=>{const g=Math.exp(-m*e),y=(n-m)*(e*e);return g*y});const d=5/e,h=kO(s,u,d);if(e=sa(e),isNaN(h))return{stiffness:At.stiffness,damping:At.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const vO=12;function kO(e,t,n){let a=n;for(let s=1;s<vO;s++)a=a-e(a)/t(a);return a}function ap(e,t){return e*Math.sqrt(1-t*t)}const wO=["duration","bounce"],SO=["stiffness","damping","mass"];function G0(e,t){return t.some(n=>e[n]!==void 0)}function zO(e){let t={velocity:At.velocity,stiffness:At.stiffness,damping:At.damping,mass:At.mass,isResolvedFromDuration:!1,...e};if(!G0(e,SO)&&G0(e,wO))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,u=2*Ar(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:At.mass,stiffness:s,damping:u}}else{const n=bO(e);t={...t,...n,mass:At.mass},t.isResolvedFromDuration=!0}return t}function Bc(e=At.visualDuration,t=At.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:s}=n;const u=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],d={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:y,velocity:b,isResolvedFromDuration:v}=zO({...n,velocity:-lr(n.velocity||0)}),S=b||0,j=m/(2*Math.sqrt(h*g)),E=l-u,N=lr(Math.sqrt(h/g)),O=Math.abs(E)<5;a||(a=O?At.restSpeed.granular:At.restSpeed.default),s||(s=O?At.restDelta.granular:At.restDelta.default);let C;if(j<1){const U=ap(N,j);C=R=>{const F=Math.exp(-j*N*R);return l-F*((S+j*N*E)/U*Math.sin(U*R)+E*Math.cos(U*R))}}else if(j===1)C=U=>l-Math.exp(-N*U)*(E+(S+N*E)*U);else{const U=N*Math.sqrt(j*j-1);C=R=>{const F=Math.exp(-j*N*R),B=Math.min(U*R,300);return l-F*((S+j*N*E)*Math.sinh(B)+U*E*Math.cosh(B))/U}}const P={calculatedDuration:v&&y||null,next:U=>{const R=C(U);if(v)d.done=U>=y;else{let F=U===0?S:0;j<1&&(F=U===0?sa(S):nz(C,U,R));const B=Math.abs(F)<=a,K=Math.abs(l-R)<=s;d.done=B&&K}return d.value=d.done?l:R,d},toString:()=>{const U=Math.min(yg(P),Vc),R=tz(F=>P.next(U*F).value,U,30);return U+"ms "+R},toTransition:()=>{}};return P}Bc.applyToOptions=e=>{const t=yO(e,100,Bc);return e.ease=t.ease,e.duration=sa(t.duration),e.type="keyframes",e};function ip({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:u=500,modifyTarget:l,min:d,max:h,restDelta:m=.5,restSpeed:g}){const y=e[0],b={done:!1,value:y},v=B=>d!==void 0&&B<d||h!==void 0&&B>h,S=B=>d===void 0?h:h===void 0||Math.abs(d-B)<Math.abs(h-B)?d:h;let j=n*t;const E=y+j,N=l===void 0?E:l(E);N!==E&&(j=N-y);const O=B=>-j*Math.exp(-B/a),C=B=>N+O(B),P=B=>{const K=O(B),fe=C(B);b.done=Math.abs(K)<=m,b.value=b.done?N:fe};let U,R;const F=B=>{v(b.value)&&(U=B,R=Bc({keyframes:[b.value,S(b.value)],velocity:nz(C,B,b.value),damping:s,stiffness:u,restDelta:m,restSpeed:g}))};return F(0),{calculatedDuration:null,next:B=>{let K=!1;return!R&&U===void 0&&(K=!0,P(B),F(B)),U!==void 0&&B>=U?R.next(B-U):(!K&&P(B),b)}}}function _O(e,t,n){const a=[],s=n||la.mix||ez,u=e.length-1;for(let l=0;l<u;l++){let d=s(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||ur:t;d=Ul(h,d)}a.push(d)}return a}function jO(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const u=e.length;if(lg(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=_O(t,a,s),h=d.length,m=g=>{if(l&&g<e[0])return t[0];let y=0;if(h>1)for(;y<e.length-2&&!(g<e[y+1]);y++);const b=jl(e[y],e[y+1],g);return d[y](b)};return n?g=>m(Ar(e[0],e[u-1],g)):m}function CO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=jl(0,t,a);e.push(St(n,1,s))}}function NO(e){const t=[0];return CO(t,e.length-1),t}function EO(e,t){return e.map(n=>n*t)}function TO(e,t){return e.map(()=>t||IS).splice(0,e.length-1)}function gl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=B4(a)?a.map(B0):B0(a),u={done:!1,value:t[0]},l=EO(n&&n.length===t.length?n:NO(t),e),d=jO(l,t,{ease:Array.isArray(s)?s:TO(t,s)});return{calculatedDuration:e,next:h=>(u.value=d(h),u.done=h>=e,u)}}const AO=e=>e!==null;function xg(e,{repeat:t,repeatType:n="loop"},a,s=1){const u=e.filter(AO),d=s<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!d||a===void 0?u[d]:a}const OO={decay:ip,inertia:ip,tween:gl,keyframes:gl,spring:Bc};function rz(e){typeof e.type=="string"&&(e.type=OO[e.type])}class bg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const RO=e=>e/100;class vg extends bg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==vn.now()&&this.tick(vn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;rz(t);const{type:n=gl,repeat:a=0,repeatDelay:s=0,repeatType:u,velocity:l=0}=t;let{keyframes:d}=t;const h=n||gl;h!==gl&&typeof d[0]!="number"&&(this.mixKeyframes=Ul(RO,ez(d[0],d[1])),d=[0,100]);const m=h({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=yg(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+s,this.totalDuration=this.resolvedDuration*(a+1)-s,this.generator=m}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:s,mixKeyframes:u,mirroredGenerator:l,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:y,repeatType:b,repeatDelay:v,type:S,onUpdate:j,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-m*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,P=a;if(y){const B=Math.min(this.currentTime,s)/d;let K=Math.floor(B),fe=B%1;!fe&&B>=1&&(fe=1),fe===1&&K--,K=Math.min(K,y+1),K%2&&(b==="reverse"?(fe=1-fe,v&&(fe-=v/d)):b==="mirror"&&(P=l)),C=Ar(0,1,fe)*d}const U=O?{done:!1,value:g[0]}:P.next(C);u&&(U.value=u(U.value));let{done:R}=U;!O&&h!==null&&(R=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const F=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return F&&S!==ip&&(U.value=xg(g,this.options,E,this.speed)),j&&j(U.value),F&&this.finish(),U}then(t,n){return this.finished.then(t,n)}get duration(){return lr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+lr(t)}get time(){return lr(this.currentTime)}set time(t){t=sa(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(vn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=lr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=gO,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(vn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function MO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ci=e=>e*180/Math.PI,sp=e=>{const t=Ci(Math.atan2(e[1],e[0]));return op(t)},DO={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:sp,rotateZ:sp,skewX:e=>Ci(Math.atan(e[1])),skewY:e=>Ci(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},op=e=>(e=e%360,e<0&&(e+=360),e),Y0=sp,X0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),J0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$O={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:X0,scaleY:J0,scale:e=>(X0(e)+J0(e))/2,rotateX:e=>op(Ci(Math.atan2(e[6],e[5]))),rotateY:e=>op(Ci(Math.atan2(-e[2],e[0]))),rotateZ:Y0,rotate:Y0,skewX:e=>Ci(Math.atan(e[4])),skewY:e=>Ci(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function lp(e){return e.includes("scale")?1:0}function up(e,t){if(!e||e==="none")return lp(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=$O,s=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=DO,s=d}if(!s)return lp(t);const u=a[t],l=s[1].split(",").map(PO);return typeof u=="function"?u(l):l[u]}const LO=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return up(n,t)};function PO(e){return parseFloat(e.trim())}const eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],to=new Set(eo),K0=e=>e===Ws||e===xe,UO=new Set(["x","y","z"]),VO=eo.filter(e=>!UO.has(e));function BO(e){const t=[];return VO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Ba={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>up(t,"x"),y:(e,{transform:t})=>up(t,"y")};Ba.translateX=Ba.x;Ba.translateY=Ba.y;const Ni=new Set;let cp=!1,dp=!1,fp=!1;function az(){if(dp){const e=Array.from(Ni).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=BO(a);s.length&&(n.set(a,s),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const s=n.get(a);s&&s.forEach(([u,l])=>{a.getValue(u)?.set(l)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}dp=!1,cp=!1,Ni.forEach(e=>e.complete(fp)),Ni.clear()}function iz(){Ni.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(dp=!0)})}function ZO(){fp=!0,iz(),az(),fp=!1}class kg{constructor(t,n,a,s,u,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=s,this.element=u,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ni.add(this),cp||(cp=!0,yt.read(iz),yt.resolveKeyframes(az))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const u=s?.get(),l=t[t.length-1];if(u!==void 0)t[0]=u;else if(a&&n){const d=a.readValue(n,l);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=l),s&&u===void 0&&s.set(t[0])}MO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ni.delete(this)}cancel(){this.state==="scheduled"&&(Ni.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const IO=e=>e.startsWith("--");function HO(e,t,n){IO(t)?e.style.setProperty(t,n):e.style[t]=n}const FO=ug(()=>window.ScrollTimeline!==void 0),qO={};function GO(e,t){const n=ug(e);return()=>qO[t]??n()}const sz=GO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),dl=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,Q0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dl([0,.65,.55,1]),circOut:dl([.55,0,1,.45]),backIn:dl([.31,.01,.66,-.59]),backOut:dl([.33,1.53,.69,.99])};function oz(e,t){if(e)return typeof e=="function"?sz()?tz(e,t):"ease-out":HS(e)?dl(e):Array.isArray(e)?e.map(n=>oz(n,t)||Q0.easeOut):Q0[e]}function YO(e,t,n,{delay:a=0,duration:s=300,repeat:u=0,repeatType:l="loop",ease:d="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const y=oz(d,s);Array.isArray(y)&&(g.easing=y);const b={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(g,b)}function lz(e){return typeof e=="function"&&"applyToOptions"in e}function XO({type:e,...t}){return lz(e)&&sz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class JO extends bg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:u,allowFlatten:l=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=l,this.options=t,lg(typeof t.type!="string");const m=XO(t);this.animation=YO(n,a,s,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=xg(s,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(g):HO(n,a,g),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return lr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+lr(t)}get time(){return lr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=sa(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&FO()?(this.animation.timeline=t,ur):n(this)}}const uz={anticipate:VS,backInOut:US,circInOut:ZS};function KO(e){return e in uz}function QO(e){typeof e.ease=="string"&&KO(e.ease)&&(e.ease=uz[e.ease])}const im=10;class WO extends JO{constructor(t){QO(t),rz(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:u,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new vg({...l,autoplay:!1}),h=Math.max(im,vn.now()-this.startTime),m=Ar(0,im,h-im);n.setWithVelocity(d.sample(Math.max(0,h-m)).value,d.sample(h).value,m),d.stop()}}const W0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fa.test(e)||e==="0")&&!e.startsWith("url("));function e3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function t3(e,t,n,a){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],l=W0(s,t),d=W0(u,t);return!l||!d?!1:e3(e)||(n==="spring"||lz(n))&&a}function hp(e){e.duration=0,e.type="keyframes"}const n3=new Set(["opacity","clipPath","filter","transform"]),r3=ug(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function a3(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:u,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return r3()&&n&&n3.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&u!==0&&l!=="inertia"}const i3=40;class s3 extends bg{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:u=0,repeatType:l="loop",keyframes:d,name:h,motionValue:m,element:g,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=vn.now();const b={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...y},v=g?.KeyframeResolver||kg;this.keyframeResolver=new v(d,(S,j,E)=>this.onKeyframesResolved(S,j,b,!E),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:u,type:l,velocity:d,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=vn.now(),t3(t,u,l,d)||((la.instantAnimations||!h)&&g?.(xg(t,a,n)),t[0]=t[t.length-1],hp(a),a.repeat=0);const b={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>i3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&a3(b),S=b.motionValue?.owner?.current,j=v?new WO({...b,element:S}):new vg(b);j.finished.then(()=>{this.notifyFinished()}).catch(ur),this.pendingTimeline&&(this.stopTimeline=j.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=j}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ZO()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function cz(e,t,n,a=0,s=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,d=(l-1)*a;return typeof n=="function"?n(u,l):s===1?u*a:d-u*a}const o3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function l3(e){const t=o3.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function dz(e,t,n=1){const[a,s]=l3(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const l=u.trim();return AS(l)?parseFloat(l):l}return hg(s)?dz(s,t,n+1):s}const u3={type:"spring",stiffness:500,damping:25,restSpeed:10},c3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),d3={type:"keyframes",duration:.8},f3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},h3=(e,{keyframes:t})=>t.length>2?d3:to.has(e)?e.startsWith("scale")?c3(t[1]):u3:f3,m3=e=>e!==null;function p3(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(m3),u=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[u]}function wg(e,t){return e?.[t]??e?.default??e}function g3({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:s,repeat:u,repeatType:l,repeatDelay:d,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const Sg=(e,t,n,a={},s,u)=>l=>{const d=wg(a,e)||{},h=d.delay||a.delay||0;let{elapsed:m=0}=a;m=m-sa(h);const g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{l(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:s};g3(d)||Object.assign(g,h3(e,g)),g.duration&&(g.duration=sa(g.duration)),g.repeatDelay&&(g.repeatDelay=sa(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(hp(g),g.delay===0&&(y=!0)),(la.instantAnimations||la.skipAnimations)&&(y=!0,hp(g),g.delay=0),g.allowFlatten=!d.type&&!d.ease,y&&!u&&t.get()!==void 0){const b=p3(g.keyframes,d);if(b!==void 0){yt.update(()=>{g.onUpdate(b),g.onComplete()});return}}return d.isSync?new vg(g):new s3(g)};function e1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function zg(e,t,n,a){if(typeof t=="function"){const[s,u]=e1(a);t=t(n!==void 0?n:e.custom,s,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,u]=e1(a);t=t(n!==void 0?n:e.custom,s,u)}return t}function Ps(e,t,n){const a=e.getProps();return zg(a,t,n!==void 0?n:a.custom,e)}const fz=new Set(["width","height","top","left","right","bottom",...eo]),t1=30,y3=e=>!isNaN(parseFloat(e));class x3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=vn.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=vn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=y3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new cg);const a=this.events[t].add(n);return t==="change"?()=>{a(),yt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=vn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>t1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,t1);return MS(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Hs(e,t){return new x3(e,t)}const mp=e=>Array.isArray(e);function b3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hs(n))}function v3(e){return mp(e)?e[e.length-1]||0:e}function k3(e,t){const n=Ps(e,t);let{transitionEnd:a={},transition:s={},...u}=n||{};u={...u,...a};for(const l in u){const d=v3(u[l]);b3(e,l,d)}}const fn=e=>!!(e&&e.getVelocity);function w3(e){return!!(fn(e)&&e.add)}function pp(e,t){const n=e.getValue("willChange");if(w3(n))return n.add(t);if(!n&&la.WillChange){const a=new la.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function _g(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const S3="framerAppearId",hz="data-"+_g(S3);function mz(e){return e.props[hz]}function z3({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function pz(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:l,...d}=t;const h=u?.reduceMotion;a&&(u=a);const m=[],g=s&&e.animationState&&e.animationState.getState()[s];for(const y in d){const b=e.getValue(y,e.latestValues[y]??null),v=d[y];if(v===void 0||g&&z3(g,y))continue;const S={delay:n,...wg(u||{},y)},j=b.get();if(j!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===j&&!S.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const C=mz(e);if(C){const P=window.MotionHandoffAnimation(C,y,yt);P!==null&&(S.startTime=P,E=!0)}}pp(e,y);const N=h??e.shouldReduceMotion;b.start(Sg(y,b,v,N&&fz.has(y)?{type:!1}:S,e,E));const O=b.animation;O&&m.push(O)}return l&&Promise.all(m).then(()=>{yt.update(()=>{l&&k3(e,l)})}),m}function gp(e,t,n={}){const a=Ps(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const u=a?()=>Promise.all(pz(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:y}=s;return _3(e,t,h,m,g,y,n)}:()=>Promise.resolve(),{when:d}=s;if(d){const[h,m]=d==="beforeChildren"?[u,l]:[l,u];return h().then(()=>m())}else return Promise.all([u(),l(n.delay)])}function _3(e,t,n=0,a=0,s=0,u=1,l){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(gp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+cz(e.variantChildren,h,a,s,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function j3(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(u=>gp(e,u,n));a=Promise.all(s)}else if(typeof t=="string")a=gp(e,t,n);else{const s=typeof t=="function"?Ps(e,t,n.custom):t;a=Promise.all(pz(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const C3={test:e=>e==="auto",parse:e=>e},gz=e=>t=>t.test(e),yz=[Ws,xe,Er,La,eO,W4,C3],n1=e=>yz.find(gz(e));function N3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||RS(e):!0}const E3=new Set(["brightness","contrast","saturate","opacity"]);function T3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(mg)||[];if(!a)return e;const s=n.replace(a,"");let u=E3.has(t)?1:0;return a!==n&&(u*=100),t+"("+u+s+")"}const A3=/\b([a-z-]*)\(.*?\)/gu,yp={...Fa,getAnimatableNone:e=>{const t=e.match(A3);return t?t.map(T3).join(" "):e}},r1={...Ws,transform:Math.round},O3={rotate:La,rotateX:La,rotateY:La,rotateZ:La,scale:fc,scaleX:fc,scaleY:fc,scaleZ:fc,skew:La,skewX:La,skewY:La,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Cl,originX:I0,originY:I0,originZ:xe},jg={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,inset:xe,insetBlock:xe,insetBlockStart:xe,insetBlockEnd:xe,insetInline:xe,insetInlineStart:xe,insetInlineEnd:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,paddingBlock:xe,paddingBlockStart:xe,paddingBlockEnd:xe,paddingInline:xe,paddingInlineStart:xe,paddingInlineEnd:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,marginBlock:xe,marginBlockStart:xe,marginBlockEnd:xe,marginInline:xe,marginInlineStart:xe,marginInlineEnd:xe,fontSize:xe,backgroundPositionX:xe,backgroundPositionY:xe,...O3,zIndex:r1,fillOpacity:Cl,strokeOpacity:Cl,numOctaves:r1},R3={...jg,color:Bt,backgroundColor:Bt,outlineColor:Bt,fill:Bt,stroke:Bt,borderColor:Bt,borderTopColor:Bt,borderRightColor:Bt,borderBottomColor:Bt,borderLeftColor:Bt,filter:yp,WebkitFilter:yp},xz=e=>R3[e];function bz(e,t){let n=xz(e);return n!==yp&&(n=Fa),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const M3=new Set(["auto","none","0"]);function D3(e,t,n){let a=0,s;for(;a<e.length&&!s;){const u=e[a];typeof u=="string"&&!M3.has(u)&&Nl(u).values.length&&(s=e[a]),a++}if(s&&n)for(const u of t)e[u]=bz(n,s)}class $3 extends kg{constructor(t,n,a,s,u){super(t,n,a,s,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let y=t[g];if(typeof y=="string"&&(y=y.trim(),hg(y))){const b=dz(y,n.current);b!==void 0&&(t[g]=b),g===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!fz.has(a)||t.length!==2)return;const[s,u]=t,l=n1(s),d=n1(u),h=Z0(s),m=Z0(u);if(h!==m&&Ba[a]){this.needsMeasurement=!0;return}if(l!==d)if(K0(l)&&K0(d))for(let g=0;g<t.length;g++){const y=t[g];typeof y=="string"&&(t[g]=parseFloat(y))}else Ba[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||N3(t[s]))&&a.push(s);a.length&&D3(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ba[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(a,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const u=a.length-1,l=a[u];a[u]=Ba[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function L3(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const s=n?.[e]??a.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(a=>a!=null)}const vz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function xp(e){return OS(e)&&"offsetHeight"in e}const{schedule:Cg}=FS(queueMicrotask,!1),yr={x:!1,y:!1};function kz(){return yr.x||yr.y}function P3(e){return e==="x"||e==="y"?yr[e]?null:(yr[e]=!0,()=>{yr[e]=!1}):yr.x||yr.y?null:(yr.x=yr.y=!0,()=>{yr.x=yr.y=!1})}function wz(e,t){const n=L3(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function a1(e){return!(e.pointerType==="touch"||kz())}function U3(e,t,n={}){const[a,s,u]=wz(e,n),l=d=>{if(!a1(d))return;const{target:h}=d,m=t(h,d);if(typeof m!="function"||!h)return;const g=y=>{a1(y)&&(m(y),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,s)};return a.forEach(d=>{d.addEventListener("pointerenter",l,s)}),u}const Sz=(e,t)=>t?e===t?!0:Sz(e,t.parentElement):!1,Ng=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,V3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zz(e){return V3.has(e.tagName)||e.isContentEditable===!0}const Oc=new WeakSet;function i1(e){return t=>{t.key==="Enter"&&e(t)}}function sm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const B3=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=i1(()=>{if(Oc.has(n))return;sm(n,"down");const s=i1(()=>{sm(n,"up")}),u=()=>sm(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function s1(e){return Ng(e)&&!kz()}function Z3(e,t,n={}){const[a,s,u]=wz(e,n),l=d=>{const h=d.currentTarget;if(!s1(d))return;Oc.add(h);const m=t(h,d),g=(v,S)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),Oc.has(h)&&Oc.delete(h),s1(v)&&typeof m=="function"&&m(v,{success:S})},y=v=>{g(v,h===window||h===document||n.useGlobalTarget||Sz(h,v.target))},b=v=>{g(v,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",b,s)};return a.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",l,s),xp(d)&&(d.addEventListener("focus",m=>B3(m,s)),!zz(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function _z(e){return OS(e)&&"ownerSVGElement"in e}function I3(e){return _z(e)&&e.tagName==="svg"}const H3=[...yz,Bt,Fa],F3=e=>H3.find(gz(e)),o1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ts=()=>({x:o1(),y:o1()}),l1=()=>({min:0,max:0}),Xt=()=>({x:l1(),y:l1()}),bp={current:null},jz={current:!1},q3=typeof window<"u";function G3(){if(jz.current=!0,!!q3)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>bp.current=e.matches;e.addEventListener("change",t),t()}else bp.current=!1}const Y3=new WeakMap;function ud(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function El(e){return typeof e=="string"||Array.isArray(e)}const Eg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tg=["initial",...Eg];function cd(e){return ud(e.animate)||Tg.some(t=>El(e[t]))}function Cz(e){return!!(cd(e)||e.variants)}function X3(e,t,n){for(const a in t){const s=t[a],u=n[a];if(fn(s))e.addValue(a,s);else if(fn(u))e.addValue(a,Hs(s,{owner:e}));else if(u!==s)if(e.hasValue(a)){const l=e.getValue(a);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(a);e.addValue(a,Hs(l!==void 0?l:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const u1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zc={};function Nz(e){Zc=e}function J3(){return Zc}class K3{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:u,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=kg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=vn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,yt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=l;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=cd(n),this.isVariantNode=Cz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in y){const v=y[b];h[b]!==void 0&&fn(v)&&v.set(h[b])}}mount(t){this.current=t,Y3.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(jz.current||G3(),this.shouldReduceMotion=bp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ha(this.notifyUpdate),Ha(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const a=to.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&yt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),u&&u(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Zc){const n=Zc[t];if(!n)continue;const{isEnabled:a,Feature:s}=n;if(!this.features[t]&&s&&a(this.props)&&(this.features[t]=new s(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<u1.length;a++){const s=u1[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const u="on"+s,l=t[u];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=X3(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=Hs(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(AS(a)||RS(a))?a=parseFloat(a):!F3(a)&&Fa.test(n)&&(a=bz(t,n)),this.setBaseTarget(t,fn(a)?a.get():a)),fn(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const u=zg(this.props,n,this.presenceContext?.custom);u&&(a=u[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!fn(s)?s:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new cg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Cg.render(this.render)}}class Ez extends K3{constructor(){super(...arguments),this.KeyframeResolver=$3}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;fn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ya{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Tz({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function Q3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function W3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function om(e){return e===void 0||e===1}function vp({scale:e,scaleX:t,scaleY:n}){return!om(e)||!om(t)||!om(n)}function Si(e){return vp(e)||Az(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Az(e){return c1(e.x)||c1(e.y)}function c1(e){return e&&e!=="0%"}function Ic(e,t,n){const a=e-n,s=t*a;return n+s}function d1(e,t,n,a,s){return s!==void 0&&(e=Ic(e,s,a)),Ic(e,n,a)+t}function kp(e,t=0,n=1,a,s){e.min=d1(e.min,t,n,a,s),e.max=d1(e.max,t,n,a,s)}function Oz(e,{x:t,y:n}){kp(e.x,t.translate,t.scale,t.originPoint),kp(e.y,n.translate,n.scale,n.originPoint)}const f1=.999999999999,h1=1.0000000000001;function eR(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let u,l;for(let d=0;d<s;d++){u=n[d],l=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Os(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Oz(e,l)),a&&Si(u.latestValues)&&Os(e,u.latestValues))}t.x<h1&&t.x>f1&&(t.x=1),t.y<h1&&t.y>f1&&(t.y=1)}function As(e,t){e.min=e.min+t,e.max=e.max+t}function m1(e,t,n,a,s=.5){const u=St(e.min,e.max,s);kp(e,t,n,u,a)}function Os(e,t){m1(e.x,t.x,t.scaleX,t.scale,t.originX),m1(e.y,t.y,t.scaleY,t.scale,t.originY)}function Rz(e,t){return Tz(W3(e.getBoundingClientRect(),t))}function tR(e,t,n){const a=Rz(e,n),{scroll:s}=t;return s&&(As(a.x,s.offset.x),As(a.y,s.offset.y)),a}const nR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rR=eo.length;function aR(e,t,n){let a="",s=!0;for(let u=0;u<rR;u++){const l=eo[u],d=e[l];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(l.startsWith("scale")?1:0);else{const m=parseFloat(d);h=l.startsWith("scale")?m===1:m===0}if(!h||n){const m=vz(d,jg[l]);if(!h){s=!1;const g=nR[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function Ag(e,t,n){const{style:a,vars:s,transformOrigin:u}=e;let l=!1,d=!1;for(const h in t){const m=t[h];if(to.has(h)){l=!0;continue}else if(GS(h)){s[h]=m;continue}else{const g=vz(m,jg[h]);h.startsWith("origin")?(d=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=aR(t,e.transform,n):a.transform&&(a.transform="none")),d){const{originX:h="50%",originY:m="50%",originZ:g=0}=u;a.transformOrigin=`${h} ${m} ${g}`}}function Mz(e,{style:t,vars:n},a,s){const u=e.style;let l;for(l in t)u[l]=t[l];s?.applyProjectionStyles(u,a);for(l in n)u.setProperty(l,n[l])}function p1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const al={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(xe.test(e))e=parseFloat(e);else return e;const n=p1(e,t.target.x),a=p1(e,t.target.y);return`${n}% ${a}%`}},iR={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=Fa.parse(e);if(s.length>5)return a;const u=Fa.createTransformer(e),l=typeof s[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;s[0+l]/=d,s[1+l]/=h;const m=St(d,h,.5);return typeof s[2+l]=="number"&&(s[2+l]/=m),typeof s[3+l]=="number"&&(s[3+l]/=m),u(s)}},wp={borderRadius:{...al,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:al,borderTopRightRadius:al,borderBottomLeftRadius:al,borderBottomRightRadius:al,boxShadow:iR};function Dz(e,{layout:t,layoutId:n}){return to.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wp[e]||e==="opacity")}function Og(e,t,n){const a=e.style,s=t?.style,u={};if(!a)return u;for(const l in a)(fn(a[l])||s&&fn(s[l])||Dz(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(u[l]=a[l]);return u}function sR(e){return window.getComputedStyle(e)}class oR extends Ez{constructor(){super(...arguments),this.type="html",this.renderInstance=Mz}readValueFromInstance(t,n){if(to.has(n))return this.projection?.isProjecting?lp(n):LO(t,n);{const a=sR(t),s=(GS(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Rz(t,n)}build(t,n,a){Ag(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Og(t,n,a)}}const lR={offset:"stroke-dashoffset",array:"stroke-dasharray"},uR={offset:"strokeDashoffset",array:"strokeDasharray"};function cR(e,t,n=1,a=0,s=!0){e.pathLength=1;const u=s?lR:uR;e[u.offset]=`${-a}`,e[u.array]=`${t} ${n}`}const dR=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function $z(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:u=1,pathOffset:l=0,...d},h,m,g){if(Ag(e,d,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:b}=e;y.transform&&(b.transform=y.transform,delete y.transform),(b.transform||y.transformOrigin)&&(b.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),b.transform&&(b.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const v of dR)y[v]!==void 0&&(b[v]=y[v],delete y[v]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),s!==void 0&&cR(y,s,u,l,!1)}const Lz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Pz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fR(e,t,n,a){Mz(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(Lz.has(s)?s:_g(s),t.attrs[s])}function Uz(e,t,n){const a=Og(e,t,n);for(const s in e)if(fn(e[s])||fn(t[s])){const u=eo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[u]=e[s]}return a}class hR extends Ez{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(to.has(n)){const a=xz(n);return a&&a.default||0}return n=Lz.has(n)?n:_g(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Uz(t,n,a)}build(t,n,a){$z(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){fR(t,n,a,s)}mount(t){this.isSVGTag=Pz(t.tagName),super.mount(t)}}const mR=Tg.length;function Vz(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Vz(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<mR;n++){const a=Tg[n],s=e.props[a];(El(s)||s===!1)&&(t[a]=s)}return t}function Bz(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const pR=[...Eg].reverse(),gR=Eg.length;function yR(e){return t=>Promise.all(t.map(({animation:n,options:a})=>j3(e,n,a)))}function xR(e){let t=yR(e),n=g1(),a=!0;const s=h=>(m,g)=>{const y=Ps(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:b,transitionEnd:v,...S}=y;m={...m,...S,...v}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Vz(e.parent)||{},y=[],b=new Set;let v={},S=1/0;for(let E=0;E<gR;E++){const N=pR[E],O=n[N],C=m[N]!==void 0?m[N]:g[N],P=El(C),U=N===h?O.isActive:null;U===!1&&(S=E);let R=C===g[N]&&C!==m[N]&&P;if(R&&a&&e.manuallyAnimateOnMount&&(R=!1),O.protectedKeys={...v},!O.isActive&&U===null||!C&&!O.prevProp||ud(C)||typeof C=="boolean")continue;const F=bR(O.prevProp,C);let B=F||N===h&&O.isActive&&!R&&P||E>S&&P,K=!1;const fe=Array.isArray(C)?C:[C];let ae=fe.reduce(s(N),{});U===!1&&(ae={});const{prevResolvedValues:le={}}=O,ne={...le,...ae},oe=J=>{B=!0,b.has(J)&&(K=!0,b.delete(J)),O.needsAnimating[J]=!0;const Z=e.getValue(J);Z&&(Z.liveStyle=!1)};for(const J in ne){const Z=ae[J],he=le[J];if(v.hasOwnProperty(J))continue;let A=!1;mp(Z)&&mp(he)?A=!Bz(Z,he):A=Z!==he,A?Z!=null?oe(J):b.add(J):Z!==void 0&&b.has(J)?oe(J):O.protectedKeys[J]=!0}O.prevProp=C,O.prevResolvedValues=ae,O.isActive&&(v={...v,...ae}),a&&e.blockInitialAnimation&&(B=!1);const ie=R&&F;B&&(!ie||K)&&y.push(...fe.map(J=>{const Z={type:N};if(typeof J=="string"&&a&&!ie&&e.manuallyAnimateOnMount&&e.parent){const{parent:he}=e,A=Ps(he,J);if(he.enteringChildren&&A){const{delayChildren:T}=A.transition||{};Z.delay=cz(he.enteringChildren,e,T)}}return{animation:J,options:Z}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const N=Ps(e,Array.isArray(m.initial)?m.initial[0]:m.initial);N&&N.transition&&(E.transition=N.transition)}b.forEach(N=>{const O=e.getBaseTarget(N),C=e.getValue(N);C&&(C.liveStyle=!0),E[N]=O??null}),y.push({animation:E})}let j=!!y.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(j=!1),a=!1,j?t(y):Promise.resolve()}function d(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const g=l(h);for(const y in n)n[y].protectedKeys={};return g}return{animateChanges:l,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=g1()}}}function bR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Bz(t,e):!1}function xi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function g1(){return{animate:xi(!0),whileInView:xi(),whileHover:xi(),whileTap:xi(),whileDrag:xi(),whileFocus:xi(),exit:xi()}}function y1(e,t){e.min=t.min,e.max=t.max}function gr(e,t){y1(e.x,t.x),y1(e.y,t.y)}function x1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Zz=1e-4,vR=1-Zz,kR=1+Zz,Iz=.01,wR=0-Iz,SR=0+Iz;function kn(e){return e.max-e.min}function zR(e,t,n){return Math.abs(e-t)<=n}function b1(e,t,n,a=.5){e.origin=a,e.originPoint=St(t.min,t.max,e.origin),e.scale=kn(n)/kn(t),e.translate=St(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vR&&e.scale<=kR||isNaN(e.scale))&&(e.scale=1),(e.translate>=wR&&e.translate<=SR||isNaN(e.translate))&&(e.translate=0)}function yl(e,t,n,a){b1(e.x,t.x,n.x,a?a.originX:void 0),b1(e.y,t.y,n.y,a?a.originY:void 0)}function v1(e,t,n){e.min=n.min+t.min,e.max=e.min+kn(t)}function _R(e,t,n){v1(e.x,t.x,n.x),v1(e.y,t.y,n.y)}function k1(e,t,n){e.min=t.min-n.min,e.max=e.min+kn(t)}function Hc(e,t,n){k1(e.x,t.x,n.x),k1(e.y,t.y,n.y)}function w1(e,t,n,a,s){return e-=t,e=Ic(e,1/n,a),s!==void 0&&(e=Ic(e,1/s,a)),e}function jR(e,t=0,n=1,a=.5,s,u=e,l=e){if(Er.test(t)&&(t=parseFloat(t),t=St(l.min,l.max,t/100)-l.min),typeof t!="number")return;let d=St(u.min,u.max,a);e===u&&(d-=t),e.min=w1(e.min,t,n,d,s),e.max=w1(e.max,t,n,d,s)}function S1(e,t,[n,a,s],u,l){jR(e,t[n],t[a],t[s],t.scale,u,l)}const CR=["x","scaleX","originX"],NR=["y","scaleY","originY"];function z1(e,t,n,a){S1(e.x,t,CR,n?n.x:void 0,a?a.x:void 0),S1(e.y,t,NR,n?n.y:void 0,a?a.y:void 0)}function _1(e){return e.translate===0&&e.scale===1}function Hz(e){return _1(e.x)&&_1(e.y)}function j1(e,t){return e.min===t.min&&e.max===t.max}function ER(e,t){return j1(e.x,t.x)&&j1(e.y,t.y)}function C1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fz(e,t){return C1(e.x,t.x)&&C1(e.y,t.y)}function N1(e){return kn(e.x)/kn(e.y)}function E1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ir(e){return[e("x"),e("y")]}function TR(e,t,n){let a="";const s=e.x.translate/t.x,u=e.y.translate/t.y,l=n?.z||0;if((s||u||l)&&(a=`translate3d(${s}px, ${u}px, ${l}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:y,rotateY:b,skewX:v,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),y&&(a+=`rotateX(${y}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),S&&(a+=`skewY(${S}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(a+=`scale(${d}, ${h})`),a||"none"}const qz=["TopLeft","TopRight","BottomLeft","BottomRight"],AR=qz.length,T1=e=>typeof e=="string"?parseFloat(e):e,A1=e=>typeof e=="number"||xe.test(e);function OR(e,t,n,a,s,u){s?(e.opacity=St(0,n.opacity??1,RR(a)),e.opacityExit=St(t.opacity??1,0,MR(a))):u&&(e.opacity=St(t.opacity??1,n.opacity??1,a));for(let l=0;l<AR;l++){const d=`border${qz[l]}Radius`;let h=O1(t,d),m=O1(n,d);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||A1(h)===A1(m)?(e[d]=Math.max(St(T1(h),T1(m),a),0),(Er.test(m)||Er.test(h))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=St(t.rotate||0,n.rotate||0,a))}function O1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const RR=Gz(0,.5,BS),MR=Gz(.5,.95,ur);function Gz(e,t,n){return a=>a<e?0:a>t?1:n(jl(e,t,a))}function DR(e,t,n){const a=fn(e)?e:Hs(e);return a.start(Sg("",a,t,n)),a.animation}function Tl(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const $R=(e,t)=>e.depth-t.depth;class LR{constructor(){this.children=[],this.isDirty=!1}add(t){sg(this.children,t),this.isDirty=!0}remove(t){og(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($R),this.isDirty=!1,this.children.forEach(t)}}function PR(e,t){const n=vn.now(),a=({timestamp:s})=>{const u=s-n;u>=t&&(Ha(a),e(u-t))};return yt.setup(a,!0),()=>Ha(a)}function Rc(e){return fn(e)?e.get():e}class UR{constructor(){this.members=[]}add(t){sg(this.members,t),t.scheduleRender()}remove(t){if(og(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let a;for(let s=n;s>=0;s--){const u=this.members[s];if(u.isPresent!==!1){a=u;break}}return a?(this.promote(a),!0):!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender();const s=a.options.layoutDependency,u=t.options.layoutDependency;s!==void 0&&u!==void 0&&s===u||(t.resumeFrom=a,n&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:d}=t.options;d===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:a}=t;n.onExitComplete&&n.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},lm=["","X","Y","Z"],VR=1e3;let BR=0;function um(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function Yz(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=mz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",yt,!(s||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&Yz(a)}function Xz({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(l={},d=t?.()){this.id=BR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(HR),this.nodes.forEach(YR),this.nodes.forEach(XR),this.nodes.forEach(FR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new LR)}addEventListener(l,d){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new cg),this.eventHandlers.get(l).add(d)}notifyListeners(l,...d){const h=this.eventHandlers.get(l);h&&h.notify(...d)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=_z(l)&&!I3(l),this.instance=l;const{layoutId:d,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let g,y=0;const b=()=>this.root.updateBlockedByResize=!1;yt.read(()=>{y=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==y&&(y=v,this.root.updateBlockedByResize=!0,g&&g(),g=PR(b,250),Mc.hasAnimatedSinceResize&&(Mc.hasAnimatedSinceResize=!1,this.nodes.forEach(D1)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||eM,{onLayoutAnimationStart:j,onLayoutAnimationComplete:E}=m.getProps(),N=!this.targetLayout||!Fz(this.targetLayout,v),O=!y&&b;if(this.options.layoutRoot||this.resumeFrom||O||y&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...wg(S,"layout"),onPlay:j,onComplete:E};(m.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(g,O)}else y||D1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ha(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(JR),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yz(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(R1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(M1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(GR),this.nodes.forEach(ZR),this.nodes.forEach(IR)):this.nodes.forEach(M1),this.clearAllSnapshots();const d=vn.now();on.delta=Ar(0,1e3/60,d-on.timestamp),on.timestamp=d,on.isProcessing=!0,em.update.process(on),em.preRender.process(on),em.render.process(on),on.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qR),this.sharedNodes.forEach(KR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!kn(this.snapshot.measuredBox.x)&&!kn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Xt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(d=!1),d&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Hz(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(d||Si(this.latestValues)||g)&&(s(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return l&&(h=this.removeTransform(h)),tM(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Xt();const d=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(nM))){const{scroll:m}=this.root;m&&(As(d.x,m.offset.x),As(d.y,m.offset.y))}return d}removeElementScroll(l){const d=Xt();if(gr(d,l),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:y}=m;m!==this.root&&g&&y.layoutScroll&&(g.wasRoot&&gr(d,l),As(d.x,g.offset.x),As(d.y,g.offset.y))}return d}applyTransform(l,d=!1){const h=Xt();gr(h,l);for(let m=0;m<this.path.length;m++){const g=this.path[m];!d&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Os(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Si(g.latestValues)&&Os(h,g.latestValues)}return Si(this.latestValues)&&Os(h,this.latestValues),h}removeTransform(l){const d=Xt();gr(d,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!Si(m.latestValues))continue;vp(m.latestValues)&&m.updateSnapshot();const g=Xt(),y=m.measurePageBox();gr(g,y),z1(d,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return Si(this.latestValues)&&z1(d,this.latestValues),d}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==on.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(l||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:y}=this.options;if(!this.layout||!(g||y))return;this.resolvedRelativeTargetAt=on.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Xt(),this.targetWithTransforms=Xt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_R(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):gr(this.target,this.layout.layoutBox),Oz(this.target,this.targetDelta)):gr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||vp(this.parent.latestValues)||Az(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,d,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Xt(),this.relativeTargetOrigin=Xt(),Hc(this.relativeTargetOrigin,d,h),gr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),d=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===on.timestamp&&(h=!1),h)return;const{layout:m,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||g))return;gr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,b=this.treeScale.y;eR(this.layoutCorrected,this.treeScale,this.path,d),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Xt());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(x1(this.prevProjectionDelta.x,this.projectionDelta.x),x1(this.prevProjectionDelta.y,this.projectionDelta.y)),yl(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==b||!E1(this.projectionDelta.x,this.prevProjectionDelta.x)||!E1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ts(),this.projectionDelta=Ts(),this.projectionDeltaWithTransform=Ts()}setAnimationOrigin(l,d=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},y=Ts();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const b=Xt(),v=h?h.source:void 0,S=this.layout?this.layout.source:void 0,j=v!==S,E=this.getStack(),N=!E||E.members.length<=1,O=!!(j&&!N&&this.options.crossfade===!0&&!this.path.some(WR));this.animationProgress=0;let C;this.mixTargetDelta=P=>{const U=P/1e3;$1(y.x,l.x,U),$1(y.y,l.y,U),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hc(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QR(this.relativeTarget,this.relativeTargetOrigin,b,U),C&&ER(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Xt()),gr(C,this.relativeTarget)),j&&(this.animationValues=g,OR(g,m,this.latestValues,U,O,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ha(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yt.update(()=>{Mc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hs(0)),this.currentAnimation=DR(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),l.onUpdate&&l.onUpdate(d)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(VR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:d,target:h,layout:m,latestValues:g}=l;if(!(!d||!h||!m)){if(this!==l&&this.layout&&m&&Jz(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Xt();const y=kn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+y;const b=kn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+b}gr(d,h),Os(d,g),yl(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(l,d){this.sharedNodes.has(l)||this.sharedNodes.set(l,new UR),this.sharedNodes.get(l).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:d,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let d=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const m={};h.z&&um("z",l,m,this.animationValues);for(let g=0;g<lm.length;g++)um(`rotate${lm[g]}`,l,m,this.animationValues),um(`skew${lm[g]}`,l,m,this.animationValues);l.render();for(const g in m)l.setStaticValue(g,m[g]),this.animationValues&&(this.animationValues[g]=m[g]);l.scheduleRender()}applyProjectionStyles(l,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Rc(d?.pointerEvents)||"",l.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Rc(d?.pointerEvents)||""),this.hasProjected&&!Si(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let y=TR(this.projectionDeltaWithTransform,this.treeScale,g);h&&(y=h(g,y)),l.transform=y;const{x:b,y:v}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?l.opacity=m===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:l.opacity=m===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const S in wp){if(g[S]===void 0)continue;const{correct:j,applyTo:E,isCSSVariable:N}=wp[S],O=y==="none"?g[S]:j(g[S],m);if(E){const C=E.length;for(let P=0;P<C;P++)l[E[P]]=O}else N?this.options.visualElement.renderState.vars[S]=O:l[S]=O}this.options.layoutId&&(l.pointerEvents=m===this?Rc(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(R1),this.root.sharedNodes.clear()}}}function ZR(e){e.updateLayout()}function IR(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:s}=e.options,u=t.source!==e.layout.source;s==="size"?ir(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],b=kn(y);y.min=n[g].min,y.max=y.min+b}):Jz(s,t.layoutBox,n)&&ir(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],b=kn(n[g]);y.max=y.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+b)});const l=Ts();yl(l,n,t.layoutBox);const d=Ts();u?yl(d,e.applyTransform(a,!0),t.measuredBox):yl(d,n,t.layoutBox);const h=!Hz(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:b}=g;if(y&&b){const v=Xt();Hc(v,t.layoutBox,y.layoutBox);const S=Xt();Hc(S,n,b.layoutBox),Fz(v,S)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=v,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function HR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function FR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qR(e){e.clearSnapshot()}function R1(e){e.clearMeasurements()}function M1(e){e.isLayoutDirty=!1}function GR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function D1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YR(e){e.resolveTargetDelta()}function XR(e){e.calcProjection()}function JR(e){e.resetSkewAndRotation()}function KR(e){e.removeLeadSnapshot()}function $1(e,t,n){e.translate=St(t.translate,0,n),e.scale=St(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function L1(e,t,n,a){e.min=St(t.min,n.min,a),e.max=St(t.max,n.max,a)}function QR(e,t,n,a){L1(e.x,t.x,n.x,a),L1(e.y,t.y,n.y,a)}function WR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const eM={duration:.45,ease:[.4,0,.1,1]},P1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),U1=P1("applewebkit/")&&!P1("chrome/")?Math.round:ur;function V1(e){e.min=U1(e.min),e.max=U1(e.max)}function tM(e){V1(e.x),V1(e.y)}function Jz(e,t,n){return e==="position"||e==="preserve-aspect"&&!zR(N1(t),N1(n),.2)}function nM(e){return e!==e.root&&e.scroll?.wasRoot}const rM=Xz({attachResizeListener:(e,t)=>Tl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),cm={current:void 0},Kz=Xz({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cm.current){const e=new rM({});e.mount(window),e.setOptions({layoutScroll:!0}),cm.current=e}return cm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Rg=z.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function B1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function aM(...e){return t=>{let n=!1;const a=e.map(s=>{const u=B1(s,t);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let s=0;s<a.length;s++){const u=a[s];typeof u=="function"?u():B1(e[s],null)}}}}function iM(...e){return z.useCallback(aM(...e),e)}class sM extends z.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=xp(a)&&a.offsetWidth||0,u=xp(a)&&a.offsetHeight||0,l=this.props.sizeRef.current;l.height=n.offsetHeight||0,l.width=n.offsetWidth||0,l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=u-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function oM({children:e,isPresent:t,anchorX:n,anchorY:a,root:s}){const u=z.useId(),l=z.useRef(null),d=z.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=z.useContext(Rg),m=e.props?.ref??e?.ref,g=iM(l,m);return z.useInsertionEffect(()=>{const{width:y,height:b,top:v,left:S,right:j,bottom:E}=d.current;if(t||!l.current||!y||!b)return;const N=n==="left"?`left: ${S}`:`right: ${j}`,O=a==="bottom"?`bottom: ${E}`:`top: ${v}`;l.current.dataset.motionPopId=u;const C=document.createElement("style");h&&(C.nonce=h);const P=s??document.head;return P.appendChild(C),C.sheet&&C.sheet.insertRule(`
|
|
12
|
-
[data-motion-pop-id="${u}"] {
|
|
13
|
-
position: absolute !important;
|
|
14
|
-
width: ${y}px !important;
|
|
15
|
-
height: ${b}px !important;
|
|
16
|
-
${N}px !important;
|
|
17
|
-
${O}px !important;
|
|
18
|
-
}
|
|
19
|
-
`),()=>{P.contains(C)&&P.removeChild(C)}},[t]),f.jsx(sM,{isPresent:t,childRef:l,sizeRef:d,children:z.cloneElement(e,{ref:g})})}const lM=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:u,mode:l,anchorX:d,anchorY:h,root:m})=>{const g=ig(uM),y=z.useId();let b=!0,v=z.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:S=>{g.set(S,!0);for(const j of g.values())if(!j)return;a&&a()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[n,g,a]);return u&&b&&(v={...v}),z.useMemo(()=>{g.forEach((S,j)=>g.set(j,!1))},[n]),z.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=f.jsx(oM,{isPresent:n,anchorX:d,anchorY:h,root:m,children:e})),f.jsx(ld.Provider,{value:v,children:e})};function uM(){return new Map}function Qz(e=!0){const t=z.useContext(ld);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,u=z.useId();z.useEffect(()=>{if(e)return s(u)},[e]);const l=z.useCallback(()=>e&&a&&a(u),[u,a,e]);return!n&&a?[!1,l]:[!0]}const hc=e=>e.key||"";function Z1(e){const t=[];return z.Children.forEach(e,n=>{z.isValidElement(n)&&t.push(n)}),t}const cM=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:u="sync",propagate:l=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[g,y]=Qz(l),b=z.useMemo(()=>Z1(e),[e]),v=l&&!g?[]:b.map(hc),S=z.useRef(!0),j=z.useRef(b),E=ig(()=>new Map),N=z.useRef(new Set),[O,C]=z.useState(b),[P,U]=z.useState(b);TS(()=>{S.current=!1,j.current=b;for(let B=0;B<P.length;B++){const K=hc(P[B]);v.includes(K)?(E.delete(K),N.current.delete(K)):E.get(K)!==!0&&E.set(K,!1)}},[P,v.length,v.join("-")]);const R=[];if(b!==O){let B=[...b];for(let K=0;K<P.length;K++){const fe=P[K],ae=hc(fe);v.includes(ae)||(B.splice(K,0,fe),R.push(fe))}return u==="wait"&&R.length&&(B=R),U(Z1(B)),C(b),null}const{forceRender:F}=z.useContext(ag);return f.jsx(f.Fragment,{children:P.map(B=>{const K=hc(B),fe=l&&!g?!1:b===P||v.includes(K),ae=()=>{if(N.current.has(K))return;if(N.current.add(K),E.has(K))E.set(K,!0);else return;let le=!0;E.forEach(ne=>{ne||(le=!1)}),le&&(F?.(),U(j.current),l&&y?.(),a&&a())};return f.jsx(lM,{isPresent:fe,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:u,root:m,onExitComplete:fe?void 0:ae,anchorX:d,anchorY:h,children:B},K)})})},Wz=z.createContext({strict:!1}),I1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let H1=!1;function dM(){if(H1)return;const e={};for(const t in I1)e[t]={isEnabled:n=>I1[t].some(a=>!!n[a])};Nz(e),H1=!0}function e_(){return dM(),J3()}function fM(e){const t=e_();for(const n in e)t[n]={...t[n],...e[n]};Nz(t)}const hM=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Fc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hM.has(e)}let t_=e=>!Fc(e);function mM(e){typeof e=="function"&&(t_=t=>t.startsWith("on")?!Fc(t):e(t))}try{mM(require("@emotion/is-prop-valid").default)}catch{}function pM(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(t_(s)||n===!0&&Fc(s)||!t&&!Fc(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const dd=z.createContext({});function gM(e,t){if(cd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||El(n)?n:void 0,animate:El(a)?a:void 0}}return e.inherit!==!1?t:{}}function yM(e){const{initial:t,animate:n}=gM(e,z.useContext(dd));return z.useMemo(()=>({initial:t,animate:n}),[F1(t),F1(n)])}function F1(e){return Array.isArray(e)?e.join(" "):e}const Mg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function n_(e,t,n){for(const a in t)!fn(t[a])&&!Dz(a,n)&&(e[a]=t[a])}function xM({transformTemplate:e},t){return z.useMemo(()=>{const n=Mg();return Ag(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bM(e,t){const n=e.style||{},a={};return n_(a,n,e),Object.assign(a,xM(e,t)),a}function vM(e,t){const n={},a=bM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const r_=()=>({...Mg(),attrs:{}});function kM(e,t,n,a){const s=z.useMemo(()=>{const u=r_();return $z(u,t,Pz(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};n_(u,e.style,e),s.style={...u,...s.style}}return s}const wM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dg(e){return typeof e!="string"||e.includes("-")?!1:!!(wM.indexOf(e)>-1||/[A-Z]/u.test(e))}function SM(e,t,n,{latestValues:a},s,u=!1,l){const h=(l??Dg(e)?kM:vM)(t,a,s,e),m=pM(t,typeof e=="string",u),g=e!==z.Fragment?{...m,...h,ref:n}:{},{children:y}=t,b=z.useMemo(()=>fn(y)?y.get():y,[y]);return z.createElement(e,{...g,children:b})}function zM({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:_M(n,a,s,e),renderState:t()}}function _M(e,t,n,a){const s={},u=a(e,{});for(const b in u)s[b]=Rc(u[b]);let{initial:l,animate:d}=e;const h=cd(e),m=Cz(e);t&&m&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),d===void 0&&(d=t.animate));let g=n?n.initial===!1:!1;g=g||l===!1;const y=g?d:l;if(y&&typeof y!="boolean"&&!ud(y)){const b=Array.isArray(y)?y:[y];for(let v=0;v<b.length;v++){const S=zg(e,b[v]);if(S){const{transitionEnd:j,transition:E,...N}=S;for(const O in N){let C=N[O];if(Array.isArray(C)){const P=g?C.length-1:0;C=C[P]}C!==null&&(s[O]=C)}for(const O in j)s[O]=j[O]}}}return s}const a_=e=>(t,n)=>{const a=z.useContext(dd),s=z.useContext(ld),u=()=>zM(e,t,a,s);return n?u():ig(u)},jM=a_({scrapeMotionValuesFromProps:Og,createRenderState:Mg}),CM=a_({scrapeMotionValuesFromProps:Uz,createRenderState:r_}),NM=Symbol.for("motionComponentSymbol");function EM(e,t,n){const a=z.useRef(n);z.useInsertionEffect(()=>{a.current=n});const s=z.useRef(null);return z.useCallback(u=>{u&&e.onMount?.(u),t&&(u?t.mount(u):t.unmount());const l=a.current;if(typeof l=="function")if(u){const d=l(u);typeof d=="function"&&(s.current=d)}else s.current?(s.current(),s.current=null):l(u);else l&&(l.current=u)},[t])}const i_=z.createContext({});function fl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function TM(e,t,n,a,s,u){const{visualElement:l}=z.useContext(dd),d=z.useContext(Wz),h=z.useContext(ld),m=z.useContext(Rg).reducedMotion,g=z.useRef(null),y=z.useRef(!1);a=a||d.renderer,!g.current&&a&&(g.current=a(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,isSVG:u}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const b=g.current,v=z.useContext(i_);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&AM(g.current,n,s,v);const S=z.useRef(!1);z.useInsertionEffect(()=>{b&&S.current&&b.update(n,h)});const j=n[hz],E=z.useRef(!!j&&!window.MotionHandoffIsComplete?.(j)&&window.MotionHasOptimisedAnimation?.(j));return TS(()=>{y.current=!0,b&&(S.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),E.current&&b.animationState&&b.animationState.animateChanges())}),z.useEffect(()=>{b&&(!E.current&&b.animationState&&b.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(j)}),E.current=!1),b.enteringChildren=void 0)}),b}function AM(e,t,n,a){const{layoutId:s,layout:u,drag:l,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:s_(e.parent)),e.projection.setOptions({layoutId:s,layout:u,alwaysMeasureLayout:!!l||d&&fl(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function s_(e){if(e)return e.options.allowProjection!==!1?e.projection:s_(e.parent)}function dm(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&fM(a);const u=n?n==="svg":Dg(e),l=u?CM:jM;function d(m,g){let y;const b={...z.useContext(Rg),...m,layoutId:OM(m)},{isStatic:v}=b,S=yM(m),j=l(m,v);if(!v&&ES){RM();const E=MM(b);y=E.MeasureLayout,S.visualElement=TM(e,j,b,s,E.ProjectionNode,u)}return f.jsxs(dd.Provider,{value:S,children:[y&&S.visualElement?f.jsx(y,{visualElement:S.visualElement,...b}):null,SM(e,m,EM(j,S.visualElement,g),j,v,t,u)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=z.forwardRef(d);return h[NM]=e,h}function OM({layoutId:e}){const t=z.useContext(ag).id;return t&&e!==void 0?t+"-"+e:e}function RM(e,t){z.useContext(Wz).strict}function MM(e){const t=e_(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function DM(e,t){if(typeof Proxy>"u")return dm;const n=new Map,a=(u,l)=>dm(u,l,e,t),s=(u,l)=>a(u,l);return new Proxy(s,{get:(u,l)=>l==="create"?a:(n.has(l)||n.set(l,dm(l,void 0,e,t)),n.get(l))})}const $M=(e,t)=>t.isSVG??Dg(e)?new hR(t):new oR(t,{allowProjection:e!==z.Fragment});class LM extends Ya{constructor(t){super(t),t.animationState||(t.animationState=xR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ud(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let PM=0;class UM extends Ya{constructor(){super(...arguments),this.id=PM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const VM={animation:{Feature:LM},exit:{Feature:UM}};function Zl(e){return{point:{x:e.pageX,y:e.pageY}}}const BM=e=>t=>Ng(t)&&e(t,Zl(t));function xl(e,t,n,a){return Tl(e,t,BM(n),a)}const o_=({current:e})=>e?e.ownerDocument.defaultView:null,q1=(e,t)=>Math.abs(e-t);function ZM(e,t){const n=q1(e.x,t.x),a=q1(e.y,t.y);return Math.sqrt(n**2+a**2)}const G1=new Set(["auto","scroll"]);class l_{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:u=!1,distanceThreshold:l=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=hm(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,j=ZM(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!j)return;const{point:E}=v,{timestamp:N}=on;this.history.push({...E,timestamp:N});const{onStart:O,onMove:C}=this.handlers;S||(O&&O(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=fm(S,this.transformPagePoint),yt.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:j,onSessionEnd:E,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=hm(v.type==="pointercancel"?this.lastMoveEventInfo:fm(S,this.transformPagePoint),this.history);this.startEvent&&j&&j(v,O),E&&E(v,O)},!Ng(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=s||window;const h=Zl(t),m=fm(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=on;this.history=[{...g,timestamp:y}];const{onSessionStart:b}=n;b&&b(t,hm(m,this.history)),this.removeListeners=Ul(xl(this.contextWindow,"pointermove",this.handlePointerMove),xl(this.contextWindow,"pointerup",this.handlePointerUp),xl(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(G1.has(a.overflowX)||G1.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:s.x-n.x,y:s.y-n.y};u.x===0&&u.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(t,s),yt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ha(this.updatePoint)}}function fm(e,t){return t?{point:t(e.point)}:e}function Y1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hm({point:e},t){return{point:e,delta:Y1(e,u_(t)),offset:Y1(e,IM(t)),velocity:HM(t,.1)}}function IM(e){return e[0]}function u_(e){return e[e.length-1]}function HM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=u_(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>sa(t)));)n--;if(!a)return{x:0,y:0};const u=lr(s.timestamp-a.timestamp);if(u===0)return{x:0,y:0};const l={x:(s.x-a.x)/u,y:(s.y-a.y)/u};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function FM(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?St(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?St(n,e,a.max):Math.min(e,n)),e}function X1(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function qM(e,{top:t,left:n,bottom:a,right:s}){return{x:X1(e.x,n,s),y:X1(e.y,t,a)}}function J1(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function GM(e,t){return{x:J1(e.x,t.x),y:J1(e.y,t.y)}}function YM(e,t){let n=.5;const a=kn(e),s=kn(t);return s>a?n=jl(t.min,t.max-a,e.min):a>s&&(n=jl(e.min,e.max-s,t.min)),Ar(0,1,n)}function XM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Sp=.35;function JM(e=Sp){return e===!1?e=0:e===!0&&(e=Sp),{x:K1(e,"left","right"),y:K1(e,"top","bottom")}}function K1(e,t,n){return{min:Q1(e,t),max:Q1(e,n)}}function Q1(e,t){return typeof e=="number"?e:e[t]||0}const KM=new WeakMap;class QM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const u=y=>{n?(this.stopAnimation(),this.snapToCursor(Zl(y).point)):this.pauseAnimation()},l=(y,b)=>{this.stopAnimation();const{drag:v,dragPropagation:S,onDragStart:j}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=P3(v),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ir(N=>{let O=this.getAxisMotionValue(N).get()||0;if(Er.test(O)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[N];P&&(O=kn(P)*(parseFloat(O)/100))}}this.originPoint[N]=O}),j&&yt.postRender(()=>j(y,b)),pp(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:j,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:N}=b;if(S&&this.currentDirection===null){this.currentDirection=WM(N),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),E&&E(y,b)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>ir(y=>this.getAnimationState(y)==="paused"&&this.getAxisMotionValue(y).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new l_(t,{onSessionStart:u,onStart:l,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:o_(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!s||!a)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:d}=this.getProps();d&&yt.postRender(()=>d(a,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:s}=this.getProps();if(!a||!mc(t,s,this.currentDirection))return;const u=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=FM(l,this.constraints[t],this.elastic[t])),u.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&fl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=qM(a.layoutBox,t):this.constraints=!1,this.elastic=JM(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&ir(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=XM(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const u=tR(a,s.root,this.visualElement.getTransformPagePoint());let l=GM(s.layout.layoutBox,u);if(n){const d=n(Q3(l));this.hasMutatedConstraints=!!d,d&&(l=Tz(d))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=ir(g=>{if(!mc(g,n,this.currentDirection))return;let y=h&&h[g]||{};l&&(y={min:0,max:0});const b=s?200:1e6,v=s?40:1e7,S={type:"inertia",velocity:a?t[g]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return pp(this.visualElement,t),a.start(Sg(t,a,0,n,this.visualElement,!1))}stopAnimation(){ir(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ir(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){ir(n=>{const{drag:a}=this.getProps();if(!mc(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,u=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:d}=s.layout.layoutBox[n],h=u.get()||0;u.set(t[n]-St(l,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!fl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ir(l=>{const d=this.getAxisMotionValue(l);if(d&&this.constraints!==!1){const h=d.get();s[l]=YM({min:h,max:h},this.constraints[l])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),ir(l=>{if(!mc(l,t,null))return;const d=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];d.set(St(h,m,s[l]))})}addListeners(){if(!this.visualElement.current)return;KM.set(this.visualElement,this);const t=this.visualElement.current,n=xl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),y=h.target,b=y!==t&&zz(y);m&&g&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();fl(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,u=s.addEventListener("measure",a);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),yt.read(a);const l=Tl(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(ir(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=h[g].translate,y.set(y.get()+h[g].translate))}),this.visualElement.render())}));return()=>{l(),n(),u(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:u=!1,dragElastic:l=Sp,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:u,dragElastic:l,dragMomentum:d}}}function mc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function WM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class eD extends Ya{constructor(t){super(t),this.removeGroupControls=ur,this.removeListeners=ur,this.controls=new QM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ur}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const W1=e=>(t,n)=>{e&&yt.postRender(()=>e(t,n))};class tD extends Ya{constructor(){super(...arguments),this.removePointerDownListener=ur}onPointerDown(t){this.session=new l_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:o_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:W1(t),onStart:W1(n),onMove:a,onEnd:(u,l)=>{delete this.session,s&&yt.postRender(()=>s(u,l))}}}mount(){this.removePointerDownListener=xl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let mm=!1;class nD extends z.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:u}=t;u&&(n.group&&n.group.add(u),a&&a.register&&s&&a.register(u),mm&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Mc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:u}=this.props,{projection:l}=a;return l&&(l.isPresent=u,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),mm=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==u?l.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?l.promote():l.relegate()||yt.postRender(()=>{const d=l.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Cg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;mm=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function c_(e){const[t,n]=Qz(),a=z.useContext(ag);return f.jsx(nD,{...e,layoutGroup:a,switchLayoutGroup:z.useContext(i_),isPresent:t,safeToRemove:n})}const rD={pan:{Feature:tD},drag:{Feature:eD,ProjectionNode:Kz,MeasureLayout:c_}};function ek(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,u=a[s];u&&yt.postRender(()=>u(t,Zl(t)))}class aD extends Ya{mount(){const{current:t}=this.node;t&&(this.unmount=U3(t,(n,a)=>(ek(this.node,a,"Start"),s=>ek(this.node,s,"End"))))}unmount(){}}class iD extends Ya{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ul(Tl(this.node.current,"focus",()=>this.onFocus()),Tl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tk(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),u=a[s];u&&yt.postRender(()=>u(t,Zl(t)))}class sD extends Ya{mount(){const{current:t}=this.node;t&&(this.unmount=Z3(t,(n,a)=>(tk(this.node,a,"Start"),(s,{success:u})=>tk(this.node,s,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const zp=new WeakMap,pm=new WeakMap,oD=e=>{const t=zp.get(e.target);t&&t(e)},lD=e=>{e.forEach(oD)};function uD({root:e,...t}){const n=e||document;pm.has(n)||pm.set(n,{});const a=pm.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(lD,{root:e,...t})),a[s]}function cD(e,t,n){const a=uD(t);return zp.set(e,n),a.observe(e),()=>{zp.delete(e),a.unobserve(e)}}const dD={some:0,all:1};class fD extends Ya{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:s="some",once:u}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:dD[s]},d=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),b=m?g:y;b&&b(h)};return cD(this.node.current,l,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(hD(t,n))&&this.startObserver()}unmount(){}}function hD({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const mD={inView:{Feature:fD},tap:{Feature:sD},focus:{Feature:iD},hover:{Feature:aD}},pD={layout:{ProjectionNode:Kz,MeasureLayout:c_}},gD={...VM,...mD,...rD,...pD},ut=DM(gD,$M),d_=()=>{const[e,t]=z.useState(!!localStorage.getItem("morpheus.auth.token"));return z.useEffect(()=>{const s=()=>{t(!!localStorage.getItem("morpheus.auth.token"))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]),{isAuthenticated:e,login:s=>{localStorage.setItem("morpheus.auth.token",s),t(!0)},logout:()=>{localStorage.removeItem("morpheus.auth.token"),t(!1),window.location.href="/login"}}};function yD({onMenuClick:e,isDark:t,toggleTheme:n}){return f.jsxs("header",{className:"lg:hidden fixed top-0 left-0 right-0 z-50 bg-azure-surface dark:bg-black border-b border-azure-border dark:border-matrix-primary/30 p-4 flex items-center justify-between",children:[f.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(Ns,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight","aria-label":t?"Modo claro":"Modo escuro",children:t?f.jsx(xS,{className:"w-5 h-5"}):f.jsx(gS,{className:"w-5 h-5"})}),f.jsx("button",{onClick:e,className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-secondary","aria-label":"Abrir menu",children:f.jsx(gA,{className:"w-6 h-6"})})]})]})}const Pa={list:()=>be.get("/webhooks"),get:e=>be.get(`/webhooks/${e}`),create:e=>be.post("/webhooks",e),update:(e,t)=>be.put(`/webhooks/${e}`,t),delete:e=>be.delete(`/webhooks/${e}`),listNotifications:e=>{const t=new URLSearchParams;e?.webhookId&&t.set("webhookId",e.webhookId),e?.unreadOnly&&t.set("unreadOnly","true");const n=t.toString()?`?${t}`:"";return be.get(`/webhooks/notifications${n}`)},unreadCount:()=>be.get("/webhooks/notifications/unread-count"),markRead:e=>be.post("/webhooks/notifications/read",{ids:e})},Or=({open:e,onOpenChange:t,children:n})=>e?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),f.jsx("div",{className:"relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:n})]}):null,Fs=({className:e,children:t})=>f.jsx("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col ${e}`,children:f.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),Rr=({children:e})=>f.jsx("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left border-b border-azure-border dark:border-matrix-primary p-6",children:e}),Mr=({className:e,children:t})=>f.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),xD=({className:e,children:t})=>f.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),or=({className:e,variant:t="default",size:n="default",...a})=>{const d=`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 ${t==="destructive"?"bg-red-500 text-zinc-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90":t==="outline"?"border border-azure-border dark:border-matrix-primary bg-transparent hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="secondary"?"bg-azure-surface dark:bg-zinc-800 hover:bg-azure-hover dark:hover:bg-zinc-700/80 text-azure-text-primary dark:text-matrix-secondary":t==="ghost"?"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="link"?"text-azure-primary dark:text-matrix-highlight underline-offset-4 hover:underline":"bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black hover:bg-azure-primary/90 dark:hover:bg-matrix-highlight/90"} ${n==="sm"?"h-9 px-3 rounded-md":n==="lg"?"h-11 px-8 rounded-md":n==="icon"?"h-10 w-10":"h-10 px-4 py-2"} ${e||""}`;return f.jsx("button",{className:d,...a})};function bD({isOpen:e,onClose:t,onConfirm:n}){return f.jsx(Or,{open:e,onOpenChange:t,children:f.jsxs(Fs,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[f.jsx(Rr,{children:f.jsx(Mr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),f.jsxs("div",{children:[f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary mb-6",children:"Are you sure you want to restart the Morpheus agent? This will temporarily disconnect all services and channels."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[f.jsx(or,{variant:"outline",onClick:t,children:"Cancel"}),f.jsx(or,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Cs={list:e=>{const t=new URLSearchParams;e?.status&&t.set("status",e.status),e?.agent&&t.set("agent",e.agent),e?.origin_channel&&t.set("origin_channel",e.origin_channel),e?.session_id&&t.set("session_id",e.session_id),e?.limit&&t.set("limit",String(e.limit));const n=t.toString()?`?${t}`:"";return be.get(`/tasks${n}`)},get:e=>be.get(`/tasks/${e}`),stats:()=>be.get("/tasks/stats"),retry:e=>be.post(`/tasks/${e}/retry`,{}),cancel:e=>be.post(`/tasks/${e}/cancel`,{})};function vD({children:e}){const t=br(),[n,a]=z.useState(()=>{const E=localStorage.getItem("theme");return E?E==="dark":!0}),[s,u]=z.useState(!1),[l,d]=z.useState(!1),{logout:h}=d_(),{data:m}=Dt("/webhooks/notifications/unread-count",()=>Pa.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:y}=Dt("/tasks/stats",()=>Cs.stats(),{refreshInterval:5e3}),b=(y?.pending??0)+(y?.running??0),v=async()=>{try{await be.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(E){console.error("Failed to restart:",E),alert("Failed to restart the agent. Please try again.")}};z.useEffect(()=>{n?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[n]),z.useEffect(()=>{u(!1)},[t.pathname]);const S=[{icon:_0,label:"Dashboard",path:"/"},{icon:zl,label:"Chat",path:"/chat"},{icon:T0,label:"Zaion",path:"/zaion"},{icon:N0,label:"MCP Servers",path:"/mcp-servers"},{icon:Zm,label:"Usage Stats",path:"/stats"},{icon:Pc,label:"Model Pricing",path:"/model-pricing"},{icon:Ns,label:"Sati Memories",path:"/sati-memories"},{icon:Gm,label:"Webhooks",path:"/webhooks"},{icon:Fm,label:"Tasks",path:"/tasks"},{icon:$s,label:"Trinity DBs",path:"/trinity-databases"},{icon:Za,label:"Chronos",path:"/chronos"},{icon:qm,label:"Logs",path:"/logs"}],j=[{icon:_0,label:"Dashboard",path:"/"},{icon:zl,label:"Chat",path:"/chat"},{icon:T0,label:"Zaion",path:"/zaion"},{icon:N0,label:"MCP Servers",path:"/mcp-servers"},{icon:Zm,label:"Usage Stats",path:"/stats"},{icon:Pc,label:"Model Pricing",path:"/model-pricing"},{icon:Ns,label:"Sati Memories",path:"/sati-memories"},{icon:Gm,label:"Webhooks",path:"/webhooks"},{icon:Fm,label:"Tasks",path:"/tasks"},{icon:$s,label:"Trinity DBs",path:"/trinity-databases"},{icon:Za,label:"Chronos",path:"/chronos"},{icon:qm,label:"Logs",path:"/logs"}];return f.jsxs("div",{className:"flex flex-col h-screen bg-azure-bg dark:bg-black text-azure-text-primary dark:text-matrix-secondary font-mono overflow-hidden transition-colors duration-300",children:[f.jsx(yD,{onMenuClick:()=>u(!0),isDark:n,toggleTheme:()=>a(!n)}),f.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",f.jsxs("div",{className:"hidden lg:flex w-64 border-r border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-black flex-col shrink-0 transition-colors duration-300",children:[f.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[f.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(Ns,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsx("button",{onClick:()=>a(!n),className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors",children:n?f.jsx(xS,{className:"w-4 h-4"}):f.jsx(gS,{className:"w-4 h-4"})})]}),f.jsxs("nav",{className:"flex-1 p-2 space-y-0.5",children:[S.map(E=>{const N=t.pathname===E.path;return f.jsxs(Va,{to:E.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsx(E.icon,{className:"w-4 h-4 shrink-0"}),f.jsx("span",{children:E.label}),E.path==="/tasks"&&b>0&&f.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:b>99?"99+":b})]},E.path)}),f.jsxs(Va,{to:"/notifications",className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[f.jsxs("div",{className:"relative shrink-0",children:[f.jsx(Sl,{className:"w-4 h-4"}),g>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),f.jsx("span",{children:"Notifications"}),g>0&&f.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]},"/notifications")]}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[f.jsx(E0,{className:"w-4 h-4 shrink-0"}),f.jsx("span",{children:"Restart"})]})}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[f.jsx(j0,{className:"w-4 h-4 shrink-0"}),f.jsx("span",{children:"Logout"})]})})]}),f.jsx(cM,{children:s&&f.jsxs(ut.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),children:[f.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),f.jsxs(ut.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[f.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(Ns,{className:"w-6 h-6"}),"MORPHEUS"]}),f.jsx("button",{onClick:()=>u(!1),className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors","aria-label":"Fechar menu",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[j.map(E=>{const N=t.pathname===E.path;return f.jsxs(Va,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[f.jsx(E.icon,{className:"w-5 h-5"}),f.jsx("span",{children:E.label}),E.path==="/tasks"&&b>0&&f.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:b>99?"99+":b})]},E.path)}),f.jsxs(Va,{to:"/notifications",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[f.jsxs("div",{className:"relative",children:[f.jsx(Sl,{className:"w-5 h-5"}),g>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),f.jsx("span",{children:"Notifications"}),g>0&&f.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]})]}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>{d(!0),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[f.jsx(E0,{className:"w-5 h-5"}),f.jsx("span",{children:"Restart"})]})}),f.jsx("div",{className:"p-2",children:f.jsxs("button",{onClick:()=>{h(),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[f.jsx(j0,{className:"w-5 h-5"}),f.jsx("span",{children:"Logout"})]})})]})]})}),f.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[f.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),f.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(18,16,16,0)_50%,rgba(0,0,0,0.1)_50%),linear-gradient(90deg,rgba(0,255,0,0.03),rgba(0,255,0,0.01))] bg-[length:100%_2px,3px_100%] opacity-0 dark:opacity-20 transition-opacity duration-300"})]})]}),f.jsx(M4,{}),f.jsx(bD,{isOpen:l,onClose:()=>d(!1),onConfirm:v})]})}const kD={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},zi=({title:e,value:t,icon:n,subValue:a})=>f.jsxs(ut.div,{variants:kD,className:"border border-azure-border dark:border-matrix-primary bg-azure-surface/50 dark:bg-zinc-950/50 p-6 rounded relative overflow-hidden group hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",children:[f.jsxs("div",{className:"flex justify-between items-start mb-4",children:[f.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),f.jsx(n,{className:"w-6 h-6 text-azure-primary dark:text-matrix-primary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),f.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&f.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),_p={fetchUsageStats:async()=>be.get("/stats/usage"),fetchGroupedUsageStats:async()=>be.get("/stats/usage/grouped")};function wD(){const{data:e}=Dt("/api/stats/usage",_p.fetchUsageStats,{refreshInterval:5e3});return f.jsxs(f.Fragment,{children:[f.jsx(zi,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:dS,subValue:"Tokens processed"}),f.jsx(zi,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:fS,subValue:"Tokens generated"})]})}function SD(){const{data:e}=CS(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return f.jsxs(ut.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[f.jsxs(ut.div,{variants:n,children:[f.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight mb-2",children:"SYSTEM STATUS"}),f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"Overview of the Morpheus agent runtime."})]}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[f.jsx(zi,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:Ns,subValue:e?`PID: ${e.pid}`:""}),f.jsx(zi,{title:"Uptime",value:e?NS(e.uptimeSeconds):"-",icon:Za,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),f.jsx(zi,{title:"Version",value:e?.projectVersion||"-",icon:pS,subValue:`Node ${e?.nodeVersion||"-"}`}),f.jsx(zi,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:RT,subValue:"LLM Inference Engine"}),f.jsx(zi,{title:"Model",value:e?.llmModel||"-",icon:AT,subValue:"Active Model"}),f.jsx(wD,{})]})]})}const zD=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:u,onRenameSession:l,isOpen:d,toggleSidebar:h})=>{const[m,g]=z.useState(null),[y,b]=z.useState(""),v=z.useRef(null);z.useEffect(()=>{m&&v.current&&v.current.focus()},[m]);const S=(O,C)=>{O.stopPropagation(),g(C.id),b(C.title||"Untitled Session")},j=O=>{O?.stopPropagation(),m&&y.trim()&&(l(m,y.trim()),g(null))},E=O=>{O?.stopPropagation(),g(null)},N=O=>{O.key==="Enter"?j():O.key==="Escape"&&E()};return d?f.jsxs("div",{className:"w-80 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col h-full transition-all duration-300",children:[f.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-matrix-primary/30 flex justify-between items-center bg-azure-bg dark:bg-black",children:[f.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),f.jsx("button",{onClick:h,className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",children:f.jsx(zl,{size:18})})]}),f.jsx("div",{className:"p-4",children:f.jsxs("button",{onClick:a,className:"w-full flex items-center justify-center gap-2 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black py-2 px-4 rounded-lg hover:bg-azure-secondary dark:hover:bg-matrix-secondary transition-colors shadow-sm",children:[f.jsx(C0,{size:18}),f.jsx("span",{children:"New Chat"})]})}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(O=>f.jsxs("div",{onClick:()=>n(O.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===O.id?"bg-azure-hover dark:bg-matrix-primary/20 border-azure-primary dark:border-matrix-highlight":"hover:bg-gray-50 dark:hover:bg-matrix-primary/10 border-transparent"}`,children:[f.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===O.id?f.jsx("div",{className:"flex items-center gap-1 w-full",onClick:C=>C.stopPropagation(),children:f.jsx("input",{ref:v,type:"text",value:y,onChange:C=>b(C.target.value),onKeyDown:N,className:"w-full text-sm px-1 py-0.5 bg-white dark:bg-black border border-azure-primary dark:border-matrix-highlight rounded focus:outline-none dark:text-matrix-highlight"})}):f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`text-sm font-medium truncate ${t===O.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:O.title||"Untitled Session"}),f.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(O.started_at).toLocaleString()})]})}),f.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===O.id?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:j,className:"p-1.5 text-green-600 hover:bg-green-50 dark:text-matrix-highlight dark:hover:bg-matrix-primary/20 rounded",title:"Save",children:f.jsx(Im,{size:14})}),f.jsx("button",{onClick:E,className:"p-1.5 text-red-500 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 rounded",title:"Cancel",children:f.jsx(eg,{size:14})})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:C=>S(C,O),className:"p-1.5 text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 dark:text-matrix-secondary/50 dark:hover:text-blue-400 rounded",title:"Rename",children:f.jsx(Wp,{size:14})}),f.jsx("button",{onClick:C=>{C.stopPropagation(),s(O.id)},className:"p-1.5 text-gray-400 hover:text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-900/20 dark:text-matrix-secondary/50 dark:hover:text-amber-500 rounded",title:"Archive",children:f.jsx(kT,{size:14})}),f.jsx("button",{onClick:C=>{C.stopPropagation(),u(O.id)},className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 dark:text-matrix-secondary/50 dark:hover:text-red-500 rounded",title:"Delete",children:f.jsx(Ti,{size:14})})]})})]},O.id)),e.length===0&&f.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):f.jsxs("div",{className:"w-16 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col items-center py-4 space-y-4 transition-colors duration-300",children:[f.jsx("button",{onClick:h,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",title:"Expand Sidebar",children:f.jsx(zl,{})}),f.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),f.jsx("button",{onClick:a,className:"p-3 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black rounded-full hover:bg-azure-secondary dark:hover:bg-matrix-secondary shadow-lg transition-all",title:"New Session",children:f.jsx(C0,{size:20})})]})};function _D(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ND={};function nk(e,t){return(ND.jsx?CD:jD).test(e)}const ED=/[ \t\n\f\r]/g;function TD(e){return typeof e=="object"?e.type==="text"?rk(e.value):!1:rk(e)}function rk(e){return e.replace(ED,"")===""}class Il{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Il.prototype.normal={};Il.prototype.property={};Il.prototype.space=void 0;function f_(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Il(n,a,t)}function jp(e){return e.toLowerCase()}class Rn{constructor(t,n){this.attribute=n,this.property=t}}Rn.prototype.attribute="";Rn.prototype.booleanish=!1;Rn.prototype.boolean=!1;Rn.prototype.commaOrSpaceSeparated=!1;Rn.prototype.commaSeparated=!1;Rn.prototype.defined=!1;Rn.prototype.mustUseProperty=!1;Rn.prototype.number=!1;Rn.prototype.overloadedBoolean=!1;Rn.prototype.property="";Rn.prototype.spaceSeparated=!1;Rn.prototype.space=void 0;let AD=0;const Me=Ri(),Vt=Ri(),Cp=Ri(),ue=Ri(),dt=Ri(),Us=Ri(),In=Ri();function Ri(){return 2**++AD}const Np=Object.freeze(Object.defineProperty({__proto__:null,boolean:Me,booleanish:Vt,commaOrSpaceSeparated:In,commaSeparated:Us,number:ue,overloadedBoolean:Cp,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),gm=Object.keys(Np);class $g extends Rn{constructor(t,n,a,s){let u=-1;if(super(t,n),ak(this,"space",s),typeof a=="number")for(;++u<gm.length;){const l=gm[u];ak(this,gm[u],(a&Np[l])===Np[l])}}}$g.prototype.defined=!0;function ak(e,t,n){n&&(e[t]=n)}function no(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const u=new $g(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[jp(a)]=a,n[jp(u.attribute)]=a}return new Il(t,n,e.space)}const h_=no({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:dt,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:ue,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:dt,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Vt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function m_(e,t){return t in e?e[t]:t}function p_(e,t){return m_(e,t.toLowerCase())}const OD=no({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Us,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:Me,allowPaymentRequest:Me,allowUserMedia:Me,alt:null,as:null,async:Me,autoCapitalize:null,autoComplete:dt,autoFocus:Me,autoPlay:Me,blocking:dt,capture:null,charSet:null,checked:Me,cite:null,className:dt,cols:ue,colSpan:null,content:null,contentEditable:Vt,controls:Me,controlsList:dt,coords:ue|Us,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Me,defer:Me,dir:null,dirName:null,disabled:Me,download:Cp,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Me,formTarget:null,headers:dt,height:ue,hidden:Cp,high:ue,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:Me,inputMode:null,integrity:null,is:null,isMap:Me,itemId:null,itemProp:dt,itemRef:dt,itemScope:Me,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Me,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Me,muted:Me,name:null,nonce:null,noModule:Me,noValidate:Me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Me,optimum:ue,pattern:null,ping:dt,placeholder:null,playsInline:Me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Me,referrerPolicy:null,rel:dt,required:Me,reversed:Me,rows:ue,rowSpan:ue,sandbox:dt,scope:null,scoped:Me,seamless:Me,selected:Me,shadowRootClonable:Me,shadowRootDelegatesFocus:Me,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Me,useMap:null,value:Vt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Me,declare:Me,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Me,noHref:Me,noShade:Me,noWrap:Me,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Me,disableRemotePlayback:Me,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:p_}),RD=no({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:In,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Me,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Us,g2:Us,glyphName:Us,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:In,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:In,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:In,rev:In,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:In,requiredFeatures:In,requiredFonts:In,requiredFormats:In,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:In,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:In,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:In,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:m_}),g_=no({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),y_=no({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:p_}),x_=no({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),MD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},DD=/[A-Z]/g,ik=/-[a-z]/g,$D=/^data[-\w.:]+$/i;function LD(e,t){const n=jp(t);let a=t,s=Rn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$D.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(ik,UD);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!ik.test(u)){let l=u.replace(DD,PD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=$g}return new s(a,t)}function PD(e){return"-"+e.toLowerCase()}function UD(e){return e.charAt(1).toUpperCase()}const VD=f_([h_,OD,g_,y_,x_],"html"),Lg=f_([h_,RD,g_,y_,x_],"svg");function BD(e){return e.join(" ").trim()}var ks={},ym,sk;function ZD(){if(sk)return ym;sk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
|
|
20
|
-
`,m="/",g="*",y="",b="comment",v="declaration";function S(E,N){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];N=N||{};var O=1,C=1;function P(oe){var ie=oe.match(t);ie&&(O+=ie.length);var L=oe.lastIndexOf(h);C=~L?oe.length-L:C+oe.length}function U(){var oe={line:O,column:C};return function(ie){return ie.position=new R(oe),K(),ie}}function R(oe){this.start=oe,this.end={line:O,column:C},this.source=N.source}R.prototype.content=E;function F(oe){var ie=new Error(N.source+":"+O+":"+C+": "+oe);if(ie.reason=oe,ie.filename=N.source,ie.line=O,ie.column=C,ie.source=E,!N.silent)throw ie}function B(oe){var ie=oe.exec(E);if(ie){var L=ie[0];return P(L),E=E.slice(L.length),ie}}function K(){B(n)}function fe(oe){var ie;for(oe=oe||[];ie=ae();)ie!==!1&&oe.push(ie);return oe}function ae(){var oe=U();if(!(m!=E.charAt(0)||g!=E.charAt(1))){for(var ie=2;y!=E.charAt(ie)&&(g!=E.charAt(ie)||m!=E.charAt(ie+1));)++ie;if(ie+=2,y===E.charAt(ie-1))return F("End of comment missing");var L=E.slice(2,ie-2);return C+=2,P(L),E=E.slice(ie),C+=2,oe({type:b,comment:L})}}function le(){var oe=U(),ie=B(a);if(ie){if(ae(),!B(s))return F("property missing ':'");var L=B(u),J=oe({type:v,property:j(ie[0].replace(e,y)),value:L?j(L[0].replace(e,y)):y});return B(l),J}}function ne(){var oe=[];fe(oe);for(var ie;ie=le();)ie!==!1&&(oe.push(ie),fe(oe));return oe}return K(),ne()}function j(E){return E?E.replace(d,y):y}return ym=S,ym}var ok;function ID(){if(ok)return ks;ok=1;var e=ks&&ks.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=n;const t=e(ZD());function n(a,s){let u=null;if(!a||typeof a!="string")return u;const l=(0,t.default)(a),d=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;d?s(m,g,h):g&&(u=u||{},u[m]=g)}),u}return ks}var il={},lk;function HD(){if(lk)return il;lk=1,Object.defineProperty(il,"__esModule",{value:!0}),il.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},l=function(m,g){return g.toUpperCase()},d=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(s,d):m=m.replace(a,d),m.replace(t,l))};return il.camelCase=h,il}var sl,uk;function FD(){if(uk)return sl;uk=1;var e=sl&&sl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(ID()),n=HD();function a(s,u){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(d,h){d&&h&&(l[(0,n.camelCase)(d,u)]=h)}),l}return a.default=a,sl=a,sl}var qD=FD();const GD=Ip(qD),b_=v_("end"),Pg=v_("start");function v_(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function YD(e){const t=Pg(e),n=b_(e);if(t&&n)return{start:t,end:n}}function bl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ck(e.position):"start"in e||"end"in e?ck(e):"line"in e||"column"in e?Ep(e):""}function Ep(e){return dk(e&&e.line)+":"+dk(e&&e.column)}function ck(e){return Ep(e&&e.start)+"-"+Ep(e&&e.end)}function dk(e){return e&&typeof e=="number"?e:1}class hn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",u={},l=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?s=t:!u.cause&&t&&(l=!0,s=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?u.ruleId=a:(u.source=a.slice(0,h),u.ruleId=a.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const d=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=bl(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=l&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const Ug={}.hasOwnProperty,XD=new Map,JD=/[A-Z]/g,KD=new Set(["table","tbody","thead","tfoot","tr"]),QD=new Set(["td","th"]),k_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function WD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=o5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=s5(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Lg:VD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=w_(s,e,void 0);return u&&typeof u!="string"?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}function w_(e,t,n){if(t.type==="element")return e5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return t5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return r5(e,t,n);if(t.type==="mdxjsEsm")return n5(e,t);if(t.type==="root")return a5(e,t,n);if(t.type==="text")return i5(e,t)}function e5(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Lg,e.schema=s),e.ancestors.push(t);const u=z_(e,t.tagName,!1),l=l5(e,t);let d=Bg(e,t);return KD.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!TD(h):!0})),S_(e,l,u,t),Vg(l,d),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function t5(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Al(e,t.position)}function n5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Al(e,t.position)}function r5(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Lg,e.schema=s),e.ancestors.push(t);const u=t.name===null?e.Fragment:z_(e,t.name,!0),l=u5(e,t),d=Bg(e,t);return S_(e,l,u,t),Vg(l,d),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function a5(e,t,n){const a={};return Vg(a,Bg(e,t)),e.create(t,e.Fragment,a,n)}function i5(e,t){return t.value}function S_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Vg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function s5(e,t,n){return a;function a(s,u,l,d){const m=Array.isArray(l.children)?n:t;return d?m(u,l,d):m(u,l)}}function o5(e,t){return n;function n(a,s,u,l){const d=Array.isArray(u.children),h=Pg(a);return t(s,u,l,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function l5(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&Ug.call(t.properties,s)){const u=c5(e,s,t.properties[s]);if(u){const[l,d]=u;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&QD.has(t.tagName)?a=d:n[l]=d}}if(a){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function u5(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const l=u.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Al(e,t.position);else{const s=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,u=e.evaluater.evaluateExpression(d.expression)}else Al(e,t.position);else u=a.value===null?!0:a.value;n[s]=u}return n}function Bg(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:XD;for(;++a<t.children.length;){const u=t.children[a];let l;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=s.get(h)||0;l=h+"-"+m,s.set(h,m+1)}}const d=w_(e,u,l);d!==void 0&&n.push(d)}return n}function c5(e,t,n){const a=LD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?_D(n):BD(n)),a.property==="style"){let s=typeof n=="object"?n:d5(e,String(n));return e.stylePropertyNameCase==="css"&&(s=f5(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?MD[a.property]||a.property:a.attribute,n]}}function d5(e,t){try{return GD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=k_+"#cannot-parse-style-attribute",s}}function z_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let u=-1,l;for(;++u<s.length;){const d=nk(s[u])?{type:"Identifier",name:s[u]}:{type:"Literal",value:s[u]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(u&&d.type==="Literal"),optional:!1}:d}a=l}else a=nk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Ug.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Al(e)}function Al(e,t){const n=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=k_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function f5(e){const t={};let n;for(n in e)Ug.call(e,n)&&(t[h5(n)]=e[n]);return t}function h5(e){let t=e.replace(JD,m5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function m5(e){return"-"+e.toLowerCase()}const xm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},p5={};function g5(e,t){const n=p5,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return __(e,a,s)}function __(e,t,n){if(y5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return fk(e.children,t,n)}return Array.isArray(e)?fk(e,t,n):""}function fk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=__(e[s],t,n);return a.join("")}function y5(e){return!!(e&&typeof e=="object")}const hk=document.createElement("i");function Zg(e){const t="&"+e+";";hk.innerHTML=t;const n=hk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Dr(e,t,n,a){const s=e.length;let u=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)l=Array.from(a),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);u<a.length;)l=a.slice(u,u+1e4),l.unshift(t,0),e.splice(...l),u+=1e4,t+=1e4}function sr(e,t){return e.length>0?(Dr(e,e.length,0,t),e):t}const mk={}.hasOwnProperty;function x5(e){const t={};let n=-1;for(;++n<e.length;)b5(t,e[n]);return t}function b5(e,t){let n;for(n in t){const s=(mk.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let l;if(u)for(l in u){mk.call(s,l)||(s[l]=[]);const d=u[l];v5(s[l],Array.isArray(d)?d:d?[d]:[])}}}function v5(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Dr(e,0,0,a)}function j_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Vs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nr=Xa(/[A-Za-z]/),Hn=Xa(/[\dA-Za-z]/),k5=Xa(/[#-'*+\--9=?A-Z^-~]/);function Tp(e){return e!==null&&(e<32||e===127)}const Ap=Xa(/\d/),w5=Xa(/[\dA-Fa-f]/),S5=Xa(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function On(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const z5=Xa(new RegExp("\\p{P}|\\p{S}","u")),_5=Xa(/\s/);function Xa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ro(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const u=e.charCodeAt(n);let l="";if(u===37&&Hn(e.charCodeAt(n+1))&&Hn(e.charCodeAt(n+2)))s=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(l=String.fromCharCode(u));else if(u>55295&&u<57344){const d=e.charCodeAt(n+1);u<56320&&d>56319&&d<57344?(l=String.fromCharCode(u,d),s=1):l="�"}else l=String.fromCharCode(u);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function ft(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return Ge(h)?(e.enter(n),d(h)):t(h)}function d(h){return Ge(h)&&u++<s?(e.consume(h),d):(e.exit(n),t(h))}}const j5={tokenize:C5};function C5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ft(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),u(d)}function u(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ne(d)?(e.consume(d),e.exit("chunkText"),u):(e.consume(d),l)}}const N5={tokenize:E5},pk={tokenize:T5};function E5(e){const t=this,n=[];let a=0,s,u,l;return d;function d(C){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,h,m)(C)}return m(C)}function h(C){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&O();const P=t.events.length;let U=P,R;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){R=t.events[U][1].end;break}N(a);let F=P;for(;F<t.events.length;)t.events[F][1].end={...R},F++;return Dr(t.events,U+1,0,t.events.slice(P)),t.events.length=F,m(C)}return d(C)}function m(C){if(a===n.length){if(!s)return b(C);if(s.currentConstruct&&s.currentConstruct.concrete)return S(C);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pk,g,y)(C)}function g(C){return s&&O(),N(a),b(C)}function y(C){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(C)}function b(C){return t.containerState={},e.attempt(pk,v,S)(C)}function v(C){return a++,n.push([t.currentConstruct,t.containerState]),b(C)}function S(C){if(C===null){s&&O(),N(0),e.consume(C);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),j(C)}function j(C){if(C===null){E(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return Ne(C)?(e.consume(C),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(C),j)}function E(C,P){const U=t.sliceStream(C);if(P&&U.push(null),C.previous=u,u&&(u.next=C),u=C,s.defineSkip(C.start),s.write(U),t.parser.lazy[C.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<l&&(!s.events[R][1].end||s.events[R][1].end.offset>l))return;const F=t.events.length;let B=F,K,fe;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(K){fe=t.events[B][1].end;break}K=!0}for(N(a),R=F;R<t.events.length;)t.events[R][1].end={...fe},R++;Dr(t.events,B+1,0,t.events.slice(F)),t.events.length=R}}function N(C){let P=n.length;for(;P-- >C;){const U=n[P];t.containerState=U[1],U[0].exit.call(t,e)}n.length=C}function O(){s.write([null]),u=void 0,s=void 0,t.containerState._closeFlow=void 0}}function T5(e,t,n){return ft(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gk(e){if(e===null||On(e)||_5(e))return 1;if(z5(e))return 2}function Ig(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const u=e[s].resolveAll;u&&!a.includes(u)&&(t=u(t,n),a.push(u))}return t}const Op={name:"attention",resolveAll:A5,tokenize:O5};function A5(e,t){let n=-1,a,s,u,l,d,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[a][1].end},b={...e[n][1].start};yk(y,-h),yk(b,h),l={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[a][1].end={...l.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=sr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=sr(m,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=sr(m,Ig(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=sr(m,[["exit",u,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=sr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Dr(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function O5(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=gk(a);let u;return l;function l(h){return u=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===u)return e.consume(h),d;const m=e.exit("attentionSequence"),g=gk(h),y=!g||g===2&&s||n.includes(h),b=!s||s===2&&g||n.includes(a);return m._open=!!(u===42?y:y&&(s||!b)),m._close=!!(u===42?b:b&&(g||!y)),t(h)}}function yk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R5={name:"autolink",tokenize:M5};function M5(e,t,n){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(v){return Nr(v)?(e.consume(v),l):v===64?n(v):m(v)}function l(v){return v===43||v===45||v===46||Hn(v)?(a=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||Hn(v))&&a++<32?(e.consume(v),d):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Tp(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),g):k5(v)?(e.consume(v),m):n(v)}function g(v){return Hn(v)?y(v):n(v)}function y(v){return v===46?(e.consume(v),a=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||Hn(v))&&a++<63){const S=v===45?b:y;return e.consume(v),S}return n(v)}}const fd={partial:!0,tokenize:D5};function D5(e,t,n){return a;function a(u){return Ge(u)?ft(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||Ne(u)?t(u):n(u)}}const C_={continuation:{tokenize:L5},exit:P5,name:"blockQuote",tokenize:$5};function $5(e,t,n){const a=this;return s;function s(l){if(l===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),u}return n(l)}function u(l){return Ge(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function L5(e,t,n){const a=this;return s;function s(l){return Ge(l)?ft(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt(C_,t,n)(l)}}function P5(e){e.exit("blockQuote")}const N_={name:"characterEscape",tokenize:U5};function U5(e,t,n){return a;function a(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),s}function s(u){return S5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const E_={name:"characterReference",tokenize:V5};function V5(e,t,n){const a=this;let s=0,u,l;return d;function d(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,l=Hn,g(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,l=w5,g):(e.enter("characterReferenceValue"),u=7,l=Ap,g(y))}function g(y){if(y===59&&s){const b=e.exit("characterReferenceValue");return l===Hn&&!Zg(a.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&s++<u?(e.consume(y),g):n(y)}}const xk={partial:!0,tokenize:Z5},bk={concrete:!0,name:"codeFenced",tokenize:B5};function B5(e,t,n){const a=this,s={partial:!0,tokenize:U};let u=0,l=0,d;return h;function h(R){return m(R)}function m(R){const F=a.events[a.events.length-1];return u=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,d=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===d?(l++,e.consume(R),g):l<3?n(R):(e.exit("codeFencedFenceSequence"),Ge(R)?ft(e,y,"whitespace")(R):y(R))}function y(R){return R===null||Ne(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(xk,j,P)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(R)):Ge(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ft(e,v,"whitespace")(R)):R===96&&R===d?n(R):(e.consume(R),b)}function v(R){return R===null||Ne(R)?y(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Ne(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(R)):R===96&&R===d?n(R):(e.consume(R),S)}function j(R){return e.attempt(s,P,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),N}function N(R){return u>0&&Ge(R)?ft(e,O,"linePrefix",u+1)(R):O(R)}function O(R){return R===null||Ne(R)?e.check(xk,j,P)(R):(e.enter("codeFlowValue"),C(R))}function C(R){return R===null||Ne(R)?(e.exit("codeFlowValue"),O(R)):(e.consume(R),C)}function P(R){return e.exit("codeFenced"),t(R)}function U(R,F,B){let K=0;return fe;function fe(ie){return R.enter("lineEnding"),R.consume(ie),R.exit("lineEnding"),ae}function ae(ie){return R.enter("codeFencedFence"),Ge(ie)?ft(R,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):le(ie)}function le(ie){return ie===d?(R.enter("codeFencedFenceSequence"),ne(ie)):B(ie)}function ne(ie){return ie===d?(K++,R.consume(ie),ne):K>=l?(R.exit("codeFencedFenceSequence"),Ge(ie)?ft(R,oe,"whitespace")(ie):oe(ie)):B(ie)}function oe(ie){return ie===null||Ne(ie)?(R.exit("codeFencedFence"),F(ie)):B(ie)}}}function Z5(e,t,n){const a=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const bm={name:"codeIndented",tokenize:H5},I5={partial:!0,tokenize:F5};function H5(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),ft(e,u,"linePrefix",5)(m)}function u(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(m):n(m)}function l(m){return m===null?h(m):Ne(m)?e.attempt(I5,l,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Ne(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function F5(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):ft(e,u,"linePrefix",5)(l)}function u(l){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):Ne(l)?s(l):n(l)}}const q5={name:"codeText",previous:Y5,resolve:G5,tokenize:X5};function G5(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function Y5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function X5(e,t,n){let a=0,s,u;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),d(y)}function d(y){return y===96?(e.consume(y),a++,d):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(u=e.enter("codeTextSequence"),s=0,g(y)):Ne(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Ne(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),m)}function g(y){return y===96?(e.consume(y),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(u.type="codeTextData",m(y))}}class J5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&ol(this.left,a),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ol(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ol(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ol(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ol(this.left,n.reverse())}}}function ol(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function T_(e){const t={};let n=-1,a,s,u,l,d,h,m;const g=new J5(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,K5(g,n)),n=t[n],m=!0);else if(a[1]._container){for(u=n,s=void 0;u--;)if(l=g.get(u),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=u);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},d=g.slice(s,n),d.unshift(a),g.splice(s,n-s+1,d))}}return Dr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function K5(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const u=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,h=[],m={};let g,y,b=-1,v=n,S=0,j=0;const E=[j];for(;v;){for(;e.get(++s)[1]!==v;);u.push(s),v._tokenizer||(g=a.sliceStream(v),v.next||g.push(null),y&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=v,v=v.next}for(v=n;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(j=b+1,E.push(j),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),b=E.length;b--;){const N=d.slice(E[b],E[b+1]),O=u.pop();h.push([O,O+N.length-1]),e.splice(O,2,N)}for(h.reverse(),b=-1;++b<h.length;)m[S+h[b][0]]=S+h[b][1],S+=h[b][1]-h[b][0]-1;return m}const Q5={resolve:e$,tokenize:t$},W5={partial:!0,tokenize:n$};function e$(e){return T_(e),e}function t$(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?u(d):Ne(d)?e.check(W5,l,u)(d):(e.consume(d),s)}function u(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function n$(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ft(e,u,"linePrefix")}function u(l){if(l===null||Ne(l))return n(l);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function A_(e,t,n,a,s,u,l,d,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return y;function y(N){return N===60?(e.enter(a),e.enter(s),e.enter(u),e.consume(N),e.exit(u),b):N===null||N===32||N===41||Tp(N)?n(N):(e.enter(a),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),j(N))}function b(N){return N===62?(e.enter(u),e.consume(N),e.exit(u),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(d),b(N)):N===null||N===60||Ne(N)?n(N):(e.consume(N),N===92?S:v)}function S(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function j(N){return!g&&(N===null||N===41||On(N))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(a),t(N)):g<m&&N===40?(e.consume(N),g++,j):N===41?(e.consume(N),g--,j):N===null||N===32||N===40||Tp(N)?n(N):(e.consume(N),N===92?E:j)}function E(N){return N===40||N===41||N===92?(e.consume(N),j):j(N)}}function O_(e,t,n,a,s,u){const l=this;let d=0,h;return m;function m(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(u),g}function g(v){return d>999||v===null||v===91||v===93&&!h||v===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(u),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):Ne(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===null||v===91||v===93||Ne(v)||d++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!Ge(v)),v===92?b:y)}function b(v){return v===91||v===92||v===93?(e.consume(v),d++,y):y(v)}}function R_(e,t,n,a,s,u){let l;return d;function d(b){return b===34||b===39||b===40?(e.enter(a),e.enter(s),e.consume(b),e.exit(s),l=b===40?41:b,h):n(b)}function h(b){return b===l?(e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):(e.enter(u),m(b))}function m(b){return b===l?(e.exit(u),h(l)):b===null?n(b):Ne(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ft(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||Ne(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?y:g)}function y(b){return b===l||b===92?(e.consume(b),g):g(b)}}function vl(e,t){let n;return a;function a(s){return Ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Ge(s)?ft(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const r$={name:"definition",tokenize:i$},a$={partial:!0,tokenize:s$};function i$(e,t,n){const a=this;let s;return u;function u(v){return e.enter("definition"),l(v)}function l(v){return O_.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return s=Vs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return On(v)?vl(e,m)(v):m(v)}function m(v){return A_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(a$,y,y)(v)}function y(v){return Ge(v)?ft(e,b,"whitespace")(v):b(v)}function b(v){return v===null||Ne(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function s$(e,t,n){return a;function a(d){return On(d)?vl(e,s)(d):n(d)}function s(d){return R_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function u(d){return Ge(d)?ft(e,l,"whitespace")(d):l(d)}function l(d){return d===null||Ne(d)?t(d):n(d)}}const o$={name:"hardBreakEscape",tokenize:l$};function l$(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),s}function s(u){return Ne(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const u$={name:"headingAtx",resolve:c$,tokenize:d$};function c$(e,t){let n=e.length-2,a=3,s,u;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},u={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Dr(e,a,n-a+1,[["enter",s,t],["enter",u,t],["exit",u,t],["exit",s,t]])),e}function d$(e,t,n){let a=0;return s;function s(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&a++<6?(e.consume(g),l):g===null||On(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ne(g)?(e.exit("atxHeading"),t(g)):Ge(g)?ft(e,d,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),d(g))}function m(g){return g===null||g===35||On(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),m)}}const f$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vk=["pre","script","style","textarea"],h$={concrete:!0,name:"htmlFlow",resolveTo:g$,tokenize:y$},m$={partial:!0,tokenize:b$},p$={partial:!0,tokenize:x$};function g$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function y$(e,t,n){const a=this;let s,u,l,d,h;return m;function m(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),y}function y(w){return w===33?(e.consume(w),b):w===47?(e.consume(w),u=!0,j):w===63?(e.consume(w),s=3,a.interrupt?t:A):Nr(w)?(e.consume(w),l=String.fromCharCode(w),E):n(w)}function b(w){return w===45?(e.consume(w),s=2,v):w===91?(e.consume(w),s=5,d=0,S):Nr(w)?(e.consume(w),s=4,a.interrupt?t:A):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:A):n(w)}function S(w){const X="CDATA[";return w===X.charCodeAt(d++)?(e.consume(w),d===X.length?a.interrupt?t:le:S):n(w)}function j(w){return Nr(w)?(e.consume(w),l=String.fromCharCode(w),E):n(w)}function E(w){if(w===null||w===47||w===62||On(w)){const X=w===47,me=l.toLowerCase();return!X&&!u&&vk.includes(me)?(s=1,a.interrupt?t(w):le(w)):f$.includes(l.toLowerCase())?(s=6,X?(e.consume(w),N):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?O(w):C(w))}return w===45||Hn(w)?(e.consume(w),l+=String.fromCharCode(w),E):n(w)}function N(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function O(w){return Ge(w)?(e.consume(w),O):fe(w)}function C(w){return w===47?(e.consume(w),fe):w===58||w===95||Nr(w)?(e.consume(w),P):Ge(w)?(e.consume(w),C):fe(w)}function P(w){return w===45||w===46||w===58||w===95||Hn(w)?(e.consume(w),P):U(w)}function U(w){return w===61?(e.consume(w),R):Ge(w)?(e.consume(w),U):C(w)}function R(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,F):Ge(w)?(e.consume(w),R):B(w)}function F(w){return w===h?(e.consume(w),h=null,K):w===null||Ne(w)?n(w):(e.consume(w),F)}function B(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||On(w)?U(w):(e.consume(w),B)}function K(w){return w===47||w===62||Ge(w)?C(w):n(w)}function fe(w){return w===62?(e.consume(w),ae):n(w)}function ae(w){return w===null||Ne(w)?le(w):Ge(w)?(e.consume(w),ae):n(w)}function le(w){return w===45&&s===2?(e.consume(w),L):w===60&&s===1?(e.consume(w),J):w===62&&s===4?(e.consume(w),T):w===63&&s===3?(e.consume(w),A):w===93&&s===5?(e.consume(w),he):Ne(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(m$,G,ne)(w)):w===null||Ne(w)?(e.exit("htmlFlowData"),ne(w)):(e.consume(w),le)}function ne(w){return e.check(p$,oe,G)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ie}function ie(w){return w===null||Ne(w)?ne(w):(e.enter("htmlFlowData"),le(w))}function L(w){return w===45?(e.consume(w),A):le(w)}function J(w){return w===47?(e.consume(w),l="",Z):le(w)}function Z(w){if(w===62){const X=l.toLowerCase();return vk.includes(X)?(e.consume(w),T):le(w)}return Nr(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),Z):le(w)}function he(w){return w===93?(e.consume(w),A):le(w)}function A(w){return w===62?(e.consume(w),T):w===45&&s===2?(e.consume(w),A):le(w)}function T(w){return w===null||Ne(w)?(e.exit("htmlFlowData"),G(w)):(e.consume(w),T)}function G(w){return e.exit("htmlFlow"),t(w)}}function x$(e,t,n){const a=this;return s;function s(l){return Ne(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u):n(l)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function b$(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(fd,t,n)}}const v$={name:"htmlText",tokenize:k$};function k$(e,t,n){const a=this;let s,u,l;return d;function d(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),U):A===63?(e.consume(A),C):Nr(A)?(e.consume(A),B):n(A)}function m(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),u=0,S):Nr(A)?(e.consume(A),O):n(A)}function g(A){return A===45?(e.consume(A),v):n(A)}function y(A){return A===null?n(A):A===45?(e.consume(A),b):Ne(A)?(l=y,J(A)):(e.consume(A),y)}function b(A){return A===45?(e.consume(A),v):y(A)}function v(A){return A===62?L(A):A===45?b(A):y(A)}function S(A){const T="CDATA[";return A===T.charCodeAt(u++)?(e.consume(A),u===T.length?j:S):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):Ne(A)?(l=j,J(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),N):j(A)}function N(A){return A===62?L(A):A===93?(e.consume(A),N):j(A)}function O(A){return A===null||A===62?L(A):Ne(A)?(l=O,J(A)):(e.consume(A),O)}function C(A){return A===null?n(A):A===63?(e.consume(A),P):Ne(A)?(l=C,J(A)):(e.consume(A),C)}function P(A){return A===62?L(A):C(A)}function U(A){return Nr(A)?(e.consume(A),R):n(A)}function R(A){return A===45||Hn(A)?(e.consume(A),R):F(A)}function F(A){return Ne(A)?(l=F,J(A)):Ge(A)?(e.consume(A),F):L(A)}function B(A){return A===45||Hn(A)?(e.consume(A),B):A===47||A===62||On(A)?K(A):n(A)}function K(A){return A===47?(e.consume(A),L):A===58||A===95||Nr(A)?(e.consume(A),fe):Ne(A)?(l=K,J(A)):Ge(A)?(e.consume(A),K):L(A)}function fe(A){return A===45||A===46||A===58||A===95||Hn(A)?(e.consume(A),fe):ae(A)}function ae(A){return A===61?(e.consume(A),le):Ne(A)?(l=ae,J(A)):Ge(A)?(e.consume(A),ae):K(A)}function le(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,ne):Ne(A)?(l=le,J(A)):Ge(A)?(e.consume(A),le):(e.consume(A),oe)}function ne(A){return A===s?(e.consume(A),s=void 0,ie):A===null?n(A):Ne(A)?(l=ne,J(A)):(e.consume(A),ne)}function oe(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||On(A)?K(A):(e.consume(A),oe)}function ie(A){return A===47||A===62||On(A)?K(A):n(A)}function L(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function J(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Z}function Z(A){return Ge(A)?ft(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):he(A)}function he(A){return e.enter("htmlTextData"),l(A)}}const Hg={name:"labelEnd",resolveAll:_$,resolveTo:j$,tokenize:C$},w$={tokenize:N$},S$={tokenize:E$},z$={tokenize:T$};function _$(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Dr(e,0,e.length,n),e}function j$(e,t){let n=e.length,a=0,s,u,l,d;for(;n--;)if(s=e[n][1],u){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(u=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[u+a+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=sr(d,e.slice(u+1,u+a+3)),d=sr(d,[["enter",g,t]]),d=sr(d,Ig(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),d=sr(d,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),d=sr(d,e.slice(l+1)),d=sr(d,[["exit",h,t]]),Dr(e,u,e.length,d),e}function C$(e,t,n){const a=this;let s=a.events.length,u,l;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){u=a.events[s][1];break}return d;function d(b){return u?u._inactive?y(b):(l=a.parser.defined.includes(Vs(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt(w$,g,l?g:y)(b):b===91?e.attempt(S$,g,l?m:y)(b):l?g(b):y(b)}function m(b){return e.attempt(z$,g,y)(b)}function g(b){return t(b)}function y(b){return u._balanced=!0,n(b)}}function N$(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),s}function s(y){return On(y)?vl(e,u)(y):u(y)}function u(y){return y===41?g(y):A_(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return On(y)?vl(e,h)(y):g(y)}function d(y){return n(y)}function h(y){return y===34||y===39||y===40?R_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function m(y){return On(y)?vl(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function E$(e,t,n){const a=this;return s;function s(d){return O_.call(a,e,u,l,"reference","referenceMarker","referenceString")(d)}function u(d){return a.parser.defined.includes(Vs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function T$(e,t,n){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),s}function s(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const A$={name:"labelStartImage",resolveAll:Hg.resolveAll,tokenize:O$};function O$(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),u}function u(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const R$={name:"labelStartLink",resolveAll:Hg.resolveAll,tokenize:M$};function M$(e,t,n){const a=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),u}function u(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const vm={name:"lineEnding",tokenize:D$};function D$(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ft(e,t,"linePrefix")}}const Dc={name:"thematicBreak",tokenize:$$};function $$(e,t,n){let a=0,s;return u;function u(m){return e.enter("thematicBreak"),l(m)}function l(m){return s=m,d(m)}function d(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Ne(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Ge(m)?ft(e,d,"whitespace")(m):d(m))}}const Tn={continuation:{tokenize:V$},exit:Z$,name:"list",tokenize:U$},L$={partial:!0,tokenize:I$},P$={partial:!0,tokenize:B$};function U$(e,t,n){const a=this,s=a.events[a.events.length-1];let u=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return d;function d(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Ap(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Dc,n,m)(v):m(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return Ap(v)&&++l<10?(e.consume(v),h):(!a.interrupt||l<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(fd,a.interrupt?n:g,e.attempt(L$,b,y))}function g(v){return a.containerState.initialBlankLine=!0,u++,b(v)}function y(v){return Ge(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function V$(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(fd,s,u);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ft(e,t,"listItemIndent",a.containerState.size+1)(d)}function u(d){return a.containerState.furtherBlankLines||!Ge(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(P$,t,l)(d))}function l(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,ft(e,e.attempt(Tn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function B$(e,t,n){const a=this;return ft(e,s,"listItemIndent",a.containerState.size+1);function s(u){const l=a.events[a.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===a.containerState.size?t(u):n(u)}}function Z$(e){e.exit(this.containerState.type)}function I$(e,t,n){const a=this;return ft(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(u){const l=a.events[a.events.length-1];return!Ge(u)&&l&&l[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const kk={name:"setextUnderline",resolveTo:H$,tokenize:F$};function H$(e,t){let n=e.length,a,s,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",u?(e.splice(s,0,["enter",l,t]),e.splice(u+1,0,["exit",e[a][1],t]),e[a][1].end={...e[u][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function F$(e,t,n){const a=this;let s;return u;function u(m){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),s=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===s?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Ge(m)?ft(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ne(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const q$={tokenize:G$};function G$(e){const t=this,n=e.attempt(fd,a,e.attempt(this.parser.constructs.flowInitial,s,ft(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Q5,s)),"linePrefix")));return n;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Y$={resolveAll:D_()},X$=M_("string"),J$=M_("text");function M_(e){return{resolveAll:D_(e==="text"?K$:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],u=n.attempt(s,l,d);return l;function l(g){return m(g)?u(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),u(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const y=s[g];let b=-1;if(y)for(;++b<y.length;){const v=y[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function D_(e){return t;function t(n,a){let s=-1,u;for(;++s<=n.length;)u===void 0?n[s]&&n[s][1].type==="data"&&(u=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==u+2&&(n[u][1].end=n[s-1][1].end,n.splice(u+2,s-u-2),s=u+2),u=void 0);return e?e(n,a):n}}function K$(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let u=s.length,l=-1,d=0,h;for(;u--;){const m=s[u];if(typeof m=="string"){for(l=m.length;m.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(m===-2)h=!0,d++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?l:a.start._bufferIndex+l,_index:a.start._index+u,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const Q$={42:Tn,43:Tn,45:Tn,48:Tn,49:Tn,50:Tn,51:Tn,52:Tn,53:Tn,54:Tn,55:Tn,56:Tn,57:Tn,62:C_},W$={91:r$},e6={[-2]:bm,[-1]:bm,32:bm},t6={35:u$,42:Dc,45:[kk,Dc],60:h$,61:kk,95:Dc,96:bk,126:bk},n6={38:E_,92:N_},r6={[-5]:vm,[-4]:vm,[-3]:vm,33:A$,38:E_,42:Op,60:[R5,v$],91:R$,92:[o$,N_],93:Hg,95:Op,96:q5},a6={null:[Op,Y$]},i6={null:[42,95]},s6={null:[]},o6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:i6,contentInitial:W$,disable:s6,document:Q$,flow:t6,flowInitial:e6,insideSpan:a6,string:n6,text:r6},Symbol.toStringTag,{value:"Module"}));function l6(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},u=[];let l=[],d=[];const h={attempt:F(U),check:F(R),consume:O,enter:C,exit:P,interrupt:F(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:y};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function y(ae){return l=sr(l,ae),E(),l[l.length-1]!==null?[]:(B(t,0),m.events=Ig(u,m.events,m),m.events)}function b(ae,le){return c6(v(ae),le)}function v(ae){return u6(l,ae)}function S(){const{_bufferIndex:ae,_index:le,line:ne,column:oe,offset:ie}=a;return{_bufferIndex:ae,_index:le,line:ne,column:oe,offset:ie}}function j(ae){s[ae.line]=ae.column,fe()}function E(){let ae;for(;a._index<l.length;){const le=l[a._index];if(typeof le=="string")for(ae=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ae&&a._bufferIndex<le.length;)N(le.charCodeAt(a._bufferIndex));else N(le)}}function N(ae){g=g(ae)}function O(ae){Ne(ae)?(a.line++,a.column=1,a.offset+=ae===-3?2:1,fe()):ae!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=ae}function C(ae,le){const ne=le||{};return ne.type=ae,ne.start=S(),m.events.push(["enter",ne,m]),d.push(ne),ne}function P(ae){const le=d.pop();return le.end=S(),m.events.push(["exit",le,m]),le}function U(ae,le){B(ae,le.from)}function R(ae,le){le.restore()}function F(ae,le){return ne;function ne(oe,ie,L){let J,Z,he,A;return Array.isArray(oe)?G(oe):"tokenize"in oe?G([oe]):T(oe);function T(D){return ce;function ce(Ae){const je=Ae!==null&&D[Ae],Ye=Ae!==null&&D.null,Nt=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(Ye)?Ye:Ye?[Ye]:[]];return G(Nt)(Ae)}}function G(D){return J=D,Z=0,D.length===0?L:w(D[Z])}function w(D){return ce;function ce(Ae){return A=K(),he=D,D.partial||(m.currentConstruct=D),D.name&&m.parser.constructs.disable.null.includes(D.name)?me():D.tokenize.call(le?Object.assign(Object.create(m),le):m,h,X,me)(Ae)}}function X(D){return ae(he,A),ie}function me(D){return A.restore(),++Z<J.length?w(J[Z]):L}}}function B(ae,le){ae.resolveAll&&!u.includes(ae)&&u.push(ae),ae.resolve&&Dr(m.events,le,m.events.length-le,ae.resolve(m.events.slice(le),m)),ae.resolveTo&&(m.events=ae.resolveTo(m.events,m))}function K(){const ae=S(),le=m.previous,ne=m.currentConstruct,oe=m.events.length,ie=Array.from(d);return{from:oe,restore:L};function L(){a=ae,m.previous=le,m.currentConstruct=ne,m.events.length=oe,d=ie,fe()}}function fe(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function u6(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,u=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(a,u)];else{if(l=e.slice(n,s),a>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(a):l.shift()}u>0&&l.push(e[s].slice(0,u))}return l}function c6(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const u=e[n];let l;if(typeof u=="string")l=u;else switch(u){case-5:{l="\r";break}case-4:{l=`
|
|
21
|
-
`;break}case-3:{l=`\r
|
|
22
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(u)}s=u===-2,a.push(l)}return a.join("")}function d6(e){const a={constructs:x5([o6,...(e||{}).extensions||[]]),content:s(j5),defined:[],document:s(N5),flow:s(q$),lazy:{},string:s(X$),text:s(J$)};return a;function s(u){return l;function l(d){return l6(a,u,d)}}}function f6(e){for(;!T_(e););return e}const wk=/[\0\t\n\r]/g;function h6(){let e=1,t="",n=!0,a;return s;function s(u,l,d){const h=[];let m,g,y,b,v;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(l||void 0).decode(u)),y=0,t="",n&&(u.charCodeAt(0)===65279&&y++,n=void 0);y<u.length;){if(wk.lastIndex=y,m=wk.exec(u),b=m&&m.index!==void 0?m.index:u.length,v=u.charCodeAt(b),!m){t=u.slice(y);break}if(v===10&&y===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<b&&(h.push(u.slice(y,b)),e+=b-y),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}y=b+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const m6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function p6(e){return e.replace(m6,g6)}function g6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),u=s===120||s===88;return j_(n.slice(u?2:1),u?16:10)}return Zg(n)||e}const $_={}.hasOwnProperty;function y6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),x6(n)(f6(d6(n).document().write(h6()(e,t,!0))))}function x6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(tt),autolinkProtocol:K,autolinkEmail:K,atxHeading:u(qn),blockQuote:u(Ye),characterEscape:K,characterReference:K,codeFenced:u(Nt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Nt,l),codeText:u(Jt,l),codeTextData:K,data:K,codeFlowValue:K,definition:u(et),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(wt),hardBreakEscape:u(Ie),hardBreakTrailing:u(Ie),htmlFlow:u(st,l),htmlFlowData:K,htmlText:u(st,l),htmlTextData:K,image:u(ht),label:l,link:u(tt),listItem:u(Gn),listItemValue:b,listOrdered:u(Kt,y),listUnordered:u(Kt),paragraph:u(Ot),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(qn),strong:u(Ft),thematicBreak:u($i)},exit:{atxHeading:h(),atxHeadingSequence:U,autolink:h(),autolinkEmail:je,autolinkProtocol:Ae,blockQuote:h(),characterEscapeValue:fe,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:D,characterReference:ce,codeFenced:h(E),codeFencedFence:j,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:fe,codeIndented:h(N),codeText:h(ie),codeTextData:fe,data:fe,definition:h(),definitionDestinationString:P,definitionLabelString:O,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ne),htmlFlowData:fe,htmlText:h(oe),htmlTextData:fe,image:h(J),label:he,labelText:Z,lineEnding:ae,link:h(L),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:X,resourceDestinationString:A,resourceTitleString:T,resource:G,setextHeading:h(B),setextHeadingLineSequence:F,setextHeadingText:R,strong:h(),thematicBreak:h()}};L_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let de={type:"root",children:[]};const ke={stack:[de],tokenStack:[],config:t,enter:d,exit:m,buffer:l,resume:g,data:n},Ce=[];let Be=-1;for(;++Be<W.length;)if(W[Be][1].type==="listOrdered"||W[Be][1].type==="listUnordered")if(W[Be][0]==="enter")Ce.push(Be);else{const mn=Ce.pop();Be=s(W,mn,Be)}for(Be=-1;++Be<W.length;){const mn=t[W[Be][0]];$_.call(mn,W[Be][1].type)&&mn[W[Be][1].type].call(Object.assign({sliceSerialize:W[Be][2].sliceSerialize},ke),W[Be][1])}if(ke.tokenStack.length>0){const mn=ke.tokenStack[ke.tokenStack.length-1];(mn[1]||Sk).call(ke,void 0,mn[0])}for(de.position={start:Ma(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ma(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)de=t.transforms[Be](de)||de;return de}function s(W,de,ke){let Ce=de-1,Be=-1,mn=!1,Dn,pn,qt,wn;for(;++Ce<=ke;){const ot=W[Ce];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Be++:Be--,wn=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(Dn&&!wn&&!Be&&!qt&&(qt=Ce),wn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wn=void 0}if(!Be&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Be===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(Dn){let ua=Ce;for(pn=void 0;ua--;){const fr=W[ua];if(fr[1].type==="lineEnding"||fr[1].type==="lineEndingBlank"){if(fr[0]==="exit")continue;pn&&(W[pn][1].type="lineEndingBlank",mn=!0),fr[1].type="lineEnding",pn=ua}else if(!(fr[1].type==="linePrefix"||fr[1].type==="blockQuotePrefix"||fr[1].type==="blockQuotePrefixWhitespace"||fr[1].type==="blockQuoteMarker"||fr[1].type==="listItemIndent"))break}qt&&(!pn||qt<pn)&&(Dn._spread=!0),Dn.end=Object.assign({},pn?W[pn][1].start:ot[1].end),W.splice(pn||Ce,0,["exit",Dn,ot[2]]),Ce++,ke++}if(ot[1].type==="listItemPrefix"){const ua={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};Dn=ua,W.splice(Ce,0,["enter",ua,ot[2]]),Ce++,ke++,qt=void 0,wn=!0}}}return W[de][1]._spread=mn,ke}function u(W,de){return ke;function ke(Ce){d.call(this,W(Ce),Ce),de&&de.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(W,de,ke){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([de,ke||void 0]),W.position={start:Ma(de.start),end:void 0}}function h(W){return de;function de(ke){W&&W.call(this,ke),m.call(this,ke)}}function m(W,de){const ke=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==W.type&&(de?de.call(this,W,Ce[0]):(Ce[1]||Sk).call(this,W,Ce[0]));else throw new Error("Cannot close `"+W.type+"` ("+bl({start:W.start,end:W.end})+"): it’s not open");ke.position.end=Ma(W.end)}function g(){return g5(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(W){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function v(){const W=this.resume(),de=this.stack[this.stack.length-1];de.lang=W}function S(){const W=this.resume(),de=this.stack[this.stack.length-1];de.meta=W}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W.replace(/(\r?\n|\r)$/g,"")}function O(W){const de=this.resume(),ke=this.stack[this.stack.length-1];ke.label=de,ke.identifier=Vs(this.sliceSerialize(W)).toLowerCase()}function C(){const W=this.resume(),de=this.stack[this.stack.length-1];de.title=W}function P(){const W=this.resume(),de=this.stack[this.stack.length-1];de.url=W}function U(W){const de=this.stack[this.stack.length-1];if(!de.depth){const ke=this.sliceSerialize(W).length;de.depth=ke}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function F(W){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function K(W){const ke=this.stack[this.stack.length-1].children;let Ce=ke[ke.length-1];(!Ce||Ce.type!=="text")&&(Ce=mt(),Ce.position={start:Ma(W.start),end:void 0},ke.push(Ce)),this.stack.push(Ce)}function fe(W){const de=this.stack.pop();de.value+=this.sliceSerialize(W),de.position.end=Ma(W.end)}function ae(W){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=de.children[de.children.length-1];ke.position.end=Ma(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(K.call(this,W),fe.call(this,W))}function le(){this.data.atHardBreak=!0}function ne(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W}function oe(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W}function ie(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W}function L(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=de,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function J(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=de,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function Z(W){const de=this.sliceSerialize(W),ke=this.stack[this.stack.length-2];ke.label=p6(de),ke.identifier=Vs(de).toLowerCase()}function he(){const W=this.stack[this.stack.length-1],de=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Ce=W.children;ke.children=Ce}else ke.alt=de}function A(){const W=this.resume(),de=this.stack[this.stack.length-1];de.url=W}function T(){const W=this.resume(),de=this.stack[this.stack.length-1];de.title=W}function G(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function X(W){const de=this.resume(),ke=this.stack[this.stack.length-1];ke.label=de,ke.identifier=Vs(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function me(W){this.data.characterReferenceType=W.type}function D(W){const de=this.sliceSerialize(W),ke=this.data.characterReferenceType;let Ce;ke?(Ce=j_(de,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Zg(de);const Be=this.stack[this.stack.length-1];Be.value+=Ce}function ce(W){const de=this.stack.pop();de.position.end=Ma(W.end)}function Ae(W){fe.call(this,W);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(W)}function je(W){fe.call(this,W);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(W)}function Ye(){return{type:"blockquote",children:[]}}function Nt(){return{type:"code",lang:null,meta:null,value:""}}function Jt(){return{type:"inlineCode",value:""}}function et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wt(){return{type:"emphasis",children:[]}}function qn(){return{type:"heading",depth:0,children:[]}}function Ie(){return{type:"break"}}function st(){return{type:"html",value:""}}function ht(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function Kt(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Gn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Ot(){return{type:"paragraph",children:[]}}function Ft(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function $i(){return{type:"thematicBreak"}}}function Ma(e){return{line:e.line,column:e.column,offset:e.offset}}function L_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?L_(e,a):b6(e,a)}}function b6(e,t){let n;for(n in t)if($_.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Sk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bl({start:t.start,end:t.end})+") is still open")}function v6(e){const t=this;t.parser=n;function n(a){return y6(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function k6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function w6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
23
|
-
`}]}function S6(e,t){const n=t.value?t.value+`
|
|
24
|
-
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function z6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=ro(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let l,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=u+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function C6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function N6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function P_(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),u=s[0];u&&u.type==="text"?u.value="["+u.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=a:s.push({type:"text",value:a}),s}function E6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return P_(e,t);const s={src:ro(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,u),e.applyData(t,u)}function T6(e,t){const n={src:ro(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function A6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function O6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return P_(e,t);const s={href:ro(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function R6(e,t){const n={href:ro(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function M6(e,t,n){const a=e.all(t),s=n?D6(n):U_(t),u={},l=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const g=a[d];(s||d!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
25
|
-
`}),g.type==="element"&&g.tagName==="p"&&!s?l.push(...g.children):l.push(g)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
26
|
-
`});const m={type:"element",tagName:"li",properties:u,children:l};return e.patch(t,m),e.applyData(t,m)}function D6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=U_(n[a])}return t}function U_(e){const t=e.spread;return t??e.children.length>1}function $6(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const l=a[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function L6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function U6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V6(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Pg(t.children[1]),h=b_(t.children[t.children.length-1]);d&&h&&(l.position={start:d,end:h}),s.push(l)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)}function B6(e,t,n){const a=n?n.children:void 0,u=(a?a.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const y=t.children[h],b={},v=l?l[h]:void 0;v&&(b.align=v);let S={type:"element",tagName:u,properties:b,children:[]};y&&(S.children=e.all(y),e.patch(y,S),S=e.applyData(y,S)),m.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function Z6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const zk=9,_k=32;function I6(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const u=[];for(;a;)u.push(jk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return u.push(jk(t.slice(s),s>0,!1)),u.join("")}function jk(e,t,n){let a=0,s=e.length;if(t){let u=e.codePointAt(a);for(;u===zk||u===_k;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(s-1);for(;u===zk||u===_k;)s--,u=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function H6(e,t){const n={type:"text",value:I6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function F6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const q6={blockquote:k6,break:w6,code:S6,delete:z6,emphasis:_6,footnoteReference:j6,heading:C6,html:N6,imageReference:E6,image:T6,inlineCode:A6,linkReference:O6,link:R6,listItem:M6,list:$6,paragraph:L6,root:P6,strong:U6,table:V6,tableCell:Z6,tableRow:B6,text:H6,thematicBreak:F6,toml:pc,yaml:pc,definition:pc,footnoteDefinition:pc};function pc(){}const V_=-1,hd=0,kl=1,qc=2,Fg=3,qg=4,Gg=5,Yg=6,B_=7,Z_=8,Ck=typeof self=="object"?self:globalThis,G6=(e,t)=>{const n=(s,u)=>(e.set(u,s),s),a=s=>{if(e.has(s))return e.get(s);const[u,l]=t[s];switch(u){case hd:case V_:return n(l,s);case kl:{const d=n([],s);for(const h of l)d.push(a(h));return d}case qc:{const d=n({},s);for(const[h,m]of l)d[a(h)]=a(m);return d}case Fg:return n(new Date(l),s);case qg:{const{source:d,flags:h}=l;return n(new RegExp(d,h),s)}case Gg:{const d=n(new Map,s);for(const[h,m]of l)d.set(a(h),a(m));return d}case Yg:{const d=n(new Set,s);for(const h of l)d.add(a(h));return d}case B_:{const{name:d,message:h}=l;return n(new Ck[d](h),s)}case Z_:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(new Ck[u](l),s)};return a},Nk=e=>G6(new Map,e)(0),ws="",{toString:Y6}={},{keys:X6}=Object,ll=e=>{const t=typeof e;if(t!=="object"||!e)return[hd,t];const n=Y6.call(e).slice(8,-1);switch(n){case"Array":return[kl,ws];case"Object":return[qc,ws];case"Date":return[Fg,ws];case"RegExp":return[qg,ws];case"Map":return[Gg,ws];case"Set":return[Yg,ws];case"DataView":return[kl,n]}return n.includes("Array")?[kl,n]:n.includes("Error")?[B_,n]:[qc,n]},gc=([e,t])=>e===hd&&(t==="function"||t==="symbol"),J6=(e,t,n,a)=>{const s=(l,d)=>{const h=a.push(l)-1;return n.set(d,h),h},u=l=>{if(n.has(l))return n.get(l);let[d,h]=ll(l);switch(d){case hd:{let g=l;switch(h){case"bigint":d=Z_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([V_],l)}return s([d,g],l)}case kl:{if(h){let b=l;return h==="DataView"?b=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(l)),s([h,[...b]],l)}const g=[],y=s([d,g],l);for(const b of l)g.push(u(b));return y}case qc:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return u(l.toJSON());const g=[],y=s([d,g],l);for(const b of X6(l))(e||!gc(ll(l[b])))&&g.push([u(b),u(l[b])]);return y}case Fg:return s([d,l.toISOString()],l);case qg:{const{source:g,flags:y}=l;return s([d,{source:g,flags:y}],l)}case Gg:{const g=[],y=s([d,g],l);for(const[b,v]of l)(e||!(gc(ll(b))||gc(ll(v))))&&g.push([u(b),u(v)]);return y}case Yg:{const g=[],y=s([d,g],l);for(const b of l)(e||!gc(ll(b)))&&g.push(u(b));return y}}const{message:m}=l;return s([d,{name:h,message:m}],l)};return u},Ek=(e,{json:t,lossy:n}={})=>{const a=[];return J6(!(t||n),!!t,new Map,a)(e),a},Gc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Nk(Ek(e,t)):structuredClone(e):(e,t)=>Nk(Ek(e,t));function K6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Q6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function W6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||K6,a=e.options.footnoteBackLabel||Q6,s=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),y=String(m.identifier).toUpperCase(),b=ro(y.toLowerCase());let v=0;const S=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++v<=j;){S.length>0&&S.push({type:"text",value:" "});let O=typeof n=="string"?n:n(h,v);typeof O=="string"&&(O={type:"text",value:O}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const O=E.children[E.children.length-1];O&&O.type==="text"?O.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else g.push(...S);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(m,N),d.push(N)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Gc(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
27
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
28
|
-
`}]}}const I_=(function(e){if(e==null)return rL;if(typeof e=="function")return md(e);if(typeof e=="object")return Array.isArray(e)?eL(e):tL(e);if(typeof e=="string")return nL(e);throw new Error("Expected function, string, or object as test")});function eL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=I_(e[n]);return md(a);function a(...s){let u=-1;for(;++u<t.length;)if(t[u].apply(this,s))return!0;return!1}}function tL(e){const t=e;return md(n);function n(a){const s=a;let u;for(u in e)if(s[u]!==t[u])return!1;return!0}}function nL(e){return md(t);function t(n){return n&&n.type===e}}function md(e){return t;function t(n,a,s){return!!(aL(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function rL(){return!0}function aL(e){return e!==null&&typeof e=="object"&&"type"in e}const H_=[],iL=!0,Tk=!1,sL="skip";function oL(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const u=I_(s),l=a?-1:1;d(e,void 0,[])();function d(h,m,g){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=H_,S,j,E;if((!t||u(h,m,g[g.length-1]||void 0))&&(v=lL(n(h,g)),v[0]===Tk))return v;if("children"in h&&h.children){const N=h;if(N.children&&v[0]!==sL)for(j=(a?N.children.length:-1)+l,E=g.concat(N);j>-1&&j<N.children.length;){const O=N.children[j];if(S=d(O,j,E)(),S[0]===Tk)return S;j=typeof S[1]=="number"?S[1]:j+l}}return v}}}function lL(e){return Array.isArray(e)?e:typeof e=="number"?[iL,e]:e==null?H_:[e]}function F_(e,t,n,a){let s,u,l;typeof t=="function"&&typeof n!="function"?(u=void 0,l=t,s=n):(u=t,l=n,s=a),oL(e,u,d,s);function d(h,m){const g=m[m.length-1],y=g?g.children.indexOf(h):void 0;return l(h,y,g)}}const Rp={}.hasOwnProperty,uL={};function cL(e,t){const n=t||uL,a=new Map,s=new Map,u=new Map,l={...q6,...n.handlers},d={all:m,applyData:fL,definitionById:a,footnoteById:s,footnoteCounts:u,footnoteOrder:[],handlers:l,one:h,options:n,patch:dL,wrap:mL};return F_(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:s,b=String(g.identifier).toUpperCase();y.has(b)||y.set(b,g)}}),d;function h(g,y){const b=g.type,v=d.handlers[b];if(Rp.call(d.handlers,b)&&v)return v(d,g,y);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in g){const{children:j,...E}=g,N=Gc(E);return N.children=d.all(g),N}return Gc(g)}return(d.options.unknownHandler||hL)(d,g,y)}function m(g){const y=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const S=d.one(b[v],g);if(S){if(v&&b[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Ak(S.value)),!Array.isArray(S)&&S.type==="element")){const j=S.children[0];j&&j.type==="text"&&(j.value=Ak(j.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function dL(e,t){e.position&&(t.position=YD(e))}function fL(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,u=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const l="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:l}}n.type==="element"&&u&&Object.assign(n.properties,Gc(u)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function hL(e,t){const n=t.data||{},a="value"in t&&!(Rp.call(n,"hProperties")||Rp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function mL(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
29
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
30
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
31
|
-
`}),n}function Ak(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ok(e,t){const n=cL(e,t),a=n.one(e,void 0),s=W6(n),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&u.children.push({type:"text",value:`
|
|
32
|
-
`},s),u}function pL(e,t){return e&&"run"in e?async function(n,a){const s=Ok(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Ok(n,{file:a,...e||t})}}function Rk(e){if(e)throw e}var km,Mk;function gL(){if(Mk)return km;Mk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},l=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},d=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return km=function h(){var m,g,y,b,v,S,j=arguments[0],E=1,N=arguments.length,O=!1;for(typeof j=="boolean"&&(O=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<N;++E)if(m=arguments[E],m!=null)for(g in m)y=d(j,g),b=d(m,g),j!==b&&(O&&b&&(u(b)||(v=s(b)))?(v?(v=!1,S=y&&s(y)?y:[]):S=y&&u(y)?y:{},l(j,{name:g,newValue:h(O,S,b)})):typeof b<"u"&&l(j,{name:g,newValue:b}));return j},km}var yL=gL();const wm=Ip(yL);function Mp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xL(){const e=[],t={run:n,use:a};return t;function n(...s){let u=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...s);function d(h,...m){const g=e[++u];let y=-1;if(h){l(h);return}for(;++y<s.length;)(m[y]===null||m[y]===void 0)&&(m[y]=s[y]);s=m,g?bL(g,d)(...m):l(null,...m)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function bL(e,t){let n;return a;function a(...l){const d=e.length>l.length;let h;d&&l.push(s);try{h=e.apply(this,l)}catch(m){const g=m;if(d&&n)throw g;return s(g)}d||(h&&h.then&&typeof h.then=="function"?h.then(u,s):h instanceof Error?s(h):u(h))}function s(l,...d){n||(n=!0,t(l,...d))}function u(l){s(null,l)}}const _r={basename:vL,dirname:kL,extname:wL,join:SL,sep:"/"};function vL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hl(e);let n=0,a=-1,s=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else a<0&&(u=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else l<0&&(u=!0,l=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function kL(e){if(Hl(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function wL(e){Hl(e);let t=e.length,n=-1,a=0,s=-1,u=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?s<0?s=t:u!==1&&(u=1):s>-1&&(u=-1)}return s<0||n<0||u===0||u===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function SL(...e){let t=-1,n;for(;++t<e.length;)Hl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zL(n)}function zL(e){Hl(e);const t=e.codePointAt(0)===47;let n=_L(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _L(e,t){let n="",a=0,s=-1,u=0,l=-1,d,h;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(s===l-1||u===1))if(s!==l-1&&u===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),s=l,u=0;continue}}else if(n.length>0){n="",a=0,s=l,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),a=l-s-1;s=l,u=0}else d===46&&u>-1?u++:u=-1}return n}function Hl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const jL={cwd:CL};function CL(){return"/"}function Dp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NL(e){if(typeof e=="string")e=new URL(e);else if(!Dp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return EL(e)}function EL(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Sm=["history","path","basename","stem","extname","dirname"];class q_{constructor(t){let n;t?Dp(t)?n={path:t}:typeof t=="string"||TL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":jL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Sm.length;){const u=Sm[a];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let s;for(s in n)Sm.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?_r.basename(this.path):void 0}set basename(t){_m(t,"basename"),zm(t,"basename"),this.path=_r.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?_r.dirname(this.path):void 0}set dirname(t){Dk(this.basename,"dirname"),this.path=_r.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?_r.extname(this.path):void 0}set extname(t){if(zm(t,"extname"),Dk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=_r.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dp(t)&&(t=NL(t)),_m(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?_r.basename(this.path,this.extname):void 0}set stem(t){_m(t,"stem"),zm(t,"stem"),this.path=_r.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new hn(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zm(e,t){if(e&&e.includes(_r.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_r.sep+"`")}function _m(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Dk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const AL=(function(e){const a=this.constructor.prototype,s=a[e],u=function(){return s.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),OL={}.hasOwnProperty;class Xg extends AL{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=xL()}copy(){const t=new Xg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(wm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Nm("data",this.frozen),this.namespace[t]=n,this):OL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Nm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=yc(t),a=this.parser||this.Parser;return jm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),jm("process",this.parser||this.Parser),Cm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(u,l){const d=yc(t),h=a.parse(d);a.run(h,d,function(g,y,b){if(g||!y||!b)return m(g);const v=y,S=a.stringify(v,b);DL(S)?b.value=S:b.result=S,m(g,b)});function m(g,y){g||!y?l(g):u?u(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),jm("processSync",this.parser||this.Parser),Cm("processSync",this.compiler||this.Compiler),this.process(t,s),Lk("processSync","process",n),a;function s(u,l){n=!0,Rk(u),a=l}}run(t,n,a){$k(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?u(void 0,a):new Promise(u);function u(l,d){const h=yc(n);s.run(t,h,m);function m(g,y,b){const v=y||t;g?d(g):l?l(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,s;return this.run(t,n,u),Lk("runSync","run",a),s;function u(l,d){Rk(l),s=d,a=!0}}stringify(t,n){this.freeze();const a=yc(n),s=this.compiler||this.Compiler;return Cm("stringify",s),$k(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(Nm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...y]=m;h(g,y)}else l(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function l(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(m.plugins),m.settings&&(s.settings=wm(!0,s.settings,m.settings))}function d(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const y=m[g];u(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let y=-1,b=-1;for(;++y<a.length;)if(a[y][0]===m){b=y;break}if(b===-1)a.push([m,...g]);else if(g.length>0){let[v,...S]=g;const j=a[b][1];Mp(j)&&Mp(v)&&(v=wm(!0,j,v)),a[b]=[m,v,...S]}}}}const RL=new Xg().freeze();function jm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Nm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $k(e){if(!Mp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yc(e){return ML(e)?e:new q_(e)}function ML(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function DL(e){return typeof e=="string"||$L(e)}function $L(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Pk=[],Uk={allowDangerousHtml:!0},PL=/^(https?|ircs?|mailto|xmpp)$/i,UL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function VL(e){const t=BL(e),n=ZL(e);return IL(t.runSync(t.parse(n),n),e)}function BL(e){const t=e.rehypePlugins||Pk,n=e.remarkPlugins||Pk,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Uk}:Uk;return RL().use(v6).use(n).use(pL,a).use(t)}function ZL(e){const t=e.children||"",n=new q_;return typeof t=="string"&&(n.value=t),n}function IL(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,u=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||HL;for(const g of UL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+LL+g.id,void 0);return F_(e,m),WD(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function m(g,y,b){if(g.type==="raw"&&b&&typeof y=="number")return l?b.children.splice(y,1):b.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let v;for(v in xm)if(Object.hasOwn(xm,v)&&Object.hasOwn(g.properties,v)){const S=g.properties[v],j=xm[v];(j===null||j.includes(g.tagName))&&(g.properties[v]=h(String(S||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!v&&a&&typeof y=="number"&&(v=!a(g,y,b)),v&&b&&typeof y=="number")return d&&g.children?b.children.splice(y,1,...g.children):b.children.splice(y,1),y}}}function HL(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||PL.test(e.slice(0,t))?e:""}const FL=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a})=>{const[s,u]=z.useState(""),l=z.useRef(null),d=()=>{l.current?.scrollIntoView({behavior:"smooth"})};z.useEffect(()=>{d()},[e,n]);const h=S=>{S.preventDefault(),!(!s.trim()||n)&&(t(s),u(""))},m=S=>S.session_id?.startsWith("sati-evaluation-")||S.tool_name?.toLowerCase().includes("sati")||S.tool_call_id?.toLowerCase().includes("sati")?!0:Array.isArray(S.tool_calls)?S.tool_calls.some(j=>String(j?.name||"").toLowerCase().includes("sati")):!1,g=S=>m(S)?"SATI Memory":"Tool Call",y=S=>{if(typeof S=="string")try{return JSON.stringify(JSON.parse(S),null,2)}catch{return S}try{return JSON.stringify(S,null,2)}catch{return String(S)}},b=S=>{const j=S.usage_metadata;if(!j||typeof j!="object")return null;const E=j.input_tokens??j.prompt_tokens??j.input??0,N=j.output_tokens??j.completion_tokens??j.output??0,O=Number(E),C=Number(N);if(!Number.isFinite(O)&&!Number.isFinite(C))return null;const P=Number.isFinite(O)?Math.max(0,Math.round(O)):0,U=Number.isFinite(C)?Math.max(0,Math.round(C)):0;return P===0&&U===0?null:{input:P,output:U}},v=S=>S.toLocaleString("pt-BR");return a?f.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((S,j)=>{const E=b(S),N=S.type==="human"?"bg-white/20 border border-white/30 text-white":"bg-gray-100 border border-gray-200 text-gray-600 dark:bg-zinc-900 dark:border-zinc-700 dark:text-gray-300";return f.jsxs("div",{className:`flex gap-4 ${S.type==="human"?"justify-end":"justify-start"}`,children:[S.type!=="human"&&f.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${S.type==="tool"?"bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400":"bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight"}`,children:S.type==="tool"?f.jsx(pS,{size:16}):f.jsx(z0,{size:18})}),f.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-sm ${S.type==="human"?"bg-azure-primary text-white dark:bg-matrix-primary dark:text-matrix-highlight dark:border dark:border-matrix-highlight/20 rounded-br-none":S.type==="tool"?"bg-white dark:bg-black border border-gray-200 dark:border-zinc-800 text-gray-800 dark:text-gray-200 rounded-bl-none":"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 text-gray-800 dark:text-matrix-secondary rounded-bl-none"}`,children:[S.type==="tool"&&f.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),f.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:y(S.content)})]}),S.type==="ai"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"prose dark:prose-invert max-w-none text-sm leading-relaxed dark:prose-p:text-matrix-secondary dark:prose-headings:text-matrix-highlight dark:prose-strong:text-matrix-highlight dark:prose-code:text-matrix-highlight",children:f.jsx(VL,{children:S.content})}),Array.isArray(S.tool_calls)&&S.tool_calls.length>0&&f.jsxs("details",{className:"mt-3 rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),f.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:y(S.tool_calls)})]})]}),S.type==="human"&&f.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:S.content}),E&&f.jsx("div",{className:"mt-3 flex justify-end",children:f.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${N}`,children:[f.jsx(fS,{size:12}),f.jsx("span",{children:v(E.input)}),f.jsx("span",{className:"opacity-60",children:"/"}),f.jsx("span",{children:v(E.output)}),f.jsx(dS,{size:12})]})})]}),S.type==="human"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-200 dark:bg-matrix-primary/20 flex items-center justify-center flex-shrink-0 text-gray-500 dark:text-matrix-secondary",children:f.jsx(XA,{size:18})})]},j)}),n&&f.jsxs("div",{className:"flex gap-4 justify-start",children:[f.jsx("div",{className:"w-8 h-8 rounded-full bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight flex items-center justify-center flex-shrink-0",children:f.jsx(z0,{size:18})}),f.jsxs("div",{className:"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 p-4 rounded-2xl rounded-bl-none shadow-sm flex items-center gap-2",children:[f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),f.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),f.jsx("div",{ref:l})]}),f.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:f.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[f.jsx("input",{type:"text",value:s,onChange:S=>u(S.target.value),placeholder:"Type your message...",className:"flex-1 bg-gray-100 dark:bg-black/50 border border-transparent dark:border-matrix-primary/30 rounded-xl px-4 py-3 focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight outline-none transition-all dark:text-matrix-highlight dark:placeholder-matrix-secondary/50",disabled:n}),f.jsx("button",{type:"submit",disabled:!s.trim()||n,className:"p-3 bg-azure-primary text-white dark:bg-matrix-secondary dark:text-black dark:hover:bg-matrix-highlight rounded-xl hover:bg-azure-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-md",children:f.jsx(MA,{size:20})})]})})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-gray-50 dark:bg-black text-gray-400 dark:text-matrix-secondary/50 h-full",children:[f.jsx(qL,{size:48,className:"mb-4 opacity-20"}),f.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},qL=({size:e,className:t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:f.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),Da={getSessions:async()=>be.get("/sessions"),createSession:async()=>be.post("/sessions",{}),deleteSession:async e=>be.delete(`/sessions/${e}`),renameSession:async(e,t)=>be.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>be.post(`/sessions/${e}/archive`,{}),getMessages:async e=>be.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>be.post("/chat",{sessionId:e,message:t})};function G_({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:u="Confirm",variant:l="default"}){return f.jsx(Or,{open:e,onOpenChange:t,children:f.jsxs(Fs,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[f.jsx(Rr,{children:f.jsx(Mr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),f.jsx("div",{className:"py-4",children:f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:s})}),f.jsxs(xD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[f.jsx(or,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),f.jsx(or,{variant:l,onClick:()=>{n(),t()},className:l==="destructive"?"dark:bg-red-900/50 dark:text-red-200 dark:hover:bg-red-800/60":"dark:bg-matrix-primary dark:text-black dark:hover:bg-matrix-highlight",children:u})]})]})})}const GL=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(null),[s,u]=z.useState([]),[l,d]=z.useState(!1),[h,m]=z.useState(!0),g=z.useRef(!1);z.useEffect(()=>{g.current=l},[l]),z.useEffect(()=>{if(!n)return;const P=setInterval(async()=>{if(!g.current)try{const R=(await Da.getMessages(n)).filter(F=>F.type!=="system");u(F=>{if(R.length!==F.length)return R;const B=R.at(-1)?.created_at??0,K=F.at(-1)?.created_at??0;return B>K?R:F})}catch{}},3e3);return()=>clearInterval(P)},[n]);const[y,b]=z.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const P=await Da.getSessions();t(P)}catch(P){console.error("Failed to load sessions:",P)}};z.useEffect(()=>{v()},[]),z.useEffect(()=>{n?S(n):u([])},[n]);const S=async P=>{try{const U=await Da.getMessages(P);u(U.filter(R=>R.type!=="system"))}catch(U){console.error("Failed to load messages:",U)}},j=async()=>{try{const P=await Da.createSession();await v(),a(P.id)}catch(P){console.error("Failed to create session:",P)}},E=async P=>{if(!n)return;const U={type:"human",content:P};u(R=>[...R,U]),d(!0);try{await Da.sendMessage(n,P),await S(n),await v()}catch(R){console.error("Failed to send message:",R)}finally{d(!1)}},N=P=>{b({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await Da.archiveSession(P),n===P&&a(null),await v()}catch(U){console.error("Failed to archive session:",U)}}})},O=P=>{b({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await Da.deleteSession(P),n===P&&a(null),await v()}catch(U){console.error("Failed to delete session:",U)}}})},C=async(P,U)=>{try{await Da.renameSession(P,U),await v()}catch(R){console.error("Failed to rename session:",R)}};return f.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[f.jsx(zD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:j,onArchiveSession:N,onDeleteSession:O,onRenameSession:C,isOpen:h,toggleSidebar:()=>m(!h)}),f.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:f.jsx(FL,{messages:s,onSendMessage:E,isLoading:l,activeSessionId:n})}),f.jsx(G_,{isOpen:y.isOpen,onClose:()=>b(P=>({...P,isOpen:!1})),onConfirm:y.onConfirm,title:y.title,description:y.description,confirmJson:y.confirmJson,variant:y.variant})]})};function YL(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return Dt(`/chronos${n}`,()=>be.get(`/chronos${n}`))}function XL(e,t=50){return Dt(e?`/chronos/${e}/executions?limit=${t}`:null,()=>be.get(`/chronos/${e}/executions?limit=${t}`))}function Y_(){return Dt("/config/chronos",()=>be.get("/config/chronos"))}const Ei={createJob:e=>be.post("/chronos",e),updateJob:(e,t)=>be.put(`/chronos/${e}`,t),deleteJob:e=>be.delete(`/chronos/${e}`),enableJob:e=>be.patch(`/chronos/${e}/enable`,{}),disableJob:e=>be.patch(`/chronos/${e}/disable`,{}),getConfig:()=>be.get("/config/chronos"),updateConfig:e=>be.post("/config/chronos",e),preview:(e,t,n)=>be.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function ar({title:e,description:t,children:n}){return f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg p-6 bg-azure-surface/50 dark:bg-matrix-base/50",children:[f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),f.jsx("div",{className:"space-y-4",children:n})]})}const JL=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},KL=(e,t)=>({classGroupId:e,validator:t}),X_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Yc="-",Vk=[],QL="arbitrary..",WL=e=>{const t=t9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return e9(l);const d=l.split(Yc),h=d[0]===""&&d.length>1?1:0;return J_(d,h,t)},getConflictingClassGroupIds:(l,d)=>{if(d){const h=a[l],m=n[l];return h?m?JL(m,h):h:m||Vk}return n[l]||Vk}}},J_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],u=n.nextPart.get(s);if(u){const m=J_(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const d=t===0?e.join(Yc):e.slice(t).join(Yc),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(d))return g.classGroupId}},e9=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?QL+a:void 0})(),t9=e=>{const{theme:t,classGroups:n}=e;return n9(n,t)},n9=(e,t)=>{const n=X_();for(const a in e){const s=e[a];Jg(s,n,a,t)}return n},Jg=(e,t,n,a)=>{const s=e.length;for(let u=0;u<s;u++){const l=e[u];r9(l,t,n,a)}},r9=(e,t,n,a)=>{if(typeof e=="string"){a9(e,t,n);return}if(typeof e=="function"){i9(e,t,n,a);return}s9(e,t,n,a)},a9=(e,t,n)=>{const a=e===""?t:K_(t,e);a.classGroupId=n},i9=(e,t,n,a)=>{if(o9(e)){Jg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(KL(n,e))},s9=(e,t,n,a)=>{const s=Object.entries(e),u=s.length;for(let l=0;l<u;l++){const[d,h]=s[l];Jg(h,K_(t,d),n,a)}},K_=(e,t)=>{let n=e;const a=t.split(Yc),s=a.length;for(let u=0;u<s;u++){const l=a[u];let d=n.nextPart.get(l);d||(d=X_(),n.nextPart.set(l,d)),n=d}return n},o9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,l9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(u,l)=>{n[u]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(u){let l=n[u];if(l!==void 0)return l;if((l=a[u])!==void 0)return s(u,l),l},set(u,l){u in n?n[u]=l:s(u,l)}}},$p="!",Bk=":",u9=[],Zk=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),c9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const u=[];let l=0,d=0,h=0,m;const g=s.length;for(let j=0;j<g;j++){const E=s[j];if(l===0&&d===0){if(E===Bk){u.push(s.slice(h,j)),h=j+1;continue}if(E==="/"){m=j;continue}}E==="["?l++:E==="]"?l--:E==="("?d++:E===")"&&d--}const y=u.length===0?s:s.slice(h);let b=y,v=!1;y.endsWith($p)?(b=y.slice(0,-1),v=!0):y.startsWith($p)&&(b=y.slice(1),v=!0);const S=m&&m>h?m-h:void 0;return Zk(u,v,b,S)};if(t){const s=t+Bk,u=a;a=l=>l.startsWith(s)?u(l.slice(s.length)):Zk(u9,!1,l,void 0,!0)}if(n){const s=a;a=u=>n({className:u,parseClassName:s})}return a},d9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let u=0;u<n.length;u++){const l=n[u],d=l[0]==="[",h=t.has(l);d||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(l)):s.push(l)}return s.length>0&&(s.sort(),a.push(...s)),a}},f9=e=>({cache:l9(e.cacheSize),parseClassName:c9(e),sortModifiers:d9(e),...WL(e)}),h9=/\s+/,m9=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:u}=t,l=[],d=e.trim().split(h9);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:y,modifiers:b,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:j}=n(g);if(y){h=g+(h.length>0?" "+h:h);continue}let E=!!j,N=a(E?S.substring(0,j):S);if(!N){if(!E){h=g+(h.length>0?" "+h:h);continue}if(N=a(S),!N){h=g+(h.length>0?" "+h:h);continue}E=!1}const O=b.length===0?"":b.length===1?b[0]:u(b).join(":"),C=v?O+$p:O,P=C+N;if(l.indexOf(P)>-1)continue;l.push(P);const U=s(N,E);for(let R=0;R<U.length;++R){const F=U[R];l.push(C+F)}h=g+(h.length>0?" "+h:h)}return h},p9=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=Q_(n))&&(s&&(s+=" "),s+=a);return s},Q_=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Q_(e[a]))&&(n&&(n+=" "),n+=t);return n},g9=(e,...t)=>{let n,a,s,u;const l=h=>{const m=t.reduce((g,y)=>y(g),e());return n=f9(m),a=n.cache.get,s=n.cache.set,u=d,d(h)},d=h=>{const m=a(h);if(m)return m;const g=m9(h,n);return s(h,g),g};return u=l,(...h)=>u(p9(...h))},y9=[],Yt=e=>{const t=n=>n[e]||y9;return t.isThemeGetter=!0,t},W_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,e2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,x9=/^\d+\/\d+$/,b9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,S9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=e=>x9.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),$a=e=>!!e&&Number.isInteger(Number(e)),Em=e=>e.endsWith("%")&&De(e.slice(0,-1)),na=e=>b9.test(e),z9=()=>!0,_9=e=>v9.test(e)&&!k9.test(e),t2=()=>!1,j9=e=>w9.test(e),C9=e=>S9.test(e),N9=e=>!ge(e)&&!ye(e),E9=e=>ao(e,a2,t2),ge=e=>W_.test(e),bi=e=>ao(e,i2,_9),Tm=e=>ao(e,M9,De),Ik=e=>ao(e,n2,t2),T9=e=>ao(e,r2,C9),xc=e=>ao(e,s2,j9),ye=e=>e2.test(e),ul=e=>io(e,i2),A9=e=>io(e,D9),Hk=e=>io(e,n2),O9=e=>io(e,a2),R9=e=>io(e,r2),bc=e=>io(e,s2,!0),ao=(e,t,n)=>{const a=W_.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},io=(e,t,n=!1)=>{const a=e2.exec(e);return a?a[1]?t(a[1]):n:!1},n2=e=>e==="position"||e==="percentage",r2=e=>e==="image"||e==="url",a2=e=>e==="length"||e==="size"||e==="bg-size",i2=e=>e==="length",M9=e=>e==="number",D9=e=>e==="family-name",s2=e=>e==="shadow",$9=()=>{const e=Yt("color"),t=Yt("font"),n=Yt("text"),a=Yt("font-weight"),s=Yt("tracking"),u=Yt("leading"),l=Yt("breakpoint"),d=Yt("container"),h=Yt("spacing"),m=Yt("radius"),g=Yt("shadow"),y=Yt("inset-shadow"),b=Yt("text-shadow"),v=Yt("drop-shadow"),S=Yt("blur"),j=Yt("perspective"),E=Yt("aspect"),N=Yt("ease"),O=Yt("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...P(),ye,ge],R=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],B=()=>[ye,ge,h],K=()=>[Ss,"full","auto",...B()],fe=()=>[$a,"none","subgrid",ye,ge],ae=()=>["auto",{span:["full",$a,ye,ge]},$a,ye,ge],le=()=>[$a,"auto",ye,ge],ne=()=>["auto","min","max","fr",ye,ge],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...B()],J=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],Z=()=>[e,ye,ge],he=()=>[...P(),Hk,Ik,{position:[ye,ge]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",O9,E9,{size:[ye,ge]}],G=()=>[Em,ul,bi],w=()=>["","none","full",m,ye,ge],X=()=>["",De,ul,bi],me=()=>["solid","dashed","dotted","double"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[De,Em,Hk,Ik],Ae=()=>["","none",S,ye,ge],je=()=>["none",De,ye,ge],Ye=()=>["none",De,ye,ge],Nt=()=>[De,ye,ge],Jt=()=>[Ss,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[na],breakpoint:[na],color:[z9],container:[na],"drop-shadow":[na],ease:["in","out","in-out"],font:[N9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[na],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[na],shadow:[na],spacing:["px",De],text:[na],"text-shadow":[na],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,ge,ye,E]}],container:["container"],columns:[{columns:[De,ge,ye,d]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[$a,"auto",ye,ge]}],basis:[{basis:[Ss,"full","auto",d,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Ss,"auto","initial","none",ge]}],grow:[{grow:["",De,ye,ge]}],shrink:[{shrink:["",De,ye,ge]}],order:[{order:[$a,"first","last","none",ye,ge]}],"grid-cols":[{"grid-cols":fe()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":fe()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[d,"screen",...J()]}],"min-w":[{"min-w":[d,"screen","none",...J()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,ul,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ye,Tm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Em,ge]}],"font-family":[{font:[A9,ge,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ye,ge]}],"line-clamp":[{"line-clamp":[De,"none",ye,Tm]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",ye,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",ye,bi]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[De,"auto",ye,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:he()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$a,ye,ge],radial:["",ye,ge],conic:[$a,ye,ge]},R9,T9]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:w()}],"rounded-s":[{"rounded-s":w()}],"rounded-e":[{"rounded-e":w()}],"rounded-t":[{"rounded-t":w()}],"rounded-r":[{"rounded-r":w()}],"rounded-b":[{"rounded-b":w()}],"rounded-l":[{"rounded-l":w()}],"rounded-ss":[{"rounded-ss":w()}],"rounded-se":[{"rounded-se":w()}],"rounded-ee":[{"rounded-ee":w()}],"rounded-es":[{"rounded-es":w()}],"rounded-tl":[{"rounded-tl":w()}],"rounded-tr":[{"rounded-tr":w()}],"rounded-br":[{"rounded-br":w()}],"rounded-bl":[{"rounded-bl":w()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,ye,ge]}],"outline-w":[{outline:["",De,ul,bi]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",g,bc,xc]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",y,bc,xc]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[De,bi]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",b,bc,xc]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[De,ye,ge]}],"mix-blend":[{"mix-blend":[...D(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":D()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[ye,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:he()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ge]}],filter:[{filter:["","none",ye,ge]}],blur:[{blur:Ae()}],brightness:[{brightness:[De,ye,ge]}],contrast:[{contrast:[De,ye,ge]}],"drop-shadow":[{"drop-shadow":["","none",v,bc,xc]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",De,ye,ge]}],"hue-rotate":[{"hue-rotate":[De,ye,ge]}],invert:[{invert:["",De,ye,ge]}],saturate:[{saturate:[De,ye,ge]}],sepia:[{sepia:["",De,ye,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ge]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[De,ye,ge]}],"backdrop-contrast":[{"backdrop-contrast":[De,ye,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,ye,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,ye,ge]}],"backdrop-invert":[{"backdrop-invert":["",De,ye,ge]}],"backdrop-opacity":[{"backdrop-opacity":[De,ye,ge]}],"backdrop-saturate":[{"backdrop-saturate":[De,ye,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",De,ye,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",ye,ge]}],ease:[{ease:["linear","initial",N,ye,ge]}],delay:[{delay:[De,ye,ge]}],animate:[{animate:["none",O,ye,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,ye,ge]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Ye()}],"scale-x":[{"scale-x":Ye()}],"scale-y":[{"scale-y":Ye()}],"scale-z":[{"scale-z":Ye()}],"scale-3d":["scale-3d"],skew:[{skew:Nt()}],"skew-x":[{"skew-x":Nt()}],"skew-y":[{"skew-y":Nt()}],transform:[{transform:[ye,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Jt()}],"translate-x":[{"translate-x":Jt()}],"translate-y":[{"translate-y":Jt()}],"translate-z":[{"translate-z":Jt()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,ge]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[De,ul,bi,Tm]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Bs=g9($9);function it({label:e,error:t,helperText:n,className:a,...s}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("input",{className:Bs("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...s}),n&&!t&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&f.jsx("p",{className:"text-xs text-red-500",children:t})]})}function jr({label:e,options:t,error:n,helperText:a,className:s,...u}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("select",{className:Bs("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors appearance-none",n&&"border-red-500 focus:border-red-500 focus:ring-red-500",s),...u,children:t.map(l=>f.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&f.jsx("p",{className:"text-xs text-red-500",children:n})]})}function yn({label:e,error:t,helperText:n,className:a,...s}){return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),f.jsx("input",{type:"number",className:Bs("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...s}),n&&!t&&f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&f.jsx("p",{className:"text-xs text-red-500",children:t})]})}function zs({label:e,checked:t,onChange:n,helperText:a,disabled:s}){return f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:Bs("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",s&&"opacity-50"),children:e}),a&&f.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),f.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!s&&n(!t),className:Bs("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:ring-offset-2 focus:ring-offset-azure-bg dark:focus:ring-offset-black",t?"bg-azure-primary dark:bg-matrix-highlight":"bg-slate-300 dark:bg-matrix-primary",s&&"opacity-50 cursor-not-allowed"),children:f.jsx("span",{className:Bs("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const zr={fetchConfig:async()=>be.get("/config"),updateConfig:async e=>be.post("/config",e),getSatiConfig:async()=>be.get("/config/sati"),updateSatiConfig:async e=>be.post("/config/sati",e),deleteSatiConfig:async()=>be.delete("/config/sati"),getApocConfig:async()=>be.get("/config/apoc"),updateApocConfig:async e=>be.post("/config/apoc",e),deleteApocConfig:async()=>be.delete("/config/apoc"),getNeoConfig:async()=>be.get("/config/neo"),updateNeoConfig:async e=>be.post("/config/neo",e),deleteNeoConfig:async()=>be.delete("/config/neo"),getTrinityConfig:async()=>be.get("/config/trinity"),updateTrinityConfig:async e=>be.post("/config/trinity",e),deleteTrinityConfig:async()=>be.delete("/config/trinity")};function ee(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const b=g[y];b in d||(d[b]=m[b].bind(d))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(d){var h;const m=n?.Parent?new u:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let Zs=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},o2=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const l2={};function qa(e){return l2}function u2(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Lp(e,t){return typeof t=="bigint"?t.toString():t}function pd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Kg(e){return e==null}function Qg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function L9(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let s=(a.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(a)){const h=a.match(/\d?e-(\d?)/);h?.[1]&&(s=Number.parseInt(h[1]))}const u=n>s?n:s,l=Number.parseInt(e.toFixed(u).replace(".","")),d=Number.parseInt(t.toFixed(u).replace(".",""));return l%d/10**u}const Fk=Symbol("evaluating");function Je(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Fk)return a===void 0&&(a=Fk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Mi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ja(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function qk(e){return JSON.stringify(e)}function P9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const c2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ol(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const U9=pd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function qs(e){if(Ol(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ol(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function d2(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const V9=new Set(["string","number","symbol"]);function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ka(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Se(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function B9(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Z9={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function I9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Ja(e._zod.def,{get shape(){const l={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(l[d]=n.shape[d])}return Mi(this,"shape",l),l},checks:[]});return Ka(e,u)}function H9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Ja(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete l[d]}return Mi(this,"shape",l),l},checks:[]});return Ka(e,u)}function F9(e,t){if(!qs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ja(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Mi(this,"shape",u),u}});return Ka(e,s)}function q9(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ja(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Mi(this,"shape",a),a}});return Ka(e,n)}function G9(e,t){const n=Ja(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Mi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ka(e,n)}function Y9(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ja(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Mi(this,"shape",h),h},checks:[]});return Ka(t,l)}function X9(e,t,n){const a=Ja(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:s[l]}))}else for(const l in s)u[l]=new e({type:"nonoptional",innerType:s[l]});return Mi(this,"shape",u),u}});return Ka(t,a)}function Rs(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ms(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function vc(e){return typeof e=="string"?e:e?.message}function Ga(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=vc(e.inst?._zod.def?.error?.(e))??vc(t?.error?.(e))??vc(n.customError?.(e))??vc(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Wg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Rl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const f2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Lp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},h2=ee("$ZodError",f2),m2=ee("$ZodError",f2,{Parent:Error});function J9(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function K9(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],d++}}};return a(e),n}const ey=e=>(t,n,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Zs;if(l.issues.length){const d=new(s?.Err??e)(l.issues.map(h=>Ga(h,u,qa())));throw c2(d,s?.callee),d}return l.value},ty=e=>async(t,n,a,s)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const d=new(s?.Err??e)(l.issues.map(h=>Ga(h,u,qa())));throw c2(d,s?.callee),d}return l.value},gd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new Zs;return u.issues.length?{success:!1,error:new(e??h2)(u.issues.map(l=>Ga(l,s,qa())))}:{success:!0,data:u.value}},Q9=gd(m2),yd=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Ga(l,s,qa())))}:{success:!0,data:u.value}},W9=yd(m2),eP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ey(e)(t,n,s)},tP=e=>(t,n,a)=>ey(e)(t,n,a),nP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ty(e)(t,n,s)},rP=e=>async(t,n,a)=>ty(e)(t,n,a),aP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return gd(e)(t,n,s)},iP=e=>(t,n,a)=>gd(e)(t,n,a),sP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return yd(e)(t,n,s)},oP=e=>async(t,n,a)=>yd(e)(t,n,a),lP=/^[cC][^\s-]{8,}$/,uP=/^[0-9a-z]+$/,cP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dP=/^[0-9a-vA-V]{20}$/,fP=/^[A-Za-z0-9]{27}$/,hP=/^[a-zA-Z0-9_-]{21}$/,mP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pP=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Gk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xP(){return new RegExp(yP,"u")}const bP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,kP=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,wP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,SP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,p2=/^[A-Za-z0-9_-]*$/,zP=/^\+[1-9]\d{6,14}$/,g2="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_P=new RegExp(`^${g2}$`);function y2(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function jP(e){return new RegExp(`^${y2(e)}$`)}function CP(e){const t=y2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${g2}T(?:${a})$`)}const NP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},EP=/^-?\d+$/,x2=/^-?\d+(?:\.\d+)?$/,TP=/^(?:true|false)$/i,AP=/^[^A-Z]*$/,OP=/^[^a-z]*$/,Mn=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),b2={number:"number",bigint:"bigint",object:"date"},v2=ee("$ZodCheckLessThan",(e,t)=>{Mn.init(e,t);const n=b2[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),k2=ee("$ZodCheckGreaterThan",(e,t)=>{Mn.init(e,t);const n=b2[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),RP=ee("$ZodCheckMultipleOf",(e,t)=>{Mn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):L9(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),MP=ee("$ZodCheckNumberFormat",(e,t)=>{Mn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,u]=Z9[t.format];e._zod.onattach.push(l=>{const d=l._zod.bag;d.format=t.format,d.minimum=s,d.maximum=u,n&&(d.pattern=EP)}),e._zod.check=l=>{const d=l.value;if(n){if(!Number.isInteger(d)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?l.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):l.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}d<s&&l.issues.push({origin:"number",input:d,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),d>u&&l.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),DP=ee("$ZodCheckMaxLength",(e,t)=>{var n;Mn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Kg(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const l=Wg(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),$P=ee("$ZodCheckMinLength",(e,t)=>{var n;Mn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Kg(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const l=Wg(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),LP=ee("$ZodCheckLengthEquals",(e,t)=>{var n;Mn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Kg(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===t.length)return;const l=Wg(s),d=u>t.length;a.issues.push({origin:l,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),xd=ee("$ZodCheckStringFormat",(e,t)=>{var n,a;Mn.init(e,t),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),PP=ee("$ZodCheckRegex",(e,t)=>{xd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),UP=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=AP),xd.init(e,t)}),VP=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=OP),xd.init(e,t)}),BP=ee("$ZodCheckIncludes",(e,t)=>{Mn.init(e,t);const n=Gs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),ZP=ee("$ZodCheckStartsWith",(e,t)=>{Mn.init(e,t);const n=new RegExp(`^${Gs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),IP=ee("$ZodCheckEndsWith",(e,t)=>{Mn.init(e,t);const n=new RegExp(`.*${Gs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),HP=ee("$ZodCheckOverwrite",(e,t)=>{Mn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let FP=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
33
|
-
`).filter(l=>l),s=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,s.join(`
|
|
34
|
-
`))}};const qP={major:4,minor:3,patch:6},zt=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qP;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const u of s._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(l,d,h)=>{let m=Rs(l),g;for(const y of d){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=y._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Zs;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Rs(l,b)))});else{if(l.issues.length===b)continue;m||(m=Rs(l,b))}}return g?g.then(()=>l):l},u=(l,d,h)=>{if(Rs(l))return l.aborted=!0,l;const m=s(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new Zs;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,d)):u(m,l,d)}const h=e._zod.parse(l,d);if(h instanceof Promise){if(d.async===!1)throw new Zs;return h.then(m=>s(m,a,d))}return s(h,a,d)}}Je(e,"~standard",()=>({validate:s=>{try{const u=Q9(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return W9(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),ny=ee("$ZodString",(e,t)=>{zt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??NP(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),vt=ee("$ZodStringFormat",(e,t)=>{xd.init(e,t),ny.init(e,t)}),GP=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pP),vt.init(e,t)}),YP=ee("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gk(a))}else t.pattern??(t.pattern=Gk());vt.init(e,t)}),XP=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gP),vt.init(e,t)}),JP=ee("$ZodURL",(e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),KP=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xP()),vt.init(e,t)}),QP=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hP),vt.init(e,t)}),WP=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lP),vt.init(e,t)}),eU=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uP),vt.init(e,t)}),tU=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=cP),vt.init(e,t)}),nU=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dP),vt.init(e,t)}),rU=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fP),vt.init(e,t)}),aU=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=CP(t)),vt.init(e,t)}),iU=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_P),vt.init(e,t)}),sU=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jP(t)),vt.init(e,t)}),oU=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mP),vt.init(e,t)}),lU=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=bP),vt.init(e,t),e._zod.bag.format="ipv4"}),uU=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=vP),vt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),cU=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=kP),vt.init(e,t)}),dU=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=wP),vt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function w2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const fU=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=SP),vt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{w2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function hU(e){if(!p2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return w2(n)}const mU=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=p2),vt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{hU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),pU=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=zP),vt.init(e,t)});function gU(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const yU=ee("$ZodJWT",(e,t)=>{vt.init(e,t),e._zod.check=n=>{gU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),S2=ee("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??x2,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),n}}),xU=ee("$ZodNumberFormat",(e,t)=>{MP.init(e,t),S2.init(e,t)}),bU=ee("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=TP,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),vU=ee("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),kU=ee("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Yk(e,t,n){e.issues.length&&t.issues.push(...Ms(n,e.issues)),t.value[n]=e.value}const wU=ee("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const u=[];for(let l=0;l<s.length;l++){const d=s[l],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?u.push(h.then(m=>Yk(m,n,l))):Yk(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function Xc(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Ms(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function z2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=B9(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function _2(e,t,n,a,s,u){const l=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(d.has(y))continue;if(m==="never"){l.push(y);continue}const b=h.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Xc(v,n,y,t,g))):Xc(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const SU=ee("$ZodObject",(e,t)=>{if(zt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=pd(()=>z2(t));Je(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const g=d[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const y of g.values)h[m].add(y)}}return h});const s=Ol,u=t.catchall;let l;e._zod.parse=(d,h)=>{l??(l=a.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const g=[],y=l.shape;for(const b of l.keys){const v=y[b],S=v._zod.optout==="optional",j=v._zod.run({value:m[b],issues:[]},h);j instanceof Promise?g.push(j.then(E=>Xc(E,d,b,m,S))):Xc(j,d,b,m,S)}return u?_2(g,m,d,h,a.value,e):g.length?Promise.all(g).then(()=>d):d}}),zU=ee("$ZodObjectJIT",(e,t)=>{SU.init(e,t);const n=e._zod.parse,a=pd(()=>z2(t)),s=b=>{const v=new FP(["shape","payload","ctx"]),S=a.value,j=C=>{const P=qk(C);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const C of S.keys)E[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of S.keys){const P=E[C],U=qk(C),F=b[C]?._zod?.optout==="optional";v.write(`const ${P} = ${j(C)};`),F?v.write(`
|
|
35
|
-
if (${P}.issues.length) {
|
|
36
|
-
if (${U} in input) {
|
|
37
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
38
|
-
...iss,
|
|
39
|
-
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
40
|
-
})));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (${P}.value === undefined) {
|
|
45
|
-
if (${U} in input) {
|
|
46
|
-
newResult[${U}] = undefined;
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
newResult[${U}] = ${P}.value;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
`):v.write(`
|
|
53
|
-
if (${P}.issues.length) {
|
|
54
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
55
|
-
...iss,
|
|
56
|
-
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
57
|
-
})));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (${P}.value === undefined) {
|
|
61
|
-
if (${U} in input) {
|
|
62
|
-
newResult[${U}] = undefined;
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
newResult[${U}] = ${P}.value;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(C,P)=>O(b,C,P)};let u;const l=Ol,d=!l2.jitless,m=d&&U9.value,g=t.catchall;let y;e._zod.parse=(b,v)=>{y??(y=a.value);const S=b.value;return l(S)?d&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=s(t.shape)),b=u(b,v),g?_2([],S,b,v,y,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function Xk(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const s=e.filter(u=>!Rs(u));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Ga(l,a,qa())))}),t)}const j2=ee("$ZodUnion",(e,t)=>{zt.init(e,t),Je(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Je(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Je(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Je(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>Qg(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,u)=>{if(n)return a(s,u);let l=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)d.push(m),l=!0;else{if(m.issues.length===0)return m;d.push(m)}}return l?Promise.all(d).then(h=>Xk(h,s,e,u)):Xk(d,s,e,u)}}),_U=ee("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,j2.init(e,t);const n=e._zod.parse;Je(e._zod,"propValues",()=>{const s={};for(const u of t.options){const l=u._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const[d,h]of Object.entries(l)){s[d]||(s[d]=new Set);for(const m of h)s[d].add(m)}}return s});const a=pd(()=>{const s=t.options,u=new Map;for(const l of s){const d=l._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const h of d){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,l)}}return u});e._zod.parse=(s,u)=>{const l=s.value;if(!Ol(l))return s.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),s;const d=a.value.get(l?.[t.discriminator]);return d?d._zod.run(s,u):t.unionFallback?n(s,u):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),s)}}),jU=ee("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,u=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>Jk(n,h,m)):Jk(n,u,l)}});function Pp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qs(e)&&qs(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(const u of a){const l=Pp(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};s[u]=l.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],u=t[a],l=Pp(s,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jk(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),Rs(e))return e;const l=Pp(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const CU=ee("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!qs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const u=[],l=t.keyType._zod.values;if(l){n.value={};const d=new Set;for(const m of l)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);const g=t.valueType._zod.run({value:s[m],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Ms(m,y.issues)),n.value[m]=y.value})):(g.issues.length&&n.issues.push(...Ms(m,g.issues)),n.value[m]=g.value)}let h;for(const m in s)d.has(m)||(h=h??[],h.push(m));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const d of Reflect.ownKeys(s)){if(d==="__proto__")continue;let h=t.keyType._zod.run({value:d,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&x2.test(d)&&h.issues.length){const y=t.keyType._zod.run({value:Number(d),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(h=y)}if(h.issues.length){t.mode==="loose"?n.value[d]=s[d]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>Ga(y,a,qa())),input:d,path:[d],inst:e});continue}const g=t.valueType._zod.run({value:s[d],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Ms(d,y.issues)),n.value[h.value]=y.value})):(g.issues.length&&n.issues.push(...Ms(d,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),NU=ee("$ZodEnum",(e,t)=>{zt.init(e,t);const n=u2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>V9.has(typeof s)).map(s=>typeof s=="string"?Gs(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),EU=ee("$ZodLiteral",(e,t)=>{if(zt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Gs(a):a?Gs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),TU=ee("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new o2(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(l=>(n.value=l,n));if(s instanceof Promise)throw new Zs;return n.value=s,n}});function Kk(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const C2=ee("$ZodOptional",(e,t)=>{zt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Qg(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Kk(u,n.value)):Kk(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),AU=ee("$ZodExactOptional",(e,t)=>{C2.init(e,t),Je(e._zod,"values",()=>t.innerType._zod.values),Je(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),OU=ee("$ZodNullable",(e,t)=>{zt.init(e,t),Je(e._zod,"optin",()=>t.innerType._zod.optin),Je(e._zod,"optout",()=>t.innerType._zod.optout),Je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Qg(n.source)}|null)$`):void 0}),Je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),RU=ee("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Qk(u,t)):Qk(s,t)}});function Qk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const MU=ee("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),DU=ee("$ZodNonOptional",(e,t)=>{zt.init(e,t),Je(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Wk(u,e)):Wk(s,e)}});function Wk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const $U=ee("$ZodCatch",(e,t)=>{zt.init(e,t),Je(e._zod,"optin",()=>t.innerType._zod.optin),Je(e._zod,"optout",()=>t.innerType._zod.optout),Je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Ga(l,a,qa()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Ga(u,a,qa()))},input:n.value}),n.issues=[]),n)}}),LU=ee("$ZodPipe",(e,t)=>{zt.init(e,t),Je(e._zod,"values",()=>t.in._zod.values),Je(e._zod,"optin",()=>t.in._zod.optin),Je(e._zod,"optout",()=>t.out._zod.optout),Je(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>kc(l,t.in,a)):kc(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>kc(u,t.out,a)):kc(s,t.out,a)}});function kc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const PU=ee("$ZodReadonly",(e,t)=>{zt.init(e,t),Je(e._zod,"propValues",()=>t.innerType._zod.propValues),Je(e._zod,"values",()=>t.innerType._zod.values),Je(e._zod,"optin",()=>t.innerType?._zod?.optin),Je(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(ew):ew(s)}});function ew(e){return e.value=Object.freeze(e.value),e}const UU=ee("$ZodCustom",(e,t)=>{Mn.init(e,t),zt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(u=>tw(u,n,a,e));tw(s,n,a,e)}});function tw(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Rl(s))}}var nw;let VU=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function BU(){return new VU}(nw=globalThis).__zod_globalRegistry??(nw.__zod_globalRegistry=BU());const hl=globalThis.__zod_globalRegistry;function ZU(e,t){return new e({type:"string",...Se(t)})}function IU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Se(t)})}function rw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Se(t)})}function HU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Se(t)})}function FU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Se(t)})}function qU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Se(t)})}function GU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Se(t)})}function YU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Se(t)})}function XU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Se(t)})}function JU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Se(t)})}function KU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Se(t)})}function QU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Se(t)})}function WU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Se(t)})}function e8(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Se(t)})}function t8(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Se(t)})}function n8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Se(t)})}function r8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Se(t)})}function a8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Se(t)})}function i8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Se(t)})}function s8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Se(t)})}function o8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Se(t)})}function l8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Se(t)})}function u8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Se(t)})}function c8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Se(t)})}function d8(e,t){return new e({type:"string",format:"date",check:"string_format",...Se(t)})}function f8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Se(t)})}function h8(e,t){return new e({type:"string",format:"duration",check:"string_format",...Se(t)})}function m8(e,t){return new e({type:"number",checks:[],...Se(t)})}function p8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Se(t)})}function g8(e,t){return new e({type:"boolean",...Se(t)})}function y8(e){return new e({type:"unknown"})}function x8(e,t){return new e({type:"never",...Se(t)})}function aw(e,t){return new v2({check:"less_than",...Se(t),value:e,inclusive:!1})}function Am(e,t){return new v2({check:"less_than",...Se(t),value:e,inclusive:!0})}function iw(e,t){return new k2({check:"greater_than",...Se(t),value:e,inclusive:!1})}function Om(e,t){return new k2({check:"greater_than",...Se(t),value:e,inclusive:!0})}function sw(e,t){return new RP({check:"multiple_of",...Se(t),value:e})}function N2(e,t){return new DP({check:"max_length",...Se(t),maximum:e})}function Jc(e,t){return new $P({check:"min_length",...Se(t),minimum:e})}function E2(e,t){return new LP({check:"length_equals",...Se(t),length:e})}function b8(e,t){return new PP({check:"string_format",format:"regex",...Se(t),pattern:e})}function v8(e){return new UP({check:"string_format",format:"lowercase",...Se(e)})}function k8(e){return new VP({check:"string_format",format:"uppercase",...Se(e)})}function w8(e,t){return new BP({check:"string_format",format:"includes",...Se(t),includes:e})}function S8(e,t){return new ZP({check:"string_format",format:"starts_with",...Se(t),prefix:e})}function z8(e,t){return new IP({check:"string_format",format:"ends_with",...Se(t),suffix:e})}function so(e){return new HP({check:"overwrite",tx:e})}function _8(e){return so(t=>t.normalize(e))}function j8(){return so(e=>e.trim())}function C8(){return so(e=>e.toLowerCase())}function N8(){return so(e=>e.toUpperCase())}function E8(){return so(e=>P9(e))}function T8(e,t,n){return new e({type:"array",element:t,...Se(n)})}function A8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Se(n)})}function O8(e){const t=R8(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Rl(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Rl(s))}},e(n.value,n)));return t}function R8(e,t){const n=new Mn({check:"custom",...Se(t)});return n._zod.check=e,n}function T2(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??hl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Zt(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const d=e._zod.toJSONSchema?.();if(d)l.schema=d;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),Zt(y,t,g),t.seen.get(y).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&xn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function A2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const d=e.metadataRegistry.get(l[0])?.id;if(d){const h=a.get(d);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,l[0])}}const s=l=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(l[1]===n)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:h,defId:m}=s(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
69
|
-
|
|
70
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(d.cycle){u(l);continue}if(d.count>1&&e.reused==="ref"){u(l);continue}}}function O2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const d=e.seen.get(l);if(d.ref===null)return;const h=d.def??d.schema,m={...h},g=d.ref;if(d.ref=null,g){a(g);const b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const j in h)j==="$ref"||j==="allOf"||j in m||delete h[j];if(v.$ref&&b.def)for(const j in h)j==="$ref"||j==="allOf"||j in b.def&&JSON.stringify(h[j])===JSON.stringify(b.def[j])&&delete h[j]}const y=l._zod.parent;if(y&&y!==g){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path:d.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Kc(t,"input",e.processors),output:Kc(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function xn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return xn(a.element,n);if(a.type==="set")return xn(a.valueType,n);if(a.type==="lazy")return xn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return xn(a.innerType,n);if(a.type==="intersection")return xn(a.left,n)||xn(a.right,n);if(a.type==="record"||a.type==="map")return xn(a.keyType,n)||xn(a.valueType,n);if(a.type==="pipe")return xn(a.in,n)||xn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(xn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(xn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(xn(s,n))return!0;return!!(a.rest&&xn(a.rest,n))}return!1}const M8=(e,t={})=>n=>{const a=T2({...n,processors:t});return Zt(e,a),A2(a,e),O2(a,e)},Kc=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=T2({...s??{},target:u,io:t,processors:n});return Zt(e,l),A2(l,e),O2(l,e)},D8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$8=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),d&&(s.format=D8[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},L8=(e,t,n,a)=>{const s=n,{minimum:u,maximum:l,format:d,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g),typeof u=="number"&&(s.minimum=u,typeof g=="number"&&t.target!=="draft-04"&&(g>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof l=="number"&&(s.maximum=l,typeof m=="number"&&t.target!=="draft-04"&&(m<=l?delete s.maximum:delete s.exclusiveMaximum)),typeof h=="number"&&(s.multipleOf=h)},P8=(e,t,n,a)=>{n.type="boolean"},U8=(e,t,n,a)=>{n.not={}},V8=(e,t,n,a)=>{},B8=(e,t,n,a)=>{const s=e._zod.def,u=u2(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},Z8=(e,t,n,a)=>{const s=e._zod.def,u=[];for(const l of s.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},I8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},H8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},F8=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Zt(u.element,t,{...a,path:[...a.path,"items"]})},q8=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object",s.properties={};const l=u.shape;for(const m in l)s.properties[m]=Zt(l[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(l)),h=new Set([...d].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Zt(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},G8=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((d,h)=>Zt(d,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},Y8=(e,t,n,a)=>{const s=e._zod.def,u=Zt(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=Zt(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(u)?u.allOf:[u],...d(l)?l.allOf:[l]];n.allOf=h},X8=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object";const l=u.keyType,h=l._zod.bag?.patterns;if(u.mode==="loose"&&h&&h.size>0){const g=Zt(u.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const y of h)s.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Zt(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Zt(u.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=l._zod.values;if(m){const g=[...m].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(s.required=g)}},J8=(e,t,n,a)=>{const s=e._zod.def,u=Zt(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},K8=(e,t,n,a)=>{const s=e._zod.def;Zt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},Q8=(e,t,n,a)=>{const s=e._zod.def;Zt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},W8=(e,t,n,a)=>{const s=e._zod.def;Zt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},eV=(e,t,n,a)=>{const s=e._zod.def;Zt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType;let l;try{l=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},tV=(e,t,n,a)=>{const s=e._zod.def,u=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Zt(u,t,a);const l=t.seen.get(e);l.ref=u},nV=(e,t,n,a)=>{const s=e._zod.def;Zt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},R2=(e,t,n,a)=>{const s=e._zod.def;Zt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},rV=ee("ZodISODateTime",(e,t)=>{aU.init(e,t),jt.init(e,t)});function aV(e){return c8(rV,e)}const iV=ee("ZodISODate",(e,t)=>{iU.init(e,t),jt.init(e,t)});function sV(e){return d8(iV,e)}const oV=ee("ZodISOTime",(e,t)=>{sU.init(e,t),jt.init(e,t)});function lV(e){return f8(oV,e)}const uV=ee("ZodISODuration",(e,t)=>{oU.init(e,t),jt.init(e,t)});function cV(e){return h8(uV,e)}const dV=(e,t)=>{h2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>K9(e,n)},flatten:{value:n=>J9(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Lp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Lp,2)}},isEmpty:{get(){return e.issues.length===0}}})},cr=ee("ZodError",dV,{Parent:Error}),fV=ey(cr),hV=ty(cr),mV=gd(cr),pV=yd(cr),gV=eP(cr),yV=tP(cr),xV=nP(cr),bV=rP(cr),vV=aP(cr),kV=iP(cr),wV=sP(cr),SV=oP(cr),_t=ee("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Kc(e,"input"),output:Kc(e,"output")}}),e.toJSONSchema=M8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ja(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Ka(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>fV(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>mV(e,n,a),e.parseAsync=async(n,a)=>hV(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>pV(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>gV(e,n,a),e.decode=(n,a)=>yV(e,n,a),e.encodeAsync=async(n,a)=>xV(e,n,a),e.decodeAsync=async(n,a)=>bV(e,n,a),e.safeEncode=(n,a)=>vV(e,n,a),e.safeDecode=(n,a)=>kV(e,n,a),e.safeEncodeAsync=async(n,a)=>wV(e,n,a),e.safeDecodeAsync=async(n,a)=>SV(e,n,a),e.refine=(n,a)=>e.check(yB(n,a)),e.superRefine=n=>e.check(xB(n)),e.overwrite=n=>e.check(so(n)),e.optional=()=>dw(e),e.exactOptional=()=>aB(e),e.nullable=()=>fw(e),e.nullish=()=>dw(fw(e)),e.nonoptional=n=>cB(e,n),e.array=()=>Ys(e),e.or=n=>L2([e,n]),e.and=n=>QV(e,n),e.transform=n=>hw(e,nB(n)),e.default=n=>oB(e,n),e.prefault=n=>uB(e,n),e.catch=n=>fB(e,n),e.pipe=n=>hw(e,n),e.readonly=()=>pB(e),e.describe=n=>{const a=e.clone();return hl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return hl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return hl.get(e);const a=e.clone();return hl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),M2=ee("_ZodString",(e,t)=>{ny.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,s,u)=>$8(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(b8(...a)),e.includes=(...a)=>e.check(w8(...a)),e.startsWith=(...a)=>e.check(S8(...a)),e.endsWith=(...a)=>e.check(z8(...a)),e.min=(...a)=>e.check(Jc(...a)),e.max=(...a)=>e.check(N2(...a)),e.length=(...a)=>e.check(E2(...a)),e.nonempty=(...a)=>e.check(Jc(1,...a)),e.lowercase=a=>e.check(v8(a)),e.uppercase=a=>e.check(k8(a)),e.trim=()=>e.check(j8()),e.normalize=(...a)=>e.check(_8(...a)),e.toLowerCase=()=>e.check(C8()),e.toUpperCase=()=>e.check(N8()),e.slugify=()=>e.check(E8())}),zV=ee("ZodString",(e,t)=>{ny.init(e,t),M2.init(e,t),e.email=n=>e.check(IU(_V,n)),e.url=n=>e.check(YU(jV,n)),e.jwt=n=>e.check(u8(BV,n)),e.emoji=n=>e.check(XU(CV,n)),e.guid=n=>e.check(rw(ow,n)),e.uuid=n=>e.check(HU(wc,n)),e.uuidv4=n=>e.check(FU(wc,n)),e.uuidv6=n=>e.check(qU(wc,n)),e.uuidv7=n=>e.check(GU(wc,n)),e.nanoid=n=>e.check(JU(NV,n)),e.guid=n=>e.check(rw(ow,n)),e.cuid=n=>e.check(KU(EV,n)),e.cuid2=n=>e.check(QU(TV,n)),e.ulid=n=>e.check(WU(AV,n)),e.base64=n=>e.check(s8(PV,n)),e.base64url=n=>e.check(o8(UV,n)),e.xid=n=>e.check(e8(OV,n)),e.ksuid=n=>e.check(t8(RV,n)),e.ipv4=n=>e.check(n8(MV,n)),e.ipv6=n=>e.check(r8(DV,n)),e.cidrv4=n=>e.check(a8($V,n)),e.cidrv6=n=>e.check(i8(LV,n)),e.e164=n=>e.check(l8(VV,n)),e.datetime=n=>e.check(aV(n)),e.date=n=>e.check(sV(n)),e.time=n=>e.check(lV(n)),e.duration=n=>e.check(cV(n))});function Xe(e){return ZU(zV,e)}const jt=ee("ZodStringFormat",(e,t)=>{vt.init(e,t),M2.init(e,t)}),_V=ee("ZodEmail",(e,t)=>{XP.init(e,t),jt.init(e,t)}),ow=ee("ZodGUID",(e,t)=>{GP.init(e,t),jt.init(e,t)}),wc=ee("ZodUUID",(e,t)=>{YP.init(e,t),jt.init(e,t)}),jV=ee("ZodURL",(e,t)=>{JP.init(e,t),jt.init(e,t)}),CV=ee("ZodEmoji",(e,t)=>{KP.init(e,t),jt.init(e,t)}),NV=ee("ZodNanoID",(e,t)=>{QP.init(e,t),jt.init(e,t)}),EV=ee("ZodCUID",(e,t)=>{WP.init(e,t),jt.init(e,t)}),TV=ee("ZodCUID2",(e,t)=>{eU.init(e,t),jt.init(e,t)}),AV=ee("ZodULID",(e,t)=>{tU.init(e,t),jt.init(e,t)}),OV=ee("ZodXID",(e,t)=>{nU.init(e,t),jt.init(e,t)}),RV=ee("ZodKSUID",(e,t)=>{rU.init(e,t),jt.init(e,t)}),MV=ee("ZodIPv4",(e,t)=>{lU.init(e,t),jt.init(e,t)}),DV=ee("ZodIPv6",(e,t)=>{uU.init(e,t),jt.init(e,t)}),$V=ee("ZodCIDRv4",(e,t)=>{cU.init(e,t),jt.init(e,t)}),LV=ee("ZodCIDRv6",(e,t)=>{dU.init(e,t),jt.init(e,t)}),PV=ee("ZodBase64",(e,t)=>{fU.init(e,t),jt.init(e,t)}),UV=ee("ZodBase64URL",(e,t)=>{mU.init(e,t),jt.init(e,t)}),VV=ee("ZodE164",(e,t)=>{pU.init(e,t),jt.init(e,t)}),BV=ee("ZodJWT",(e,t)=>{yU.init(e,t),jt.init(e,t)}),D2=ee("ZodNumber",(e,t)=>{S2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,s,u)=>L8(e,a,s),e.gt=(a,s)=>e.check(iw(a,s)),e.gte=(a,s)=>e.check(Om(a,s)),e.min=(a,s)=>e.check(Om(a,s)),e.lt=(a,s)=>e.check(aw(a,s)),e.lte=(a,s)=>e.check(Am(a,s)),e.max=(a,s)=>e.check(Am(a,s)),e.int=a=>e.check(lw(a)),e.safe=a=>e.check(lw(a)),e.positive=a=>e.check(iw(0,a)),e.nonnegative=a=>e.check(Om(0,a)),e.negative=a=>e.check(aw(0,a)),e.nonpositive=a=>e.check(Am(0,a)),e.multipleOf=(a,s)=>e.check(sw(a,s)),e.step=(a,s)=>e.check(sw(a,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Tr(e){return m8(D2,e)}const ZV=ee("ZodNumberFormat",(e,t)=>{xU.init(e,t),D2.init(e,t)});function lw(e){return p8(ZV,e)}const IV=ee("ZodBoolean",(e,t)=>{bU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>P8(e,n,a)});function Ua(e){return g8(IV,e)}const HV=ee("ZodUnknown",(e,t)=>{vU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>V8()});function uw(){return y8(HV)}const FV=ee("ZodNever",(e,t)=>{kU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>U8(e,n,a)});function qV(e){return x8(FV,e)}const GV=ee("ZodArray",(e,t)=>{wU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>F8(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(Jc(n,a)),e.nonempty=n=>e.check(Jc(1,n)),e.max=(n,a)=>e.check(N2(n,a)),e.length=(n,a)=>e.check(E2(n,a)),e.unwrap=()=>e.element});function Ys(e,t){return T8(GV,e,t)}const YV=ee("ZodObject",(e,t)=>{zU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>q8(e,n,a,s),Je(e,"shape",()=>t.shape),e.keyof=()=>bd(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:uw()}),e.loose=()=>e.clone({...e._zod.def,catchall:uw()}),e.strict=()=>e.clone({...e._zod.def,catchall:qV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>F9(e,n),e.safeExtend=n=>q9(e,n),e.merge=n=>G9(e,n),e.pick=n=>I9(e,n),e.omit=n=>H9(e,n),e.partial=(...n)=>Y9(P2,e,n[0]),e.required=(...n)=>X9(U2,e,n[0])});function cn(e,t){const n={type:"object",shape:e??{},...Se(t)};return new YV(n)}const $2=ee("ZodUnion",(e,t)=>{j2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>G8(e,n,a,s),e.options=t.options});function L2(e,t){return new $2({type:"union",options:e,...Se(t)})}const XV=ee("ZodDiscriminatedUnion",(e,t)=>{$2.init(e,t),_U.init(e,t)});function JV(e,t,n){return new XV({type:"union",options:t,discriminator:e,...Se(n)})}const KV=ee("ZodIntersection",(e,t)=>{jU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Y8(e,n,a,s)});function QV(e,t){return new KV({type:"intersection",left:e,right:t})}const WV=ee("ZodRecord",(e,t)=>{CU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>X8(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function $c(e,t,n){return new WV({type:"record",keyType:e,valueType:t,...Se(n)})}const Up=ee("ZodEnum",(e,t)=>{NU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,s,u)=>B8(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Up({...t,checks:[],...Se(s),entries:u})},e.exclude=(a,s)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Up({...t,checks:[],...Se(s),entries:u})}});function bd(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Up({type:"enum",entries:n,...Se(t)})}const eB=ee("ZodLiteral",(e,t)=>{EU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Z8(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cw(e,t){return new eB({type:"literal",values:Array.isArray(e)?e:[e],...Se(t)})}const tB=ee("ZodTransform",(e,t)=>{TU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>H8(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new o2(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Rl(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Rl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function nB(e){return new tB({type:"transform",transform:e})}const P2=ee("ZodOptional",(e,t)=>{C2.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>R2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function dw(e){return new P2({type:"optional",innerType:e})}const rB=ee("ZodExactOptional",(e,t)=>{AU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>R2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function aB(e){return new rB({type:"optional",innerType:e})}const iB=ee("ZodNullable",(e,t)=>{OU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>J8(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function fw(e){return new iB({type:"nullable",innerType:e})}const sB=ee("ZodDefault",(e,t)=>{RU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Q8(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oB(e,t){return new sB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():d2(t)}})}const lB=ee("ZodPrefault",(e,t)=>{MU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>W8(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function uB(e,t){return new lB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():d2(t)}})}const U2=ee("ZodNonOptional",(e,t)=>{DU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>K8(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function cB(e,t){return new U2({type:"nonoptional",innerType:e,...Se(t)})}const dB=ee("ZodCatch",(e,t)=>{$U.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fB(e,t){return new dB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const hB=ee("ZodPipe",(e,t)=>{LU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tV(e,n,a,s),e.in=t.in,e.out=t.out});function hw(e,t){return new hB({type:"pipe",in:e,out:t})}const mB=ee("ZodReadonly",(e,t)=>{PU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function pB(e){return new mB({type:"readonly",innerType:e})}const gB=ee("ZodCustom",(e,t)=>{UU.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,s)=>I8(e,n)});function yB(e,t={}){return A8(gB,e,t)}function xB(e){return O8(e)}const ct={agent:{name:"morpheus",personality:"helpful_dev"},logging:{enabled:!0,level:"info",retention:"14d"},audio:{provider:"google",model:"gemini-2.5-flash-lite",enabled:!0,maxDurationSeconds:300,supportedMimeTypes:["audio/ogg","audio/mp3","audio/mpeg","audio/wav"]},memory:{limit:100},runtime:{async_tasks:{enabled:!0}},llm:{provider:"openai",model:"gpt-4",temperature:.7,context_window:100},channels:{telegram:{enabled:!1,allowedUsers:[]},discord:{enabled:!1,allowedUsers:[]}},ui:{enabled:!0,port:3333}},bB=cn({provider:bd(["google","openai","openrouter","ollama"]).default(ct.audio.provider),model:Xe().min(1).default(ct.audio.model),enabled:Ua().default(ct.audio.enabled),apiKey:Xe().optional(),base_url:Xe().optional(),maxDurationSeconds:Tr().default(ct.audio.maxDurationSeconds),supportedMimeTypes:Ys(Xe()).default(ct.audio.supportedMimeTypes)}),Fl=cn({provider:bd(["openai","anthropic","openrouter","ollama","gemini"]).default(ct.llm.provider),model:Xe().min(1).default(ct.llm.model),temperature:Tr().min(0).max(1).default(ct.llm.temperature),max_tokens:Tr().int().positive().optional(),api_key:Xe().optional(),base_url:Xe().optional(),context_window:Tr().int().positive().optional()}),vB=Fl.extend({memory_limit:Tr().int().positive().optional(),enabled_archived_sessions:Ua().default(!0)}),kB=Fl.extend({working_dir:Xe().optional(),timeout_ms:Tr().int().positive().optional()}),wB=Fl,SB=Fl,zB=cn({telegram_notify_all:Ua().optional()}).optional(),_B=cn({timezone:Xe().default("UTC"),check_interval_ms:Tr().min(6e4).default(6e4),max_active_jobs:Tr().min(1).max(1e3).default(100)}),jB=cn({agent:cn({name:Xe().default(ct.agent.name),personality:Xe().default(ct.agent.personality)}).default(ct.agent),llm:Fl.default(ct.llm),sati:vB.optional(),neo:wB.optional(),apoc:kB.optional(),trinity:SB.optional(),webhooks:zB,audio:bB.default(ct.audio),memory:cn({limit:Tr().int().positive().optional()}).default(ct.memory),runtime:cn({async_tasks:cn({enabled:Ua().default(ct.runtime?.async_tasks.enabled)}).default(ct.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:_B.optional(),channels:cn({telegram:cn({enabled:Ua().default(!1),token:Xe().optional(),allowedUsers:Ys(Xe()).default([])}).default(ct.channels.telegram),discord:cn({enabled:Ua().default(!1),token:Xe().optional(),allowedUsers:Ys(Xe()).default([])}).default(ct.channels.discord)}).default(ct.channels),ui:cn({enabled:Ua().default(ct.ui.enabled),port:Tr().default(ct.ui.port)}).default(ct.ui),logging:cn({enabled:Ua().default(ct.logging.enabled),level:bd(["debug","info","warn","error"]).default(ct.logging.level),retention:Xe().default(ct.logging.retention)}).default(ct.logging)}),CB=JV("transport",[cn({transport:cw("stdio"),command:Xe().min(1,"Command is required for stdio transport"),args:Ys(Xe()).optional().default([]),env:$c(Xe(),Xe()).optional().default({}),_comment:Xe().optional()}),cn({transport:cw("http"),url:Xe().url("Valid URL is required for http transport"),headers:$c(Xe(),Xe()).optional().default({}),args:Ys(Xe()).optional().default([]),env:$c(Xe(),Xe()).optional().default({}),_comment:Xe().optional()})]);$c(Xe(),L2([CB,Xe()]));function se(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const b=g[y];b in d||(d[b]=m[b].bind(d))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(d){var h;const m=n?.Parent?new u:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Is extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class V2 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const B2={};function Ai(e){return B2}function Z2(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Vp(e,t){return typeof t=="bigint"?t.toString():t}function ry(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ay(e){return e==null}function iy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const mw=Symbol("evaluating");function We(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==mw)return a===void 0&&(a=mw,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Di(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Qa(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function pw(e){return JSON.stringify(e)}function NB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const I2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const EB=ry(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ml(e){if(Qc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Qc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function H2(e){return Ml(e)?{...e}:Array.isArray(e)?[...e]:e}const TB=new Set(["string","number","symbol"]);function Xs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wa(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Ee(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function AB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function OB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Qa(e._zod.def,{get shape(){const l={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(l[d]=n.shape[d])}return Di(this,"shape",l),l},checks:[]});return Wa(e,u)}function RB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Qa(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete l[d]}return Di(this,"shape",l),l},checks:[]});return Wa(e,u)}function MB(e,t){if(!Ml(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Qa(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Di(this,"shape",u),u}});return Wa(e,s)}function DB(e,t){if(!Ml(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Qa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Di(this,"shape",a),a}});return Wa(e,n)}function $B(e,t){const n=Qa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Di(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Wa(e,n)}function LB(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Qa(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Di(this,"shape",h),h},checks:[]});return Wa(t,l)}function PB(e,t,n){const a=Qa(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:s[l]}))}else for(const l in s)u[l]=new e({type:"nonoptional",innerType:s[l]});return Di(this,"shape",u),u}});return Wa(t,a)}function Ds(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function F2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Sc(e){return typeof e=="string"?e:e?.message}function Oi(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Sc(e.inst?._zod.def?.error?.(e))??Sc(t?.error?.(e))??Sc(n.customError?.(e))??Sc(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function sy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Dl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const q2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Vp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},G2=se("$ZodError",q2),Y2=se("$ZodError",q2,{Parent:Error});function UB(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function VB(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,d=0;for(;d<u.path.length;){const h=u.path[d];d===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],d++}}};return a(e),n}const oy=e=>(t,n,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Is;if(l.issues.length){const d=new(s?.Err??e)(l.issues.map(h=>Oi(h,u,Ai())));throw I2(d,s?.callee),d}return l.value},ly=e=>async(t,n,a,s)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const d=new(s?.Err??e)(l.issues.map(h=>Oi(h,u,Ai())));throw I2(d,s?.callee),d}return l.value},vd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new Is;return u.issues.length?{success:!1,error:new(e??G2)(u.issues.map(l=>Oi(l,s,Ai())))}:{success:!0,data:u.value}},BB=vd(Y2),kd=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Oi(l,s,Ai())))}:{success:!0,data:u.value}},ZB=kd(Y2),IB=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return oy(e)(t,n,s)},HB=e=>(t,n,a)=>oy(e)(t,n,a),FB=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ly(e)(t,n,s)},qB=e=>async(t,n,a)=>ly(e)(t,n,a),GB=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return vd(e)(t,n,s)},YB=e=>(t,n,a)=>vd(e)(t,n,a),XB=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kd(e)(t,n,s)},JB=e=>async(t,n,a)=>kd(e)(t,n,a),KB=/^[cC][^\s-]{8,}$/,QB=/^[0-9a-z]+$/,WB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eZ=/^[0-9a-vA-V]{20}$/,tZ=/^[A-Za-z0-9]{27}$/,nZ=/^[a-zA-Z0-9_-]{21}$/,rZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,aZ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,gw=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,iZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function oZ(){return new RegExp(sZ,"u")}const lZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,cZ=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X2=/^[A-Za-z0-9_-]*$/,hZ=/^\+[1-9]\d{6,14}$/,J2="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mZ=new RegExp(`^${J2}$`);function K2(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pZ(e){return new RegExp(`^${K2(e)}$`)}function gZ(e){const t=K2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${J2}T(?:${a})$`)}const yZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xZ=/^[^A-Z]*$/,bZ=/^[^a-z]*$/,Lr=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vZ=se("$ZodCheckMaxLength",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ay(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const l=sy(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),kZ=se("$ZodCheckMinLength",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ay(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const l=sy(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),wZ=se("$ZodCheckLengthEquals",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ay(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===t.length)return;const l=sy(s),d=u>t.length;a.issues.push({origin:l,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),wd=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Lr.init(e,t),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),SZ=se("$ZodCheckRegex",(e,t)=>{wd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),zZ=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xZ),wd.init(e,t)}),_Z=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bZ),wd.init(e,t)}),jZ=se("$ZodCheckIncludes",(e,t)=>{Lr.init(e,t);const n=Xs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),CZ=se("$ZodCheckStartsWith",(e,t)=>{Lr.init(e,t);const n=new RegExp(`^${Xs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),NZ=se("$ZodCheckEndsWith",(e,t)=>{Lr.init(e,t);const n=new RegExp(`.*${Xs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),EZ=se("$ZodCheckOverwrite",(e,t)=>{Lr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class TZ{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
71
|
-
`).filter(l=>l),s=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,s.join(`
|
|
72
|
-
`))}}const AZ={major:4,minor:3,patch:6},It=se("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=AZ;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const u of s._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(l,d,h)=>{let m=Ds(l),g;for(const y of d){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=y._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Is;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Ds(l,b)))});else{if(l.issues.length===b)continue;m||(m=Ds(l,b))}}return g?g.then(()=>l):l},u=(l,d,h)=>{if(Ds(l))return l.aborted=!0,l;const m=s(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new Is;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,d)):u(m,l,d)}const h=e._zod.parse(l,d);if(h instanceof Promise){if(d.async===!1)throw new Is;return h.then(m=>s(m,a,d))}return s(h,a,d)}}We(e,"~standard",()=>({validate:s=>{try{const u=BB(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ZB(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),uy=se("$ZodString",(e,t)=>{It.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yZ(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),kt=se("$ZodStringFormat",(e,t)=>{wd.init(e,t),uy.init(e,t)}),OZ=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=aZ),kt.init(e,t)}),RZ=se("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=gw(a))}else t.pattern??(t.pattern=gw());kt.init(e,t)}),MZ=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=iZ),kt.init(e,t)}),DZ=se("$ZodURL",(e,t)=>{kt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),$Z=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=oZ()),kt.init(e,t)}),LZ=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=nZ),kt.init(e,t)}),PZ=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=KB),kt.init(e,t)}),UZ=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=QB),kt.init(e,t)}),VZ=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=WB),kt.init(e,t)}),BZ=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eZ),kt.init(e,t)}),ZZ=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tZ),kt.init(e,t)}),IZ=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=gZ(t)),kt.init(e,t)}),HZ=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mZ),kt.init(e,t)}),FZ=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pZ(t)),kt.init(e,t)}),qZ=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rZ),kt.init(e,t)}),GZ=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=lZ),kt.init(e,t),e._zod.bag.format="ipv4"}),YZ=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=uZ),kt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),XZ=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cZ),kt.init(e,t)}),JZ=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=dZ),kt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Q2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const KZ=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=fZ),kt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Q2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function QZ(e){if(!X2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Q2(n)}const WZ=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=X2),kt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{QZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),eI=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hZ),kt.init(e,t)});function tI(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const nI=se("$ZodJWT",(e,t)=>{kt.init(e,t),e._zod.check=n=>{tI(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rI=se("$ZodUnknown",(e,t)=>{It.init(e,t),e._zod.parse=n=>n}),aI=se("$ZodNever",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function yw(e,t,n){e.issues.length&&t.issues.push(...F2(n,e.issues)),t.value[n]=e.value}const iI=se("$ZodArray",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const u=[];for(let l=0;l<s.length;l++){const d=s[l],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?u.push(h.then(m=>yw(m,n,l))):yw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function Wc(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...F2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function W2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=AB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ej(e,t,n,a,s,u){const l=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(d.has(y))continue;if(m==="never"){l.push(y);continue}const b=h.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Wc(v,n,y,t,g))):Wc(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const sI=se("$ZodObject",(e,t)=>{if(It.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=ry(()=>W2(t));We(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const g=d[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const y of g.values)h[m].add(y)}}return h});const s=Qc,u=t.catchall;let l;e._zod.parse=(d,h)=>{l??(l=a.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const g=[],y=l.shape;for(const b of l.keys){const v=y[b],S=v._zod.optout==="optional",j=v._zod.run({value:m[b],issues:[]},h);j instanceof Promise?g.push(j.then(E=>Wc(E,d,b,m,S))):Wc(j,d,b,m,S)}return u?ej(g,m,d,h,a.value,e):g.length?Promise.all(g).then(()=>d):d}}),oI=se("$ZodObjectJIT",(e,t)=>{sI.init(e,t);const n=e._zod.parse,a=ry(()=>W2(t)),s=b=>{const v=new TZ(["shape","payload","ctx"]),S=a.value,j=C=>{const P=pw(C);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const C of S.keys)E[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of S.keys){const P=E[C],U=pw(C),F=b[C]?._zod?.optout==="optional";v.write(`const ${P} = ${j(C)};`),F?v.write(`
|
|
73
|
-
if (${P}.issues.length) {
|
|
74
|
-
if (${U} in input) {
|
|
75
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
76
|
-
...iss,
|
|
77
|
-
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
78
|
-
})));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (${P}.value === undefined) {
|
|
83
|
-
if (${U} in input) {
|
|
84
|
-
newResult[${U}] = undefined;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
newResult[${U}] = ${P}.value;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
`):v.write(`
|
|
91
|
-
if (${P}.issues.length) {
|
|
92
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
93
|
-
...iss,
|
|
94
|
-
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
95
|
-
})));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (${P}.value === undefined) {
|
|
99
|
-
if (${U} in input) {
|
|
100
|
-
newResult[${U}] = undefined;
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
newResult[${U}] = ${P}.value;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(C,P)=>O(b,C,P)};let u;const l=Qc,d=!B2.jitless,m=d&&EB.value,g=t.catchall;let y;e._zod.parse=(b,v)=>{y??(y=a.value);const S=b.value;return l(S)?d&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=s(t.shape)),b=u(b,v),g?ej([],S,b,v,y,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function xw(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const s=e.filter(u=>!Ds(u));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Oi(l,a,Ai())))}),t)}const lI=se("$ZodUnion",(e,t)=>{It.init(e,t),We(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),We(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),We(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),We(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>iy(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,u)=>{if(n)return a(s,u);let l=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)d.push(m),l=!0;else{if(m.issues.length===0)return m;d.push(m)}}return l?Promise.all(d).then(h=>xw(h,s,e,u)):xw(d,s,e,u)}}),uI=se("$ZodIntersection",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,u=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>bw(n,h,m)):bw(n,u,l)}});function Bp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ml(e)&&Ml(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(const u of a){const l=Bp(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};s[u]=l.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],u=t[a],l=Bp(s,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function bw(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const u=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),Ds(e))return e;const l=Bp(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const cI=se("$ZodEnum",(e,t)=>{It.init(e,t);const n=Z2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>TB.has(typeof s)).map(s=>typeof s=="string"?Xs(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),dI=se("$ZodLiteral",(e,t)=>{if(It.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Xs(a):a?Xs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),fI=se("$ZodTransform",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new V2(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(l=>(n.value=l,n));if(s instanceof Promise)throw new Is;return n.value=s,n}});function vw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const tj=se("$ZodOptional",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",We(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),We(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iy(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>vw(u,n.value)):vw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),hI=se("$ZodExactOptional",(e,t)=>{tj.init(e,t),We(e._zod,"values",()=>t.innerType._zod.values),We(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),mI=se("$ZodNullable",(e,t)=>{It.init(e,t),We(e._zod,"optin",()=>t.innerType._zod.optin),We(e._zod,"optout",()=>t.innerType._zod.optout),We(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iy(n.source)}|null)$`):void 0}),We(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),pI=se("$ZodDefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",We(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>kw(u,t)):kw(s,t)}});function kw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const gI=se("$ZodPrefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",We(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),yI=se("$ZodNonOptional",(e,t)=>{It.init(e,t),We(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>ww(u,e)):ww(s,e)}});function ww(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const xI=se("$ZodCatch",(e,t)=>{It.init(e,t),We(e._zod,"optin",()=>t.innerType._zod.optin),We(e._zod,"optout",()=>t.innerType._zod.optout),We(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Oi(l,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Oi(u,a,Ai()))},input:n.value}),n.issues=[]),n)}}),bI=se("$ZodPipe",(e,t)=>{It.init(e,t),We(e._zod,"values",()=>t.in._zod.values),We(e._zod,"optin",()=>t.in._zod.optin),We(e._zod,"optout",()=>t.out._zod.optout),We(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>zc(l,t.in,a)):zc(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>zc(u,t.out,a)):zc(s,t.out,a)}});function zc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const vI=se("$ZodReadonly",(e,t)=>{It.init(e,t),We(e._zod,"propValues",()=>t.innerType._zod.propValues),We(e._zod,"values",()=>t.innerType._zod.values),We(e._zod,"optin",()=>t.innerType?._zod?.optin),We(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(Sw):Sw(s)}});function Sw(e){return e.value=Object.freeze(e.value),e}const kI=se("$ZodCustom",(e,t)=>{Lr.init(e,t),It.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(u=>zw(u,n,a,e));zw(s,n,a,e)}});function zw(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Dl(s))}}var _w;class wI{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function SI(){return new wI}(_w=globalThis).__zod_globalRegistry??(_w.__zod_globalRegistry=SI());const ml=globalThis.__zod_globalRegistry;function zI(e,t){return new e({type:"string",...Ee(t)})}function _I(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function jw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function jI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function CI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}function NI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}function EI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}function TI(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}function AI(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}function OI(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}function RI(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}function MI(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}function DI(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}function $I(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}function LI(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}function PI(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}function UI(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}function VI(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}function BI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}function ZI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}function II(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}function HI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}function FI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}function qI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(t)})}function GI(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}function YI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(t)})}function XI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}function JI(e){return new e({type:"unknown"})}function KI(e,t){return new e({type:"never",...Ee(t)})}function nj(e,t){return new vZ({check:"max_length",...Ee(t),maximum:e})}function ed(e,t){return new kZ({check:"min_length",...Ee(t),minimum:e})}function rj(e,t){return new wZ({check:"length_equals",...Ee(t),length:e})}function QI(e,t){return new SZ({check:"string_format",format:"regex",...Ee(t),pattern:e})}function WI(e){return new zZ({check:"string_format",format:"lowercase",...Ee(e)})}function e7(e){return new _Z({check:"string_format",format:"uppercase",...Ee(e)})}function t7(e,t){return new jZ({check:"string_format",format:"includes",...Ee(t),includes:e})}function n7(e,t){return new CZ({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}function r7(e,t){return new NZ({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}function oo(e){return new EZ({check:"overwrite",tx:e})}function a7(e){return oo(t=>t.normalize(e))}function i7(){return oo(e=>e.trim())}function s7(){return oo(e=>e.toLowerCase())}function o7(){return oo(e=>e.toUpperCase())}function l7(){return oo(e=>NB(e))}function u7(e,t,n){return new e({type:"array",element:t,...Ee(n)})}function c7(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ee(n)})}function d7(e){const t=f7(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Dl(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Dl(s))}},e(n.value,n)));return t}function f7(e,t){const n=new Lr({check:"custom",...Ee(t)});return n._zod.check=e,n}function aj(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ml,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ln(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const d=e._zod.toJSONSchema?.();if(d)l.schema=d;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const b=l.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),ln(y,t,g),t.seen.get(y).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&bn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function ij(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const d=e.metadataRegistry.get(l[0])?.id;if(d){const h=a.get(d);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,l[0])}}const s=l=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(l[1]===n)return{ref:"#"};const m=`#/${d}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:h,defId:m}=s(l);d.def={...d.schema},m&&(d.defId=m);const g=d.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
107
|
-
|
|
108
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(d.cycle){u(l);continue}if(d.count>1&&e.reused==="ref"){u(l);continue}}}function sj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const d=e.seen.get(l);if(d.ref===null)return;const h=d.def??d.schema,m={...h},g=d.ref;if(d.ref=null,g){a(g);const b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const j in h)j==="$ref"||j==="allOf"||j in m||delete h[j];if(v.$ref&&b.def)for(const j in h)j==="$ref"||j==="allOf"||j in b.def&&JSON.stringify(h[j])===JSON.stringify(b.def[j])&&delete h[j]}const y=l._zod.parent;if(y&&y!==g){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path:d.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:td(t,"input",e.processors),output:td(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function bn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return bn(a.element,n);if(a.type==="set")return bn(a.valueType,n);if(a.type==="lazy")return bn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return bn(a.innerType,n);if(a.type==="intersection")return bn(a.left,n)||bn(a.right,n);if(a.type==="record"||a.type==="map")return bn(a.keyType,n)||bn(a.valueType,n);if(a.type==="pipe")return bn(a.in,n)||bn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(bn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(bn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(bn(s,n))return!0;return!!(a.rest&&bn(a.rest,n))}return!1}const h7=(e,t={})=>n=>{const a=aj({...n,processors:t});return ln(e,a),ij(a,e),sj(a,e)},td=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=aj({...s??{},target:u,io:t,processors:n});return ln(e,l),ij(l,e),sj(l,e)},m7={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},p7=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),d&&(s.format=m7[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},g7=(e,t,n,a)=>{n.not={}},y7=(e,t,n,a)=>{},x7=(e,t,n,a)=>{const s=e._zod.def,u=Z2(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},b7=(e,t,n,a)=>{const s=e._zod.def,u=[];for(const l of s.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},v7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},w7=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=ln(u.element,t,{...a,path:[...a.path,"items"]})},S7=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object",s.properties={};const l=u.shape;for(const m in l)s.properties[m]=ln(l[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(l)),h=new Set([...d].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=ln(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},z7=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((d,h)=>ln(d,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},_7=(e,t,n,a)=>{const s=e._zod.def,u=ln(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=ln(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(u)?u.allOf:[u],...d(l)?l.allOf:[l]];n.allOf=h},j7=(e,t,n,a)=>{const s=e._zod.def,u=ln(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},C7=(e,t,n,a)=>{const s=e._zod.def;ln(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},N7=(e,t,n,a)=>{const s=e._zod.def;ln(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},E7=(e,t,n,a)=>{const s=e._zod.def;ln(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},T7=(e,t,n,a)=>{const s=e._zod.def;ln(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType;let l;try{l=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},A7=(e,t,n,a)=>{const s=e._zod.def,u=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;ln(u,t,a);const l=t.seen.get(e);l.ref=u},O7=(e,t,n,a)=>{const s=e._zod.def;ln(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},oj=(e,t,n,a)=>{const s=e._zod.def;ln(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},R7=se("ZodISODateTime",(e,t)=>{IZ.init(e,t),Ct.init(e,t)});function M7(e){return qI(R7,e)}const D7=se("ZodISODate",(e,t)=>{HZ.init(e,t),Ct.init(e,t)});function $7(e){return GI(D7,e)}const L7=se("ZodISOTime",(e,t)=>{FZ.init(e,t),Ct.init(e,t)});function P7(e){return YI(L7,e)}const U7=se("ZodISODuration",(e,t)=>{qZ.init(e,t),Ct.init(e,t)});function V7(e){return XI(U7,e)}const lj=(e,t)=>{G2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>VB(e,n)},flatten:{value:n=>UB(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Vp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Vp,2)}},isEmpty:{get(){return e.issues.length===0}}})},B7=se("ZodError",lj),dr=se("ZodError",lj,{Parent:Error}),Z7=oy(dr),I7=ly(dr),H7=vd(dr),F7=kd(dr),q7=IB(dr),G7=HB(dr),Y7=FB(dr),X7=qB(dr),J7=GB(dr),K7=YB(dr),Q7=XB(dr),W7=JB(dr),Ht=se("ZodType",(e,t)=>(It.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:td(e,"input"),output:td(e,"output")}}),e.toJSONSchema=h7(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Qa(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Wa(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>Z7(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>H7(e,n,a),e.parseAsync=async(n,a)=>I7(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>F7(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>q7(e,n,a),e.decode=(n,a)=>G7(e,n,a),e.encodeAsync=async(n,a)=>Y7(e,n,a),e.decodeAsync=async(n,a)=>X7(e,n,a),e.safeEncode=(n,a)=>J7(e,n,a),e.safeDecode=(n,a)=>K7(e,n,a),e.safeEncodeAsync=async(n,a)=>Q7(e,n,a),e.safeDecodeAsync=async(n,a)=>W7(e,n,a),e.refine=(n,a)=>e.check(qH(n,a)),e.superRefine=n=>e.check(GH(n)),e.overwrite=n=>e.check(oo(n)),e.optional=()=>Tw(e),e.exactOptional=()=>RH(e),e.nullable=()=>Aw(e),e.nullish=()=>Tw(Aw(e)),e.nonoptional=n=>UH(e,n),e.array=()=>wH(e),e.or=n=>cj([e,n]),e.and=n=>CH(e,n),e.transform=n=>Ow(e,AH(n)),e.default=n=>$H(e,n),e.prefault=n=>PH(e,n),e.catch=n=>BH(e,n),e.pipe=n=>Ow(e,n),e.readonly=()=>HH(e),e.describe=n=>{const a=e.clone();return ml.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return ml.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ml.get(e);const a=e.clone();return ml.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),uj=se("_ZodString",(e,t)=>{uy.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(a,s,u)=>p7(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(QI(...a)),e.includes=(...a)=>e.check(t7(...a)),e.startsWith=(...a)=>e.check(n7(...a)),e.endsWith=(...a)=>e.check(r7(...a)),e.min=(...a)=>e.check(ed(...a)),e.max=(...a)=>e.check(nj(...a)),e.length=(...a)=>e.check(rj(...a)),e.nonempty=(...a)=>e.check(ed(1,...a)),e.lowercase=a=>e.check(WI(a)),e.uppercase=a=>e.check(e7(a)),e.trim=()=>e.check(i7()),e.normalize=(...a)=>e.check(a7(...a)),e.toLowerCase=()=>e.check(s7()),e.toUpperCase=()=>e.check(o7()),e.slugify=()=>e.check(l7())}),eH=se("ZodString",(e,t)=>{uy.init(e,t),uj.init(e,t),e.email=n=>e.check(_I(tH,n)),e.url=n=>e.check(TI(nH,n)),e.jwt=n=>e.check(FI(yH,n)),e.emoji=n=>e.check(AI(rH,n)),e.guid=n=>e.check(jw(Cw,n)),e.uuid=n=>e.check(jI(_c,n)),e.uuidv4=n=>e.check(CI(_c,n)),e.uuidv6=n=>e.check(NI(_c,n)),e.uuidv7=n=>e.check(EI(_c,n)),e.nanoid=n=>e.check(OI(aH,n)),e.guid=n=>e.check(jw(Cw,n)),e.cuid=n=>e.check(RI(iH,n)),e.cuid2=n=>e.check(MI(sH,n)),e.ulid=n=>e.check(DI(oH,n)),e.base64=n=>e.check(ZI(mH,n)),e.base64url=n=>e.check(II(pH,n)),e.xid=n=>e.check($I(lH,n)),e.ksuid=n=>e.check(LI(uH,n)),e.ipv4=n=>e.check(PI(cH,n)),e.ipv6=n=>e.check(UI(dH,n)),e.cidrv4=n=>e.check(VI(fH,n)),e.cidrv6=n=>e.check(BI(hH,n)),e.e164=n=>e.check(HI(gH,n)),e.datetime=n=>e.check(M7(n)),e.date=n=>e.check($7(n)),e.time=n=>e.check(P7(n)),e.duration=n=>e.check(V7(n))});function Rm(e){return zI(eH,e)}const Ct=se("ZodStringFormat",(e,t)=>{kt.init(e,t),uj.init(e,t)}),tH=se("ZodEmail",(e,t)=>{MZ.init(e,t),Ct.init(e,t)}),Cw=se("ZodGUID",(e,t)=>{OZ.init(e,t),Ct.init(e,t)}),_c=se("ZodUUID",(e,t)=>{RZ.init(e,t),Ct.init(e,t)}),nH=se("ZodURL",(e,t)=>{DZ.init(e,t),Ct.init(e,t)}),rH=se("ZodEmoji",(e,t)=>{$Z.init(e,t),Ct.init(e,t)}),aH=se("ZodNanoID",(e,t)=>{LZ.init(e,t),Ct.init(e,t)}),iH=se("ZodCUID",(e,t)=>{PZ.init(e,t),Ct.init(e,t)}),sH=se("ZodCUID2",(e,t)=>{UZ.init(e,t),Ct.init(e,t)}),oH=se("ZodULID",(e,t)=>{VZ.init(e,t),Ct.init(e,t)}),lH=se("ZodXID",(e,t)=>{BZ.init(e,t),Ct.init(e,t)}),uH=se("ZodKSUID",(e,t)=>{ZZ.init(e,t),Ct.init(e,t)}),cH=se("ZodIPv4",(e,t)=>{GZ.init(e,t),Ct.init(e,t)}),dH=se("ZodIPv6",(e,t)=>{YZ.init(e,t),Ct.init(e,t)}),fH=se("ZodCIDRv4",(e,t)=>{XZ.init(e,t),Ct.init(e,t)}),hH=se("ZodCIDRv6",(e,t)=>{JZ.init(e,t),Ct.init(e,t)}),mH=se("ZodBase64",(e,t)=>{KZ.init(e,t),Ct.init(e,t)}),pH=se("ZodBase64URL",(e,t)=>{WZ.init(e,t),Ct.init(e,t)}),gH=se("ZodE164",(e,t)=>{eI.init(e,t),Ct.init(e,t)}),yH=se("ZodJWT",(e,t)=>{nI.init(e,t),Ct.init(e,t)}),xH=se("ZodUnknown",(e,t)=>{rI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>y7()});function Nw(){return JI(xH)}const bH=se("ZodNever",(e,t)=>{aI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>g7(e,n,a)});function vH(e){return KI(bH,e)}const kH=se("ZodArray",(e,t)=>{iI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>w7(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(ed(n,a)),e.nonempty=n=>e.check(ed(1,n)),e.max=(n,a)=>e.check(nj(n,a)),e.length=(n,a)=>e.check(rj(n,a)),e.unwrap=()=>e.element});function wH(e,t){return u7(kH,e,t)}const SH=se("ZodObject",(e,t)=>{oI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>S7(e,n,a,s),We(e,"shape",()=>t.shape),e.keyof=()=>NH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nw()}),e.strict=()=>e.clone({...e._zod.def,catchall:vH()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>MB(e,n),e.safeExtend=n=>DB(e,n),e.merge=n=>$B(e,n),e.pick=n=>OB(e,n),e.omit=n=>RB(e,n),e.partial=(...n)=>LB(dj,e,n[0]),e.required=(...n)=>PB(fj,e,n[0])});function zH(e,t){const n={type:"object",shape:e??{},...Ee(t)};return new SH(n)}const _H=se("ZodUnion",(e,t)=>{lI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>z7(e,n,a,s),e.options=t.options});function cj(e,t){return new _H({type:"union",options:e,...Ee(t)})}const jH=se("ZodIntersection",(e,t)=>{uI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_7(e,n,a,s)});function CH(e,t){return new jH({type:"intersection",left:e,right:t})}const Zp=se("ZodEnum",(e,t)=>{cI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(a,s,u)=>x7(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Zp({...t,checks:[],...Ee(s),entries:u})},e.exclude=(a,s)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Zp({...t,checks:[],...Ee(s),entries:u})}});function NH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Zp({type:"enum",entries:n,...Ee(t)})}const EH=se("ZodLiteral",(e,t)=>{dI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>b7(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ew(e,t){return new EH({type:"literal",values:Array.isArray(e)?e:[e],...Ee(t)})}const TH=se("ZodTransform",(e,t)=>{fI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>k7(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new V2(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Dl(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Dl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function AH(e){return new TH({type:"transform",transform:e})}const dj=se("ZodOptional",(e,t)=>{tj.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oj(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Tw(e){return new dj({type:"optional",innerType:e})}const OH=se("ZodExactOptional",(e,t)=>{hI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oj(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function RH(e){return new OH({type:"optional",innerType:e})}const MH=se("ZodNullable",(e,t)=>{mI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>j7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Aw(e){return new MH({type:"nullable",innerType:e})}const DH=se("ZodDefault",(e,t)=>{pI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>N7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $H(e,t){return new DH({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():H2(t)}})}const LH=se("ZodPrefault",(e,t)=>{gI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>E7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function PH(e,t){return new LH({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():H2(t)}})}const fj=se("ZodNonOptional",(e,t)=>{yI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>C7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function UH(e,t){return new fj({type:"nonoptional",innerType:e,...Ee(t)})}const VH=se("ZodCatch",(e,t)=>{xI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>T7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BH(e,t){return new VH({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ZH=se("ZodPipe",(e,t)=>{bI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>A7(e,n,a,s),e.in=t.in,e.out=t.out});function Ow(e,t){return new ZH({type:"pipe",in:e,out:t})}const IH=se("ZodReadonly",(e,t)=>{vI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>O7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function HH(e){return new IH({type:"readonly",innerType:e})}const FH=se("ZodCustom",(e,t)=>{kI.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,a,s)=>v7(e,n)});function qH(e,t={}){return c7(FH,e,t)}function GH(e){return d7(e)}const YH=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"ui",label:"Interface"},{id:"logging",label:"Logging"},{id:"chronos",label:"Chronos"}],XH=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],cl=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function JH(){const{data:e,error:t}=Dt("/api/config",zr.fetchConfig),{data:n}=Dt("/api/config/sati",zr.getSatiConfig),{data:a}=Dt("/api/config/apoc",zr.getApocConfig),{data:s}=Dt("/api/config/neo",zr.getNeoConfig),{data:u}=Dt("/api/config/trinity",zr.getTrinityConfig),{data:l}=Y_(),[d,h]=z.useState(null),[m,g]=z.useState(!1),[y,b]=z.useState(null),[v,S]=z.useState(null),[j,E]=z.useState(null),[N,O]=z.useState(null),[C,P]=z.useState(null),[U,R]=z.useState("general"),[F,B]=z.useState("oracle"),[K,fe]=z.useState(!1),[ae,le]=z.useState({}),[ne,oe]=z.useState(null);z.useEffect(()=>{e&&!y&&b(e)},[e]),z.useEffect(()=>{n&&!v&&S(n)},[n]),z.useEffect(()=>{a&&!N?O(a):!a&&!N&&y&&O({...y.apoc??y.llm,temperature:y.apoc?.temperature??.2,timeout_ms:y.apoc?.timeout_ms??3e4})},[a,y]),z.useEffect(()=>{s&&!j?E(s):!s&&!j&&y&&E({...y.neo??y.llm,temperature:y.neo?.temperature??.2})},[s,y]),z.useEffect(()=>{u&&!C?P(u):!u&&!C&&y&&P({...y.trinity??y.llm,temperature:y.trinity?.temperature??.2})},[u,y]),z.useEffect(()=>{l&&!d&&h(l)},[l]);const ie=JSON.stringify(e)!==JSON.stringify(y)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(j)||JSON.stringify(a)!==JSON.stringify(N)||JSON.stringify(u)!==JSON.stringify(C),L=(D,ce)=>{if(!y)return;const Ae=JSON.parse(JSON.stringify(y));let je=Ae;for(let Ye=0;Ye<D.length-1;Ye++)je=je[D[Ye]];je[D[D.length-1]]=ce,b(Ae);try{jB.parse(Ae),le({})}catch(Ye){if(Ye instanceof B7){const Nt={};Ye.errors.forEach(Jt=>{const et=Jt.path.join(".");Nt[et]=Jt.message}),le(Nt)}}},J=(D,ce)=>{v&&S({...v,[D]:ce})},Z=(D,ce)=>{N&&O({...N,[D]:ce})},he=(D,ce)=>{j&&E({...j,[D]:ce})},A=(D,ce)=>{C&&P({...C,[D]:ce})},T=()=>{!y||!C||P({...C,provider:y.llm.provider,model:y.llm.model,api_key:y.llm.api_key})},G=()=>{!y||!v||S({...v,provider:y.llm.provider,model:y.llm.model,api_key:y.llm.api_key})},w=()=>{!y||!N||O({...N,provider:y.llm.provider,model:y.llm.model,api_key:y.llm.api_key})},X=()=>{!y||!j||E({...j,provider:y.llm.provider,model:y.llm.model,api_key:y.llm.api_key})},me=async()=>{if(y){fe(!0),oe(null);try{await zr.updateConfig(y),v&&await zr.updateSatiConfig(v),j&&await zr.updateNeoConfig(j),N&&await zr.updateApocConfig(N),C&&await zr.updateTrinityConfig(C),An("/api/config"),An("/api/config/sati"),An("/api/config/neo"),An("/api/config/apoc"),An("/api/config/trinity"),oe({type:"success",message:"Settings saved successfully. Restart Morpheus daemon for changes to take effect."})}catch(D){if(oe({type:"error",message:D.message}),D.details&&Array.isArray(D.details)){const ce={};D.details.forEach(Ae=>{const je=Ae.path.join(".");ce[je]=Ae.message}),le(ce)}}finally{fe(!1)}}};return t?f.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):y?f.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Zaion Settings"}),f.jsx("button",{onClick:me,disabled:!ie||Object.keys(ae).length>0||K,className:`px-4 py-2 rounded font-medium transition-colors ${ie&&Object.keys(ae).length===0?"bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90":"bg-azure-border text-azure-text-secondary cursor-not-allowed dark:bg-matrix-primary/50 dark:text-matrix-highlight/50"}`,children:K?"Saving...":"Save Changes"})]}),ne&&f.jsx("div",{className:`p-4 rounded border ${ne.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:ne.message}),f.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:f.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:YH.map(D=>f.jsx("button",{onClick:()=>R(D.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${U===D.id?"bg-azure-surface/50 text-azure-primary border-t border-x border-azure-border dark:bg-matrix-primary/20 dark:text-matrix-highlight dark:border-t dark:border-x dark:border-matrix-primary":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:D.label},D.id))})}),f.jsxs("div",{className:"space-y-6",children:[U==="general"&&f.jsxs(ar,{title:"Agent Identity",children:[f.jsx(it,{label:"Agent Name",value:y.agent.name,onChange:D=>L(["agent","name"],D.target.value),error:ae["agent.name"]}),f.jsx(it,{label:"Personality",value:y.agent.personality,onChange:D=>L(["agent","personality"],D.target.value),error:ae["agent.personality"]})]}),U==="agents"&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:XH.map(D=>f.jsx("button",{onClick:()=>B(D.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${F===D.id?"bg-azure-primary/10 text-azure-primary border-b-2 border-azure-primary dark:bg-matrix-highlight/10 dark:text-matrix-highlight dark:border-matrix-highlight":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:D.label},D.id))}),F==="oracle"&&f.jsxs(ar,{title:"Oracle Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Main orchestration agent — handles user requests and delegates to subagents"}),f.jsx(jr,{label:"Provider",value:y.llm.provider,onChange:D=>L(["llm","provider"],D.target.value),options:cl,error:ae["llm.provider"]}),f.jsx(it,{label:"Model Name",value:y.llm.model,onChange:D=>L(["llm","model"],D.target.value),error:ae["llm.model"]}),f.jsx(yn,{label:"Temperature",value:y.llm.temperature,onChange:D=>L(["llm","temperature"],parseFloat(D.target.value)),step:.1,min:0,max:1,error:ae["llm.temperature"]}),f.jsx(yn,{label:"Max Tokens",value:y.llm.max_tokens??"",onChange:D=>L(["llm","max_tokens"],D.target.value?parseInt(D.target.value):void 0),min:1,error:ae["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(yn,{label:"Context Window (Messages)",value:y.llm.context_window??100,onChange:D=>L(["llm","context_window"],parseInt(D.target.value)),min:1,step:1,error:ae["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100)."}),f.jsx(it,{label:"API Key",type:"password",value:y.llm.api_key||"",onChange:D=>L(["llm","api_key"],D.target.value),placeholder:"sk-...",helperText:"Stored locally."}),y.llm.provider==="openrouter"&&f.jsx(it,{label:"Base URL",value:y.llm.base_url||"https://openrouter.ai/api/v1",onChange:D=>L(["llm","base_url"],D.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),F==="sati"&&f.jsxs(ar,{title:"Sati Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Background memory consolidation agent — evaluates conversations and persists important context"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:G,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),v&&f.jsxs(f.Fragment,{children:[f.jsx(jr,{label:"Provider",value:v.provider,onChange:D=>J("provider",D.target.value),options:cl}),f.jsx(it,{label:"Model Name",value:v.model,onChange:D=>J("model",D.target.value)}),f.jsx(it,{label:"API Key",type:"password",value:v.api_key||"",onChange:D=>J("api_key",D.target.value),placeholder:"sk-...",helperText:"Stored locally."}),v.provider==="openrouter"&&f.jsx(it,{label:"Base URL",value:v.base_url||"https://openrouter.ai/api/v1",onChange:D=>J("base_url",D.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),f.jsx(yn,{label:"Memory Limit",value:v.memory_limit??10,onChange:D=>J("memory_limit",parseInt(D.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),f.jsx(zs,{label:"Enable Archived Sessions in Memory Retrieval",checked:v.enabled_archived_sessions??!0,onChange:D=>J("enabled_archived_sessions",D)})]})]}),F==="neo"&&f.jsxs(ar,{title:"Neo Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"MCP + internal tools subagent — executes analytical and operational tasks delegated by Oracle"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:X,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),j&&f.jsxs(f.Fragment,{children:[f.jsx(jr,{label:"Provider",value:j.provider,onChange:D=>he("provider",D.target.value),options:cl}),f.jsx(it,{label:"Model Name",value:j.model,onChange:D=>he("model",D.target.value)}),f.jsx(yn,{label:"Temperature",value:j.temperature,onChange:D=>he("temperature",parseFloat(D.target.value)),step:.1,min:0,max:1}),f.jsx(yn,{label:"Max Tokens",value:j.max_tokens??"",onChange:D=>he("max_tokens",D.target.value?parseInt(D.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(yn,{label:"Context Window (Messages)",value:j.context_window??100,onChange:D=>he("context_window",parseInt(D.target.value)),min:1,step:1}),f.jsx(it,{label:"API Key",type:"password",value:j.api_key||"",onChange:D=>he("api_key",D.target.value),placeholder:"sk-...",helperText:"Stored locally."}),j.provider==="openrouter"&&f.jsx(it,{label:"Base URL",value:j.base_url||"https://openrouter.ai/api/v1",onChange:D=>he("base_url",D.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),F==="trinity"&&f.jsxs(ar,{title:"Trinity Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Database subagent — interprets natural language queries and executes them against registered databases (PostgreSQL, MySQL, SQLite, MongoDB)"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:T,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),C&&f.jsxs(f.Fragment,{children:[f.jsx(jr,{label:"Provider",value:C.provider,onChange:D=>A("provider",D.target.value),options:cl}),f.jsx(it,{label:"Model Name",value:C.model,onChange:D=>A("model",D.target.value)}),f.jsx(yn,{label:"Temperature",value:C.temperature,onChange:D=>A("temperature",parseFloat(D.target.value)),step:.1,min:0,max:1}),f.jsx(yn,{label:"Max Tokens",value:C.max_tokens??"",onChange:D=>A("max_tokens",D.target.value?parseInt(D.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default."}),f.jsx(it,{label:"API Key",type:"password",value:C.api_key||"",onChange:D=>A("api_key",D.target.value),placeholder:"sk-...",helperText:"Stored locally."}),C.provider==="openrouter"&&f.jsx(it,{label:"Base URL",value:C.base_url||"https://openrouter.ai/api/v1",onChange:D=>A("base_url",D.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),F==="apoc"&&f.jsxs(ar,{title:"Apoc Agent",children:[f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"DevTools subagent — executes file, shell, git, network, and system operations on behalf of Oracle"}),f.jsxs("div",{className:"mb-4",children:[f.jsx("button",{type:"button",onClick:w,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),N&&f.jsxs(f.Fragment,{children:[f.jsx(jr,{label:"Provider",value:N.provider,onChange:D=>Z("provider",D.target.value),options:cl}),f.jsx(it,{label:"Model Name",value:N.model,onChange:D=>Z("model",D.target.value)}),f.jsx(yn,{label:"Temperature",value:N.temperature,onChange:D=>Z("temperature",parseFloat(D.target.value)),step:.1,min:0,max:1}),f.jsx(it,{label:"API Key",type:"password",value:N.api_key||"",onChange:D=>Z("api_key",D.target.value),placeholder:"sk-...",helperText:"Stored locally."}),N.provider==="openrouter"&&f.jsx(it,{label:"Base URL",value:N.base_url||"https://openrouter.ai/api/v1",onChange:D=>Z("base_url",D.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),f.jsx(it,{label:"Working Directory",value:N.working_dir||"",onChange:D=>Z("working_dir",D.target.value),placeholder:"/home/user/projects",helperText:"Root directory for file and shell operations. Leave empty to use process working directory."}),f.jsx(yn,{label:"Timeout (ms)",value:N.timeout_ms??3e4,onChange:D=>Z("timeout_ms",parseInt(D.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),U==="audio"&&f.jsxs(ar,{title:"Audio Transcription",children:[f.jsx(zs,{label:"Enable Audio",checked:y.audio.enabled,onChange:D=>L(["audio","enabled"],D)}),f.jsx(jr,{label:"Provider",value:y.audio.provider||"google",onChange:D=>L(["audio","provider"],D.target.value),options:[{label:"Google Gemini",value:"google"},{label:"OpenAI (Whisper)",value:"openai"},{label:"OpenRouter (multimodal)",value:"openrouter"},{label:"Ollama (Whisper local)",value:"ollama"}],error:ae["audio.provider"]}),f.jsx(it,{label:"Model",value:y.audio.model,onChange:D=>L(["audio","model"],D.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:ae["audio.model"]}),y.audio.provider==="ollama"&&f.jsx(it,{label:"Base URL",value:y.audio.base_url||"",onChange:D=>L(["audio","base_url"],D.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),f.jsx(it,{label:"API Key",type:"password",value:y.audio.apiKey||"",onChange:D=>L(["audio","apiKey"],D.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider."}),f.jsx(yn,{label:"Max Duration (Seconds)",value:y.audio.maxDurationSeconds,onChange:D=>L(["audio","maxDurationSeconds"],parseInt(D.target.value)),min:1}),f.jsx(it,{label:"Supported Mime Types",value:y.audio.supportedMimeTypes.join(", "),onChange:D=>L(["audio","supportedMimeTypes"],D.target.value.split(",").map(ce=>ce.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),U==="channels"&&f.jsxs(f.Fragment,{children:[f.jsxs(ar,{title:"Telegram",children:[f.jsx(zs,{label:"Enable Telegram",checked:y.channels.telegram.enabled,onChange:D=>L(["channels","telegram","enabled"],D)}),y.channels.telegram.enabled&&f.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[f.jsx(it,{label:"Bot Token",type:"password",value:y.channels.telegram.token||"",onChange:D=>L(["channels","telegram","token"],D.target.value)}),f.jsx(it,{label:"Allowed Users (comma separated)",value:y.channels.telegram.allowedUsers.join(", "),onChange:D=>L(["channels","telegram","allowedUsers"],D.target.value.split(",").map(ce=>ce.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),f.jsxs(ar,{title:"Discord",children:[f.jsx(zs,{label:"Enable Discord",checked:y.channels.discord.enabled,onChange:D=>L(["channels","discord","enabled"],D)}),y.channels.discord.enabled&&f.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[f.jsx(it,{label:"Bot Token",type:"password",value:y.channels.discord.token||"",onChange:D=>L(["channels","discord","token"],D.target.value)}),f.jsx(it,{label:"Allowed Users (comma separated)",value:(y.channels.discord.allowedUsers??[]).join(", "),onChange:D=>L(["channels","discord","allowedUsers"],D.target.value.split(",").map(ce=>ce.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),U==="ui"&&f.jsxs(ar,{title:"Dashboard",children:[f.jsx(zs,{label:"Enable Web UI",checked:y.ui.enabled,onChange:D=>L(["ui","enabled"],D)}),f.jsx(yn,{label:"Port",value:y.ui.port,onChange:D=>L(["ui","port"],parseInt(D.target.value)),disabled:!0,helperText:"Requires restart to change."})]}),U==="logging"&&f.jsxs(ar,{title:"Logging",children:[f.jsx(zs,{label:"Enable Logging",checked:y.logging.enabled,onChange:D=>L(["logging","enabled"],D)}),f.jsx(jr,{label:"Log Level",value:y.logging.level,onChange:D=>L(["logging","level"],D.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),U==="chronos"&&d&&f.jsxs(ar,{title:"Chronos — Temporal Intent Engine",children:[f.jsx(jr,{label:"Timezone",value:d.timezone,onChange:D=>h({...d,timezone:D.target.value}),options:[{label:"UTC",value:"UTC"},{label:"America/New_York",value:"America/New_York"},{label:"America/Chicago",value:"America/Chicago"},{label:"America/Denver",value:"America/Denver"},{label:"America/Los_Angeles",value:"America/Los_Angeles"},{label:"America/Sao_Paulo",value:"America/Sao_Paulo"},{label:"America/Buenos_Aires",value:"America/Buenos_Aires"},{label:"America/Bogota",value:"America/Bogota"},{label:"America/Lima",value:"America/Lima"},{label:"America/Santiago",value:"America/Santiago"},{label:"America/Mexico_City",value:"America/Mexico_City"},{label:"America/Toronto",value:"America/Toronto"},{label:"America/Vancouver",value:"America/Vancouver"},{label:"Europe/London",value:"Europe/London"},{label:"Europe/Paris",value:"Europe/Paris"},{label:"Europe/Berlin",value:"Europe/Berlin"},{label:"Europe/Madrid",value:"Europe/Madrid"},{label:"Europe/Rome",value:"Europe/Rome"},{label:"Europe/Amsterdam",value:"Europe/Amsterdam"},{label:"Europe/Brussels",value:"Europe/Brussels"},{label:"Europe/Zurich",value:"Europe/Zurich"},{label:"Europe/Lisbon",value:"Europe/Lisbon"},{label:"Europe/Warsaw",value:"Europe/Warsaw"},{label:"Europe/Stockholm",value:"Europe/Stockholm"},{label:"Europe/Helsinki",value:"Europe/Helsinki"},{label:"Europe/Moscow",value:"Europe/Moscow"},{label:"Asia/Dubai",value:"Asia/Dubai"},{label:"Asia/Kolkata",value:"Asia/Kolkata"},{label:"Asia/Bangkok",value:"Asia/Bangkok"},{label:"Asia/Singapore",value:"Asia/Singapore"},{label:"Asia/Hong_Kong",value:"Asia/Hong_Kong"},{label:"Asia/Shanghai",value:"Asia/Shanghai"},{label:"Asia/Tokyo",value:"Asia/Tokyo"},{label:"Asia/Seoul",value:"Asia/Seoul"},{label:"Australia/Sydney",value:"Australia/Sydney"},{label:"Australia/Melbourne",value:"Australia/Melbourne"},{label:"Pacific/Auckland",value:"Pacific/Auckland"},{label:"Africa/Cairo",value:"Africa/Cairo"},{label:"Africa/Johannesburg",value:"Africa/Johannesburg"}]}),f.jsx(yn,{label:"Check Interval (seconds)",value:Math.round(d.check_interval_ms/1e3),onChange:D=>h({...d,check_interval_ms:Number(D.target.value)*1e3}),min:60}),f.jsx(yn,{label:"Max Active Jobs",value:d.max_active_jobs,onChange:D=>h({...d,max_active_jobs:Number(D.target.value)}),min:1,max:1e3}),f.jsx("div",{className:"flex justify-end pt-2",children:f.jsx("button",{onClick:async()=>{g(!0),oe(null);try{await Ei.updateConfig(d),An("/api/config/chronos"),oe({type:"success",message:"Chronos settings saved."})}catch(D){oe({type:"error",message:D.message})}finally{g(!1)}},disabled:m,className:"px-4 py-2 rounded font-medium bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:m?"Saving…":"Save Chronos Settings"})})]})]})]}):f.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function KH(){const{data:e}=O4(),[t,n]=z.useState(null),{data:a,mutate:s}=R4(t),u=z.useRef(null);return z.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),z.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[a]),f.jsxs(ut.div,{className:"flex flex-col space-y-4 md:pt-0",style:{height:"calc(100vh - 2rem)"},initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.3},children:[f.jsxs("div",{className:"shrink-0",children:[f.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"SYSTEM LOGS"}),f.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"View runtime logs."})]}),f.jsxs("div",{className:"flex-1 flex gap-4 min-h-0 border border-azure-border dark:border-matrix-primary rounded bg-azure-surface dark:bg-zinc-950 p-4",children:[f.jsxs("div",{className:"hidden md:flex w-64 flex-col gap-2 border-r border-azure-border dark:border-matrix-primary pr-4 overflow-y-auto shrink-0",children:[f.jsx("h3",{className:"font-bold text-azure-text-secondary dark:text-matrix-secondary mb-2 sticky top-0 bg-azure-surface dark:bg-zinc-950",children:"LOG FILES"}),e?.map(l=>f.jsxs("button",{onClick:()=>n(l.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===l.name?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-zinc-900 group-hover:text-azure-primary dark:group-hover:text-matrix-highlight"}`,children:[f.jsx(tA,{className:"w-4 h-4 shrink-0"}),f.jsxs("div",{className:"flex flex-col overflow-hidden",children:[f.jsx("span",{className:"truncate font-bold",children:l.name}),f.jsxs("span",{className:"text-xs opacity-70",children:[(l.size/1024).toFixed(1)," KB"]})]})]},l.name))]}),f.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary/50 rounded",children:[f.jsxs("div",{className:"shrink-0 flex justify-between items-center gap-2 p-2 bg-azure-hover dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary/50",children:[f.jsx("select",{value:t??"",onChange:l=>n(l.target.value),className:"md:hidden flex-1 bg-transparent text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm border-none outline-none cursor-pointer",children:e?.map(l=>f.jsx("option",{value:l.name,children:l.name},l.name))}),f.jsx("span",{className:"hidden md:block text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm truncate",children:t}),f.jsx("button",{onClick:()=>s(),className:"shrink-0 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(yS,{className:"w-4 h-4"})})]}),f.jsx("div",{ref:u,className:"flex-1 overflow-x-hidden overflow-y-auto p-4 font-mono text-xs break-all text-azure-text-primary dark:text-white",children:a?a.lines.map((l,d)=>{const h=l.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s?(.*)/s);return h?f.jsxs("div",{children:[f.jsxs("span",{className:"hidden md:inline opacity-50",children:[h[1]," "]}),f.jsx("span",{children:h[2]})]},d):f.jsx("div",{children:l},d)}):f.jsx("span",{className:"opacity-50",children:"Select a log file to view content..."})})]})]})]})}function QH(){const[e,t]=z.useState(null),[n,a]=z.useState([]),[s,u]=z.useState(!0),[l,d]=z.useState("");if(z.useEffect(()=>{async function g(){try{const[y,b]=await Promise.all([_p.fetchUsageStats(),_p.fetchGroupedUsageStats()]);t(y),a(b)}catch(y){d("Failed to load usage statistics"),console.error(y)}finally{u(!1)}}g()},[]),s)return f.jsx("div",{className:"flex items-center justify-center h-64 text-azure-accent dark:text-matrix-highlight font-mono animate-pulse",children:"LOADING_DATA_STREAM..."});if(l)return f.jsxs("div",{className:"p-4 bg-red-900/20 border border-red-500/50 text-red-500 font-mono rounded",children:["ERROR_ACCESSING_DATABASE: ",l]});const h={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},m={hidden:{y:20,opacity:0},show:{y:0,opacity:1}};return f.jsxs(ut.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsx("div",{className:"flex items-center justify-between border-b border-azure-border dark:border-matrix-primary pb-4",children:f.jsxs("div",{children:[f.jsxs("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight font-mono flex items-center gap-2",children:[f.jsx(Zm,{className:"w-6 h-6"}),"USAGE_ANALYTICS"]}),f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1 font-mono text-sm",children:"Resource consumption tracking and metrics"})]})}),f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[f.jsxs(ut.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx(zl,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),f.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),f.jsxs(ut.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx($s,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),f.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),f.jsxs(ut.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[f.jsx(Pc,{className:"w-5 h-5"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),f.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),f.jsxs(ut.div,{variants:m,className:"bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden backdrop-blur-sm",children:[f.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:f.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[f.jsx("thead",{className:"bg-azure-bg dark:bg-zinc-900/50 text-azure-text-secondary dark:text-matrix-secondary border-b border-azure-border dark:border-matrix-primary",children:f.jsxs("tr",{children:[f.jsx("th",{className:"p-4",children:"Provider"}),f.jsx("th",{className:"p-4",children:"Model"}),f.jsx("th",{className:"p-4 text-right",children:"Messages"}),f.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),f.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),f.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),f.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:8,className:"p-8 text-center text-azure-text-muted dark:text-matrix-secondary italic",children:"NO_DATA_AVAILABLE"})}):n.map((g,y)=>f.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[f.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),f.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),f.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),f.jsx("td",{className:"p-4 text-right font-bold text-green-600 dark:text-green-400",children:g.estimatedCostUsd!=null?`$${g.estimatedCostUsd.toFixed(4)}`:"—"})]},`${g.provider}-${g.model}-${y}`))})]})})]})]})}const WH=()=>{const[e,t]=z.useState(""),[n,a]=z.useState(""),s=Yp(),u=br(),l=d=>{d.preventDefault(),e&&(a(""),fetch("/api/config",{headers:{"x-architect-pass":e}}).then(async h=>{if(h.ok){localStorage.setItem("morpheus.auth.token",e);const m=u.state?.from?.pathname||"/";s(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return f.jsx("div",{className:"flex items-center justify-center min-h-screen bg-azure-bg dark:bg-black text-azure-primary dark:text-green-500 font-mono",children:f.jsxs("div",{className:"max-w-md w-full p-8 border border-azure-primary dark:border-green-500 shadow-xl dark:shadow-[0_0_15px_rgba(34,197,94,0.3)] bg-white dark:bg-black rounded-lg dark:rounded-none",children:[f.jsx("h1",{className:"text-2xl font-bold mb-6 text-center tracking-widest uppercase text-azure-primary dark:text-green-500",children:"> The Architect Login"}),f.jsxs("form",{onSubmit:l,className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),f.jsx("input",{type:"password",value:e,onChange:d=>t(d.target.value),className:"w-full bg-azure-bg dark:bg-black border border-azure-border dark:border-green-800 p-2 focus:outline-none focus:border-azure-primary dark:focus:border-green-500 text-azure-text-primary dark:text-green-500 placeholder-azure-text-secondary/50 dark:placeholder-green-900 rounded dark:rounded-none",placeholder:"••••••••",autoFocus:!0})]}),n&&f.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),f.jsx("button",{type:"submit",className:"w-full bg-azure-primary hover:bg-azure-active dark:bg-green-900 dark:hover:bg-green-700 text-white dark:text-black font-bold py-2 transition-colors duration-200 uppercase tracking-wider rounded dark:rounded-none",children:"Authenticate"})]}),f.jsx("div",{className:"mt-8 text-[10px] opacity-30 text-center uppercase text-azure-text-secondary dark:text-green-500",children:"Morpheus OS v0.1.5 | Unauthorized access is logged."})]})})},eF=({children:e})=>{const{isAuthenticated:t}=d_(),n=br();return t?f.jsx(f.Fragment,{children:e}):f.jsx(iS,{to:"/login",state:{from:n},replace:!0})},tF=({className:e,...t})=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),nF=({...e})=>f.jsx("thead",{...e}),rF=({...e})=>f.jsx("tbody",{...e}),Mm=({...e})=>f.jsx("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 transition-colors hover:bg-azure-hover/50 dark:hover:bg-matrix-primary/10",...e}),_s=({className:e,...t})=>f.jsx("th",{className:`h-12 px-4 text-left align-middle font-medium text-azure-text-secondary dark:text-matrix-secondary/70 [&:has([role=checkbox])]:pr-0 ${e}`,...t}),vi=({className:e,...t})=>f.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),Rw=({checked:e,onCheckedChange:t,className:n,...a})=>{const s=u=>{t&&t(u.target.checked),a.onChange&&a.onChange(u)};return f.jsx("input",{type:"checkbox",checked:e,onChange:s,className:`h-4 w-4 rounded border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-primary dark:text-matrix-highlight focus:ring-azure-primary dark:focus:ring-matrix-highlight ${n||""}`,...a})},nd=({className:e,variant:t="default",...n})=>{const s=`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:focus:ring-zinc-300 ${t==="destructive"?"border-transparent bg-red-500 text-zinc-50 dark:bg-red-900 dark:text-zinc-50":t==="secondary"?"border-transparent bg-azure-surface dark:bg-zinc-800 text-azure-text-secondary dark:text-matrix-secondary":t==="outline"?"text-azure-text-primary dark:text-matrix-secondary border-azure-border dark:border-matrix-primary":"border-transparent bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black"} ${e||""}`;return f.jsx("div",{className:s,...n})},Dm=({className:e,...t})=>f.jsx("div",{className:`rounded-lg border border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary shadow-sm ${e||""}`,...t}),Mw=({className:e,...t})=>f.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),aF=({className:e,...t})=>f.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),$m=({className:e,...t})=>f.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),iF=({className:e,variant:t="default",...n})=>{const s=`relative w-full rounded-lg border p-4 ${t==="destructive"?"border-red-500/50 text-red-700 dark:border-red-900/50 dark:text-red-300":"border-azure-border dark:border-matrix-primary"} ${e||""}`;return f.jsx("div",{className:s,...n})},sF=({className:e,...t})=>f.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),hj=({isOpen:e,onClose:t,title:n,children:a,size:s="md"})=>{if(!e)return null;const u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),f.jsxs("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full ${u[s]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&f.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&f.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),f.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},oF=({isOpen:e,onClose:t,memory:n})=>n?f.jsx(hj,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(UA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),f.jsx("div",{children:f.jsx(nd,{variant:"outline",children:n.category})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(GA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),f.jsx("div",{children:f.jsx(nd,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(hS,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Za,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(sd,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(iA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(uA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),f.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),f.jsxs("div",{children:[f.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),f.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md",children:n.summary})]}),n.details&&f.jsxs("div",{children:[f.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),f.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md whitespace-pre-wrap",children:n.details})]}),f.jsx("div",{className:"flex justify-end pt-4",children:f.jsx(or,{onClick:t,children:"Close"})})]})}):null,mj=({isOpen:e,onClose:t,onConfirm:n,title:a="Confirm Deletion",message:s="Are you sure you want to delete this item? This action cannot be undone.",confirmButtonText:u="Delete",cancelButtonText:l="Cancel"})=>f.jsx(hj,{isOpen:e,onClose:t,title:a,size:"md",children:f.jsxs("div",{className:"space-y-6",children:[f.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(or,{variant:"outline",onClick:t,children:l}),f.jsx(or,{variant:"destructive",onClick:()=>{n(),t()},children:u})]})]})}),lF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=z.useCallback(h=>(t(!0),a(null),be.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),u=z.useCallback((h,m)=>(t(!0),a(null),be.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),l=z.useCallback((h,m)=>(t(!0),a(null),be.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),d=z.useCallback(h=>(t(!0),a(null),be.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:s,post:u,put:l,del:d,loading:e,error:n}},uF=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(!0),[s,u]=z.useState([]),[l,d]=z.useState(""),[h,m]=z.useState("all"),[g,y]=z.useState("all"),[b,v]=z.useState(null),[S,j]=z.useState(!1),[E,N]=z.useState(null),[O,C]=z.useState(!1),[P,U]=z.useState(null),[R,F]=z.useState(!1),{get:B,del:K,post:fe}=lF();z.useEffect(()=>{ae()},[]);const ae=async()=>{try{a(!0);const T=await B("/sati/memories");t(T),v(null)}catch(T){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",T)}finally{a(!1)}},le=()=>{s.length===Z.length?u([]):u(Z.map(T=>T.id))},ne=T=>{s.includes(T)?u(s.filter(G=>G!==T)):u([...s,T])},oe=async()=>{if(s.length!==0)try{await fe("/sati/memories/bulk-delete",{ids:s}),await ae(),u([]),j(!1)}catch(T){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",T)}},ie=T=>{U(T),F(!0)},L=async()=>{if(P)try{await K(`/sati/memories/${P}`),await ae()}catch(T){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",T)}finally{U(null),F(!1)}},J=T=>{N(T),C(!0)},Z=e.filter(T=>{const G=T.summary.toLowerCase().includes(l.toLowerCase())||T.details?.toLowerCase().includes(l.toLowerCase())||T.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||T.category===h,X=g==="all"||T.importance===g;return G&&w&&X&&!T.archived}),he=Array.from(new Set(e.map(T=>T.category))),A=Array.from(new Set(e.map(T=>T.importance)));return n?f.jsx(Dm,{className:"w-full",children:f.jsx($m,{className:"flex justify-center items-center h-64",children:f.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Sati Memories"}),f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1",children:"View and manage your long-term memories stored by Sati"})]}),s.length>0&&f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[s.length," selected"]}),f.jsxs(or,{variant:"destructive",size:"sm",onClick:()=>j(!0),disabled:s.length===0,children:[f.jsx(Ti,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&f.jsx(iF,{variant:"destructive",children:f.jsx(sF,{children:b})}),f.jsxs(Dm,{children:[f.jsx(Mw,{className:"border-b border-azure-border dark:border-matrix-primary",children:f.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[f.jsxs("div",{className:"flex flex-col relative w-full",children:[f.jsx(OA,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),f.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:T=>d(T.target.value),className:"w-full pl-10 pr-4 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight"})]}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[f.jsxs("select",{value:h,onChange:T=>m(T.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[f.jsx("option",{value:"all",children:"All Categories"}),he.map(T=>f.jsx("option",{value:T,children:T},T))]}),f.jsxs("select",{value:g,onChange:T=>y(T.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[f.jsx("option",{value:"all",children:"All Importance"}),A.map(T=>f.jsx("option",{value:T,children:T},T))]})]})]})}),f.jsx($m,{className:"p-0",children:f.jsxs(tF,{children:[f.jsx(nF,{children:f.jsxs(Mm,{className:"hover:bg-transparent",children:[f.jsx(_s,{className:"w-12",children:f.jsx(Rw,{checked:Z.length>0&&s.length===Z.length,onCheckedChange:le})}),f.jsx(_s,{children:"Summary"}),f.jsx(_s,{children:"Category"}),f.jsx(_s,{children:"Importance"}),f.jsx(_s,{children:"Created"}),f.jsx(_s,{className:"w-32",children:"Actions"})]})}),f.jsx(rF,{children:Z.length===0?f.jsx(Mm,{children:f.jsx(vi,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):Z.map(T=>f.jsxs(Mm,{children:[f.jsx(vi,{children:f.jsx(Rw,{checked:s.includes(T.id),onCheckedChange:()=>ne(T.id)})}),f.jsx(vi,{className:"font-medium max-w-xs truncate",children:T.summary}),f.jsx(vi,{children:f.jsx(nd,{variant:"outline",children:T.category})}),f.jsx(vi,{children:f.jsx(nd,{variant:T.importance==="critical"?"destructive":T.importance==="high"?"default":T.importance==="medium"?"secondary":"outline",children:T.importance})}),f.jsx(vi,{children:f.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx(hS,{className:"w-4 h-4"}),new Date(T.created_at).toLocaleDateString()]})}),f.jsx(vi,{children:f.jsxs("div",{className:"flex gap-1",children:[f.jsx(or,{variant:"ghost",size:"sm",onClick:()=>J(T),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:f.jsx(sd,{className:"w-4 h-4"})}),f.jsx(or,{variant:"ghost",size:"sm",onClick:()=>ie(T.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:f.jsx(Ti,{className:"w-4 h-4"})})]})})]},T.id))})]})})]}),S&&f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:f.jsxs(Dm,{className:"w-full max-w-md mx-4",children:[f.jsx(Mw,{children:f.jsx(aF,{children:"Delete Memories"})}),f.jsxs($m,{children:[f.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",s.length," ","memory(ies)? This action cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(or,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),f.jsx(or,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),f.jsx(oF,{isOpen:O,onClose:()=>C(!1),memory:E}),f.jsx(mj,{isOpen:R,onClose:()=>F(!1),onConfirm:L,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},ki=_i.getInstance(),wi={fetchServers:async()=>ki.get("/mcp/servers"),addServer:async(e,t)=>ki.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>ki.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>ki.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>ki.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>ki.post("/mcp/reload",{}),fetchStatus:async()=>ki.get("/mcp/status")},cF=({label:e,values:t,onChange:n,placeholder:a})=>{const s=t.length>0?t:[""],u=(h,m)=>{const g=[...s];g[h]=m,n(g.filter(y=>y.trim().length>0))},l=()=>n([...s,""]),d=h=>{const m=s.filter((g,y)=>y!==h);n(m.filter(g=>g.trim().length>0))};return f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),s.map((h,m)=>f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{className:"flex-1 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:h,placeholder:a,onChange:g=>u(m,g.target.value)}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>d(m),children:"Remove"})]},`${e}-${m}`)),f.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:l,children:"Add argument"})]})},Dw=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const u=z.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,y)=>{const b=[...u];b[m]={...b[m],[g]:y},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},d=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((y,b)=>b!==m);n(g.filter(y=>y.key.trim().length>0||y.value.trim().length>0))};return f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),u.map((m,g)=>f.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[f.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.key,placeholder:a,onChange:y=>l(g,"key",y.target.value)}),f.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.value,placeholder:s,onChange:y=>l(g,"value",y.target.value)}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>h(g),children:"Remove"})]},`${e}-${g}`)),f.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:d,children:"Add entry"})]})},dF=({transport:e,command:t,url:n,args:a,env:s,headers:u,onCommandChange:l,onUrlChange:d,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>f.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:t,onChange:y=>l(y.target.value),placeholder:"npx"})]}),f.jsx(cF,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:n,onChange:y=>d(y.target.value),placeholder:"https://example.com/mcp"})]}),f.jsx(Dw,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&f.jsx(Dw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),fF=zH({name:Rm().min(1,"Name is required"),transport:cj([Ew("stdio"),Ew("http")]),command:Rm().optional(),url:Rm().optional()}),jc=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Lm=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),hF=({open:e,mode:t,initial:n,onClose:a,onSubmit:s})=>{const[u,l]=z.useState(n?.name??""),[d,h]=z.useState(n?.config.transport??"stdio"),[m,g]=z.useState(n?.config.transport==="stdio"?n.config.command:""),[y,b]=z.useState(n?.config.transport==="http"?n.config.url:""),[v,S]=z.useState(n?.config.args??[]),[j,E]=z.useState(jc(n?.config.env)),[N,O]=z.useState(n?.config.transport==="http"?jc(n.config.headers):[]),[C,P]=z.useState(null);z.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),b(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),E(jc(n?.config.env)),O(n?.config.transport==="http"?jc(n.config.headers):[]),P(null))},[e,n]);const U=t==="create",R=async()=>{const B=fF.safeParse({name:u,transport:d,command:m,url:y});if(!B.success){P(B.error.issues[0]?.message??"Invalid form");return}if(d==="stdio"&&(!m||m.trim().length===0)){P("Command is required for stdio transport.");return}if(d==="http"&&(!y||y.trim().length===0)){P("URL is required for http transport.");return}const K=d==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:j.length>0?Lm(j):void 0}:{transport:"http",url:y.trim(),headers:N.length>0?Lm(N):void 0,env:j.length>0?Lm(j):void 0};P(null),await s(u.trim(),K)},F=z.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return f.jsx(Or,{open:e,onOpenChange:a,children:f.jsxs(Fs,{children:[f.jsx(Rr,{children:f.jsx(Mr,{children:F})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none disabled:bg-azure-border dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary dark:disabled:bg-matrix-primary/50",value:u,onChange:B=>l(B.target.value),placeholder:"coolify",disabled:!U})]}),f.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",f.jsxs("select",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:d,onChange:B=>h(B.target.value),children:[f.jsx("option",{value:"stdio",children:"stdio"}),f.jsx("option",{value:"http",children:"http"})]})]}),f.jsx(dF,{transport:d,command:m,url:y,args:v,env:j,headers:N,onCommandChange:g,onUrlChange:b,onArgsChange:S,onEnvChange:E,onHeadersChange:O}),C&&f.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/50 dark:text-red-400",children:C}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:a,children:"Cancel"}),f.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:R,children:"Save"})]})]})]})})},mF=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:s})=>f.jsxs("div",{className:"rounded-2xl border border-azure-border bg-azure-surface/80 p-4 shadow-sm overflow-hidden dark:border-matrix-primary dark:bg-zinc-950/70",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-lg font-semibold text-azure-text-primary break-words dark:text-matrix-highlight",children:e.name}),f.jsx("div",{className:"text-xs uppercase tracking-wide text-azure-text-muted dark:text-matrix-secondary",children:e.config.transport})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[t&&f.jsx("span",{title:t.ok?`${t.toolCount} tools`:t.error,className:`rounded-full px-2 py-0.5 text-xs font-semibold ${t.ok?"bg-green-500/20 text-green-600 dark:bg-green-400/20 dark:text-green-400":"bg-red-500/20 text-red-600 dark:bg-red-400/20 dark:text-red-400"}`,children:t.ok?`✓ ${t.toolCount} tools`:"✗ Failed"}),f.jsx("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-semibold ${e.enabled?"bg-matrix-highlight dark:text-matrix-primary":"bg-azure-border text-azure-text-secondary dark:bg-matrix-primary/50 dark:text-matrix-secondary"}`,onClick:()=>s(e,!e.enabled),children:e.enabled?"Enabled":"Disabled"})]})]}),f.jsxs("div",{className:"mt-4 space-y-2 text-sm text-azure-text-secondary dark:text-matrix-secondary",children:[e.config.transport==="stdio"&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Command:"})," ",e.config.command]}),e.config.transport==="http"&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"URL:"})," ",e.config.url]}),e.config.args&&e.config.args.length>0&&f.jsxs("div",{className:"break-all",children:[f.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Args:"})," ",e.config.args.join(" ")]}),t&&!t.ok&&t.error&&f.jsx("div",{className:"mt-1 break-all rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/30 dark:text-red-400",children:t.error.length>120?t.error.slice(0,120)+"…":t.error})]}),f.jsxs("div",{className:"mt-4 flex gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-3 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>n(e),children:"Edit"}),f.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>a(e),children:"Delete"})]})]}),pF=()=>{const{data:e,error:t,mutate:n,isLoading:a}=Dt("/api/mcp/servers",()=>wi.fetchServers()),[s,u]=z.useState(""),[l,d]=z.useState("all"),[h,m]=z.useState(!1),[g,y]=z.useState(null),[b,v]=z.useState(!1),[S,j]=z.useState(null),[E,N]=z.useState(null),[O,C]=z.useState({}),[P,U]=z.useState(!1),[R,F]=z.useState(!1),B=e?.servers??[],K=z.useMemo(()=>B.filter(Z=>{const he=Z.name.toLowerCase().includes(s.toLowerCase()),A=l==="all"||Z.config.transport===l;return he&&A}),[B,s,l]),fe=()=>{y(null),m(!0)},ae=Z=>{y(Z),m(!0)},le=async(Z,he)=>{try{g?await wi.updateServer(g.name,he):await wi.addServer(Z,he),m(!1),y(null),await n(),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(A){N({type:"error",message:A.message||"Failed to save MCP server."})}},ne=async Z=>{j(Z),v(!0)},oe=async()=>{if(S)try{await wi.deleteServer(S.name),await n(),v(!1),j(null),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(Z){N({type:"error",message:Z.message||"Failed to delete MCP server."})}},ie=async()=>{U(!0);try{const Z=await wi.fetchStatus(),he={};for(const A of Z.servers)he[A.name]=A;C(he)}catch(Z){N({type:"error",message:Z.message||"Failed to check MCP status."})}finally{U(!1)}},L=async()=>{F(!0);try{await wi.reloadTools(),N({type:"success",message:"MCP tools reloaded successfully."})}catch(Z){N({type:"error",message:Z.message||"Failed to reload MCP tools."})}finally{F(!1)}},J=async(Z,he)=>{try{await wi.toggleServer(Z.name,he),await n(),N({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(A){N({type:"error",message:A.message||"Failed to toggle MCP server."})}};return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Manage MCP servers stored in mcps.json."})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{type:"button",disabled:P,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:ie,children:P?"Checking…":"Check Status"}),f.jsx("button",{type:"button",disabled:R,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:L,children:R?"Reloading…":"Reload MCPs"}),f.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:fe,children:"Add Server"})]})]}),E&&f.jsx("div",{className:`p-4 rounded border ${E.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:E.message}),f.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[f.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:s,onChange:Z=>u(Z.target.value),placeholder:"Search by name"}),f.jsxs("select",{className:"rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:l,onChange:Z=>d(Z.target.value),children:[f.jsx("option",{value:"all",children:"All"}),f.jsx("option",{value:"stdio",children:"stdio"}),f.jsx("option",{value:"http",children:"http"})]})]}),a&&f.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&f.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&K.length===0&&f.jsx("div",{className:"rounded-2xl border border-dashed border-azure-border bg-azure-surface/60 p-6 text-center text-sm text-azure-text-secondary dark:border-matrix-primary dark:bg-zinc-950/60 dark:text-matrix-secondary",children:"No MCP servers found. Add a server to get started."}),f.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:K.map(Z=>f.jsx(mF,{server:Z,probeResult:O[Z.name],onEdit:ae,onDelete:ne,onToggle:J},`${Z.name}-${Z.enabled?"on":"off"}`))}),f.jsx(hF,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:le}),f.jsx(Or,{open:b,onOpenChange:v,children:f.jsxs(Fs,{children:[f.jsx(Rr,{children:f.jsx(Mr,{children:"Confirm Deletion"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",f.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',S?.name,'"']}),"? This action cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>v(!1),children:"Cancel"}),f.jsx("button",{type:"button",className:"rounded-md bg-red-500 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-red-400 dark:bg-red-600 hover:dark:bg-red-500",onClick:oe,children:"Delete"})]})]})]})})]})},Pm={list:()=>be.get("/model-pricing"),upsert:e=>be.post("/model-pricing",e),update:(e,t,n)=>be.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>be.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},gF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},$w={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},yF=["anthropic","openai","google","openrouter","ollama","other"],Lw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),xF=()=>{const{data:e=[],mutate:t}=Dt("/api/model-pricing",()=>Pm.list()),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,d]=z.useState(Lw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[b,v]=z.useState(!1),S=(C,P)=>{y({type:C,message:P}),setTimeout(()=>y(null),3e3)},j=()=>{u(null),d(Lw()),a(!0)},E=C=>{u(C),d({...C}),a(!0)},N=async()=>{if(!(!l.provider.trim()||!l.model.trim())){v(!0);try{await Pm.upsert(l),await t(),a(!1),S("success",s?"Pricing updated.":"Pricing created.")}catch{S("error","Failed to save pricing entry.")}finally{v(!1)}}},O=async()=>{if(h)try{await Pm.delete(h.provider,h.model),await t(),m(null),S("success","Pricing entry deleted.")}catch{S("error","Failed to delete pricing entry.")}};return f.jsxs(ut.div,{variants:gF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ut.div,{variants:$w,className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Pc,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Model Pricing"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Manage per-model pricing to estimate LLM costs in Usage Stats."})]})]}),f.jsxs("button",{onClick:j,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(od,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&f.jsx(ut.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),f.jsx(ut.div,{variants:$w,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(C=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:C},C))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:'No pricing entries. Click "Add Pricing" to get started.'})}):e.map(C=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[f.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:C.provider}),f.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:C.model}),f.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.input_price_per_1m.toFixed(4)]}),f.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.output_price_per_1m.toFixed(4)]}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>E(C),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:f.jsx(Wp,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>m(C),className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",title:"Delete",children:f.jsx(Ti,{className:"w-4 h-4"})})]})})]},`${C.provider}/${C.model}`))})]})}),f.jsx(Or,{open:n,onOpenChange:a,children:f.jsxs(Fs,{children:[f.jsx(Rr,{children:f.jsx(Mr,{children:s?"Edit Pricing":"Add Pricing"})}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),s?f.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm capitalize",children:l.provider}):f.jsxs("select",{value:l.provider,onChange:C=>d({...l,provider:C.target.value}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight",children:[f.jsx("option",{value:"",children:"Select provider..."}),yF.map(C=>f.jsx("option",{value:C,children:C},C))]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),s?f.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm font-mono",children:l.model}):f.jsx("input",{type:"text",value:l.model,onChange:C=>d({...l,model:C.target.value}),placeholder:"e.g. gpt-4o",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),f.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:C=>d({...l,input_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),f.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:C=>d({...l,output_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]})]}),f.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:N,disabled:b||!l.provider.trim()||!l.model.trim(),className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving...":"Save"})]})]})]})}),f.jsx(Or,{open:!!h,onOpenChange:C=>!C&&m(null),children:f.jsxs(Fs,{children:[f.jsx(Rr,{children:f.jsx(Mr,{children:"Delete Pricing Entry"})}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",f.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:O,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},bF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Pw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},vF=["ui","telegram","discord"],Uw=()=>({name:"",prompt:"",notification_channels:["ui"]}),kF=()=>{const{data:e=[],mutate:t}=Dt("/webhooks",()=>Pa.list(),{refreshInterval:1e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,d]=z.useState(Uw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[b,v]=z.useState(!1),[S,j]=z.useState(null),[E,N]=z.useState(null),O=(ne,oe)=>{y({type:ne,message:oe}),setTimeout(()=>y(null),3500)},C=()=>{u(null),d(Uw()),N(null),a(!0)},P=ne=>{u(ne),d({name:ne.name,prompt:ne.prompt,notification_channels:ne.notification_channels}),N(null),a(!0)},U=ne=>/^[a-z0-9-_]+$/.test(ne),R=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!U(l.name)){N("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){N("Select at least one notification channel.");return}N(null),v(!0);try{s?(await Pa.update(s.id,l),O("success","Webhook updated.")):(await Pa.create(l),O("success","Webhook created.")),await t(),a(!1)}catch(ne){const oe=ne?.message||"Failed to save webhook.";N(oe)}finally{v(!1)}}},F=async ne=>{try{await Pa.update(ne.id,{enabled:!ne.enabled}),await t()}catch{O("error","Failed to toggle webhook.")}},B=async()=>{if(h)try{await Pa.delete(h.id),await t(),m(null),O("success","Webhook deleted.")}catch{O("error","Failed to delete webhook.")}},K=ne=>`${window.location.origin}/api/webhooks/trigger/${ne}`,fe=ne=>`curl -X POST ${K(ne.name)} \\
|
|
109
|
-
-H "x-api-key: ${ne.api_key}" \\
|
|
110
|
-
-H "Content-Type: application/json" \\
|
|
111
|
-
-d '{"event":"your_payload"}'`,ae=async(ne,oe)=>{await navigator.clipboard.writeText(ne),j(oe),setTimeout(()=>j(null),2e3)},le=ne=>{const oe=l.notification_channels.includes(ne);d({...l,notification_channels:oe?l.notification_channels.filter(ie=>ie!==ne):[...l.notification_channels,ne]})};return f.jsxs(ut.div,{variants:bF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ut.div,{variants:Pw,className:"flex items-center justify-between flex-wrap gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Gm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Webhooks"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs(Va,{to:"/notifications",className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[f.jsx(Sl,{className:"w-4 h-4"}),"Notifications"]}),f.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(od,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&f.jsx(ut.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),f.jsx(ut.div,{variants:Pw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(ne=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ne},ne))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{children:f.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",f.jsx("button",{onClick:C,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ne=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[f.jsx("td",{className:"px-4 py-3",children:f.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:ne.name})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[ne.api_key.slice(0,16),"…"]}),f.jsx("button",{onClick:()=>ae(fe(ne),`curl-${ne.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy curl example",children:S===`curl-${ne.id}`?f.jsx(Im,{className:"w-3.5 h-3.5 text-green-500"}):f.jsx(qm,{className:"w-3.5 h-3.5"})}),f.jsx("button",{onClick:()=>ae(ne.api_key,`key-${ne.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy API key",children:S===`key-${ne.id}`?f.jsx(Im,{className:"w-3.5 h-3.5 text-green-500"}):f.jsx(XT,{className:"w-3.5 h-3.5"})})]})}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("div",{className:"flex gap-1 flex-wrap",children:ne.notification_channels.map(oe=>f.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-azure-border dark:bg-matrix-primary/20 text-azure-text-secondary dark:text-matrix-secondary capitalize",children:oe},oe))})}),f.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ne.trigger_count}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>F(ne),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ne.enabled?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:ne.enabled?f.jsxs(f.Fragment,{children:[f.jsx(HA,{className:"w-3.5 h-3.5"})," Enabled"]}):f.jsxs(f.Fragment,{children:[f.jsx(ZA,{className:"w-3.5 h-3.5"})," Disabled"]})})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:()=>P(ne),title:"Edit",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(Wp,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>m(ne),title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",children:f.jsx(Ti,{className:"w-4 h-4"})})]})})]},ne.id))})]})})}),f.jsxs(Or,{open:n,onOpenChange:a,children:[f.jsx(Rr,{children:f.jsx(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Webhook":"New Webhook"})}),f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",f.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),f.jsx("input",{type:"text",value:l.name,onChange:ne=>{d({...l,name:ne.target.value.toLowerCase().replace(/\s+/g,"-")}),N(null)},placeholder:"e.g. deploy-done, github-issue-opened",disabled:!!s,className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight disabled:opacity-50 disabled:cursor-not-allowed"}),l.name&&f.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",f.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),f.jsx("textarea",{rows:5,value:l.prompt,onChange:ne=>d({...l,prompt:ne.target.value}),placeholder:"Describe what Apoc should do when this webhook fires. The received payload will be appended automatically.",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight resize-none"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),f.jsx("div",{className:"flex gap-4",children:vF.map(ne=>f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(ne),onChange:()=>le(ne),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),f.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:ne})]},ne))})]}),E&&f.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded px-3 py-2",children:E}),f.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:R,disabled:b||!l.name.trim()||!l.prompt.trim()||l.notification_channels.length===0,className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving…":s?"Update":"Create"})]})]})]}),f.jsxs(Or,{open:!!h,onOpenChange:ne=>!ne&&m(null),children:[f.jsx(Rr,{children:f.jsx(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),f.jsxs("div",{className:"p-6 space-y-4",children:[f.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",f.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:B,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},wF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Vw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},Bw=({status:e})=>e==="completed"?f.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[f.jsx(mS,{className:"w-4 h-4"}),f.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?f.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[f.jsx(Hm,{className:"w-4 h-4"}),f.jsx("span",{className:"text-xs",children:"Failed"})]}):f.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[f.jsx(Za,{className:"w-4 h-4 animate-pulse"}),f.jsx("span",{className:"text-xs",children:"Pending"})]}),Cc=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),SF=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},zF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),{data:s=[],mutate:u}=Dt(["/webhooks/notifications",e],()=>Pa.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=s.filter(g=>!g.read).length,d=async g=>{g.length!==0&&(await Pa.markRead(g),await u())},h=()=>{const g=s.filter(y=>!y.read).map(y=>y.id);d(g)},m=async g=>{a(g),g.read||await d([g.id])};return f.jsxs(ut.div,{variants:wF,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ut.div,{variants:Vw,className:"flex items-center justify-between flex-wrap gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("div",{className:"relative",children:[f.jsx(Sl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),l>0&&f.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[10px] font-bold rounded-full w-4 h-4 flex items-center justify-center leading-none",children:l>9?"9+":l})]}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Notifications"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs(Va,{to:"/webhooks",className:"flex items-center gap-2 text-sm text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:[f.jsx(zT,{className:"w-4 h-4"}),"Back to Webhooks"]}),f.jsxs("button",{onClick:()=>t(!e),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm transition-colors ${e?"border-azure-primary dark:border-matrix-highlight bg-azure-active dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800"}`,children:[f.jsx(rA,{className:"w-4 h-4"}),"Unread only"]}),l>0&&f.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[f.jsx(LT,{className:"w-4 h-4"}),"Mark all read"]})]})]}),f.jsx(ut.div,{variants:Vw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>f.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),f.jsx("tbody",{children:s.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:e?"No unread notifications.":"No notifications yet."})}):s.map(g=>f.jsxs("tr",{className:`border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors ${g.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[f.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&f.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),f.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(Bw,{status:g.status})}),f.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:Cc(g.created_at)}),f.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?Cc(g.completed_at):"—"}),f.jsx("td",{className:"px-4 py-3",children:f.jsx("button",{onClick:()=>m(g),title:"View details",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(sd,{className:"w-4 h-4"})})})]},g.id))})]})})}),f.jsxs(Or,{open:!!n,onOpenChange:g=>!g&&a(null),children:[f.jsx(Rr,{children:f.jsxs(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[f.jsx(Sl,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[f.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[f.jsx(Bw,{status:n.status}),f.jsx("span",{children:Cc(n.created_at)}),n.completed_at&&f.jsxs("span",{children:["→ ",Cc(n.completed_at)]})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),f.jsx("pre",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-44 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:SF(n.payload)})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),f.jsx("div",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-64 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:n.result??f.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),f.jsx("div",{className:"flex justify-end pt-2",children:f.jsx("button",{onClick:()=>a(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Close"})})]})]})]})},_F={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Nc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},jF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function CF({status:e}){return e==="completed"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[f.jsx(mS,{className:"w-4 h-4"}),"Completed"]}):e==="failed"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600 dark:text-red-400",children:[f.jsx(Hm,{className:"w-4 h-4"}),"Failed"]}):e==="running"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[f.jsx(hA,{className:"w-4 h-4 animate-spin"}),"Running"]}):e==="cancelled"?f.jsxs("span",{className:"inline-flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[f.jsx(Hm,{className:"w-4 h-4"}),"Cancelled"]}):f.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[f.jsx(Za,{className:"w-4 h-4"}),"Pending"]})}const Zw=e=>e?new Date(e).toLocaleString():"—";function NF(){const[e,t]=z.useState(""),[n,a]=z.useState(""),[s,u]=z.useState(""),[l,d]=z.useState(""),[h,m]=z.useState(null),g=z.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:s||void 0,session_id:l.trim()||void 0,limit:200}),[e,n,s,l]),{data:y}=Dt("/tasks/stats",()=>Cs.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=Dt(["/tasks",g],()=>Cs.list(g),{refreshInterval:3e3});return f.jsxs(ut.div,{variants:_F,initial:"hidden",animate:"show",className:"space-y-6",children:[f.jsxs(ut.div,{variants:Nc,className:"flex items-center gap-3",children:[f.jsx(Fm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Tasks"}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),f.jsxs(ut.div,{variants:Nc,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[f.jsx(js,{label:"Pending",value:y?.pending??0}),f.jsx(js,{label:"Running",value:y?.running??0}),f.jsx(js,{label:"Completed",value:y?.completed??0}),f.jsx(js,{label:"Failed",value:y?.failed??0}),f.jsx(js,{label:"Cancelled",value:y?.cancelled??0}),f.jsx(js,{label:"Total",value:y?.total??0})]}),f.jsxs(ut.div,{variants:Nc,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-azure-surface dark:bg-zinc-950 grid grid-cols-1 md:grid-cols-4 gap-3",children:[f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:e,onChange:S=>t(S.target.value||""),children:[f.jsx("option",{value:"",children:"All status"}),Object.entries(jF).map(([S,j])=>f.jsx("option",{value:S,children:j},S))]}),f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:n,onChange:S=>a(S.target.value||""),children:[f.jsx("option",{value:"",children:"All agents"}),f.jsx("option",{value:"apoc",children:"Apoc"}),f.jsx("option",{value:"neo",children:"Neo"})]}),f.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:s,onChange:S=>u(S.target.value||""),children:[f.jsx("option",{value:"",children:"All channels"}),f.jsx("option",{value:"telegram",children:"Telegram"}),f.jsx("option",{value:"ui",children:"UI"}),f.jsx("option",{value:"api",children:"API"}),f.jsx("option",{value:"webhook",children:"Webhook"}),f.jsx("option",{value:"cli",children:"CLI"})]}),f.jsx("input",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:l,onChange:S=>d(S.target.value),placeholder:"Filter by session id"})]}),f.jsx(ut.div,{variants:Nc,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:f.jsx("tr",{children:["Task ID","Status","Agent","Channel","Session","Attempts","Created","Finished","Actions"].map(S=>f.jsx("th",{className:"text-left px-4 py-3 font-semibold text-azure-text-secondary dark:text-matrix-dim",children:S},S))})}),f.jsx("tbody",{children:b.length===0?f.jsx("tr",{children:f.jsx("td",{colSpan:9,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:"No tasks found."})}):b.map(S=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-900/40 transition-colors",children:[f.jsx("td",{className:"px-4 py-3 font-mono",children:S.id.slice(0,8)}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(CF,{status:S.status})}),f.jsx("td",{className:"px-4 py-3",children:S.agent.toUpperCase()}),f.jsx("td",{className:"px-4 py-3",children:S.origin_channel.toUpperCase()}),f.jsx("td",{className:"px-4 py-3 font-mono",children:S.session_id}),f.jsxs("td",{className:"px-4 py-3",children:[S.attempt_count,"/",S.max_attempts]}),f.jsx("td",{className:"px-4 py-3",children:Zw(S.created_at)}),f.jsx("td",{className:"px-4 py-3",children:Zw(S.finished_at)}),f.jsxs("td",{className:"px-4 py-3 flex items-center gap-1",children:[f.jsx("button",{onClick:()=>m(S),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim",children:f.jsx(sd,{className:"w-4 h-4"})}),(S.status==="pending"||S.status==="running")&&f.jsx("button",{onClick:async()=>{await Cs.cancel(S.id),await v()},title:"Cancel task",className:"p-1.5 rounded hover:bg-red-100 dark:hover:bg-red-900/30 text-red-500 dark:text-red-400",children:f.jsx(CT,{className:"w-4 h-4"})})]})]},S.id))})]})}),f.jsxs(Or,{open:!!h,onOpenChange:S=>!S&&m(null),children:[f.jsx(Rr,{children:f.jsx(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Task Details"})}),h&&f.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[70vh] text-sm",children:[f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-azure-text-secondary dark:text-matrix-dim",children:[f.jsxs("div",{children:[f.jsx("b",{children:"ID:"})," ",f.jsx("span",{className:"font-mono",children:h.id})]}),f.jsxs("div",{children:[f.jsx("b",{children:"Status:"})," ",h.status]}),f.jsxs("div",{children:[f.jsx("b",{children:"Agent:"})," ",h.agent]}),f.jsxs("div",{children:[f.jsx("b",{children:"Origin:"})," ",h.origin_channel]}),f.jsxs("div",{children:[f.jsx("b",{children:"Session:"})," ",f.jsx("span",{className:"font-mono",children:h.session_id})]}),f.jsxs("div",{children:[f.jsx("b",{children:"Attempts:"})," ",h.attempt_count,"/",h.max_attempts]})]}),f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1",children:"Input"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.input})]}),h.output&&f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1",children:"Output"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.output})]}),h.error&&f.jsxs("section",{children:[f.jsx("p",{className:"font-medium mb-1 text-red-600 dark:text-red-400",children:"Error"}),f.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-red-200 dark:border-red-900/50 p-3 bg-red-50 dark:bg-red-950/40",children:h.error})]}),(h.status==="failed"||h.status==="pending"||h.status==="running")&&f.jsxs("div",{className:"flex justify-end gap-2",children:[(h.status==="pending"||h.status==="running")&&f.jsx("button",{onClick:async()=>{await Cs.cancel(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg border border-red-400 dark:border-red-500 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 text-sm",children:"Cancel Task"}),h.status==="failed"&&f.jsx("button",{onClick:async()=>{await Cs.retry(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black text-sm",children:"Retry Task"})]})]})]})]})}function js({label:e,value:t}){return f.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950 px-4 py-3",children:[f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:e}),f.jsx("p",{className:"text-xl font-semibold text-azure-text-primary dark:text-matrix-highlight",children:t})]})}const Um={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},Iw={name:"",type:"postgresql",host:"",port:"",database_name:"",username:"",password:"",connection_string:"",allow_read:!0,allow_insert:!1,allow_update:!1,allow_delete:!1,allow_ddl:!1},EF={postgresql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mysql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],sqlite:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mongodb:[{key:"allow_read",label:"find / aggregate",description:"Permite consultas e agregações"},{key:"allow_insert",label:"insertOne / insertMany",description:"Permite inserir documentos"},{key:"allow_update",label:"updateOne / updateMany",description:"Permite atualizar documentos"},{key:"allow_delete",label:"deleteOne / deleteMany",description:"Permite excluir documentos"},{key:"allow_ddl",label:"Schema changes",description:"createCollection / dropCollection / createIndex"}]};async function TF(){return be.get("/trinity/databases")}function AF(){const{data:e,error:t}=Dt("/trinity/databases",TF,{refreshInterval:3e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,d]=z.useState(Iw),[h,m]=z.useState(!1),[g,y]=z.useState(null),[b,v]=z.useState({}),[S,j]=z.useState(null),[E,N]=z.useState({}),[O,C]=z.useState(null),[P,U]=z.useState(null),[R,F]=z.useState(null),[B,K]=z.useState(!1),fe=()=>{u(null),d(Iw),K(!1),y(null),a(!0)},ae=w=>{u(w),d({name:w.name,type:w.type,host:w.host||"",port:w.port?String(w.port):"",database_name:w.database_name||"",username:w.username||"",password:"",connection_string:"",allow_read:w.allow_read,allow_insert:w.allow_insert,allow_update:w.allow_update,allow_delete:w.allow_delete,allow_ddl:w.allow_ddl}),K(!!w.connection_string),y(null),a(!0)},le=async()=>{if(m(!0),y(null),!B&&!l.database_name.trim()){y(l.type==="sqlite"?"File path is required.":"Database name is required."),m(!1);return}try{const w={name:l.name,type:l.type,allow_read:l.allow_read,allow_insert:l.allow_insert,allow_update:l.allow_update,allow_delete:l.allow_delete,allow_ddl:l.allow_ddl};B?(!s||l.connection_string)&&(w.connection_string=l.connection_string||null):(w.host=l.host||null,w.port=l.port?parseInt(l.port):null,w.database_name=l.database_name||null,w.username=l.username||null,(!s||l.password)&&(w.password=l.password||null)),s?await be.put(`/trinity/databases/${s.id}`,w):await be.post("/trinity/databases",w),await An("/trinity/databases"),a(!1)}catch(w){y(w.message||"Failed to save database")}finally{m(!1)}},ne=w=>{F(w)},oe=async()=>{if(!R)return;const w=R.id;U(w);try{await be.delete(`/trinity/databases/${w}`),await An("/trinity/databases")}catch(X){alert(`Delete failed: ${X.message}`)}finally{U(null),F(null)}},ie=async w=>{j(w);try{const X=await be.post(`/trinity/databases/${w}/test`,{});N(me=>({...me,[w]:X.success}))}catch{N(X=>({...X,[w]:!1}))}finally{j(null)}},L=async w=>{C(w);try{await be.post(`/trinity/databases/${w}/refresh-schema`,{}),await An("/trinity/databases")}catch(X){alert(`Schema refresh failed: ${X.message}`)}finally{C(null)}},J=w=>{v(X=>({...X,[w]:!X[w]}))},Z=w=>{w!=="mongodb"&&K(!1),d(X=>({...X,type:w,port:Um[w]?String(Um[w]):""}))},he=w=>{d(X=>({...X,[w]:!X[w]}))};if(t)return f.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const A="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",T="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",G=w=>[{key:"allow_read",badge:"R"},{key:"allow_insert",badge:"I"},{key:"allow_update",badge:"U"},{key:"allow_delete",badge:"D"},{key:"allow_ddl",badge:"DDL"}].filter(me=>w[me.key]).map(me=>me.badge);return f.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[f.jsxs("div",{className:"flex justify-between items-center",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx($s,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Trinity Databases"})]}),f.jsxs("button",{onClick:fe,className:"flex items-center gap-2 px-4 py-2 bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors text-sm font-medium",children:[f.jsx(od,{className:"w-4 h-4"}),"Register Database"]})]}),f.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Register databases for Trinity to access. Configure permissions to control what operations Trinity can perform on each database."}),e?e.length===0?f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded p-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx($s,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),f.jsx("p",{className:"font-medium",children:"No databases registered"}),f.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):f.jsx("div",{className:"space-y-4",children:e.map(w=>{const X=w.schema_json?JSON.parse(w.schema_json):null,me=!!X?.databases,D=me?X.databases.reduce((et,wt)=>et+wt.tables.length,0):X?.tables?.length??0,ce=me?X.databases.length:0,Ae=w.type==="mongodb"?"collection":"table",je=w.type==="mongodb"?"collections":"tables",Ye=E[w.id],Nt=b[w.id],Jt=G(w);return f.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[f.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[f.jsx($s,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),f.jsx("span",{className:"text-xs px-2 py-0.5 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary uppercase flex-shrink-0",children:w.type}),Ye===!0&&f.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[f.jsx(Fh,{className:"w-3 h-3"})," Connected"]}),Ye===!1&&f.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[f.jsx(QA,{className:"w-3 h-3"})," Failed"]}),Jt.length>0&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(A0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),Jt.map(et=>f.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight font-mono",children:et},et))]})]}),f.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary truncate mt-0.5",children:[w.host?`${w.host}:${w.port}${w.database_name?`/${w.database_name}`:""}`:w.database_name||"connection string configured",me&&ce>0&&f.jsxs("span",{className:"ml-2 opacity-70",children:["· ",ce," database",ce!==1?"s":""," · ",D," ",D!==1?je:Ae]}),!me&&D>0&&f.jsxs("span",{className:"ml-2 opacity-70",children:["· ",D," ",D!==1?je:Ae]}),w.schema_updated_at&&f.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[f.jsx("button",{onClick:()=>ie(w.id),disabled:S===w.id,title:"Test connection",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:S===w.id?f.jsx(Fh,{className:"w-4 h-4 animate-pulse"}):f.jsx(Fh,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>L(w.id),disabled:O===w.id,title:"Refresh schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:f.jsx(yS,{className:`w-4 h-4 ${O===w.id?"animate-spin":""}`})}),f.jsx("button",{onClick:()=>ae(w),title:"Edit",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors text-xs font-medium px-2",children:"Edit"}),f.jsx("button",{onClick:()=>ne(w),disabled:P===w.id,title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-red-500 transition-colors",children:f.jsx(Ti,{className:"w-4 h-4"})}),X&&f.jsx("button",{onClick:()=>J(w.id),title:Nt?"Hide schema":"Show schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:Nt?f.jsx(VT,{className:"w-4 h-4"}):f.jsx(ZT,{className:"w-4 h-4"})})]})]}),Nt&&X&&f.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[f.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:me?`${ce} database${ce!==1?"s":""} — ${D} ${D!==1?je:Ae} total`:`Schema — ${D} ${D!==1?je:Ae}`}),f.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:me?X.databases?.map(et=>f.jsxs("div",{className:"text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[f.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:et.name}),f.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",et.tables.length," ",et.tables.length!==1?je:Ae,")"]})]}),f.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[et.tables.map(wt=>f.jsxs("div",{children:[f.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:wt.name}),f.jsx("div",{className:"pl-3 space-y-0.5",children:wt.columns?.map(qn=>f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[f.jsx("span",{children:qn.name}),f.jsx("span",{className:"opacity-50 ml-2",children:qn.type}),qn.nullable===!1&&f.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},qn.name))})]},wt.name)),et.tables.length===0&&f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",je]})]})]},et.name)):X.tables?.map(et=>f.jsxs("div",{className:"text-xs",children:[f.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:et.name}),f.jsx("div",{className:"pl-3 space-y-0.5",children:et.columns?.map(wt=>f.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[f.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:wt.name}),f.jsx("span",{className:"opacity-50 ml-2",children:wt.type}),wt.nullable===!1&&f.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},wt.name))})]},et.name))})]})]},w.id)})}):f.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),f.jsx(G_,{isOpen:!!R,onClose:()=>F(null),onConfirm:oe,title:"Delete database",description:`Remove "${R?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),f.jsxs("div",{className:"relative bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[90vh] overflow-y-auto",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[f.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Database":"Register Database"}),f.jsx("button",{onClick:()=>a(!1),className:"text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:f.jsx(eg,{className:"w-5 h-5"})})]}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:T,children:"Name *"}),f.jsx("input",{className:A,value:l.name,onChange:w=>d(X=>({...X,name:w.target.value})),placeholder:"My Production DB"})]}),f.jsxs("div",{children:[f.jsx("label",{className:T,children:"Type *"}),f.jsxs("select",{className:A,value:l.type,onChange:w=>Z(w.target.value),children:[f.jsx("option",{value:"postgresql",children:"PostgreSQL"}),f.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),f.jsx("option",{value:"sqlite",children:"SQLite"}),f.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{type:"button",onClick:()=>K(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${B?"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary":"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight"}`,children:"Individual fields"}),f.jsx("button",{type:"button",onClick:()=>K(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${B?"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary"}`,children:"Connection string"})]}),l.type==="mongodb"&&B?f.jsxs("div",{children:[f.jsxs("label",{className:T,children:["Connection String ",s&&f.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),f.jsx("input",{className:A,type:"password",value:l.connection_string,onChange:w=>d(X=>({...X,connection_string:w.target.value})),placeholder:s?"unchanged":"mongodb://user:pass@host:27017/dbname"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]}):f.jsxs(f.Fragment,{children:[l.type!=="sqlite"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx("label",{className:T,children:"Host"}),f.jsx("input",{className:A,value:l.host,onChange:w=>d(X=>({...X,host:w.target.value})),placeholder:"localhost"})]}),f.jsxs("div",{children:[f.jsx("label",{className:T,children:"Port"}),f.jsx("input",{className:A,type:"number",value:l.port,onChange:w=>d(X=>({...X,port:w.target.value})),placeholder:String(Um[l.type]||"")})]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:T,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),f.jsx("input",{className:`w-full px-3 py-2 bg-azure-surface dark:bg-black border rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none ${g&&!l.database_name.trim()?"border-red-500 dark:border-red-500":"border-azure-border dark:border-matrix-primary focus:border-azure-primary dark:focus:border-matrix-highlight"}`,value:l.database_name,onChange:w=>d(X=>({...X,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx("label",{className:T,children:"Username"}),f.jsx("input",{className:A,value:l.username,onChange:w=>d(X=>({...X,username:w.target.value})),placeholder:"postgres"})]}),f.jsxs("div",{children:[f.jsxs("label",{className:T,children:["Password ",s&&f.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),f.jsx("input",{className:A,type:"password",value:l.password,onChange:w=>d(X=>({...X,password:w.target.value})),placeholder:s?"unchanged":"••••••••"}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]})]})]}),f.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(A0,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),f.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mb-3",children:"Defina quais operações Trinity pode executar neste banco. Operações não permitidas retornarão erro de permissão."}),f.jsx("div",{className:"space-y-2",children:EF[l.type]?.map(({key:w,label:X,description:me})=>f.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[f.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[f.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>he(w),className:"sr-only"}),f.jsx("div",{className:`w-4 h-4 rounded border transition-colors flex items-center justify-center ${l[w]?"bg-azure-primary dark:bg-matrix-highlight border-azure-primary dark:border-matrix-highlight":"border-azure-border dark:border-matrix-primary bg-transparent"}`,children:l[w]&&f.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:f.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:X}),f.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:me})]})]},w))})]}),g&&f.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),f.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[f.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 text-sm text-azure-text-secondary dark:text-matrix-secondary border border-azure-border dark:border-matrix-primary rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 transition-colors",children:"Cancel"}),f.jsx("button",{onClick:le,disabled:h||!l.name,className:"px-4 py-2 text-sm font-medium bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors disabled:opacity-50",children:h?"Saving...":s?"Update":"Register"})]})]})]})]})}const OF={running:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",success:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",failed:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",timeout:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400"};function RF({jobId:e}){const{data:t,isLoading:n}=XL(e,50);return n?f.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary animate-pulse",children:"Loading history…"}):!t||t.length===0?f.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary italic",children:"No executions yet."}):f.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary dark:bg-zinc-900 overflow-hidden",children:f.jsxs("table",{className:"w-full text-xs font-mono",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary",children:[f.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Triggered At"}),f.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Completed At"}),f.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Status"}),f.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Error"})]})}),f.jsx("tbody",{children:t.map(a=>f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0",children:[f.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:new Date(a.triggered_at).toLocaleString()}),f.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:a.completed_at?new Date(a.completed_at).toLocaleString():"—"}),f.jsx("td",{className:"px-3 py-2",children:f.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold uppercase ${OF[a.status]}`,children:a.status})}),f.jsx("td",{className:"px-3 py-2 dark:text-red-400 max-w-xs truncate",children:a.error??"—"})]},a.id))})]})})}function MF({enabled:e}){return f.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold uppercase ${e?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-zinc-800 dark:text-matrix-tertiary"}`,children:e?"Enabled":"Disabled"})}function Hw(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Fw(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function DF({onEdit:e}){const{data:t,isLoading:n}=YL(),[a,s]=z.useState(null),[u,l]=z.useState(null),[d,h]=z.useState(null),m=async y=>{l(y.id);try{y.enabled?await Ei.disableJob(y.id):await Ei.enableJob(y.id),await An(b=>typeof b=="string"&&b.startsWith("/chronos"))}finally{l(null)}},g=async()=>{if(d){l(d.id);try{await Ei.deleteJob(d.id),await An(y=>typeof y=="string"&&y.startsWith("/chronos"))}finally{l(null),h(null)}}};return n?f.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary p-8 text-center dark:text-matrix-secondary animate-pulse",children:"Loading jobs…"}):!t||t.length===0?f.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary p-8 text-center dark:text-matrix-secondary",children:["No Chronos jobs yet. Click ",f.jsx("strong",{className:"dark:text-matrix-highlight",children:"New Job"})," to get started."]}):f.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary overflow-hidden",children:[f.jsxs("table",{className:"w-full text-sm font-mono",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900",children:[f.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Prompt"}),f.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden md:table-cell",children:"Schedule"}),f.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden lg:table-cell",children:"Next Run"}),f.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden lg:table-cell",children:"Last Run"}),f.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Status"}),f.jsx("th",{className:"px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium text-right",children:"Actions"})]})}),f.jsx("tbody",{children:t.map(y=>f.jsxs(f.Fragment,{children:[f.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0 hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[f.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary max-w-xs",children:[f.jsx("span",{title:y.prompt,children:Hw(y.prompt,50)}),f.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:y.created_by})]}),f.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden md:table-cell text-xs",children:[f.jsx("div",{className:"capitalize",children:y.schedule_type}),f.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:y.schedule_expression,children:y.schedule_expression})]}),f.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Fw(y.next_run_at)}),f.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Fw(y.last_run_at)}),f.jsx("td",{className:"px-4 py-3",children:f.jsx(MF,{enabled:y.enabled})}),f.jsx("td",{className:"px-4 py-3",children:f.jsxs("div",{className:"flex items-center justify-end gap-1",children:[f.jsx("button",{title:a===y.id?"Hide history":"View history",onClick:()=>s(a===y.id?null:y.id),className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors",children:a===y.id?f.jsx(HT,{className:"w-4 h-4"}):f.jsx(oA,{className:"w-4 h-4"})}),f.jsx("button",{title:"Edit",onClick:()=>e(y),className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors",children:f.jsx(SA,{className:"w-4 h-4"})}),f.jsx("button",{title:y.enabled?"Disable":"Enable",onClick:()=>m(y),disabled:u===y.id,className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors disabled:opacity-40",children:y.enabled?f.jsx(kA,{className:"w-4 h-4"}):f.jsx(jA,{className:"w-4 h-4"})}),f.jsx("button",{title:"Delete",onClick:()=>h(y),disabled:u===y.id,className:"p-1.5 rounded text-red-500 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-40",children:f.jsx(Ti,{className:"w-4 h-4"})})]})})]},y.id),a===y.id&&f.jsx("tr",{className:"bg-azure-surface dark:bg-zinc-900/50",children:f.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[f.jsx("div",{className:"text-xs font-bold dark:text-matrix-highlight mb-2",children:"Execution History"}),f.jsx(RF,{jobId:y.id})]})},`${y.id}-history`)]}))})]}),f.jsx(mj,{isOpen:!!d,onClose:()=>h(null),onConfirm:g,title:"Delete Chronos Job",message:d?`Delete job "${Hw(d.prompt,60)}"? This action cannot be undone.`:""})]})}function $F({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=z.useState(null),[u,l]=z.useState(null),d=z.useRef(null);return z.useEffect(()=>{if(!e.trim()){s(null),l(null);return}return d.current&&clearTimeout(d.current),d.current=setTimeout(async()=>{try{const h=await Ei.preview(e,t,n);s(h),l(null)}catch(h){l(h.message??"Invalid expression"),s(null)}},500),()=>{d.current&&clearTimeout(d.current)}},[e,t,n]),e.trim()?f.jsx("div",{className:"mt-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900 p-3 text-sm",children:u?f.jsxs("p",{className:"text-red-500 dark:text-red-400 flex items-center gap-1.5",children:[f.jsx("span",{children:"⚠"})," ",u]}):a?f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-azure-text-secondary dark:text-matrix-secondary",children:[f.jsx(Za,{className:"w-3.5 h-3.5 text-azure-primary dark:text-matrix-highlight shrink-0"}),f.jsx("span",{className:"font-medium dark:text-matrix-highlight",children:"Next run:"}),f.jsx("span",{children:new Date(a.next_run_at).toLocaleString()})]}),a.human_readable&&f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary/70 pl-5",children:a.human_readable}),a.next_occurrences.length>0&&f.jsx("div",{className:"pl-5 space-y-0.5",children:a.next_occurrences.map((h,m)=>f.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",m+2,": ",h]},m))})]}):f.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})}):null}const LF=["UTC","America/Sao_Paulo","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Mexico_City","America/Buenos_Aires","America/Bogota","America/Lima","America/Santiago","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Europe/Madrid","Europe/Lisbon","Europe/Moscow","Europe/Istanbul","Asia/Dubai","Asia/Kolkata","Asia/Bangkok","Asia/Singapore","Asia/Tokyo","Asia/Shanghai","Asia/Seoul","Asia/Jakarta","Australia/Sydney","Australia/Melbourne","Pacific/Auckland","Africa/Cairo","Africa/Johannesburg","Africa/Lagos"],PF=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],UF=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],VF={once:'e.g. "in 30 minutes", "tomorrow at 9am", "2026-03-01T09:00:00"',cron:'e.g. "0 9 * * 1-5" (weekdays at 9am)',interval:'e.g. "every 30 minutes", "every sunday at 9am", "every weekday"'};function BF({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:u}=Y_(),[l,d]=z.useState(""),[h,m]=z.useState("once"),[g,y]=z.useState(""),[b,v]=z.useState("UTC"),[S,j]=z.useState([]),[E,N]=z.useState(null),[O,C]=z.useState(!1),P=R=>{j(F=>F.includes(R)?F.filter(B=>B!==R):[...F,R])};z.useEffect(()=>{a?(d(a.prompt),m(a.schedule_type),y(a.schedule_expression),v(a.timezone),j(a.notify_channels??[])):(d(""),m("once"),y(""),v(u?.timezone??"UTC"),j([])),N(null)},[a,e,u?.timezone]);const U=async()=>{if(N(null),!l.trim()){N("Prompt is required");return}if(!g.trim()){N("Schedule expression is required");return}C(!0);try{if(s&&a){const R={prompt:l,schedule_expression:g,timezone:b,notify_channels:S};await Ei.updateJob(a.id,R)}else{const R={prompt:l,schedule_type:h,schedule_expression:g,timezone:b,notify_channels:S};await Ei.createJob(R)}await An(R=>typeof R=="string"&&R.startsWith("/chronos")),n(),t()}catch(R){N(R.message??"Failed to save job")}finally{C(!1)}};return e?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),f.jsxs("div",{className:"relative z-10 w-full max-w-lg mx-4 rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[f.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono",children:s?"Edit Chronos Job":"New Chronos Job"}),f.jsx("button",{onClick:t,className:"p-1 rounded text-azure-text-muted dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight transition-colors",children:f.jsx(eg,{className:"w-5 h-5"})})]}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsx(it,{label:"Prompt",value:l,onChange:R=>d(R.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&f.jsx(jr,{label:"Schedule Type",value:h,onChange:R=>m(R.target.value),options:UF}),f.jsxs("div",{children:[f.jsx(it,{label:"Schedule Expression",value:g,onChange:R=>y(R.target.value),placeholder:VF[h]}),f.jsx($F,{scheduleExpression:g,scheduleType:h,timezone:b})]}),f.jsx(jr,{label:"Timezone",value:b,onChange:R=>v(R.target.value),options:LF.map(R=>({value:R,label:R}))}),f.jsxs("div",{children:[f.jsxs("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:["Notify Channels ",f.jsx("span",{className:"text-xs font-normal opacity-60",children:"(empty = all active channels)"})]}),f.jsx("div",{className:"flex gap-4",children:PF.map(({value:R,label:F})=>f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:S.includes(R),onChange:()=>P(R),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),f.jsx("span",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary capitalize",children:F})]},R))})]}),E&&f.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:E})]}),f.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-azure-border dark:border-matrix-primary",children:[f.jsx("button",{onClick:t,className:"px-4 py-2 rounded text-sm border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors font-mono",children:"Cancel"}),f.jsx("button",{onClick:U,disabled:O,className:"px-4 py-2 rounded text-sm bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight font-bold hover:opacity-90 disabled:opacity-50 transition-opacity font-mono",children:O?"Saving…":s?"Update":"Create"})]})]})]}):null}function ZF(){const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=d=>{a(d),t(!0)},u=()=>{t(!1),a(null)},l=()=>{An(d=>typeof d=="string"&&d.startsWith("/chronos"))};return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Za,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Chronos"}),f.jsx("p",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary mt-0.5",children:"Temporal Intent Engine — schedule prompts for the Oracle"})]})]}),f.jsxs("button",{onClick:()=>{a(null),t(!0)},className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[f.jsx(od,{className:"w-4 h-4"}),"New Job"]})]}),f.jsx(DF,{onEdit:s}),f.jsx(BF,{isOpen:e,onClose:u,onCreated:l,editJob:n})]})}function IF(){return f.jsx(aT,{children:f.jsxs(k0,{children:[f.jsx(sn,{path:"/login",element:f.jsx(WH,{})}),f.jsx(sn,{path:"/*",element:f.jsx(eF,{children:f.jsx(vD,{children:f.jsxs(k0,{children:[f.jsx(sn,{path:"/",element:f.jsx(SD,{})}),f.jsx(sn,{path:"/chat",element:f.jsx(GL,{})}),f.jsx(sn,{path:"/zaion",element:f.jsx(JH,{})}),f.jsx(sn,{path:"/logs",element:f.jsx(KH,{})}),f.jsx(sn,{path:"/stats",element:f.jsx(QH,{})}),f.jsx(sn,{path:"/sati-memories",element:f.jsx(uF,{})}),f.jsx(sn,{path:"/mcp-servers",element:f.jsx(pF,{})}),f.jsx(sn,{path:"/model-pricing",element:f.jsx(xF,{})}),f.jsx(sn,{path:"/webhooks",element:f.jsx(kF,{})}),f.jsx(sn,{path:"/notifications",element:f.jsx(zF,{})}),f.jsx(sn,{path:"/tasks",element:f.jsx(NF,{})}),f.jsx(sn,{path:"/trinity-databases",element:f.jsx(AF,{})}),f.jsx(sn,{path:"/chronos",element:f.jsx(ZF,{})}),f.jsx(sn,{path:"*",element:f.jsx(iS,{to:"/",replace:!0})})]})})})})]})})}PN.createRoot(document.getElementById("root")).render(f.jsx(z.StrictMode,{children:f.jsx(IF,{})}));
|