morpheus-cli 0.6.5 → 0.6.6

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.
@@ -0,0 +1,111 @@
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 EC(){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 f in s)f!=="key"&&(u[f]=s[f])}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 TC(){return o0||(o0=1,$h.exports=EC()),$h.exports}var d=TC(),Lh={exports:{}},Oe={};var l0;function AC(){if(l0)return Oe;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"),f=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"),v=Symbol.iterator;function b(C){return C===null||typeof C!="object"?null:(C=v&&C[v]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,A={};function E(C,I,w){this.props=C,this.context=I,this.refs=A,this.updater=w||S}E.prototype.isReactComponent={},E.prototype.setState=function(C,I){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,I,"setState")},E.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function O(){}O.prototype=E.prototype;function N(C,I,w){this.props=C,this.context=I,this.refs=A,this.updater=w||S}var L=N.prototype=new O;L.constructor=N,j(L,E.prototype),L.isPureReactComponent=!0;var D=Array.isArray;function R(){}var q={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function X(C,I,w){var Y=w.ref;return{$$typeof:e,type:C,key:I,ref:Y!==void 0?Y:null,props:w}}function fe(C,I){return X(C.type,I,C.props)}function se(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function le(C){var I={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(w){return I[w]})}var ee=/\/+/g;function oe(C,I){return typeof C=="object"&&C!==null&&C.key!=null?le(""+C.key):I.toString(36)}function ae(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(R,R):(C.status="pending",C.then(function(I){C.status==="pending"&&(C.status="fulfilled",C.value=I)},function(I){C.status==="pending"&&(C.status="rejected",C.reason=I)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function P(C,I,w,Y,de){var he=typeof C;(he==="undefined"||he==="boolean")&&(C=null);var pe=!1;if(C===null)pe=!0;else switch(he){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(C.$$typeof){case e:case t:pe=!0;break;case g:return pe=C._init,P(pe(C._payload),I,w,Y,de)}}if(pe)return de=de(C),pe=Y===""?"."+oe(C,0):Y,D(de)?(w="",pe!=null&&(w=pe.replace(ee,"$&/")+"/"),P(de,I,w,"",function(pt){return pt})):de!=null&&(se(de)&&(de=fe(de,w+(de.key==null||C&&C.key===de.key?"":(""+de.key).replace(ee,"$&/")+"/")+pe)),I.push(de)),1;pe=0;var Pe=Y===""?".":Y+":";if(D(C))for(var Ae=0;Ae<C.length;Ae++)Y=C[Ae],he=Pe+oe(Y,Ae),pe+=P(Y,I,w,he,de);else if(Ae=b(C),typeof Ae=="function")for(C=Ae.call(C),Ae=0;!(Y=C.next()).done;)Y=Y.value,he=Pe+oe(Y,Ae++),pe+=P(Y,I,w,he,de);else if(he==="object"){if(typeof C.then=="function")return P(ae(C),I,w,Y,de);throw I=String(C),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return pe}function J(C,I,w){if(C==null)return C;var Y=[],de=0;return P(C,Y,"","",function(he){return I.call(w,he,de++)}),Y}function B(C){if(C._status===-1){var I=C._result;I=I(),I.then(function(w){(C._status===0||C._status===-1)&&(C._status=1,C._result=w)},function(w){(C._status===0||C._status===-1)&&(C._status=2,C._result=w)}),C._status===-1&&(C._status=0,C._result=I)}if(C._status===1)return C._result.default;throw C._result}var me=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},T={map:J,forEach:function(C,I,w){J(C,function(){I.apply(this,arguments)},w)},count:function(C){var I=0;return J(C,function(){I++}),I},toArray:function(C){return J(C,function(I){return I})||[]},only:function(C){if(!se(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Oe.Activity=y,Oe.Children=T,Oe.Component=E,Oe.Fragment=n,Oe.Profiler=s,Oe.PureComponent=N,Oe.StrictMode=a,Oe.Suspense=h,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(C){return q.H.useMemoCache(C)}},Oe.cache=function(C){return function(){return C.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(C,I,w){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var Y=j({},C.props),de=C.key;if(I!=null)for(he in I.key!==void 0&&(de=""+I.key),I)!V.call(I,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&I.ref===void 0||(Y[he]=I[he]);var he=arguments.length-2;if(he===1)Y.children=w;else if(1<he){for(var pe=Array(he),Pe=0;Pe<he;Pe++)pe[Pe]=arguments[Pe+2];Y.children=pe}return X(C.type,de,Y)},Oe.createContext=function(C){return C={$$typeof:l,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},Oe.createElement=function(C,I,w){var Y,de={},he=null;if(I!=null)for(Y in I.key!==void 0&&(he=""+I.key),I)V.call(I,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(de[Y]=I[Y]);var pe=arguments.length-2;if(pe===1)de.children=w;else if(1<pe){for(var Pe=Array(pe),Ae=0;Ae<pe;Ae++)Pe[Ae]=arguments[Ae+2];de.children=Pe}if(C&&C.defaultProps)for(Y in pe=C.defaultProps,pe)de[Y]===void 0&&(de[Y]=pe[Y]);return X(C,he,de)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(C){return{$$typeof:f,render:C}},Oe.isValidElement=se,Oe.lazy=function(C){return{$$typeof:g,_payload:{_status:-1,_result:C},_init:B}},Oe.memo=function(C,I){return{$$typeof:m,type:C,compare:I===void 0?null:I}},Oe.startTransition=function(C){var I=q.T,w={};q.T=w;try{var Y=C(),de=q.S;de!==null&&de(w,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(R,me)}catch(he){me(he)}finally{I!==null&&w.types!==null&&(I.types=w.types),q.T=I}},Oe.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Oe.use=function(C){return q.H.use(C)},Oe.useActionState=function(C,I,w){return q.H.useActionState(C,I,w)},Oe.useCallback=function(C,I){return q.H.useCallback(C,I)},Oe.useContext=function(C){return q.H.useContext(C)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(C,I){return q.H.useDeferredValue(C,I)},Oe.useEffect=function(C,I){return q.H.useEffect(C,I)},Oe.useEffectEvent=function(C){return q.H.useEffectEvent(C)},Oe.useId=function(){return q.H.useId()},Oe.useImperativeHandle=function(C,I,w){return q.H.useImperativeHandle(C,I,w)},Oe.useInsertionEffect=function(C,I){return q.H.useInsertionEffect(C,I)},Oe.useLayoutEffect=function(C,I){return q.H.useLayoutEffect(C,I)},Oe.useMemo=function(C,I){return q.H.useMemo(C,I)},Oe.useOptimistic=function(C,I){return q.H.useOptimistic(C,I)},Oe.useReducer=function(C,I,w){return q.H.useReducer(C,I,w)},Oe.useRef=function(C){return q.H.useRef(C)},Oe.useState=function(C){return q.H.useState(C)},Oe.useSyncExternalStore=function(C,I,w){return q.H.useSyncExternalStore(C,I,w)},Oe.useTransition=function(){return q.H.useTransition()},Oe.version="19.2.4",Oe}var u0;function rd(){return u0||(u0=1,Lh.exports=AC()),Lh.exports}var z=rd();const Hp=Ip(z);var Ph={exports:{}},tl={},Uh={exports:{}},Vh={};var c0;function OC(){return c0||(c0=1,(function(e){function t(P,J){var B=P.length;P.push(J);e:for(;0<B;){var me=B-1>>>1,T=P[me];if(0<s(T,J))P[me]=J,P[B]=T,B=me;else break e}}function n(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var J=P[0],B=P.pop();if(B!==J){P[0]=B;e:for(var me=0,T=P.length,C=T>>>1;me<C;){var I=2*(me+1)-1,w=P[I],Y=I+1,de=P[Y];if(0>s(w,B))Y<T&&0>s(de,w)?(P[me]=de,P[Y]=B,me=Y):(P[me]=w,P[I]=B,me=I);else if(Y<T&&0>s(de,B))P[me]=de,P[Y]=B,me=Y;else break e}}return J}function s(P,J){var B=P.sortIndex-J.sortIndex;return B!==0?B:P.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,f=l.now();e.unstable_now=function(){return l.now()-f}}var h=[],m=[],g=1,y=null,v=3,b=!1,S=!1,j=!1,A=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(P){for(var J=n(m);J!==null;){if(J.callback===null)a(m);else if(J.startTime<=P)a(m),J.sortIndex=J.expirationTime,t(h,J);else break;J=n(m)}}function D(P){if(j=!1,L(P),!S)if(n(h)!==null)S=!0,R||(R=!0,le());else{var J=n(m);J!==null&&ae(D,J.startTime-P)}}var R=!1,q=-1,V=5,X=-1;function fe(){return A?!0:!(e.unstable_now()-X<V)}function se(){if(A=!1,R){var P=e.unstable_now();X=P;var J=!0;try{e:{S=!1,j&&(j=!1,O(q),q=-1),b=!0;var B=v;try{t:{for(L(P),y=n(h);y!==null&&!(y.expirationTime>P&&fe());){var me=y.callback;if(typeof me=="function"){y.callback=null,v=y.priorityLevel;var T=me(y.expirationTime<=P);if(P=e.unstable_now(),typeof T=="function"){y.callback=T,L(P),J=!0;break t}y===n(h)&&a(h),L(P)}else a(h);y=n(h)}if(y!==null)J=!0;else{var C=n(m);C!==null&&ae(D,C.startTime-P),J=!1}}break e}finally{y=null,v=B,b=!1}J=void 0}}finally{J?le():R=!1}}}var le;if(typeof N=="function")le=function(){N(se)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,oe=ee.port2;ee.port1.onmessage=se,le=function(){oe.postMessage(null)}}else le=function(){E(se,0)};function ae(P,J){q=E(function(){P(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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var J=3;break;default:J=v}var B=v;v=J;try{return P()}finally{v=B}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(P,J){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var B=v;v=P;try{return J()}finally{v=B}},e.unstable_scheduleCallback=function(P,J,B){var me=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?me+B:me):B=me,P){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=B+T,P={id:g++,callback:J,priorityLevel:P,startTime:B,expirationTime:T,sortIndex:-1},B>me?(P.sortIndex=B,t(m,P),n(h)===null&&P===n(m)&&(j?(O(q),q=-1):j=!0,ae(D,B-me))):(P.sortIndex=T,t(h,P),S||b||(S=!0,R||(R=!0,le()))),P},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(P){var J=v;return function(){var B=v;v=J;try{return P.apply(this,arguments)}finally{v=B}}}})(Vh)),Vh}var d0;function RC(){return d0||(d0=1,Uh.exports=OC()),Uh.exports}var Bh={exports:{}},cn={};var f0;function MC(){if(f0)return cn;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 f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,cn.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)},cn.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()}},cn.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))},cn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},cn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,b=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:v,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},cn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=f(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)},cn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=f(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})}},cn.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=f(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)},cn.requestFormReset=function(h){a.d.r(h)},cn.unstable_batchedUpdates=function(h,m){return h(m)},cn.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},cn.version="19.2.4",cn}var h0;function DC(){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=MC(),Bh.exports}var m0;function $C(){if(m0)return tl;m0=1;var e=RC(),t=rd(),n=DC();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 f(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,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=se&&r[se]||r["@@iterator"],typeof r=="function"?r:null)}var ee=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ee?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case E:return"Profiler";case A:return"StrictMode";case D:return"Suspense";case R:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case O:return(r._context.displayName||"Context")+".Consumer";case L:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case q:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case V:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ae=Array.isArray,P=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,B={pending:!1,data:null,method:null,action:null},me=[],T=-1;function C(r){return{current:r}}function I(r){0>T||(r.current=me[T],me[T]=null,T--)}function w(r,i){T++,me[T]=r.current,r.current=i}var Y=C(null),de=C(null),he=C(null),pe=C(null);function Pe(r,i){switch(w(he,i),w(de,r),w(Y,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}}I(Y),w(Y,r)}function Ae(){I(Y),I(de),I(he)}function pt(r){r.memoizedState!==null&&w(pe,r);var i=Y.current,o=Tv(i,r.type);i!==o&&(w(de,r),w(Y,o))}function Rt(r){de.current===r&&(I(Y),I(de)),pe.current===r&&(I(pe),Xo._currentValue=B)}var Z,Ne;function qe(r){if(Z===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);Z=i&&i[1]||"",Ne=-1<o.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Z+r+Ne}var Lt=!1;function Me(r,i){if(!r||Lt)return"";Lt=!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(K){var G=K}Reflect.construct(r,[],re)}else{try{re.call()}catch(K){G=K}r.call(re.prototype)}}else{try{throw Error()}catch(K){G=K}(re=r())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(K){if(K&&G&&typeof K.stack=="string")return[K.stack,G.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
+ `),F=_.split(`
5
+ `);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===F.length)for(c=M.length-1,p=F.length-1;1<=c&&0<=p&&M[c]!==F[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==F[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==F[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{Lt=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?qe(o):""}function Ke(r,i){switch(r.tag){case 26:case 27:case 5:return qe(r.type);case 16:return qe("Lazy");case 13:return r.child!==i&&i!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return Me(r.type,!1);case 11:return Me(r.type.render,!1);case 1:return Me(r.type,!0);case 31:return qe("Activity");default:return""}}function at(r){try{var i="",o=null;do i+=Ke(r,o),o=r,r=r.return;while(r);return i}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var Qe=Object.prototype.hasOwnProperty,Qt=e.unstable_scheduleCallback,Gn=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Gt=e.unstable_requestPaint,gt=e.unstable_now,$i=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,He=e.unstable_IdlePriority,pn=e.log,$n=e.unstable_setDisableYieldValue,gn=null,Yt=null;function Sn(r){if(typeof pn=="function"&&$n(r),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(gn,r)}catch{}}var ut=Math.clz32?Math.clz32:p2,ua=Math.log,hr=Math.LN2;function p2(r){return r>>>=0,r===0?32:31-(ua(r)/hr|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 Kl(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 g2(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 cx(){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 x2(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,F=r.hiddenUpdates;for(o=k&~o;0<o;){var Q=31-ut(o),re=1<<Q;_[Q]=0,M[Q]=-1;var G=F[Q];if(G!==null)for(F[Q]=null,Q=0;Q<G.length;Q++){var K=G[Q];K!==null&&(K.lane&=-536870913)}o&=~re}c!==0&&dx(r,c,0),x!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=x&~(k&~i))}function dx(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ut(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|o&261930}function fx(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var c=31-ut(o),p=1<<c;p&i|r[c]&i&&(r[c]|=i),o&=~p}}function hx(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 mx(){var r=J.p;return r!==0?r:(r=window.event,r===void 0?32:Wv(r.type))}function px(r,i){var o=J.p;try{return J.p=r,i()}finally{J.p=o}}var ca=Math.random().toString(36).slice(2),tn="__reactFiber$"+ca,zn="__reactProps$"+ca,Li="__reactContainer$"+ca,jd="__reactEvents$"+ca,y2="__reactListeners$"+ca,b2="__reactHandles$"+ca,gx="__reactResources$"+ca,co="__reactMarker$"+ca;function Nd(r){delete r[tn],delete r[zn],delete r[jd],delete r[y2],delete r[b2]}function Pi(r){var i=r[tn];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Li]||o[tn]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Lv(r);r!==null;){if(o=r[tn])return o;r=Lv(r)}return i}r=o,o=r.parentNode}return null}function Ui(r){if(r=r[tn]||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[gx];return i||(i=r[gx]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Wt(r){r[co]=!0}var xx=new Set,yx={};function ti(r,i){Bi(r,i),Bi(r+"Capture",i)}function Bi(r,i){for(yx[r]=i,r=0;r<i.length;r++)xx.add(i[r])}var v2=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]*$"),bx={},vx={};function k2(r){return Qe.call(vx,r)?!0:Qe.call(bx,r)?!1:v2.test(r)?vx[r]=!0:(bx[r]=!0,!1)}function Xl(r,i,o){if(k2(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 Jl(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 kx(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function w2(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 Cd(r){if(!r._valueTracker){var i=kx(r)?"checked":"value";r._valueTracker=w2(r,i,""+r[i])}}function wx(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),c="";return r&&(c=kx(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 S2=/[\n"\\]/g;function Kn(r){return r.replace(S2,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 Sx(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)){Cd(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),Cd(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 zx(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 _x(r,i,o,c){if(i==null){if(c!=null){if(o!=null)throw Error(a(92));if(ae(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),Cd(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 z2=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 jx(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||z2.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Nx(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&&jx(r,p,c)}else for(var x in i)i.hasOwnProperty(x)&&jx(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 _2=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"]]),j2=/^[\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 j2.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 Cx(r){var i=Ui(r);if(i&&(r=i.stateNode)){var o=r[zn]||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="'+Kn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var c=o[i];if(c!==r&&c.form===r.form){var p=c[zn]||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&&wx(c)}break e;case"textarea":zx(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Zi(r,!!o.multiple,i,!1)}}}var Md=!1;function Ex(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,Cx(i),r)))for(i=0;i<r.length;i++)Cx(r[i])}}function ho(r,i){var o=r.stateNode;if(o===null)return null;var c=o[zn]||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 Tx(){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 Ax(){return!1}function _n(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:Ax,this.isPropagationStopped=Ax,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=_n(ni),po=y({},ni,{view:0,detail:0}),N2=_n(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}}),Ox=_n(au),C2=y({},au,{dataTransfer:0}),E2=_n(C2),T2=y({},po,{relatedTarget:0}),Ud=_n(T2),A2=y({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),O2=_n(A2),R2=y({},ni,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),M2=_n(R2),D2=y({},ni,{data:0}),Rx=_n(D2),$2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},L2={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"},P2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function U2(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=P2[r])?!!i[r]:!1}function Vd(){return U2}var V2=y({},po,{key:function(r){if(r.key){var i=$2[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"?L2[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}}),B2=_n(V2),Z2=y({},au,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mx=_n(Z2),I2=y({},po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vd}),H2=_n(I2),F2=y({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),q2=_n(F2),G2=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}),Y2=_n(G2),K2=y({},ni,{newState:0,oldState:0}),X2=_n(K2),J2=[9,13,27,32],Bd=Vr&&"CompositionEvent"in window,xo=null;Vr&&"documentMode"in document&&(xo=document.documentMode);var Q2=Vr&&"TextEvent"in window&&!xo,Dx=Vr&&(!Bd||xo&&8<xo&&11>=xo),$x=" ",Lx=!1;function Px(r,i){switch(r){case"keyup":return J2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ux(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qi=!1;function W2(r,i){switch(r){case"compositionend":return Ux(i);case"keypress":return i.which!==32?null:(Lx=!0,$x);case"textInput":return r=i.data,r===$x&&Lx?null:r;default:return null}}function eN(r,i){if(qi)return r==="compositionend"||!Bd&&Px(r,i)?(r=Tx(),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 Dx&&i.locale!=="ko"?null:i.data;default:return null}}var tN={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 Vx(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!tN[r.type]:i==="textarea"}function Bx(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 yo=null,bo=null;function nN(r){Sv(r,0)}function iu(r){var i=fo(r);if(wx(i))return r}function Zx(r,i){if(r==="change")return i}var Ix=!1;if(Vr){var Zd;if(Vr){var Id="oninput"in document;if(!Id){var Hx=document.createElement("div");Hx.setAttribute("oninput","return;"),Id=typeof Hx.oninput=="function"}Zd=Id}else Zd=!1;Ix=Zd&&(!document.documentMode||9<document.documentMode)}function Fx(){yo&&(yo.detachEvent("onpropertychange",qx),bo=yo=null)}function qx(r){if(r.propertyName==="value"&&iu(bo)){var i=[];Bx(i,bo,r,Rd(r)),Ex(nN,i)}}function rN(r,i,o){r==="focusin"?(Fx(),yo=i,bo=o,yo.attachEvent("onpropertychange",qx)):r==="focusout"&&Fx()}function aN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return iu(bo)}function iN(r,i){if(r==="click")return iu(i)}function sN(r,i){if(r==="input"||r==="change")return iu(i)}function oN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Ln=typeof Object.is=="function"?Object.is:oN;function vo(r,i){if(Ln(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(!Qe.call(i,p)||!Ln(r[p],i[p]))return!1}return!0}function Gx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Yx(r,i){var o=Gx(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=Gx(o)}}function Kx(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Kx(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Xx(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 lN=Vr&&"documentMode"in document&&11>=document.documentMode,Gi=null,Fd=null,ko=null,qd=!1;function Jx(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={},Qx={};Vr&&(Qx=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 Qx)return Gd[r]=i[o];return r}var Wx=ai("animationend"),ey=ai("animationiteration"),ty=ai("animationstart"),uN=ai("transitionrun"),cN=ai("transitionstart"),dN=ai("transitioncancel"),ny=ai("transitionend"),ry=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 mr(r,i){ry.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)},Xn=[],Ki=0,Kd=0;function ou(){for(var r=Ki,i=Kd=Ki=0;i<r;){var o=Xn[i];Xn[i++]=null;var c=Xn[i];Xn[i++]=null;var p=Xn[i];Xn[i++]=null;var x=Xn[i];if(Xn[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&&ay(o,p,x)}}function lu(r,i,o,c){Xn[Ki++]=r,Xn[Ki++]=i,Xn[Ki++]=o,Xn[Ki++]=c,Kd|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Xd(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 ay(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-ut(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 Xi={};function fN(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 Pn(r,i,o,c){return new fN(r,i,o,c)}function Jd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Br(r,i){var o=r.alternate;return o===null?(o=Pn(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 iy(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")Jd(r)&&(k=1);else if(typeof r=="string")k=xC(r,o,Y.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=Pn(31,o,i,p),r.elementType=X,r.lanes=x,r;case j:return si(o.children,p,x,i);case A:k=8,p|=24;break;case E:return r=Pn(12,o,i,p|2),r.elementType=E,r.lanes=x,r;case D:return r=Pn(13,o,i,p),r.elementType=D,r.lanes=x,r;case R:return r=Pn(19,o,i,p),r.elementType=R,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:k=10;break e;case O:k=9;break e;case L:k=11;break e;case q:k=14;break e;case V:k=16,c=null;break e}k=29,o=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Pn(k,o,i,p),i.elementType=r,i.type=c,i.lanes=x,i}function si(r,i,o,c){return r=Pn(7,r,c,i),r.lanes=o,r}function Qd(r,i,o){return r=Pn(6,r,null,i),r.lanes=o,r}function sy(r){var i=Pn(18,null,null,0);return i.stateNode=r,i}function Wd(r,i,o){return i=Pn(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var oy=new WeakMap;function Jn(r,i){if(typeof r=="object"&&r!==null){var o=oy.get(r);return o!==void 0?o:(i={value:r,source:i,stack:at(i)},oy.set(r,i),i)}return{value:r,source:i,stack:at(i)}}var Ji=[],Qi=0,du=null,wo=0,Qn=[],Wn=0,fa=null,kr=1,wr="";function Zr(r,i){Ji[Qi++]=wo,Ji[Qi++]=du,du=r,wo=i}function ly(r,i,o){Qn[Wn++]=kr,Qn[Wn++]=wr,Qn[Wn++]=fa,fa=r;var c=kr;r=wr;var p=32-ut(c)-1;c&=~(1<<p),o+=1;var x=32-ut(i)+p;if(30<x){var k=p-p%5;x=(c&(1<<k)-1).toString(32),c>>=k,p-=k,kr=1<<32-ut(i)+p|o<<p|c,wr=x+r}else kr=1<<x|o<<p|c,wr=r}function ef(r){r.return!==null&&(Zr(r,1),ly(r,1,0))}function tf(r){for(;r===du;)du=Ji[--Qi],Ji[Qi]=null,wo=Ji[--Qi],Ji[Qi]=null;for(;r===fa;)fa=Qn[--Wn],Qn[Wn]=null,wr=Qn[--Wn],Qn[Wn]=null,kr=Qn[--Wn],Qn[Wn]=null}function uy(r,i){Qn[Wn++]=kr,Qn[Wn++]=wr,Qn[Wn++]=fa,kr=i.id,wr=i.overflow,fa=r}var nn=null,xt=null,Ie=!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(Jn(i,r)),nf}function cy(r){var i=r.stateNode,o=r.type,c=r.memoizedProps;switch(i[tn]=r,i[zn]=c,o){case"dialog":Ve("cancel",i),Ve("close",i);break;case"iframe":case"object":case"embed":Ve("load",i);break;case"video":case"audio":for(o=0;o<Fo.length;o++)Ve(Fo[o],i);break;case"source":Ve("error",i);break;case"img":case"image":case"link":Ve("error",i),Ve("load",i);break;case"details":Ve("toggle",i);break;case"input":Ve("invalid",i),Sx(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ve("invalid",i);break;case"textarea":Ve("invalid",i),_x(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||Nv(i.textContent,o)?(c.popover!=null&&(Ve("beforetoggle",i),Ve("toggle",i)),c.onScroll!=null&&Ve("scroll",i),c.onScrollEnd!=null&&Ve("scrollend",i),c.onClick!=null&&(i.onclick=Ur),i=!0):i=!1,i||ma(r,!0)}function dy(r){for(nn=r.return;nn;)switch(nn.tag){case 5:case 31:case 13:er=!1;return;case 27:case 3:er=!0;return;default:nn=nn.return}}function Wi(r){if(r!==nn)return!1;if(!Ie)return dy(r),Ie=!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&&xt&&ma(r),dy(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));xt=$v(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));xt=$v(r)}else i===27?(i=xt,Ca(r.type)?(r=jh,jh=null,xt=r):xt=i):xt=nn?nr(r.stateNode.nextSibling):null;return!0}function oi(){xt=nn=null,Ie=!1}function rf(){var r=ha;return r!==null&&(En===null?En=r:En.push.apply(En,r),ha=null),r}function So(r){ha===null?ha=[r]:ha.push(r)}var af=C(null),li=null,Ir=null;function pa(r,i,o){w(af,i._currentValue),i._currentValue=o}function Hr(r){r._currentValue=af.current,I(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;Ln(p.pendingProps.value,k.value)||(r!==null?r.push(_):r=[_])}}else if(p===pe.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Xo):r=[Xo])}p=p.return}r!==null&&of(i,r,o,c),i.flags|=262144}function fu(r){for(r=r.firstContext;r!==null;){if(!Ln(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 rn(r){return fy(li,r)}function hu(r,i){return li===null&&ui(r),fy(r,i)}function fy(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 hN=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()})}},mN=e.unstable_scheduleCallback,pN=e.unstable_NormalPriority,Pt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lf(){return{controller:new hN,data:new Map,refCount:0}}function zo(r){r.refCount--,r.refCount===0&&mN(pN,function(){r.controller.abort()})}var _o=null,uf=0,ts=0,ns=null;function gN(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(hy,hy),i}function hy(){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 xN(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 my=P.S;P.S=function(r,i){Jb=gt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&gN(r,i),my!==null&&my(r,i)};var ci=C(null);function cf(){var r=ci.current;return r!==null?r:ct.pooledCache}function mu(r,i){i===null?w(ci,ci.current):w(ci,i.pool)}function py(){var r=cf();return r===null?null:{parent:Pt._currentValue,pool:r}}var rs=Error(a(460)),df=Error(a(474)),pu=Error(a(542)),gu={then:function(){}};function gy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function xy(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,by(r),r;default:if(typeof i.status=="string")i.then(Ur,Ur);else{if(r=ct,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,by(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 yy(){if(fi===null)throw Error(a(459));var r=fi;return fi=null,r}function by(r){if(r===rs||r===pu)throw Error(a(483))}var as=null,jo=0;function xu(r){var i=jo;return jo+=1,as===null&&(as=[]),xy(as,r,i)}function No(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function yu(r,i){throw i.$$typeof===v?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function vy(r){function i(U,$){if(r){var H=U.deletions;H===null?(U.deletions=[$],U.flags|=16):H.push($)}}function o(U,$){if(!r)return null;for(;$!==null;)i(U,$),$=$.sibling;return null}function c(U){for(var $=new Map;U!==null;)U.key!==null?$.set(U.key,U):$.set(U.index,U),U=U.sibling;return $}function p(U,$){return U=Br(U,$),U.index=0,U.sibling=null,U}function x(U,$,H){return U.index=H,r?(H=U.alternate,H!==null?(H=H.index,H<$?(U.flags|=67108866,$):H):(U.flags|=67108866,$)):(U.flags|=1048576,$)}function k(U){return r&&U.alternate===null&&(U.flags|=67108866),U}function _(U,$,H,ne){return $===null||$.tag!==6?($=Qd(H,U.mode,ne),$.return=U,$):($=p($,H),$.return=U,$)}function M(U,$,H,ne){var _e=H.type;return _e===j?Q(U,$,H.props.children,ne,H.key):$!==null&&($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===V&&di(_e)===$.type)?($=p($,H.props),No($,H),$.return=U,$):($=cu(H.type,H.key,H.props,null,U.mode,ne),No($,H),$.return=U,$)}function F(U,$,H,ne){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=Wd(H,U.mode,ne),$.return=U,$):($=p($,H.children||[]),$.return=U,$)}function Q(U,$,H,ne,_e){return $===null||$.tag!==7?($=si(H,U.mode,ne,_e),$.return=U,$):($=p($,H),$.return=U,$)}function re(U,$,H){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Qd(""+$,U.mode,H),$.return=U,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return H=cu($.type,$.key,$.props,null,U.mode,H),No(H,$),H.return=U,H;case S:return $=Wd($,U.mode,H),$.return=U,$;case V:return $=di($),re(U,$,H)}if(ae($)||le($))return $=si($,U.mode,H,null),$.return=U,$;if(typeof $.then=="function")return re(U,xu($),H);if($.$$typeof===N)return re(U,hu(U,$),H);yu(U,$)}return null}function G(U,$,H,ne){var _e=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return _e!==null?null:_(U,$,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===_e?M(U,$,H,ne):null;case S:return H.key===_e?F(U,$,H,ne):null;case V:return H=di(H),G(U,$,H,ne)}if(ae(H)||le(H))return _e!==null?null:Q(U,$,H,ne,null);if(typeof H.then=="function")return G(U,$,xu(H),ne);if(H.$$typeof===N)return G(U,$,hu(U,H),ne);yu(U,H)}return null}function K(U,$,H,ne,_e){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return U=U.get(H)||null,_($,U,""+ne,_e);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return U=U.get(ne.key===null?H:ne.key)||null,M($,U,ne,_e);case S:return U=U.get(ne.key===null?H:ne.key)||null,F($,U,ne,_e);case V:return ne=di(ne),K(U,$,H,ne,_e)}if(ae(ne)||le(ne))return U=U.get(H)||null,Q($,U,ne,_e,null);if(typeof ne.then=="function")return K(U,$,H,xu(ne),_e);if(ne.$$typeof===N)return K(U,$,H,hu($,ne),_e);yu($,ne)}return null}function ge(U,$,H,ne){for(var _e=null,Ge=null,Se=$,De=$=0,Ze=null;Se!==null&&De<H.length;De++){Se.index>De?(Ze=Se,Se=null):Ze=Se.sibling;var Ye=G(U,Se,H[De],ne);if(Ye===null){Se===null&&(Se=Ze);break}r&&Se&&Ye.alternate===null&&i(U,Se),$=x(Ye,$,De),Ge===null?_e=Ye:Ge.sibling=Ye,Ge=Ye,Se=Ze}if(De===H.length)return o(U,Se),Ie&&Zr(U,De),_e;if(Se===null){for(;De<H.length;De++)Se=re(U,H[De],ne),Se!==null&&($=x(Se,$,De),Ge===null?_e=Se:Ge.sibling=Se,Ge=Se);return Ie&&Zr(U,De),_e}for(Se=c(Se);De<H.length;De++)Ze=K(Se,U,De,H[De],ne),Ze!==null&&(r&&Ze.alternate!==null&&Se.delete(Ze.key===null?De:Ze.key),$=x(Ze,$,De),Ge===null?_e=Ze:Ge.sibling=Ze,Ge=Ze);return r&&Se.forEach(function(Ra){return i(U,Ra)}),Ie&&Zr(U,De),_e}function je(U,$,H,ne){if(H==null)throw Error(a(151));for(var _e=null,Ge=null,Se=$,De=$=0,Ze=null,Ye=H.next();Se!==null&&!Ye.done;De++,Ye=H.next()){Se.index>De?(Ze=Se,Se=null):Ze=Se.sibling;var Ra=G(U,Se,Ye.value,ne);if(Ra===null){Se===null&&(Se=Ze);break}r&&Se&&Ra.alternate===null&&i(U,Se),$=x(Ra,$,De),Ge===null?_e=Ra:Ge.sibling=Ra,Ge=Ra,Se=Ze}if(Ye.done)return o(U,Se),Ie&&Zr(U,De),_e;if(Se===null){for(;!Ye.done;De++,Ye=H.next())Ye=re(U,Ye.value,ne),Ye!==null&&($=x(Ye,$,De),Ge===null?_e=Ye:Ge.sibling=Ye,Ge=Ye);return Ie&&Zr(U,De),_e}for(Se=c(Se);!Ye.done;De++,Ye=H.next())Ye=K(Se,U,De,Ye.value,ne),Ye!==null&&(r&&Ye.alternate!==null&&Se.delete(Ye.key===null?De:Ye.key),$=x(Ye,$,De),Ge===null?_e=Ye:Ge.sibling=Ye,Ge=Ye);return r&&Se.forEach(function(CC){return i(U,CC)}),Ie&&Zr(U,De),_e}function ot(U,$,H,ne){if(typeof H=="object"&&H!==null&&H.type===j&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var _e=H.key;$!==null;){if($.key===_e){if(_e=H.type,_e===j){if($.tag===7){o(U,$.sibling),ne=p($,H.props.children),ne.return=U,U=ne;break e}}else if($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===V&&di(_e)===$.type){o(U,$.sibling),ne=p($,H.props),No(ne,H),ne.return=U,U=ne;break e}o(U,$);break}else i(U,$);$=$.sibling}H.type===j?(ne=si(H.props.children,U.mode,ne,H.key),ne.return=U,U=ne):(ne=cu(H.type,H.key,H.props,null,U.mode,ne),No(ne,H),ne.return=U,U=ne)}return k(U);case S:e:{for(_e=H.key;$!==null;){if($.key===_e)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){o(U,$.sibling),ne=p($,H.children||[]),ne.return=U,U=ne;break e}else{o(U,$);break}else i(U,$);$=$.sibling}ne=Wd(H,U.mode,ne),ne.return=U,U=ne}return k(U);case V:return H=di(H),ot(U,$,H,ne)}if(ae(H))return ge(U,$,H,ne);if(le(H)){if(_e=le(H),typeof _e!="function")throw Error(a(150));return H=_e.call(H),je(U,$,H,ne)}if(typeof H.then=="function")return ot(U,$,xu(H),ne);if(H.$$typeof===N)return ot(U,$,hu(U,H),ne);yu(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,$!==null&&$.tag===6?(o(U,$.sibling),ne=p($,H),ne.return=U,U=ne):(o(U,$),ne=Qd(H,U.mode,ne),ne.return=U,U=ne),k(U)):o(U,$)}return function(U,$,H,ne){try{jo=0;var _e=ot(U,$,H,ne);return as=null,_e}catch(Se){if(Se===rs||Se===pu)throw Se;var Ge=Pn(29,Se,null,U.mode);return Ge.lanes=ne,Ge.return=U,Ge}}}var hi=vy(!0),ky=vy(!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 xa(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ya(r,i,o){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(Xe&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),ay(r,null,o),i}return lu(r,c,i,o),uu(r)}function Co(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,fx(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=_,F=M.next;M.next=null,k===null?x=F:k.next=F,k=M;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,_=Q.lastBaseUpdate,_!==k&&(_===null?Q.firstBaseUpdate=F:_.next=F,Q.lastBaseUpdate=M))}if(x!==null){var re=p.baseState;k=0,Q=F=M=null,_=x;do{var G=_.lane&-536870913,K=G!==_.lane;if(K?(Be&G)===G:(c&G)===G){G!==0&&G===ts&&(pf=!0),Q!==null&&(Q=Q.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ge=r,je=_;G=i;var ot=o;switch(je.tag){case 1:if(ge=je.payload,typeof ge=="function"){re=ge.call(ot,re,G);break e}re=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=je.payload,G=typeof ge=="function"?ge.call(ot,re,G):ge,G==null)break e;re=y({},re,G);break e;case 2:ga=!0}}G=_.callback,G!==null&&(r.flags|=64,K&&(r.flags|=8192),K=p.callbacks,K===null?p.callbacks=[G]:K.push(G))}else K={lane:G,tag:_.tag,payload:_.payload,callback:_.callback,next:null},Q===null?(F=Q=K,M=re):Q=Q.next=K,k|=G;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;K=_,_=K.next,K.next=null,p.lastBaseUpdate=K,p.shared.pending=null}}while(!0);Q===null&&(M=re),p.baseState=M,p.firstBaseUpdate=F,p.lastBaseUpdate=Q,x===null&&(p.shared.lanes=0),Sa|=k,r.lanes=k,r.memoizedState=re}}function wy(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Sy(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)wy(o[r],i)}var is=C(null),bu=C(0);function zy(r,i){r=Wr,w(bu,r),w(is,i),Wr=r|i.baseLanes}function gf(){w(bu,Wr),w(is,is.current)}function xf(){Wr=bu.current,I(is),I(bu)}var Un=C(null),tr=null;function ba(r){var i=r.alternate;w(Dt,Dt.current&1),w(Un,r),tr===null&&(i===null||is.current!==null||i.memoizedState!==null)&&(tr=r)}function yf(r){w(Dt,Dt.current),w(Un,r),tr===null&&(tr=r)}function _y(r){r.tag===22?(w(Dt,Dt.current),w(Un,r),tr===null&&(tr=r)):va()}function va(){w(Dt,Dt.current),w(Un,Un.current)}function Vn(r){I(Un),tr===r&&(tr=null),I(Dt)}var Dt=C(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,Re=null,it=null,Ut=null,ku=!1,ss=!1,mi=!1,wu=0,Ao=0,os=null,yN=0;function Tt(){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(!Ln(r[o],i[o]))return!1;return!0}function vf(r,i,o,c,p,x){return Fr=x,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=r===null||r.memoizedState===null?lb:Df,mi=!1,x=o(c,p),mi=!1,ss&&(x=Ny(i,o,c,p)),jy(r),x}function jy(r){P.H=Mo;var i=it!==null&&it.next!==null;if(Fr=0,Ut=it=Re=null,ku=!1,Ao=0,os=null,i)throw Error(a(300));r===null||Vt||(r=r.dependencies,r!==null&&fu(r)&&(Vt=!0))}function Ny(r,i,o,c){Re=r;var p=0;do{if(ss&&(os=null),Ao=0,ss=!1,25<=p)throw Error(a(301));if(p+=1,Ut=it=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}P.H=ub,x=i(o,c)}while(ss);return x}function bN(){var r=P.H,i=r.useState()[0];return i=typeof i.then=="function"?Oo(i):i,r=r.useState()[0],(it!==null?it.memoizedState:null)!==r&&(Re.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,Ut=it=Re=null,ss=!1,Ao=wu=0,os=null}function xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Re.memoizedState=Ut=r:Ut=Ut.next=r,Ut}function $t(){if(it===null){var r=Re.alternate;r=r!==null?r.memoizedState:null}else r=it.next;var i=Ut===null?Re.memoizedState:Ut.next;if(i!==null)Ut=i,it=r;else{if(r===null)throw Re.alternate===null?Error(a(467)):Error(a(310));it=r,r={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Ut===null?Re.memoizedState=Ut=r:Ut=Ut.next=r}return Ut}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(r){var i=Ao;return Ao+=1,os===null&&(os=[]),r=xy(os,r,i),i=Re,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,P.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===N)return rn(r)}throw Error(a(438,String(r)))}function zf(r){var i=null,o=Re.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var c=Re.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(),Re.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=$t();return _f(i,it,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,F=i,Q=!1;do{var re=F.lane&-536870913;if(re!==F.lane?(Be&re)===re:(Fr&re)===re){var G=F.revertLane;if(G===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===ts&&(Q=!0);else if((Fr&G)===G){F=F.next,G===ts&&(Q=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},M===null?(_=M=re,k=x):M=M.next=re,Re.lanes|=G,Sa|=G;re=F.action,mi&&o(x,re),x=F.hasEagerState?F.eagerState:o(x,re)}else G={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},M===null?(_=M=G,k=x):M=M.next=G,Re.lanes|=re,Sa|=re;F=F.next}while(F!==null&&F!==i);if(M===null?k=x:M.next=_,!Ln(x,r.memoizedState)&&(Vt=!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=$t(),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);Ln(x,i.memoizedState)||(Vt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,c]}function Cy(r,i,o){var c=Re,p=$t(),x=Ie;if(x){if(o===void 0)throw Error(a(407));o=o()}else o=i();var k=!Ln((it||p).memoizedState,o);if(k&&(p.memoizedState=o,Vt=!0),p=p.queue,Ef(Ay.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||Ut!==null&&Ut.memoizedState.tag&1){if(c.flags|=2048,ls(9,{destroy:void 0},Ty.bind(null,c,p,o,i),null),ct===null)throw Error(a(349));x||(Fr&127)!==0||Ey(c,i,o)}return o}function Ey(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=Su(),Re.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function Ty(r,i,o,c){i.value=o,i.getSnapshot=c,Oy(i)&&Ry(r)}function Ay(r,i,o){return o(function(){Oy(i)&&Ry(r)})}function Oy(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!Ln(r,o)}catch{return!0}}function Ry(r){var i=ii(r,2);i!==null&&Tn(i,r,2)}function Nf(r){var i=xn();if(typeof r=="function"){var o=r;if(r=o(),mi){Sn(!0);try{o()}finally{Sn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:r},i}function My(r,i,o,c){return r.baseState=o,_f(r,it,typeof c=="function"?c:qr)}function vN(r,i,o,c,p){if(Cu(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)}};P.T!==null?o(!0):x.isTransition=!1,c(x),o=i.pending,o===null?(x.next=i.pending=x,Dy(i,x)):(x.next=o.next,i.pending=o.next=x)}}function Dy(r,i){var o=i.action,c=i.payload,p=r.state;if(i.isTransition){var x=P.T,k={};P.T=k;try{var _=o(p,c),M=P.S;M!==null&&M(k,_),$y(r,i,_)}catch(F){Cf(r,i,F)}finally{x!==null&&k.types!==null&&(x.types=k.types),P.T=x}}else try{x=o(p,c),$y(r,i,x)}catch(F){Cf(r,i,F)}}function $y(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Ly(r,i,c)},function(c){return Cf(r,i,c)}):Ly(r,i,o)}function Ly(r,i,o){i.status="fulfilled",i.value=o,Py(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,Dy(r,o)))}function Cf(r,i,o){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=o,Py(i),i=i.next;while(i!==c)}r.action=null}function Py(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Uy(r,i){return i}function Vy(r,i){if(Ie){var o=ct.formState;if(o!==null){e:{var c=Re;if(Ie){if(xt){t:{for(var p=xt,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){xt=nr(p.nextSibling),c=p.data==="F!";break e}}ma(c)}c=!1}c&&(i=o[0])}}return o=xn(),o.memoizedState=o.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uy,lastRenderedState:i},o.queue=c,o=ib.bind(null,Re,c),c.dispatch=o,c=Nf(!1),x=Mf.bind(null,Re,!1,c.queue),c=xn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,o=vN.bind(null,Re,p,x,o),p.dispatch=o,c.memoizedState=r,[i,o,!1]}function By(r){var i=$t();return Zy(i,it,r)}function Zy(r,i,o){if(i=_f(r,i,Uy)[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=$t();var p=i.queue,x=p.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,ls(9,{destroy:void 0},kN.bind(null,p,o),null)),[c,x,r]}function kN(r,i){r.action=i}function Iy(r){var i=$t(),o=it;if(o!==null)return Zy(i,o,r);$t(),i=i.memoizedState,o=$t();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=Re.updateQueue,i===null&&(i=Su(),Re.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 Hy(){return $t().memoizedState}function ju(r,i,o,c){var p=xn();Re.flags|=r,p.memoizedState=ls(1|i,{destroy:void 0},o,c===void 0?null:c)}function Nu(r,i,o,c){var p=$t();c=c===void 0?null:c;var x=p.memoizedState.inst;it!==null&&c!==null&&bf(c,it.memoizedState.deps)?p.memoizedState=ls(i,x,o,c):(Re.flags|=r,p.memoizedState=ls(1|i,x,o,c))}function Fy(r,i){ju(8390656,8,r,i)}function Ef(r,i){Nu(2048,8,r,i)}function wN(r){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=Su(),Re.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function qy(r){var i=$t().memoizedState;return wN({ref:i,nextImpl:r}),function(){if((Xe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Gy(r,i){return Nu(4,2,r,i)}function Yy(r,i){return Nu(4,4,r,i)}function Ky(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 Xy(r,i,o){o=o!=null?o.concat([r]):null,Nu(4,4,Ky.bind(null,i,r),o)}function Tf(){}function Jy(r,i){var o=$t();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 Qy(r,i){var o=$t();i=i===void 0?null:i;var c=o.memoizedState;if(i!==null&&bf(i,c[1]))return c[0];if(c=r(),mi){Sn(!0);try{r()}finally{Sn(!1)}}return o.memoizedState=[c,i],c}function Af(r,i,o){return o===void 0||(Fr&1073741824)!==0&&(Be&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=Wb(),Re.lanes|=r,Sa|=r,o)}function Wy(r,i,o,c){return Ln(o,i)?o:is.current!==null?(r=Af(r,o,c),Ln(r,i)||(Vt=!0),r):(Fr&42)===0||(Fr&1073741824)!==0&&(Be&261930)===0?(Vt=!0,r.memoizedState=o):(r=Wb(),Re.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=P.T,_={};P.T=_,Mf(r,!1,i,o);try{var M=p(),F=P.S;if(F!==null&&F(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var Q=xN(M,c);Ro(r,i,Q,In(r))}else Ro(r,i,c,In(r))}catch(re){Ro(r,i,{then:function(){},status:"rejected",reason:re},In())}finally{J.p=x,k!==null&&_.types!==null&&(k.types=_.types),P.T=k}}function SN(){}function Of(r,i,o,c){if(r.tag!==5)throw Error(a(476));var p=tb(r).queue;eb(r,p,i,B,o===null?SN:function(){return nb(r),o(c)})}function tb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:B},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,{},In())}function Rf(){return rn(Xo)}function rb(){return $t().memoizedState}function ab(){return $t().memoizedState}function zN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=In();r=xa(o);var c=ya(i,r,o);c!==null&&(Tn(c,i,o),Co(c,i,o)),i={cache:lf()},r.payload=i;return}i=i.return}}function _N(r,i,o){var c=In();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Cu(r)?sb(i,o):(o=Xd(r,i,o,c),o!==null&&(Tn(o,r,c),ob(o,i,c)))}function ib(r,i,o){var c=In();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(Cu(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=_,Ln(_,k))return lu(r,i,p,0),ct===null&&ou(),!1}catch{}if(o=Xd(r,i,p,c),o!==null)return Tn(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},Cu(r)){if(i)throw Error(a(479))}else i=Xd(r,o,c,2),i!==null&&Tn(i,r,2)}function Cu(r){var i=r.alternate;return r===Re||i!==null&&i===Re}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,fx(r,o)}}var Mo={readContext:rn,use:zu,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};Mo.useEffectEvent=Tt;var lb={readContext:rn,use:zu,useCallback:function(r,i){return xn().memoizedState=[r,i===void 0?null:i],r},useContext:rn,useEffect:Fy,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,ju(4194308,4,Ky.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=xn();i=i===void 0?null:i;var c=r();if(mi){Sn(!0);try{r()}finally{Sn(!1)}}return o.memoizedState=[c,i],c},useReducer:function(r,i,o){var c=xn();if(o!==void 0){var p=o(i);if(mi){Sn(!0);try{o(i)}finally{Sn(!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=_N.bind(null,Re,r),[c.memoizedState,r]},useRef:function(r){var i=xn();return r={current:r},i.memoizedState=r},useState:function(r){r=Nf(r);var i=r.queue,o=ib.bind(null,Re,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:Tf,useDeferredValue:function(r,i){var o=xn();return Af(o,r,i)},useTransition:function(){var r=Nf(!1);return r=eb.bind(null,Re,r.queue,!0,!1),xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var c=Re,p=xn();if(Ie){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),ct===null)throw Error(a(349));(Be&127)!==0||Ey(c,i,o)}p.memoizedState=o;var x={value:o,getSnapshot:i};return p.queue=x,Fy(Ay.bind(null,c,x,r),[r]),c.flags|=2048,ls(9,{destroy:void 0},Ty.bind(null,c,x,o,i),null),o},useId:function(){var r=xn(),i=ct.identifierPrefix;if(Ie){var o=wr,c=kr;o=(c&~(1<<32-ut(c)-1)).toString(32)+o,i="_"+i+"R_"+o,o=wu++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=yN++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Rf,useFormState:Vy,useActionState:Vy,useOptimistic:function(r){var i=xn();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,Re,!0,o),o.dispatch=i,[r,i]},useMemoCache:zf,useCacheRefresh:function(){return xn().memoizedState=zN.bind(null,Re)},useEffectEvent:function(r){var i=xn(),o={impl:r};return i.memoizedState=o,function(){if((Xe&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Df={readContext:rn,use:zu,useCallback:Jy,useContext:rn,useEffect:Ef,useImperativeHandle:Xy,useInsertionEffect:Gy,useLayoutEffect:Yy,useMemo:Qy,useReducer:_u,useRef:Hy,useState:function(){return _u(qr)},useDebugValue:Tf,useDeferredValue:function(r,i){var o=$t();return Wy(o,it.memoizedState,r,i)},useTransition:function(){var r=_u(qr)[0],i=$t().memoizedState;return[typeof r=="boolean"?r:Oo(r),i]},useSyncExternalStore:Cy,useId:rb,useHostTransitionStatus:Rf,useFormState:By,useActionState:By,useOptimistic:function(r,i){var o=$t();return My(o,it,r,i)},useMemoCache:zf,useCacheRefresh:ab};Df.useEffectEvent=qy;var ub={readContext:rn,use:zu,useCallback:Jy,useContext:rn,useEffect:Ef,useImperativeHandle:Xy,useInsertionEffect:Gy,useLayoutEffect:Yy,useMemo:Qy,useReducer:jf,useRef:Hy,useState:function(){return jf(qr)},useDebugValue:Tf,useDeferredValue:function(r,i){var o=$t();return it===null?Af(o,r,i):Wy(o,it.memoizedState,r,i)},useTransition:function(){var r=jf(qr)[0],i=$t().memoizedState;return[typeof r=="boolean"?r:Oo(r),i]},useSyncExternalStore:Cy,useId:rb,useHostTransitionStatus:Rf,useFormState:Iy,useActionState:Iy,useOptimistic:function(r,i){var o=$t();return it!==null?My(o,it,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:zf,useCacheRefresh:ab};ub.useEffectEvent=qy;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=In(),p=xa(c);p.payload=i,o!=null&&(p.callback=o),i=ya(r,p,c),i!==null&&(Tn(i,r,c),Co(i,r,c))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var c=In(),p=xa(c);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=ya(r,p,c),i!==null&&(Tn(i,r,c),Co(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=In(),c=xa(o);c.tag=2,i!=null&&(c.callback=i),i=ya(r,c,o),i!==null&&(Tn(i,r,o),Co(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=xa(o),o.tag=3,o.payload={element:null},o.callback=function(){Eu(r,i)},o}function gb(r){return r=xa(r),r.tag=3,r}function xb(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 jN(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=Un.current,o!==null){switch(o.tag){case 31:case 13:return tr===null?Bu():o.alternate===null&&At===0&&(At=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(Ie)return i=Un.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(Jn(r,o)))):(c!==nf&&(i=Error(a(423),{cause:c}),So(Jn(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=Jn(c,o),p=Pf(r.stateNode,c,p),mf(r,p),At!==4&&(At=2)),!1;var x=Error(a(520),{cause:c});if(x=Jn(x,o),Zo===null?Zo=[x]:Zo.push(x),At!==4&&(At=2),i===null)return!0;c=Jn(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),xb(p,r,o,c),mf(o,p),!1}o=o.return}while(o!==null);return!1}var Uf=Error(a(461)),Vt=!1;function an(r,i,o,c){i.child=r===null?ky(i,null,o,c):hi(i,r.child,o,c)}function yb(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&&!Vt?(wf(r,i,p),Gr(r,i,p)):(Ie&&_&&ef(i),i.flags|=1,an(r,i,c,p),i.child)}function bb(r,i,o,c,p){if(r===null){var x=o.type;return typeof x=="function"&&!Jd(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(Vt=!1,i.pendingProps=c=x,Gf(r,p))(r.flags&131072)!==0&&(Vt=!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?zy(i,x):gf(),_y(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),zy(i,x),va(),i.memoizedState=null):(r!==null&&mu(i,null),gf(),va());return an(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:Pt._currentValue,pool:x},i.memoizedState={baseLanes:o,cachePool:x},r!==null&&mu(i,null),gf(),_y(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,Vn(i),i.memoizedState=null,r}function NN(r,i,o){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ie){if(c.mode==="hidden")return r=Tu(i,c),i.lanes=536870912,Do(null,r);if(yf(i),(r=xt)?(r=Dv(r,er),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:fa!==null?{id:kr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},o=sy(r),o.return=i,i.child=o,nn=i,xt=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(yf(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(Vt||es(r,i,o,!1),p=(o&r.childLanes)!==0,Vt||p){if(c=ct,c!==null&&(k=hx(c,o),k!==0&&k!==x.retryLane))throw x.retryLane=k,ii(r,k),Tn(c,r,k),Uf;Bu(),i=Sb(r,i,o)}else r=x.treeContext,xt=nr(k.nextSibling),nn=i,Ie=!0,ha=null,er=!1,r!==null&&uy(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&&!Vt?(wf(r,i,p),Gr(r,i,p)):(Ie&&c&&ef(i),i.flags|=1,an(r,i,o,p),i.child)}function zb(r,i,o,c,p,x){return ui(i),i.updateQueue=null,o=Ny(i,c,o,p),jy(r),c=kf(),r!==null&&!Vt?(wf(r,i,x),Gr(r,i,x)):(Ie&&c&&ef(i),i.flags|=1,an(r,i,o,x),i.child)}function _b(r,i,o,c,p){if(ui(i),i.stateNode===null){var x=Xi,k=o.contextType;typeof k=="object"&&k!==null&&(x=rn(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?rn(k):Xi,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 F=x.context,Q=o.contextType;k=Xi,typeof Q=="object"&&Q!==null&&(k=rn(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"||(_||F!==k)&&db(i,x,c,k),ga=!1;var G=i.memoizedState;x.state=G,To(i,c,x,p),Eo(),F=i.memoizedState,_||G!==F||ga?(typeof re=="function"&&($f(i,o,re,c),F=i.memoizedState),(M=ga||cb(i,o,M,c,G,F,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=F),x.props=c,x.state=F,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,G=x.context,F=o.contextType,M=Xi,typeof F=="object"&&F!==null&&(M=rn(F)),_=o.getDerivedStateFromProps,(F=typeof _=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==re||G!==M)&&db(i,x,c,M),ga=!1,G=i.memoizedState,x.state=G,To(i,c,x,p),Eo();var K=i.memoizedState;k!==re||G!==K||ga||r!==null&&r.dependencies!==null&&fu(r.dependencies)?(typeof _=="function"&&($f(i,o,_,c),K=i.memoizedState),(Q=ga||cb(i,o,Q,c,G,K,M)||r!==null&&r.dependencies!==null&&fu(r.dependencies))?(F||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,K,M),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,K,M)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=K),x.props=c,x.state=K,x.context=M,c=Q):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&G===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)):an(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,an(r,i,o,c),i.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(r){return{baseLanes:r,cachePool:py()}}function If(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Zn),r}function Nb(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:(Dt.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ie){if(p?ba(i):va(),(r=xt)?(r=Dv(r,er),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:fa!==null?{id:kr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},o=sy(r),o.return=i,i.child=o,nn=i,xt=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 F=k.dgst;k=F,c=Error(a(419)),c.stack="",c.digest=k,So({value:c,source:null,stack:null}),i=Ff(r,i,o)}else if(Vt||es(r,i,o,!1),k=(o&r.childLanes)!==0,Vt||k){if(k=ct,k!==null&&(c=hx(k,o),c!==0&&c!==M.retryLane))throw M.retryLane=c,ii(r,c),Tn(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,xt=nr(_.nextSibling),nn=i,Ie=!0,ha=null,er=!1,r!==null&&uy(i,r),i=Hf(i,c.children),i.flags|=4096);return i}return p?(va(),_=c.fallback,p=i.mode,M=r.child,F=M.sibling,c=Br(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,F!==null?_=Br(F,_):(_=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=Pt._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=py(),_={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=Pn(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 Cb(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=Dt.current,_=(k&2)!==0;if(_?(k=k&1|2,i.flags|=128):k&=1,w(Dt,k),an(r,i,c,o),c=Ie?wo:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Cb(r,o,i);else if(r.tag===19)Cb(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 CN(r,i,o){switch(i.tag){case 3:Pe(i,i.stateNode.containerInfo),pa(i,Pt,r.memoizedState.cache),oi();break;case 27:case 5:pt(i);break;case 4:Pe(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,yf(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?Nb(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(Dt,Dt.current),c)break;return null;case 22:return i.lanes=0,kb(r,i,o,i.pendingProps);case 24:pa(i,Pt,r.memoizedState.cache)}return Gr(r,i,o)}function Tb(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Vt=!0;else{if(!Gf(r,o)&&(i.flags&128)===0)return Vt=!1,CN(r,i,o);Vt=(r.flags&131072)!==0}else Vt=!1,Ie&&(i.flags&1048576)!==0&&ly(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")Jd(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===L){i.tag=11,i=yb(null,i,r,c,o);break e}else if(p===q){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(Pe(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,Pt,c),c!==x.cache&&of(i,[Pt],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=Jn(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,xt=nr(r.firstChild),nn=i,Ie=!0,ha=null,er=!0,o=ky(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}an(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:Ie||(o=i.type,r=i.pendingProps,c=Yu(he.current).createElement(o),c[tn]=i,c[zn]=r,sn(c,o,r),Wt(c),i.stateNode=c):i.memoizedState=Bv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return pt(i),r===null&&Ie&&(c=i.stateNode=Pv(i.type,i.pendingProps,he.current),nn=i,er=!0,p=xt,Ca(i.type)?(jh=p,xt=nr(c.firstChild)):xt=p),an(r,i,i.pendingProps.children,o),Au(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ie&&((p=c=xt)&&(c=aC(c,i.type,i.pendingProps,er),c!==null?(i.stateNode=c,nn=i,xt=nr(c.firstChild),er=!1,p=!0):p=!1),p||ma(i)),pt(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,bN,null,null,o),Xo._currentValue=p),Au(r,i),an(r,i,c,o),i.child;case 6:return r===null&&Ie&&((r=o=xt)&&(o=iC(o,i.pendingProps,er),o!==null?(i.stateNode=o,nn=i,xt=null,r=!0):r=!1),r||ma(i)),null;case 13:return Nb(r,i,o);case 4:return Pe(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=hi(i,null,c,o):an(r,i,c,o),i.child;case 11:return yb(r,i,i.type,i.pendingProps,o);case 7:return an(r,i,i.pendingProps,o),i.child;case 8:return an(r,i,i.pendingProps.children,o),i.child;case 12:return an(r,i,i.pendingProps.children,o),i.child;case 10:return c=i.pendingProps,pa(i,i.type,c.value),an(r,i,c.children,o),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,ui(i),p=rn(p),c=c(p),i.flags|=1,an(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 NN(r,i,o);case 22:return kb(r,i,o,i.pendingProps);case 24:return ui(i),c=rn(Pt),r===null?(p=cf(),p===null&&(p=ct,x=lf(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),i.memoizedState={parent:c,cache:p},ff(i),pa(i,Pt,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,Pt,c)):(c=x.cache,pa(i,Pt,c),c!==p.cache&&of(i,[Pt],o,!0))),an(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?cx():536870912,r.lanes|=i,fs|=i)}function $o(r,i){if(!Ie)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 yt(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 EN(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 yt(i),null;case 1:return yt(i),null;case 3:return o=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Hr(Pt),Ae(),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())),yt(i),null;case 26:var p=i.type,x=i.memoizedState;return r===null?(Yr(i),x!==null?(yt(i),Ab(i,x)):(yt(i),Yf(i,p,null,c,o))):x?x!==r.memoizedState?(Yr(i),yt(i),Ab(i,x)):(yt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&Yr(i),yt(i),Yf(i,p,r,c,o)),null;case 27:if(Rt(i),o=he.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 yt(i),null}r=Y.current,Wi(i)?cy(i):(r=Pv(p,c,o),i.stateNode=r,Yr(i))}return yt(i),null;case 5:if(Rt(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 yt(i),null}if(x=Y.current,Wi(i))cy(i);else{var k=Yu(he.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[tn]=i,x[zn]=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(sn(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 yt(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=he.current,Wi(i)){if(r=i.stateNode,o=i.memoizedProps,c=null,p=nn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[tn]=i,r=!!(r.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Nv(r.nodeValue,o)),r||ma(i,!0)}else r=Yu(r).createTextNode(c),r[tn]=i,i.stateNode=r}return yt(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[tn]=i}else oi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),r=!1}else o=rf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(Vn(i),i):(Vn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return yt(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[tn]=i}else oi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),p=!1}else p=rf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Vn(i),i):(Vn(i),null)}return Vn(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),yt(i),null);case 4:return Ae(),r===null&&gh(i.stateNode.containerInfo),yt(i),null;case 10:return Hr(i.type),yt(i),null;case 19:if(I(Dt),c=i.memoizedState,c===null)return yt(i),null;if(p=(i.flags&128)!==0,x=c.rendering,x===null)if(p)$o(c,!1);else{if(At!==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;)iy(o,r),o=o.sibling;return w(Dt,Dt.current&1|2),Ie&&Zr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&gt()>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&&!Ie)return yt(i),null}else 2*gt()-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=gt(),r.sibling=null,o=Dt.current,w(Dt,p?o&1|2:o&1),Ie&&Zr(i,c.treeForkCount),r):(yt(i),null);case 22:case 23:return Vn(i),xf(),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&&(yt(i),i.subtreeFlags&6&&(i.flags|=8192)):yt(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&&I(ci),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Hr(Pt),yt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function TN(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(Pt),Ae(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Rt(i),null;case 31:if(i.memoizedState!==null){if(Vn(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(Vn(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 I(Dt),null;case 4:return Ae(),null;case 10:return Hr(i.type),null;case 22:case 23:return Vn(i),xf(),r!==null&&I(ci),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Hr(Pt),null;case 25:return null;default:return null}}function Ob(r,i){switch(tf(i),i.tag){case 3:Hr(Pt),Ae();break;case 26:case 27:case 5:Rt(i);break;case 4:Ae();break;case 31:i.memoizedState!==null&&Vn(i);break;case 13:Vn(i);break;case 19:I(Dt);break;case 10:Hr(i.type);break;case 22:case 23:Vn(i),xf(),r!==null&&I(ci);break;case 24:Hr(Pt)}}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(_){nt(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,F=_;try{F()}catch(Q){nt(p,M,Q)}}}c=c.next}while(c!==x)}}catch(Q){nt(i,i.return,Q)}}function Rb(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{Sy(i,o)}catch(c){nt(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){nt(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){nt(r,i,p)}}function Sr(r,i){var o=r.ref,c=r.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){nt(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){nt(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){nt(r,r.return,p)}}function Kf(r,i,o){try{var c=r.stateNode;QN(c,r.type,o,i),c[zn]=i}catch(p){nt(r,r.return,p)}}function $b(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ca(r.type)||r.tag===4}function Xf(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&&Ca(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 Jf(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&&Ca(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(Jf(r,i,o),r=r.sibling;r!==null;)Jf(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&&Ca(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]);sn(i,c,o),i[tn]=r,i[zn]=o}catch(x){nt(r,r.return,x)}}var Kr=!1,Bt=!1,Qf=!1,Pb=typeof WeakSet=="function"?WeakSet:Set,en=null;function AN(r,i){if(r=r.containerInfo,bh=tc,r=Xx(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,F=0,Q=0,re=r,G=null;t:for(;;){for(var K;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),(K=re.firstChild)!==null;)G=re,re=K;for(;;){if(re===r)break t;if(G===o&&++F===p&&(_=k),G===x&&++Q===c&&(M=k),(K=re.nextSibling)!==null)break;re=G,G=re.parentNode}re=K}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,en=i;en!==null;)if(i=en,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,en=r;else for(;en!==null;){switch(i=en,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 ge=pi(o.type,p);r=c.getSnapshotBeforeUpdate(ge,x),c.__reactInternalSnapshotBeforeUpdate=r}catch(je){nt(o,o.return,je)}}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,en=r;break}en=i.return}}function Ub(r,i,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(r,o),c&4&&Lo(5,o);break;case 1:if(Jr(r,o),c&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(k){nt(o,o.return,k)}else{var p=pi(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){nt(o,o.return,k)}}c&64&&Rb(o),c&512&&Po(o,o.return);break;case 3:if(Jr(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{Sy(r,i)}catch(k){nt(o,o.return,k)}}break;case 27:i===null&&c&4&&Lb(o);case 26:case 5:Jr(r,o),i===null&&c&4&&Db(o),c&512&&Po(o,o.return);break;case 12:Jr(r,o);break;case 31:Jr(r,o),c&4&&Zb(r,o);break;case 13:Jr(r,o),c&4&&Ib(r,o),c&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=VN.bind(null,o),sC(r,o))));break;case 22:if(c=o.memoizedState!==null||Kr,!c){i=i!==null&&i.memoizedState!==null||Bt,p=Kr;var x=Bt;Kr=c,(Bt=i)&&!x?Qr(r,o,(o.subtreeFlags&8772)!==0):Jr(r,o),Kr=p,Bt=x}break;case 30:break;default:Jr(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&&Nd(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 vt=null,jn=!1;function Xr(r,i,o){for(o=o.child;o!==null;)Bb(r,i,o),o=o.sibling}function Bb(r,i,o){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(gn,o)}catch{}switch(o.tag){case 26:Bt||Sr(o,i),Xr(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Bt||Sr(o,i);var c=vt,p=jn;Ca(o.type)&&(vt=o.stateNode,jn=!1),Xr(r,i,o),Go(o.stateNode),vt=c,jn=p;break;case 5:Bt||Sr(o,i);case 6:if(c=vt,p=jn,vt=null,Xr(r,i,o),vt=c,jn=p,vt!==null)if(jn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(o.stateNode)}catch(x){nt(o,i,x)}else try{vt.removeChild(o.stateNode)}catch(x){nt(o,i,x)}break;case 18:vt!==null&&(jn?(r=vt,Rv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),vs(r)):Rv(vt,o.stateNode));break;case 4:c=vt,p=jn,vt=o.stateNode.containerInfo,jn=!0,Xr(r,i,o),vt=c,jn=p;break;case 0:case 11:case 14:case 15:ka(2,o,i),Bt||ka(4,o,i),Xr(r,i,o);break;case 1:Bt||(Sr(o,i),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Mb(o,i,c)),Xr(r,i,o);break;case 21:Xr(r,i,o);break;case 22:Bt=(c=Bt)||o.memoizedState!==null,Xr(r,i,o),Bt=c;break;default:Xr(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){nt(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){nt(i,i.return,o)}}function ON(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=ON(r);i.forEach(function(c){if(!o.has(c)){o.add(c);var p=BN.bind(null,r,c);c.then(p,p)}})}function Nn(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(Ca(_.type)){vt=_.stateNode,jn=!1;break e}break;case 5:vt=_.stateNode,jn=!1;break e;case 3:case 4:vt=_.stateNode.containerInfo,jn=!0;break e}_=_.return}if(vt===null)throw Error(a(160));Bb(x,k,p),vt=null,jn=!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 pr=null;function Hb(r,i){var o=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Nn(i,r),Cn(r),c&4&&(ka(3,r,r.return),Lo(3,r),ka(5,r,r.return));break;case 1:Nn(i,r),Cn(r),c&512&&(Bt||o===null||Sr(o,o.return)),c&64&&Kr&&(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=pr;if(Nn(i,r),Cn(r),c&512&&(Bt||o===null||Sr(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[tn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),sn(x,c,o),x[tn]=r,Wt(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),sn(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),sn(x,c,o),p.head.appendChild(x);break;default:throw Error(a(468,c))}x[tn]=r,Wt(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&&Kf(r,r.memoizedProps,o.memoizedProps)}break;case 27:Nn(i,r),Cn(r),c&512&&(Bt||o===null||Sr(o,o.return)),o!==null&&c&4&&Kf(r,r.memoizedProps,o.memoizedProps);break;case 5:if(Nn(i,r),Cn(r),c&512&&(Bt||o===null||Sr(o,o.return)),r.flags&32){p=r.stateNode;try{Ii(p,"")}catch(ge){nt(r,r.return,ge)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Kf(r,p,o!==null?o.memoizedProps:p)),c&1024&&(Qf=!0);break;case 6:if(Nn(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(ge){nt(r,r.return,ge)}}break;case 3:if(Ju=null,p=pr,pr=Ku(i.containerInfo),Nn(i,r),pr=p,Cn(r),c&4&&o!==null&&o.memoizedState.isDehydrated)try{vs(i.containerInfo)}catch(ge){nt(r,r.return,ge)}Qf&&(Qf=!1,Fb(r));break;case 4:c=pr,pr=Ku(r.stateNode.containerInfo),Nn(i,r),Cn(r),pr=c;break;case 12:Nn(i,r),Cn(r);break;case 31:Nn(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Du(r,c)));break;case 13:Nn(i,r),Cn(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Lu=gt()),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,F=Kr,Q=Bt;if(Kr=F||p,Bt=Q||M,Nn(i,r),Bt=Q,Kr=F,Cn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||M||Kr||Bt||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,G=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ge){nt(M,M.return,ge)}}}else if(i.tag===6){if(o===null){M=i;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(ge){nt(M,M.return,ge)}}}else if(i.tag===18){if(o===null){M=i;try{var K=M.stateNode;p?Mv(K,!0):Mv(M.stateNode,!1)}catch(ge){nt(M,M.return,ge)}}}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:Nn(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:Nn(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=Xf(r);Mu(r,x,p);break;case 5:var k=o.stateNode;o.flags&32&&(Ii(k,""),o.flags&=-33);var _=Xf(r);Mu(r,_,k);break;case 3:case 4:var M=o.stateNode.containerInfo,F=Xf(r);Jf(r,F,M);break;default:throw Error(a(161))}}catch(Q){nt(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 Jr(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:Sr(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:Sr(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(F){nt(c,c.return,F)}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++)wy(M[p],_)}catch(F){nt(c,c.return,F)}}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 gr(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:gr(r,i,o,c),p&2048&&Lo(9,i);break;case 1:gr(r,i,o,c);break;case 3:gr(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){gr(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){nt(i,i.return,M)}}else gr(r,i,o,c);break;case 31:gr(r,i,o,c);break;case 13:gr(r,i,o,c);break;case 23:break;case 22:x=i.stateNode,k=i.alternate,i.memoizedState!==null?x._visibility&2?gr(r,i,o,c):Uo(r,i):x._visibility&2?gr(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:gr(r,i,o,c),p&2048&&eh(i.alternate,i);break;default:gr(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,F=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&&F&2048&&Wf(k.alternate,k);break;case 24:us(x,k,_,M,p),p&&F&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&&yC(o,pr,r.memoizedState,r.memoizedProps);break;case 5:cs(r,i,o);break;case 3:case 4:var c=pr;pr=Ku(r.stateNode.containerInfo),cs(r,i,o),pr=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];en=c,Xb(c,r)}Yb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Kb(r),r=r.sibling}function Kb(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];en=c,Xb(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 Xb(r,i){for(;en!==null;){var o=en;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,en=c;else e:for(o=r;en!==null;){c=en;var p=c.sibling,x=c.return;if(Vb(c),c===o){en=null;break e}if(p!==null){p.return=x,en=p;break e}en=x}}}var RN={getCacheForType:function(r){var i=rn(Pt),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return rn(Pt).controller.signal}},MN=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ct=null,Ue=null,Be=0,tt=0,Bn=null,wa=!1,ds=!1,th=!1,Wr=0,At=0,Sa=0,xi=0,nh=0,Zn=0,fs=0,Zo=null,En=null,rh=!1,Lu=0,Jb=0,Pu=1/0,Uu=null,za=null,Kt=0,_a=null,hs=null,ea=0,ah=0,ih=null,Qb=null,Io=0,sh=null;function In(){return(Xe&2)!==0&&Be!==0?Be&-Be:P.T!==null?fh():mx()}function Wb(){if(Zn===0)if((Be&536870912)===0||Ie){var r=Gl;Gl<<=1,(Gl&3932160)===0&&(Gl=262144),Zn=r}else Zn=536870912;return r=Un.current,r!==null&&(r.flags|=32),Zn}function Tn(r,i,o){(r===ct&&(tt===2||tt===9)||r.cancelPendingCommit!==null)&&(ms(r,0),ja(r,Be,Zn,!1)),uo(r,o),((Xe&2)===0||r!==ct)&&(r===ct&&((Xe&2)===0&&(xi|=o),At===4&&ja(r,Be,Zn,!1)),zr(r))}function ev(r,i,o){if((Xe&6)!==0)throw Error(a(327));var c=!o&&(i&127)===0&&(i&r.expiredLanes)===0||lo(r,i),p=c?LN(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&&!DN(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,xi|=x,p=4;break e}x=En,En=p,x!==null&&(En===null?En=x:En.push.apply(En,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,Zn,!wa);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Lu+300-gt(),10<p)){if(ja(c,i,Zn,!wa),Kl(c,0,!0)!==0)break e;ea=i,c.timeoutHandle=Av(tv.bind(null,c,o,En,Uu,rh,i,Zn,xi,fs,wa,x,"Throttled",-0,0),p);break e}tv(c,o,En,Uu,rh,i,Zn,xi,fs,wa,x,null,-0,0)}}break}while(!0);zr(r)}function tv(r,i,o,c,p,x,k,_,M,F,Q,re,G,K){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 ge=(x&62914560)===x?Lu-gt():(x&4194048)===x?Jb-gt():0;if(ge=bC(re,ge),ge!==null){ea=x,r.cancelPendingCommit=ge(uv.bind(null,r,i,x,o,c,p,k,_,M,Q,re,null,G,K)),ja(r,x,k,!F);return}}uv(r,i,x,o,c,p,k,_,M)}function DN(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(!Ln(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&=~xi,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var x=31-ut(p),k=1<<x;c[x]=-1,p&=~k}o!==0&&dx(r,o,i)}function Vu(){return(Xe&6)===0?(Ho(0),!1):!0}function oh(){if(Ue!==null){if(tt===0)var r=Ue.return;else r=Ue,Ir=li=null,Sf(r),as=null,jo=0,r=Ue;for(;r!==null;)Ob(r.alternate,r),r=r.return;Ue=null}}function ms(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,tC(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),ea=0,oh(),ct=r,Ue=o=Br(r.current,null),Be=i,tt=0,Bn=null,wa=!1,ds=lo(r,i),th=!1,fs=Zn=nh=xi=Sa=At=0,En=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-ut(c),x=1<<p;i|=r[p],c&=~x}return Wr=i,ou(),o}function nv(r,i){Re=null,P.H=Mo,i===rs||i===pu?(i=yy(),tt=3):i===df?(i=yy(),tt=4):tt=i===Uf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Bn=i,Ue===null&&(At=1,Eu(r,Jn(i,r.current)))}function rv(){var r=Un.current;return r===null?!0:(Be&4194048)===Be?tr===null:(Be&62914560)===Be||(Be&536870912)!==0?r===tr:!1}function av(){var r=P.H;return P.H=Mo,r===null?Mo:r}function iv(){var r=P.A;return P.A=RN,r}function Bu(){At=4,wa||(Be&4194048)!==Be&&Un.current!==null||(ds=!0),(Sa&134217727)===0&&(xi&134217727)===0||ct===null||ja(ct,Be,Zn,!1)}function lh(r,i,o){var c=Xe;Xe|=2;var p=av(),x=iv();(ct!==r||Be!==i)&&(Uu=null,ms(r,i)),i=!1;var k=At;e:do try{if(tt!==0&&Ue!==null){var _=Ue,M=Bn;switch(tt){case 8:oh(),k=6;break e;case 3:case 2:case 9:case 6:Un.current===null&&(i=!0);var F=tt;if(tt=0,Bn=null,ps(r,_,M,F),o&&ds){k=0;break e}break;default:F=tt,tt=0,Bn=null,ps(r,_,M,F)}}$N(),k=At;break}catch(Q){nv(r,Q)}while(!0);return i&&r.shellSuspendCounter++,Ir=li=null,Xe=c,P.H=p,P.A=x,Ue===null&&(ct=null,Be=0,ou()),k}function $N(){for(;Ue!==null;)sv(Ue)}function LN(r,i){var o=Xe;Xe|=2;var c=av(),p=iv();ct!==r||Be!==i?(Uu=null,Pu=gt()+500,ms(r,i)):ds=lo(r,i);e:do try{if(tt!==0&&Ue!==null){i=Ue;var x=Bn;t:switch(tt){case 1:tt=0,Bn=null,ps(r,i,x,1);break;case 2:case 9:if(gy(x)){tt=0,Bn=null,ov(i);break}i=function(){tt!==2&&tt!==9||ct!==r||(tt=7),zr(r)},x.then(i,i);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:gy(x)?(tt=0,Bn=null,ov(i)):(tt=0,Bn=null,ps(r,i,x,7));break;case 5:var k=null;switch(Ue.tag){case 26:k=Ue.memoizedState;case 5:case 27:var _=Ue;if(k?qv(k):_.stateNode.complete){tt=0,Bn=null;var M=_.sibling;if(M!==null)Ue=M;else{var F=_.return;F!==null?(Ue=F,Zu(F)):Ue=null}break t}}tt=0,Bn=null,ps(r,i,x,5);break;case 6:tt=0,Bn=null,ps(r,i,x,6);break;case 8:oh(),At=6;break e;default:throw Error(a(462))}}PN();break}catch(Q){nv(r,Q)}while(!0);return Ir=li=null,P.H=c,P.A=p,Xe=o,Ue!==null?0:(ct=null,Be=0,ou(),At)}function PN(){for(;Ue!==null&&!Mt();)sv(Ue)}function sv(r){var i=Tb(r.alternate,r,Wr);r.memoizedProps=r.pendingProps,i===null?Zu(r):Ue=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,Be);break;case 11:i=zb(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:Sf(i);default:Ob(o,i),i=Ue=iy(i,Wr),i=Tb(o,i,Wr)}r.memoizedProps=r.pendingProps,i===null?Zu(r):Ue=i}function ps(r,i,o,c){Ir=li=null,Sf(i),as=null,jo=0;var p=i.return;try{if(jN(r,p,i,o,Be)){At=1,Eu(r,Jn(o,r.current)),Ue=null;return}}catch(x){if(p!==null)throw Ue=p,x;At=1,Eu(r,Jn(o,r.current)),Ue=null;return}i.flags&32768?(Ie||c===1?r=!0:ds||(Be&536870912)!==0?r=!1:(wa=r=!0,(c===2||c===9||c===3||c===6)&&(c=Un.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=EN(i.alternate,i,Wr);if(o!==null){Ue=o;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=r}while(i!==null);At===0&&(At=5)}function lv(r,i){do{var o=TN(r.alternate,r);if(o!==null){o.flags&=32767,Ue=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Ue=r;return}Ue=r=o}while(r!==null);At=6,Ue=null}function uv(r,i,o,c,p,x,k,_,M){r.cancelPendingCommit=null;do Iu();while(Kt!==0);if((Xe&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=Kd,x2(r,o,x,k,_,M),r===ct&&(Ue=ct=null,Be=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,ZN(we,function(){return mv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=J.p,J.p=2,k=Xe,Xe|=4;try{AN(r,i,o)}finally{Xe=k,J.p=p,P.T=c}}Kt=1,cv(),dv(),fv()}}function cv(){if(Kt===1){Kt=0;var r=_a,i=hs,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=P.T,P.T=null;var c=J.p;J.p=2;var p=Xe;Xe|=4;try{Hb(i,r);var x=vh,k=Xx(r.containerInfo),_=x.focusedElem,M=x.selectionRange;if(k!==_&&_&&_.ownerDocument&&Kx(_.ownerDocument.documentElement,_)){if(M!==null&&Hd(_)){var F=M.start,Q=M.end;if(Q===void 0&&(Q=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(Q,_.value.length);else{var re=_.ownerDocument||document,G=re&&re.defaultView||window;if(G.getSelection){var K=G.getSelection(),ge=_.textContent.length,je=Math.min(M.start,ge),ot=M.end===void 0?je:Math.min(M.end,ge);!K.extend&&je>ot&&(k=ot,ot=je,je=k);var U=Yx(_,je),$=Yx(_,ot);if(U&&$&&(K.rangeCount!==1||K.anchorNode!==U.node||K.anchorOffset!==U.offset||K.focusNode!==$.node||K.focusOffset!==$.offset)){var H=re.createRange();H.setStart(U.node,U.offset),K.removeAllRanges(),je>ot?(K.addRange(H),K.extend($.node,$.offset)):(H.setEnd($.node,$.offset),K.addRange(H))}}}}for(re=[],K=_;K=K.parentNode;)K.nodeType===1&&re.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var ne=re[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}tc=!!bh,vh=bh=null}finally{Xe=p,J.p=c,P.T=o}}r.current=i,Kt=2}}function dv(){if(Kt===2){Kt=0;var r=_a,i=hs,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=P.T,P.T=null;var c=J.p;J.p=2;var p=Xe;Xe|=4;try{Ub(r,i.alternate,i)}finally{Xe=p,J.p=c,P.T=o}}Kt=3}}function fv(){if(Kt===4||Kt===3){Kt=0,Gt();var r=_a,i=hs,o=ea,c=Qb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,hs=_a=null,hv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(za=null),_d(o),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(gn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=P.T,p=J.p,J.p=2,P.T=null;try{for(var x=r.onRecoverableError,k=0;k<c.length;k++){var _=c[k];x(_.value,{componentStack:_.stack})}}finally{P.T=i,J.p=p}}(ea&3)!==0&&Iu(),zr(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(Kt!==5)return!1;var r=_a,i=ah;ah=0;var o=_d(ea),c=P.T,p=J.p;try{J.p=32>o?32:o,P.T=null,o=ih,ih=null;var x=_a,k=ea;if(Kt=0,hs=_a=null,ea=0,(Xe&6)!==0)throw Error(a(331));var _=Xe;if(Xe|=4,Kb(x.current),qb(x,x.current,k,o),Xe=_,Ho(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(gn,x)}catch{}return!0}finally{J.p=p,P.T=c,hv(r,i)}}function pv(r,i,o){i=Jn(o,i),i=Pf(r.stateNode,i,2),r=ya(r,i,2),r!==null&&(uo(r,2),zr(r))}function nt(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=Jn(o,r),o=gb(2),c=ya(i,o,2),c!==null&&(xb(o,c,i,r),uo(c,2),zr(c));break}}i=i.return}}function uh(r,i,o){var c=r.pingCache;if(c===null){c=r.pingCache=new MN;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=UN.bind(null,r,i,o),i.then(r,r))}function UN(r,i,o){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,ct===r&&(Be&o)===o&&(At===4||At===3&&(Be&62914560)===Be&&300>gt()-Lu?(Xe&2)===0&&ms(r,0):nh|=o,fs===Be&&(fs=0)),zr(r)}function gv(r,i){i===0&&(i=cx()),r=ii(r,i),r!==null&&(uo(r,i),zr(r))}function VN(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),gv(r,o)}function BN(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 ZN(r,i){return Qt(r,i)}var Hu=null,gs=null,ch=!1,Fu=!1,dh=!1,Na=0;function zr(r){r!==gs&&r.next===null&&(gs===null?Hu=gs=r:gs=gs.next=r),Fu=!0,ch||(ch=!0,HN())}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-ut(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=Be,x=Kl(c,c===ct?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 IN(){xv()}function xv(){Fu=ch=!1;var r=0;Na!==0&&eC()&&(r=Na);for(var i=gt(),o=null,c=Hu;c!==null;){var p=c.next,x=yv(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}Kt!==0&&Kt!==5||Ho(r),Na!==0&&(Na=0)}function yv(r,i){for(var o=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var k=31-ut(x),_=1<<k,M=p[k];M===-1?((_&o)===0||(_&c)!==0)&&(p[k]=g2(_,i)):M<=i&&(r.expiredLanes|=_),x&=~_}if(i=ct,o=Be,o=Kl(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,o===0||r===i&&(tt===2||tt===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=ce;break;case 32:o=we;break;case 268435456:o=He;break;default:o=we}return c=bv.bind(null,r),o=Qt(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(Kt!==0&&Kt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(Iu()&&r.callbackNode!==o)return null;var c=Be;return c=Kl(r,r===ct?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(ev(r,c,i),yv(r,gt()),r.callbackNode!=null&&r.callbackNode===o?bv.bind(null,r):null)}function vv(r,i){if(Iu())return null;ev(r,i,!0)}function HN(){nC(function(){(Xe&6)!==0?Qt(W,IN):xv()})}function fh(){if(Na===0){var r=ts;r===0&&(r=ql,ql<<=1,(ql&261888)===0&&(ql=256)),Na=r}return Na}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 FN(r,i,o,c,p){if(i==="submit"&&o&&o.stateNode===p){var x=kv((p[zn]||null).action),k=c.submitter;k&&(i=(i=k[zn]||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(Na!==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],qN=mh.toLowerCase(),GN=mh[0].toUpperCase()+mh.slice(1);mr(qN,"on"+GN)}mr(Wx,"onAnimationEnd"),mr(ey,"onAnimationIteration"),mr(ty,"onAnimationStart"),mr("dblclick","onDoubleClick"),mr("focusin","onFocus"),mr("focusout","onBlur"),mr(uN,"onTransitionRun"),mr(cN,"onTransitionStart"),mr(dN,"onTransitionCancel"),mr(ny,"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(" "),YN=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,F=_.currentTarget;if(_=_.listener,M!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=F;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,F=_.currentTarget,_=_.listener,M!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=F;try{x(p)}catch(Q){su(Q)}p.currentTarget=null,x=M}}}}function Ve(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,xx.forEach(function(o){o!=="selectionchange"&&(YN.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=wC;break;case 8:p=SC;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 xh(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}Ex(function(){var F=x,Q=Rd(o),re=[];e:{var G=ry.get(r);if(G!==void 0){var K=ru,ge=r;switch(r){case"keypress":if(tu(o)===0)break e;case"keydown":case"keyup":K=B2;break;case"focusin":ge="focus",K=Ud;break;case"focusout":ge="blur",K=Ud;break;case"beforeblur":case"afterblur":K=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":K=Ox;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=E2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=H2;break;case Wx:case ey:case ty:K=O2;break;case ny:K=q2;break;case"scroll":case"scrollend":K=N2;break;case"wheel":K=Y2;break;case"copy":case"cut":case"paste":K=M2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Mx;break;case"toggle":case"beforetoggle":K=X2}var je=(i&4)!==0,ot=!je&&(r==="scroll"||r==="scrollend"),U=je?G!==null?G+"Capture":null:G;je=[];for(var $=F,H;$!==null;){var ne=$;if(H=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||H===null||U===null||(ne=ho($,U),ne!=null&&je.push(qo($,ne,H))),ot)break;$=$.return}0<je.length&&(G=new K(G,ge,null,o,Q),re.push({event:G,listeners:je}))}}if((i&7)===0){e:{if(G=r==="mouseover"||r==="pointerover",K=r==="mouseout"||r==="pointerout",G&&o!==Od&&(ge=o.relatedTarget||o.fromElement)&&(Pi(ge)||ge[Li]))break e;if((K||G)&&(G=Q.window===Q?Q:(G=Q.ownerDocument)?G.defaultView||G.parentWindow:window,K?(ge=o.relatedTarget||o.toElement,K=F,ge=ge?Pi(ge):null,ge!==null&&(ot=u(ge),je=ge.tag,ge!==ot||je!==5&&je!==27&&je!==6)&&(ge=null)):(K=null,ge=F),K!==ge)){if(je=Ox,ne="onMouseLeave",U="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(je=Mx,ne="onPointerLeave",U="onPointerEnter",$="pointer"),ot=K==null?G:fo(K),H=ge==null?G:fo(ge),G=new je(ne,$+"leave",K,o,Q),G.target=ot,G.relatedTarget=H,ne=null,Pi(Q)===F&&(je=new je(U,$+"enter",ge,o,Q),je.target=H,je.relatedTarget=ot,ne=je),ot=ne,K&&ge)t:{for(je=KN,U=K,$=ge,H=0,ne=U;ne;ne=je(ne))H++;ne=0;for(var _e=$;_e;_e=je(_e))ne++;for(;0<H-ne;)U=je(U),H--;for(;0<ne-H;)$=je($),ne--;for(;H--;){if(U===$||$!==null&&U===$.alternate){je=U;break t}U=je(U),$=je($)}je=null}else je=null;K!==null&&_v(re,G,K,je,!1),ge!==null&&ot!==null&&_v(re,ot,ge,je,!0)}}e:{if(G=F?fo(F):window,K=G.nodeName&&G.nodeName.toLowerCase(),K==="select"||K==="input"&&G.type==="file")var Ge=Zx;else if(Vx(G))if(Ix)Ge=sN;else{Ge=aN;var Se=rN}else K=G.nodeName,!K||K.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&Ad(F.elementType)&&(Ge=Zx):Ge=iN;if(Ge&&(Ge=Ge(r,F))){Bx(re,Ge,o,Q);break e}Se&&Se(r,G,F),r==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&Td(G,"number",G.value)}switch(Se=F?fo(F):window,r){case"focusin":(Vx(Se)||Se.contentEditable==="true")&&(Gi=Se,Fd=F,ko=null);break;case"focusout":ko=Fd=Gi=null;break;case"mousedown":qd=!0;break;case"contextmenu":case"mouseup":case"dragend":qd=!1,Jx(re,o,Q);break;case"selectionchange":if(lN)break;case"keydown":case"keyup":Jx(re,o,Q)}var De;if(Bd)e:{switch(r){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else qi?Px(r,o)&&(Ze="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Ze="onCompositionStart");Ze&&(Dx&&o.locale!=="ko"&&(qi||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&qi&&(De=Tx()):(da=Q,$d="value"in da?da.value:da.textContent,qi=!0)),Se=Gu(F,Ze),0<Se.length&&(Ze=new Rx(Ze,r,null,o,Q),re.push({event:Ze,listeners:Se}),De?Ze.data=De:(De=Ux(o),De!==null&&(Ze.data=De)))),(De=Q2?W2(r,o):eN(r,o))&&(Ze=Gu(F,"onBeforeInput"),0<Ze.length&&(Se=new Rx("onBeforeInput","beforeinput",null,o,Q),re.push({event:Se,listeners:Ze}),Se.data=De)),FN(re,r,F,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 KN(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,F=_.stateNode;if(_=_.tag,M!==null&&M===c)break;_!==5&&_!==26&&_!==27||F===null||(M=F,p?(F=ho(o,x),F!=null&&k.unshift(qo(o,F,M))):p||(F=ho(o,x),F!=null&&k.push(qo(o,F,M)))),o=o.return}k.length!==0&&r.push({event:i,listeners:k})}var XN=/\r\n?/g,JN=/\u0000|\uFFFD/g;function jv(r){return(typeof r=="string"?r:""+r).replace(XN,`
9
+ `).replace(JN,"")}function Nv(r,i){return i=jv(i),jv(r)===i}function st(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":Jl(r,"class",c);break;case"tabIndex":Jl(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Jl(r,o,c);break;case"style":Nx(r,c,x);break;case"data":if(i!=="object"){Jl(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"&&st(r,i,"name",p.name,p,null),st(r,i,"formEncType",p.formEncType,p,null),st(r,i,"formMethod",p.formMethod,p,null),st(r,i,"formTarget",p.formTarget,p,null)):(st(r,i,"encType",p.encType,p,null),st(r,i,"method",p.method,p,null),st(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&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("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":Ve("beforetoggle",r),Ve("toggle",r),Xl(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":Xl(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=_2.get(o)||o,Xl(r,o,c))}}function yh(r,i,o,c,p,x){switch(o){case"style":Nx(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&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("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(!yx.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[zn]||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,""):Xl(r,o,c)}}}function sn(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",r),Ve("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:st(r,i,x,k,o,null)}}p&&st(r,i,"srcSet",o.srcSet,o,null),c&&st(r,i,"src",o.src,o,null);return;case"input":Ve("invalid",r);var _=x=k=p=null,M=null,F=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":F=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:st(r,i,c,Q,o,null)}}Sx(r,x,_,M,F,k,p,!1);return;case"select":Ve("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:st(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":Ve("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:st(r,i,k,_,o,null)}_x(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":st(r,i,M,c,o,null));return;case"dialog":Ve("beforetoggle",r),Ve("toggle",r),Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":Ve("load",r);break;case"video":case"audio":for(c=0;c<Fo.length;c++)Ve(Fo[c],r);break;case"image":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"embed":case"source":case"link":Ve("error",r),Ve("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(F in o)if(o.hasOwnProperty(F)&&(c=o[F],c!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:st(r,i,F,c,o,null)}return;default:if(Ad(i)){for(Q in o)o.hasOwnProperty(Q)&&(c=o[Q],c!==void 0&&yh(r,i,Q,c,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(c=o[_],c!=null&&st(r,i,_,c,o,null))}function QN(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,F=null,Q=null;for(K in o){var re=o[K];if(o.hasOwnProperty(K)&&re!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":M=re;default:c.hasOwnProperty(K)||st(r,i,K,null,c,re)}}for(var G in c){var K=c[G];if(re=o[G],c.hasOwnProperty(G)&&(K!=null||re!=null))switch(G){case"type":x=K;break;case"name":p=K;break;case"checked":F=K;break;case"defaultChecked":Q=K;break;case"value":k=K;break;case"defaultValue":_=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:K!==re&&st(r,i,G,K,c,re)}}Ed(r,k,_,M,F,Q,x,p);return;case"select":K=k=_=G=null;for(x in o)if(M=o[x],o.hasOwnProperty(x)&&M!=null)switch(x){case"value":break;case"multiple":K=M;default:c.hasOwnProperty(x)||st(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":G=x;break;case"defaultValue":_=x;break;case"multiple":k=x;default:x!==M&&st(r,i,p,x,c,M)}i=_,o=k,c=K,G!=null?Zi(r,!!o,G,!1):!!c!=!!o&&(i!=null?Zi(r,!!o,i,!0):Zi(r,!!o,o?[]:"",!1));return;case"textarea":K=G=null;for(_ in o)if(p=o[_],o.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:st(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":G=p;break;case"defaultValue":K=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&&st(r,i,k,p,c,x)}zx(r,G,K);return;case"option":for(var ge in o)G=o[ge],o.hasOwnProperty(ge)&&G!=null&&!c.hasOwnProperty(ge)&&(ge==="selected"?r.selected=!1:st(r,i,ge,null,c,G));for(M in c)G=c[M],K=o[M],c.hasOwnProperty(M)&&G!==K&&(G!=null||K!=null)&&(M==="selected"?r.selected=G&&typeof G!="function"&&typeof G!="symbol":st(r,i,M,G,c,K));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 je in o)G=o[je],o.hasOwnProperty(je)&&G!=null&&!c.hasOwnProperty(je)&&st(r,i,je,null,c,G);for(F in c)if(G=c[F],K=o[F],c.hasOwnProperty(F)&&G!==K&&(G!=null||K!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(a(137,i));break;default:st(r,i,F,G,c,K)}return;default:if(Ad(i)){for(var ot in o)G=o[ot],o.hasOwnProperty(ot)&&G!==void 0&&!c.hasOwnProperty(ot)&&yh(r,i,ot,void 0,c,G);for(Q in c)G=c[Q],K=o[Q],!c.hasOwnProperty(Q)||G===K||G===void 0&&K===void 0||yh(r,i,Q,G,c,K);return}}for(var U in o)G=o[U],o.hasOwnProperty(U)&&G!=null&&!c.hasOwnProperty(U)&&st(r,i,U,null,c,G);for(re in c)G=c[re],K=o[re],!c.hasOwnProperty(re)||G===K||G==null&&K==null||st(r,i,re,G,c,K)}function Cv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function WN(){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&&_&&Cv(k)){for(k=0,_=p.responseEnd,c+=1;c<o.length;c++){var M=o[c],F=M.startTime;if(F>_)break;var Q=M.transferSize,re=M.initiatorType;Q&&Cv(re)&&(M=M.responseEnd,k+=Q*(M<_?1:(_-F)/(M-F)))}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 eC(){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,tC=typeof clearTimeout=="function"?clearTimeout:void 0,Ov=typeof Promise=="function"?Promise:void 0,nC=typeof queueMicrotask=="function"?queueMicrotask:typeof Ov<"u"?function(r){return Ov.resolve(null).then(r).catch(rC)}:Av;function rC(r){setTimeout(function(){throw r})}function Ca(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),Nd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function aC(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 iC(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 sC(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]);Nd(r)}var rr=new Map,Uv=new Set;function Ku(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ta=J.d;J.d={f:oC,r:lC,D:uC,C:cC,L:dC,m:fC,X:mC,S:hC,M:pC};function oC(){var r=ta.f(),i=Vu();return r||i}function lC(r){var i=Ui(r);i!==null&&i.tag===5&&i.type==="form"?nb(i):ta.r(r)}var xs=typeof document>"u"?null:document;function Vv(r,i,o){var c=xs;if(c&&typeof i=="string"&&i){var p=Kn(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"),sn(i,"link",r),Wt(i),c.head.appendChild(i)))}}function uC(r){ta.D(r),Vv("dns-prefetch",r,null)}function cC(r,i){ta.C(r,i),Vv("preconnect",r,i)}function dC(r,i,o){ta.L(r,i,o);var c=xs;if(c&&r&&i){var p='link[rel="preload"][as="'+Kn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Kn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Kn(o.imageSizes)+'"]')):p+='[href="'+Kn(r)+'"]';var x=p;switch(i){case"style":x=ys(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(Ko(x))||(i=c.createElement("link"),sn(i,"link",r),Wt(i),c.head.appendChild(i)))}}function fC(r,i){ta.m(r,i);var o=xs;if(o&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Kn(c)+'"][href="'+Kn(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(Ko(x)))return}c=o.createElement("link"),sn(c,"link",r),Wt(c),o.head.appendChild(c)}}}function hC(r,i,o){ta.S(r,i,o);var c=xs;if(c&&r){var p=Vi(c).hoistableStyles,x=ys(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))&&Nh(r,o);var M=k=c.createElement("link");Wt(M),sn(M,"link",r),M._p=new Promise(function(F,Q){M.onload=F,M.onerror=Q}),M.addEventListener("load",function(){_.loading|=1}),M.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Xu(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:_},p.set(x,k)}}}function mC(r,i){ta.X(r,i);var o=xs;if(o&&r){var c=Vi(o).hoistableScripts,p=bs(r),x=c.get(p);x||(x=o.querySelector(Ko(p)),x||(r=y({src:r,async:!0},i),(i=rr.get(p))&&Ch(r,i),x=o.createElement("script"),Wt(x),sn(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function pC(r,i){ta.M(r,i);var o=xs;if(o&&r){var c=Vi(o).hoistableScripts,p=bs(r),x=c.get(p);x||(x=o.querySelector(Ko(p)),x||(r=y({src:r,async:!0,type:"module"},i),(i=rr.get(p))&&Ch(r,i),x=o.createElement("script"),Wt(x),sn(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=he.current)?Ku(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=ys(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=ys(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||gC(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 ys(r){return'href="'+Kn(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function Zv(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function gC(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}),sn(i,"link",o),Wt(i),r.head.appendChild(i))}function bs(r){return'[src="'+Kn(r)+'"]'}function Ko(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~="'+Kn(o.href)+'"]');if(c)return i.instance=c,Wt(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"),Wt(c),sn(c,"style",p),Xu(c,o.precedence,r),i.instance=c;case"stylesheet":p=ys(o.href);var x=r.querySelector(Yo(p));if(x)return i.state.loading|=4,i.instance=x,Wt(x),x;c=Zv(o),(p=rr.get(p))&&Nh(c,p),x=(r.ownerDocument||r).createElement("link"),Wt(x);var k=x;return k._p=new Promise(function(_,M){k.onload=_,k.onerror=M}),sn(x,"link",c),i.state.loading|=4,Xu(x,o.precedence,r),i.instance=x;case"script":return x=bs(o.src),(p=r.querySelector(Ko(x)))?(i.instance=p,Wt(p),p):(c=o,(p=rr.get(x))&&(c=y({},o),Ch(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Wt(p),sn(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,Xu(c,o.precedence,r));return i.instance}function Xu(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 Nh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Ch(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Ju=null;function Hv(r,i,o){if(Ju===null){var c=new Map,p=Ju=new Map;p.set(o,c)}else p=Ju,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[tn]||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 xC(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 yC(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=ys(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,Wt(x);return}x=i.ownerDocument||i,c=Zv(c),(p=rr.get(p))&&Nh(c,p),x=x.createElement("link"),Wt(x);var k=x;k._p=new Promise(function(_,M){k.onload=_,k.onerror=M}),sn(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 bC(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*WN());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(vC,r),Wu=null,Qu.call(r))}function vC(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 Xo={$$typeof:N,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function kC(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,F,Q,re){return r=new kC(r,i,o,k,M,F,Q,re,_),i=1,x===!0&&(i|=24),x=Pn(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=Xi,r):Xi}function Kv(r,i,o,c,p,x){p=Yv(p),c.context===null?c.context=p:c.pendingContext=p,c=xa(i),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=ya(r,c,i),o!==null&&(Tn(o,r,i),Co(o,r,i))}function Xv(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){Xv(r,i),(r=r.alternate)&&Xv(r,i)}function Jv(r){if(r.tag===13||r.tag===31){var i=ii(r,67108864);i!==null&&Tn(i,r,67108864),Th(r,67108864)}}function Qv(r){if(r.tag===13||r.tag===31){var i=In();i=zd(i);var o=ii(r,i);o!==null&&Tn(o,r,i),Th(r,i)}}var tc=!0;function wC(r,i,o,c){var p=P.T;P.T=null;var x=J.p;try{J.p=2,Ah(r,i,o,c)}finally{J.p=x,P.T=p}}function SC(r,i,o,c){var p=P.T;P.T=null;var x=J.p;try{J.p=8,Ah(r,i,o,c)}finally{J.p=x,P.T=p}}function Ah(r,i,o,c){if(tc){var p=Oh(c);if(p===null)xh(r,i,c,nc,o),e0(r,c);else if(_C(p,r,i,o,c))c.stopPropagation();else if(e0(r,c),i&4&&-1<zC.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-ut(k);_.entanglements[1]|=M,k&=~M}zr(x),(Xe&6)===0&&(Pu=gt()+500,Ho(0))}}break;case 31:case 13:_=ii(x,2),_!==null&&Tn(_,x,2),Vu(),Th(x,2)}if(x=Oh(c),x===null&&xh(r,i,c,nc,o),x===p)break;p=x}p!==null&&c.stopPropagation()}else xh(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=f(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 ce:return 8;case we:case Ce:return 32;case He:return 268435456;default:return 32}default:return 32}}var Mh=!1,Ea=null,Ta=null,Aa=null,Jo=new Map,Qo=new Map,Oa=[],zC="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":Jo.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&&Jv(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function _C(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 Jo.set(x,Wo(Jo.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,px(r.priority,function(){Qv(o)});return}}else if(i===31){if(i=f(o),i!==null){r.blockedOn=i,px(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&&Jv(i),r.blockedOn=o,!1;i.shift()}return!0}function n0(r,i,o){rc(r)&&o.delete(i)}function jC(){Mh=!1,Ea!==null&&rc(Ea)&&(Ea=null),Ta!==null&&rc(Ta)&&(Ta=null),Aa!==null&&rc(Aa)&&(Aa=null),Jo.forEach(n0),Qo.forEach(n0)}function ac(r,i){r.blockedOn===i&&(r.blockedOn=null,Mh||(Mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jC)))}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),Jo.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[zn]||null;if(typeof x=="function")k||r0(o);else if(k){var _=null;if(x&&x.hasAttribute("formAction")){if(p=x,k=x[zn]||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=In();Kv(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;Kv(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=mx();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 NC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{gn=oc.inject(NC),Yt=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=In(),c=zd(c),p=xa(c),p.callback=null,ya(o,p,c),o=c,i.current.lanes=o,uo(i,o),zr(i),r[Li]=i.current,gh(r),new sc(i)},tl.version="19.2.4",tl}var p0;function LC(){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=$C(),Ph.exports}var PC=LC();var g0="popstate";function UC(e={}){function t(a,s){let{pathname:u,search:l,hash:f}=a.location;return Vm("",{pathname:u,search:l,hash:f},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:wl(s)}return BC(t,n,null,e)}function kt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function br(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function VC(){return Math.random().toString(36).substring(2,10)}function x0(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"?Xs(t):t,state:n,key:t&&t.key||a||VC()}}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 Xs(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 BC(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:u=!1}=a,l=s.history,f="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(){f="POP";let A=g(),E=A==null?null:A-m;m=A,h&&h({action:f,location:j.location,delta:E})}function v(A,E){f="PUSH";let O=Vm(j.location,A,E);m=g()+1;let N=x0(O,m),L=j.createHref(O);try{l.pushState(N,"",L)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(L)}u&&h&&h({action:f,location:j.location,delta:1})}function b(A,E){f="REPLACE";let O=Vm(j.location,A,E);m=g();let N=x0(O,m),L=j.createHref(O);l.replaceState(N,"",L),u&&h&&h({action:f,location:j.location,delta:0})}function S(A){return ZC(A)}let j={get action(){return f},get location(){return e(s,l)},listen(A){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(g0,y),h=A,()=>{s.removeEventListener(g0,y),h=null}},createHref(A){return t(s,A)},createURL:S,encodeLocation(A){let E=S(A);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:b,go(A){return l.go(A)}};return j}function ZC(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),kt(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 IC(e,t,n,!1)}function IC(e,t,n,a){let s=typeof t=="string"?Xs(t):t,u=oa(s.pathname||"/",n);if(u==null)return null;let l=Gw(e);HC(l);let f=null;for(let h=0;f==null&&h<l.length;++h){let m=tE(u);f=WC(l[h],m,a)}return f}function Gw(e,t=[],n=[],a="",s=!1){let u=(l,f,h=s,m)=>{let g={relativePath:m===void 0?l.path||"":m,caseSensitive:l.caseSensitive===!0,childrenIndex:f,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;kt(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]),v=n.concat(g);l.children&&l.children.length>0&&(kt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Gw(l.children,t,v,y,h)),!(l.path==null&&!l.index)&&t.push({path:y,score:JC(y,l.index),routesMeta:v})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))u(l,f);else for(let h of Yw(l.path))u(l,f,!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("/")),f=[];return f.push(...l.map(h=>h===""?u:[u,h].join("/"))),s&&f.push(...l),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function HC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:QC(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var FC=/^:[\w-]+$/,qC=3,GC=2,YC=1,KC=10,XC=-2,y0=e=>e==="*";function JC(e,t){let n=e.split("/"),a=n.length;return n.some(y0)&&(a+=XC),t&&(a+=GC),n.filter(s=>!y0(s)).reduce((s,u)=>s+(FC.test(u)?qC:u===""?YC:KC),a)}function QC(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 WC(e,t,n=!1){let{routesMeta:a}=e,s={},u="/",l=[];for(let f=0;f<a.length;++f){let h=a[f],m=f===a.length-1,g=u==="/"?t:t.slice(u.length)||"/",y=Lc({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),v=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:v}),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"),f=s.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:y},v)=>{if(g==="*"){let S=f[v]||"";l=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const b=f[v];return y&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function eE(e,t=!1,n=!0){br(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,f,h)=>(a.push({paramName:f,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 br(!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"?Xs(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=Xs(e):(s={...e},kt(!s.pathname||!s.pathname.includes("?"),Zh("?","pathname","search",s)),kt(!s.pathname||!s.pathname.includes("#"),Zh("#","pathname","hash",s)),kt(!s.search||!s.search.includes("#"),Zh("#","search","hash",s)));let u=e===""||s.pathname==="",l=u?"/":s.pathname,f;if(l==null)f=n;else{let y=t.length-1;if(!a&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),y-=1;s.pathname=v.join("/")}f=y>=0?t[y]:"/"}let h=rE(s,f),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 Kw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xw(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(Kw)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),f=oa(l.pathname,t);l.origin===u.origin&&f!=null?n=f+l.search+l.hash:s=!0}catch{br(!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 Jw=["POST","PUT","PATCH","DELETE"];new Set(Jw);var dE=["GET",...Jw];new Set(dE);var Js=z.createContext(null);Js.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 qn=z.createContext(null);qn.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 xE(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 yE(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}={}){kt(Qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=z.useContext(qn),{hash:s,pathname:u,search:l}=Ll(e,{relative:t}),f=u;return n!=="/"&&(f=u==="/"?n:ia([n,u])),a.createHref({pathname:f,search:l,hash:s})}function Qs(){return z.useContext($l)!=null}function vr(){return kt(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(qn).static||z.useLayoutEffect(e)}function Yp(){let{isDataRoute:e}=z.useContext($r);return e?OE():vE()}function vE(){kt(Qs(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(Js),{basename:t,navigator:n}=z.useContext(qn),{matches:a}=z.useContext($r),{pathname:s}=vr(),u=JSON.stringify(Fp(a)),l=z.useRef(!1);return tS(()=>{l.current=!0}),z.useCallback((h,m={})=>{if(br(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}=vr(),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){kt(Qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=z.useContext(qn),{matches:l}=z.useContext($r),f=l[l.length-1],h=f?f.params:{},m=f?f.pathname:"/",g=f?f.pathnameBase:"/",y=f&&f.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 v=vr(),b;if(t){let O=typeof t=="string"?Xs(t):t;kt(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.`),b=O}else b=v;let S=b.pathname||"/",j=S;if(g!=="/"){let O=g.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(O.length).join("/")}let A=qw(e,{pathname:j});br(y||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),br(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 E=jE(A&&A.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&&E?z.createElement($l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}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=yE(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(qn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=xE(t.digest);if(a){let s=Ih.get(t);if(s)throw s;let u=Xw(a.location,n);if(Kw&&!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(Js);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);kt(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 f=!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:v,errors:b}=n,S=y.route.loader&&!v.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||S){f=!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,v)=>{let b,S=!1,j=null,A=null;n&&(b=l&&y.route.id?l[y.route.id]:void 0,j=y.route.errorElement||SE,f&&(h<0&&v===0?(aS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,A=null):h===v&&(S=!0,A=y.route.hydrateFallbackElement||null)));let E=t.concat(u.slice(0,v+1)),O=()=>{let N;return b?N=j:S?N=A:y.route.Component?N=z.createElement(y.route.Component,null):y.route.element?N=y.route.element:N=g,z.createElement(_E,{match:y,routeContext:{outlet:g,matches:E,isDataRoute:n!=null},children:N})};return n&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?z.createElement(rS,{location:n.location,revalidation:n.revalidation,component:j,error:b,children:O(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:m}):O()},null)}function Kp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NE(e){let t=z.useContext(Js);return kt(t,Kp(e)),t}function CE(e){let t=z.useContext(ad);return kt(t,Kp(e)),t}function EE(e){let t=z.useContext($r);return kt(t,Kp(e)),t}function Xp(e){let t=EE(e),n=t.matches[t.matches.length-1];return kt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function TE(){return Xp("useRouteId")}function AE(){let e=z.useContext(Gp),t=CE("useRouteError"),n=Xp("useRouteError");return e!==void 0?e:t.errors?.[n]}function OE(){let{router:e}=NE("useNavigate"),t=Xp("useNavigate"),n=z.useRef(!1);return tS(()=>{n.current=!0}),z.useCallback(async(s,u={})=>{br(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,br(!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}){kt(Qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=z.useContext(qn);br(!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}=vr(),f=Yp(),h=qp(e,Fp(u),l,a==="path"),m=JSON.stringify(h);return z.useEffect(()=>{f(JSON.parse(m),{replace:t,state:n,relative:a})},[f,m,a,t,n]),null}function on(e){kt(!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}){kt(!Qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=z.useMemo(()=>({basename:f,navigator:s,static:u,unstable_useTransitions:l,future:{}}),[f,s,u,l]);typeof n=="string"&&(n=Xs(n));let{pathname:m="/",search:g="",hash:y="",state:v=null,key:b="default"}=n,S=z.useMemo(()=>{let j=oa(m,f);return j==null?null:{location:{pathname:j,search:g,hash:y,state:v,key:b},navigationType:a}},[f,m,g,y,v,b,a]);return br(S!=null,`<Router basename="${f}"> 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(qn.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}kt(a.type===on,`[${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>`),kt(!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)?(br(!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 f=e.getAttribute("action");a=f?oa(f,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 f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(a=h?oa(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Ec,s=Hh(e.getAttribute("formenctype"))||Hh(f.getAttribute("enctype"))||Tc,u=new FormData(f,e),!VE()){let{name:m,type:g,value:y}=e;if(g==="image"){let v=m?`${m}.`:"";u.append(`${v}x`,"0"),u.append(`${v}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 Jp(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 XE(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,f=(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)||f(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)||f(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 KE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function XE(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let u=JSON.stringify(KE(s));return n.has(u)||(n.add(u),a.push({key:u,link:s})),a},[])}function sS(){let e=z.useContext(Js);return Jp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function JE(){let e=z.useContext(ad);return Jp(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 Jp(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:f,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:y}=t,v=z.useRef(null);z.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let j=E=>{E.forEach(O=>{l(O.isIntersecting)})},A=new IntersectionObserver(j,{threshold:.5});return v.current&&A.observe(v.current),()=>{A.disconnect()}}},[e]),z.useEffect(()=>{if(a){let j=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(j)}}},[a]);let b=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[u,v,{}]:[u,v,{onFocus:nl(f,b),onBlur:nl(h,S),onMouseEnter:nl(m,b),onMouseLeave:nl(g,S),onTouchStart:nl(y,b)}]:[!1,v,{}]}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=vr(),{future:s,manifest:u,routeModules:l}=oS(),{basename:f}=sS(),{loaderData:h,matches:m}=JE(),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]),v=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,A=!1;if(t.forEach(O=>{let N=u.routes[O.route.id];!N||!N.hasLoader||(!g.some(L=>L.route.id===O.route.id)&&O.route.id in h&&l[O.route.id]?.shouldRevalidate||N.hasClientLoader?A=!0:j.add(O.route.id))}),j.size===0)return[];let E=IE(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return A&&j.size>0&&E.searchParams.set("_routes",t.filter(O=>j.has(O.route.id)).map(O=>O.route.id).join(",")),[E.pathname+E.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),b=z.useMemo(()=>GE(y,u),[y,u]),S=eT(y);return z.createElement(z.Fragment,null,v.map(j=>z.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),b.map(j=>z.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),S.map(({key:j,link:A})=>z.createElement("link",{key:j,nonce:n.nonce,...A,crossOrigin:A.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=UC({window:a,v5Compat:!0}));let u=s.current,[l,f]=z.useState({action:u.action,location:u.location}),h=z.useCallback(m=>{n===!1?f(m):z.startTransition(()=>f(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:f,target:h,to:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},S){let{basename:j,unstable_useTransitions:A}=z.useContext(qn),E=typeof m=="string"&&lS.test(m),O=Xw(m,j);m=O.to;let N=bE(m,{relative:s}),[L,D,R]=QE(a,b),q=lT(m,{replace:l,state:f,target:h,preventScrollReset:g,relative:s,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:A});function V(fe){t&&t(fe),fe.defaultPrevented||q(fe)}let X=z.createElement("a",{...b,...R,href:O.absoluteURL||N,onClick:O.isExternal||u?t:V,ref:nT(S,D),target:h,"data-discover":!E&&n==="render"?"true":void 0});return L&&!E?z.createElement(z.Fragment,null,X,z.createElement(WE,{page:N})):X});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:f,children:h,...m},g){let y=Ll(l,{relative:m.relative}),v=vr(),b=z.useContext(ad),{navigator:S,basename:j}=z.useContext(qn),A=b!=null&&hT(y)&&f===!0,E=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,O=v.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(O=O.toLowerCase(),N=N?N.toLowerCase():null,E=E.toLowerCase()),N&&j&&(N=oa(N,j)||N);const L=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=O===E||!s&&O.startsWith(E)&&O.charAt(L)==="/",R=N!=null&&(N===E||!s&&N.startsWith(E)&&N.charAt(E.length)==="/"),q={isActive:D,isPending:R,isTransitioning:A},V=D?t:void 0,X;typeof a=="function"?X=a(q):X=[a,D?"active":null,R?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(q):u;return z.createElement(Va,{...m,"aria-current":V,className:X,ref:g,style:fe,to:l,viewTransition:f},typeof h=="function"?h(q):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:f,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:j}=z.useContext(qn),A=dT(),E=fT(f,{relative:m}),O=l.toLowerCase()==="get"?"get":"post",N=typeof f=="string"&&lS.test(f),L=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,q=R?.getAttribute("formmethod")||l,V=()=>A(R||D.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:s,state:u,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v});j&&n!==!1?z.startTransition(()=>V()):V()};return z.createElement("form",{ref:S,method:O,action:E,onSubmit:a?h:L,...b,"data-discover":!N&&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(Js);return kt(t,oT(e)),t}function lT(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=Yp(),g=vr(),y=Ll(e,{relative:u});return z.useCallback(v=>{if(UE(v,t)){v.preventDefault();let b=n!==void 0?n:wl(g)===wl(y),S=()=>m(e,{replace:b,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f});h?z.startTransition(()=>S()):S()}},[g,m,y,n,a,t,e,s,u,l,f,h])}var uT=0,cT=()=>`__${String(++uT)}__`;function dT(){let{router:e}=uS("useSubmit"),{basename:t}=z.useContext(qn),n=TE(),a=e.fetch,s=e.navigate;return z.useCallback(async(u,l={})=>{let{action:f,method:h,encType:m,formData:g,body:y}=ZE(u,t);if(l.navigate===!1){let v=l.fetcherKey||cT();await a(v,n,l.action||f,{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||f,{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(qn),a=z.useContext($r);kt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Ll(e||".",{relative:t})},l=vr();if(e==null){u.search=l.search;let f=new URLSearchParams(u.search),h=f.getAll("index");if(h.some(g=>g==="")){f.delete("index"),h.filter(y=>y).forEach(y=>f.append("index",y));let g=f.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);kt(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 xT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const yT=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:u,iconNode:l,...f},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&&!xT(f)&&{"aria-hidden":"true"},...f},[...l.map(([m,g])=>z.createElement(m,g)),...Array.isArray(u)?u:[u]]));const ke=(e,t)=>{const n=z.forwardRef(({className:a,...s},u)=>z.createElement(yT,{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"}]],Cs=ke("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=ke("archive",vT);const wT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],dS=ke("arrow-down",wT);const ST=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zT=ke("arrow-left",ST);const _T=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],fS=ke("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"}]],NT=ke("ban",jT);const CT=[["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=ke("bell",CT);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=ke("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=ke("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=ke("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=ke("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=ke("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=ke("check-check",$T);const PT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Im=ke("check",PT);const UT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],VT=ke("chevron-down",UT);const BT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ZT=ke("chevron-right",BT);const IT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],HT=ke("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=ke("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=ke("circle-x",qT);const GT=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Za=ke("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"}]],KT=ke("copy",YT);const XT=[["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=ke("cpu",XT);const JT=[["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=ke("database",JT);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=ke("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=ke("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=ke("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=ke("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=ke("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=ke("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=ke("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=ke("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=ke("list-checks",dA);const fA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],hA=ke("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=ke("log-out",mA);const pA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],gA=ke("menu",pA);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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],N0=ke("message-square-plus",xA);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"}]],zl=ke("message-square",yA);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=ke("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=ke("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=ke("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=ke("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=ke("play",_A);const NA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],od=ke("plus",NA);const CA=[["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"}]],C0=ke("puzzle",CA);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"}]],xS=ke("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=ke("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=ke("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=ke("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=ke("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=ke("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"}]],yS=ke("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=ke("tag",PA);const VA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],qm=ke("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=ke("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=ke("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=ke("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=ke("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"}]],KA=ke("user",YA);const XA=[["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=ke("webhook",XA);const JA=[["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=ke("wifi-off",JA);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=ke("wifi",WA);const e4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],eg=ke("x",e4);var qh={exports:{}},Gh={};var O0;function t4(){if(O0)return Gh;O0=1;var e=rd();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function f(y,v){var b=v(),S=a({inst:{value:b,getSnapshot:v}}),j=S[0].inst,A=S[1];return u(function(){j.value=b,j.getSnapshot=v,h(j)&&A({inst:j})},[y,b,v]),s(function(){return h(j)&&A({inst:j}),y(function(){h(j)&&A({inst:j})})},[y]),l(b),b}function h(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!n(y,b)}catch{return!0}}function m(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;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=()=>{},fn=aa(),Km=Object,Fe=e=>e===fn,Nr=e=>typeof e=="function",Ia=(e,t)=>({...e,...t}),wS=e=>Nr(e.then),Yh={},uc={},tg="undefined",Pl=typeof window!=tg,Xm=typeof document!=tg,r4=Pl&&"Deno"in window,a4=()=>Pl&&typeof window.requestAnimationFrame!=tg,SS=(e,t)=>{const n=ra.get(e);return[()=>!Fe(t)&&e.get(t)||Yh,a=>{if(!Fe(t)){const s=e.get(t);t in uc||(uc[t]=s),n[5](t,Ia(s,a),s||Yh)}},n[6],()=>!Fe(t)&&t in uc?uc[t]:!Fe(t)&&e.get(t)||Yh]};let Jm=!0;const i4=()=>Jm,[Qm,Wm]=Pl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[aa,aa],s4=()=>{const e=Xm&&document.visibilityState;return Fe(e)||e!=="hidden"},o4=e=>(Xm&&document.addEventListener("visibilitychange",e),Qm("focus",e),()=>{Xm&&document.removeEventListener("visibilitychange",e),Wm("focus",e)}),l4=e=>{const t=()=>{Jm=!0,e()},n=()=>{Jm=!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),Kh=Ls?z.useEffect:z.useLayoutEffect,Xh=typeof navigator<"u"&&navigator.connection,P0=!Ls&&Xh&&(["slow-2g","2g"].includes(Xh.effectiveType)||Xh.saveData),cc=new WeakMap,f4=e=>Km.prototype.toString.call(e),Jh=(e,t)=>e===`[object ${t}]`;let h4=0;const ep=e=>{const t=typeof e,n=f4(e),a=Jh(n,"Date"),s=Jh(n,"RegExp"),u=Jh(n,"Object");let l,f;if(Km(e)===e&&!a&&!s){if(l=cc.get(e),l)return l;if(l=++h4+"~",cc.set(e,l),Array.isArray(e)){for(l="@",f=0;f<e.length;f++)l+=ep(e[f])+",";cc.set(e,l)}if(u){l="#";const h=Km.keys(e).sort();for(;!Fe(f=h.pop());)Fe(e[f])||(l+=f+":"+ep(e[f])+",");cc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},ng=e=>{if(Nr(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 f=u.rollbackOnError;let h=u.optimisticData;const m=v=>typeof f=="function"?f(v):f!==!1,g=u.throwOnError;if(Nr(n)){const v=n,b=[],S=t.keys();for(const j of S)!/^\$(inf|sub)\$/.test(j)&&v(t.get(j)._k)&&b.push(j);return Promise.all(b.map(y))}return y(n);async function y(v){const[b]=ng(v);if(!b)return;const[S,j]=SS(t,b),[A,E,O,N]=ra.get(t),L=()=>{const oe=A[b];return(Nr(u.revalidate)?u.revalidate(S().data,v):u.revalidate!==!1)&&(delete O[b],delete N[b],oe&&oe[0])?oe[0](kS).then(()=>S().data):S().data};if(e.length<3)return L();let D=a,R,q=!1;const V=tp();E[b]=[V,0];const X=!Fe(h),fe=S(),se=fe.data,le=fe._c,ee=Fe(le)?se:le;if(X&&(h=Nr(h)?h(ee,se):h,j({data:h,_c:ee})),Nr(D))try{D=D(ee)}catch(oe){R=oe,q=!0}if(D&&wS(D))if(D=await D.catch(oe=>{R=oe,q=!0}),V!==E[b][0]){if(q)throw R;return D}else q&&X&&m(R)&&(l=!0,j({data:ee,_c:fn}));if(l&&!q)if(Nr(l)){const oe=l(D,ee);j({data:oe,error:fn,_c:fn})}else j({data:D,error:fn,_c:fn});if(E[b][1]=tp(),Promise.resolve(L()).then(()=>{j({_c:fn})}),q){if(g)throw R;return}return D}}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(fn,e);let u=aa;const l=Object.create(null),f=(g,y)=>{const v=l[g]||[];return l[g]=v,v.push(y),()=>v.splice(v.indexOf(y),1)},h=(g,y,v)=>{e.set(g,y);const b=l[g];if(b)for(const S of b)S(y,v)},m=()=>{if(!ra.has(e)&&(ra.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,f]),!Ls)){const g=n.initFocus(setTimeout.bind(fn,U0.bind(fn,a,bS))),y=n.initReconnect(setTimeout.bind(fn,U0.bind(fn,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,f=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Fe(u)&&l>u||setTimeout(a,f,s)},x4=Ym,[_S,On]=p4(new Map),y4=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:x4,isPaused:()=>!1,cache:_S,mutate:On,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=>Nr(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(y4,e),[e])},j4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=ng(t),[,,,f]=ra.get(_S);if(l.startsWith(k4))return n(...u);const h=f[l];return Fe(h)?n(...u):(delete f[l],h)}),a),N4=w4.concat(j4),C4=e=>function(...n){const a=_4(),[s,u,l]=z4(n),f=b4(a,l);let h=e;const{use:m}=f,g=(m||[]).concat(N4);for(let y=g.length;y--;)h=g[y](h);return h(s,u||f.fetcher||null,f)},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(fn),T4=(e,t,n)=>{const{cache:a,compare:s,suspense:u,fallbackData:l,revalidateOnMount:f,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:v,strictServerPrefetchWarning:b}=n,[S,j,A,E]=ra.get(a),[O,N]=ng(e),L=z.useRef(!1),D=z.useRef(!1),R=z.useRef(O),q=z.useRef(t),V=z.useRef(n),X=()=>V.current,fe=()=>X().isVisible()&&X().isOnline(),[se,le,ee,oe]=SS(a,O),ae=z.useRef({}).current,P=Fe(l)?Fe(n.fallback)?fn:n.fallback[O]:l,J=(Me,Ke)=>{for(const at in ae){const Qe=at;if(Qe==="data"){if(!s(Me[Qe],Ke[Qe])&&(!Fe(Me[Qe])||!s(he,Ke[Qe])))return!1}else if(Ke[Qe]!==Me[Qe])return!1}return!0},B=z.useMemo(()=>{const Me=!O||!t?!1:Fe(f)?X().isPaused()||u?!1:h!==!1:f,Ke=Gt=>{const gt=Ia(Gt);return delete gt._k,Me?{isValidating:!0,isLoading:!0,...gt}:gt},at=se(),Qe=oe(),Qt=Ke(at),Gn=at===Qe?Qt:Ke(Qe);let Mt=Qt;return[()=>{const Gt=Ke(se());return J(Gt,Mt)?(Mt.data=Gt.data,Mt.isLoading=Gt.isLoading,Mt.isValidating=Gt.isValidating,Mt.error=Gt.error,Mt):(Mt=Gt,Gt)},()=>Gn]},[a,O]),me=M0.useSyncExternalStore(z.useCallback(Me=>ee(O,(Ke,at)=>{J(at,Ke)||Me()}),[a,O]),B[0],B[1]),T=!L.current,C=S[O]&&S[O].length>0,I=me.data,w=Fe(I)?P&&wS(P)?Qh(P):P:I,Y=me.error,de=z.useRef(w),he=v?Fe(I)?Fe(de.current)?w:de.current:I:w,pe=O&&Fe(w),Pe=!Ls&&M0.useSyncExternalStore(()=>aa,()=>!1,()=>!0);b&&Pe&&!u&&pe&&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 Ae=C&&!Fe(Y)?!1:T&&!Fe(f)?f:X().isPaused()?!1:u?Fe(w)?!1:h:Fe(w)||h,pt=!!(O&&t&&T&&Ae),Rt=Fe(me.isValidating)?pt:me.isValidating,Z=Fe(me.isLoading)?pt:me.isLoading,Ne=z.useCallback(async Me=>{const Ke=q.current;if(!O||!Ke||D.current||X().isPaused())return!1;let at,Qe,Qt=!0;const Gn=Me||{},Mt=!A[O]||!Gn.dedupe,Gt=()=>L0?!D.current&&O===R.current&&L.current:O===R.current,gt={isValidating:!1,isLoading:!1},$i=()=>{le(gt)},W=()=>{const we=A[O];we&&we[1]===Qe&&delete A[O]},ce={isValidating:!0};Fe(se().data)&&(ce.isLoading=!0);try{if(Mt&&(le(ce),n.loadingTimeout&&Fe(se().data)&&setTimeout(()=>{Qt&&Gt()&&X().onLoadingSlow(O,n)},n.loadingTimeout),A[O]=[Ke(N),tp()]),[at,Qe]=A[O],at=await at,Mt&&setTimeout(W,n.dedupingInterval),!A[O]||A[O][1]!==Qe)return Mt&&Gt()&&X().onDiscarded(O),!1;gt.error=fn;const we=j[O];if(!Fe(we)&&(Qe<=we[0]||Qe<=we[1]||we[1]===0))return $i(),Mt&&Gt()&&X().onDiscarded(O),!1;const Ce=se().data;gt.data=s(Ce,at)?Ce:at,Mt&&Gt()&&X().onSuccess(at,O,n)}catch(we){W();const Ce=X(),{shouldRetryOnError:He}=Ce;Ce.isPaused()||(gt.error=we,Mt&&Gt()&&(Ce.onError(we,O,Ce),(He===!0||Nr(He)&&He(we))&&(!X().revalidateOnFocus||!X().revalidateOnReconnect||fe())&&Ce.onErrorRetry(we,O,Ce,pn=>{const $n=S[O];$n&&$n[0]&&$n[0](D0,pn)},{retryCount:(Gn.retryCount||0)+1,dedupe:!0})))}return Qt=!1,$i(),!0},[O,a]),qe=z.useCallback((...Me)=>zS(a,R.current,...Me),[]);if(Kh(()=>{q.current=t,V.current=n,Fe(I)||(de.current=I)}),Kh(()=>{if(!O)return;const Me=Ne.bind(fn,Wh);let Ke=0;X().revalidateOnFocus&&(Ke=Date.now()+X().focusThrottleInterval);const Qe=E4(O,S,(Qt,Gn={})=>{if(Qt==bS){const Mt=Date.now();X().revalidateOnFocus&&Mt>Ke&&fe()&&(Ke=Mt+X().focusThrottleInterval,Me())}else if(Qt==vS)X().revalidateOnReconnect&&fe()&&Me();else{if(Qt==kS)return Ne();if(Qt==D0)return Ne(Gn)}});return D.current=!1,R.current=O,L.current=!0,le({_k:N}),Ae&&(A[O]||(Fe(w)||Ls?Me():d4(Me))),()=>{D.current=!0,Qe()}},[O]),Kh(()=>{let Me;function Ke(){const Qe=Nr(m)?m(se().data):m;Qe&&Me!==-1&&(Me=setTimeout(at,Qe))}function at(){!se().error&&(g||X().isVisible())&&(y||X().isOnline())?Ne(Wh).then(Ke):Ke()}return Ke(),()=>{Me&&(clearTimeout(Me),Me=-1)}},[m,g,y,O]),z.useDebugValue(he),u){if(!L0&&Ls&&pe)throw new Error("Fallback data is required when using Suspense in SSR.");pe&&(q.current=t,V.current=n,D.current=!1);const Me=E[O],Ke=!Fe(Me)&&pe?qe(Me):V0;if(Qh(Ke),!Fe(Y)&&pe)throw Y;const at=pe?Ne(Wh):V0;!Fe(he)&&pe&&(at.status="fulfilled",at.value=!0),Qh(at)}return{mutate:qe,get data(){return ae.data=!0,he},get error(){return ae.error=!0,Y},get isValidating(){return ae.isValidating=!0,Rt},get isLoading(){return ae.isLoading=!0,Z}}},zt=C4(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 xe=_i.getInstance(),_l="/api",rg=e=>{const t=e.startsWith(_l)?e.substring(_l.length):e;return xe.get(t)};function NS(){return zt(`${_l}/status`,rg,{refreshInterval:5e3})}function O4(){return zt(`${_l}/logs`,rg)}function R4(e){return zt(e?`${_l}/logs/${e}?limit=1000`:null,rg,{refreshInterval:2e3})}function CS(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}=NS();return d.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:[d.jsxs("div",{className:"flex gap-4",children:[d.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),d.jsxs("span",{children:["PID: ",e?.pid||"-"]}),d.jsxs("span",{children:["UPTIME: ",e?CS(e.uptimeSeconds):"-"]})]}),d.jsxs("div",{className:"flex gap-4 opacity-70",children:[d.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),d.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 cr=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,ur=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,f=0;do l=t+(n-t)/2,u=DS(l,a,s)-e,u>0?n=l:t=l;while(Math.abs(u)>$4&&++f<L4);return l}function Vl(e,t,n,a){if(e===t&&n===a)return cr;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:cr,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 f={delta:0,timestamp:0,isProcessing:!1};function h(g){l.has(g)&&(m.schedule(g),e()),g(f)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&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(f=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((N,L)=>(N[L]=H4(u),N),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:g,update:y,preRender:v,render:b,postRender:S}=l,j=()=>{const N=la.useManualTiming?s.timestamp:performance.now();n=!1,la.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(N-s.timestamp,F4),1)),s.timestamp=N,s.isProcessing=!0,f.process(s),h.process(s),m.process(s),g.process(s),y.process(s),v.process(s),b.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(j))},A=()=>{n=!0,a=!0,s.isProcessing||e(j)};return{schedule:dc.reduce((N,L)=>{const D=l[L];return N[L]=(R,q=!1,V=!1)=>(n||A(),D.schedule(R,q,V)),N},{}),cancel:N=>{for(let L=0;L<dc.length;L++)l[dc[L]].cancel(N)},state:s,steps:l}}const{schedule:bt,cancel:Ha,state:ln,steps:em}=FS(typeof requestAnimationFrame<"u"?requestAnimationFrame:cr,!0);let Ac;function q4(){Ac=void 0}const kn={now:()=>(Ac===void 0&&kn.set(ln.isProcessing||la.useManualTiming?ln.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},Nl={...Ws,transform:e=>Ar(0,1,e)},fc={...Ws,default:1},pl=e=>Math.round(e*1e5)/1e5,mg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function K4(e){return e==null}const X4=/^(?:#[\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"&&X4.test(n)&&n.startsWith(e)||t&&!K4(n)&&Object.prototype.hasOwnProperty.call(n,t)),YS=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,u,l,f]=a.match(mg);return{[e]:parseFloat(s),[t]:parseFloat(u),[n]:parseFloat(l),alpha:f!==void 0?parseFloat(f):1}},J4=e=>Ar(0,255,e),tm={...Ws,transform:e=>Math.round(J4(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(Nl.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("%"),ve=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(Nl.transform(a))+")"},It={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=It.parse(e);return t.alpha=0,It.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 KS="number",XS="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 Cl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let u=0;const f=t.replace(iO,h=>(It.test(h)?(a.color.push(u),s.push(XS),n.push(It.parse(h))):h.startsWith(aO)?(a.var.push(u),s.push(rO),n.push(h)):(a.number.push(u),s.push(KS),n.push(parseFloat(h))),++u,H0)).split(H0);return{values:n,split:f,indexes:a,types:s}}function JS(e){return Cl(e).values}function QS(e){const{split:t,types:n}=Cl(e),a=t.length;return s=>{let u="";for(let l=0;l<a;l++)if(u+=t[l],s[l]!==void 0){const f=n[l];f===KS?u+=pl(s[l]):f===XS?u+=It.transform(s[l]):u+=s[l]}return u}}const sO=e=>typeof e=="number"?0:It.test(e)?It.getAnimatableNone(e):e;function oO(e){const t=JS(e);return QS(e)(t.map(sO))}const Fa={test:nO,parse:JS,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 f=n<.5?n*(1+t):n+t-n*t,h=2*n-f;s=nm(h,f,e+1/3),u=nm(h,f,e),l=nm(h,f,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 _t=(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=_t(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=>_t(e,t,n)}function gg(e){return typeof e=="number"?fO:typeof e=="string"?hg(e)?Uc:It.test(e)?q0:pO:Array.isArray(e)?WS:typeof e=="object"?It.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]],f=e.values[l]??0;n[s]=f,a[u]++}return n}const pO=(e,t)=>{const n=Fa.createTransformer(t),a=Cl(e),s=Cl(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"?_t(e,t,n):gg(e)(e,t)}const gO=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>bt.update(t,n),stop:()=>Ha(t),now:()=>ln.isProcessing?ln.timestamp:kn.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 xg(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 xO(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(xg(a),Vc);return{type:"keyframes",ease:u=>a.next(s*u).value/t,duration:ur(s)}}const yO=5;function nz(e,t,n){const a=Math.max(t-yO,0);return MS(n-e(a),t-a)}const Ot={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=Ot.duration,bounce:t=Ot.bounce,velocity:n=Ot.velocity,mass:a=Ot.mass}){let s,u,l=1-t;l=Ar(Ot.minDamping,Ot.maxDamping,l),e=Ar(Ot.minDuration,Ot.maxDuration,ur(e)),l<1?(s=m=>{const g=m*l,y=g*e,v=g-n,b=ap(m,l),S=Math.exp(-y);return am-v/b*S},u=m=>{const y=m*l*e,v=y*n+n,b=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)*((v-b)*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 f=5/e,h=kO(s,u,f);if(e=sa(e),isNaN(h))return{stiffness:Ot.stiffness,damping:Ot.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:Ot.velocity,stiffness:Ot.stiffness,damping:Ot.damping,mass:Ot.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:Ot.mass,stiffness:s,damping:u}}else{const n=bO(e);t={...t,...n,mass:Ot.mass},t.isResolvedFromDuration=!0}return t}function Bc(e=Ot.visualDuration,t=Ot.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],f={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:y,velocity:v,isResolvedFromDuration:b}=zO({...n,velocity:-ur(n.velocity||0)}),S=v||0,j=m/(2*Math.sqrt(h*g)),A=l-u,E=ur(Math.sqrt(h/g)),O=Math.abs(A)<5;a||(a=O?Ot.restSpeed.granular:Ot.restSpeed.default),s||(s=O?Ot.restDelta.granular:Ot.restDelta.default);let N;if(j<1){const D=ap(E,j);N=R=>{const q=Math.exp(-j*E*R);return l-q*((S+j*E*A)/D*Math.sin(D*R)+A*Math.cos(D*R))}}else if(j===1)N=D=>l-Math.exp(-E*D)*(A+(S+E*A)*D);else{const D=E*Math.sqrt(j*j-1);N=R=>{const q=Math.exp(-j*E*R),V=Math.min(D*R,300);return l-q*((S+j*E*A)*Math.sinh(V)+D*A*Math.cosh(V))/D}}const L={calculatedDuration:b&&y||null,next:D=>{const R=N(D);if(b)f.done=D>=y;else{let q=D===0?S:0;j<1&&(q=D===0?sa(S):nz(N,D,R));const V=Math.abs(q)<=a,X=Math.abs(l-R)<=s;f.done=V&&X}return f.value=f.done?l:R,f},toString:()=>{const D=Math.min(xg(L),Vc),R=tz(q=>L.next(D*q).value,D,30);return D+"ms "+R},toTransition:()=>{}};return L}Bc.applyToOptions=e=>{const t=xO(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:f,max:h,restDelta:m=.5,restSpeed:g}){const y=e[0],v={done:!1,value:y},b=V=>f!==void 0&&V<f||h!==void 0&&V>h,S=V=>f===void 0?h:h===void 0||Math.abs(f-V)<Math.abs(h-V)?f:h;let j=n*t;const A=y+j,E=l===void 0?A:l(A);E!==A&&(j=E-y);const O=V=>-j*Math.exp(-V/a),N=V=>E+O(V),L=V=>{const X=O(V),fe=N(V);v.done=Math.abs(X)<=m,v.value=v.done?E:fe};let D,R;const q=V=>{b(v.value)&&(D=V,R=Bc({keyframes:[v.value,S(v.value)],velocity:nz(N,V,v.value),damping:s,stiffness:u,restDelta:m,restSpeed:g}))};return q(0),{calculatedDuration:null,next:V=>{let X=!1;return!R&&D===void 0&&(X=!0,L(V),q(V)),D!==void 0&&V>=D?R.next(V-D):(!X&&L(V),v)}}}function _O(e,t,n){const a=[],s=n||la.mix||ez,u=e.length-1;for(let l=0;l<u;l++){let f=s(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||cr:t;f=Ul(h,f)}a.push(f)}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 f=_O(t,a,s),h=f.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 v=jl(e[y],e[y+1],g);return f[y](v)};return n?g=>m(Ar(e[0],e[u-1],g)):m}function NO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=jl(0,t,a);e.push(_t(n,1,s))}}function CO(e){const t=[0];return NO(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:CO(t),e),f=jO(l,t,{ease:Array.isArray(s)?s:TO(t,s)});return{calculatedDuration:e,next:h=>(u.value=f(h),u.done=h>=e,u)}}const AO=e=>e!==null;function yg(e,{repeat:t,repeatType:n="loop"},a,s=1){const u=e.filter(AO),f=s<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!f||a===void 0?u[f]: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!==kn.now()&&this.tick(kn.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:f}=t;const h=n||gl;h!==gl&&typeof f[0]!="number"&&(this.mixKeyframes=Ul(RO,ez(f[0],f[1])),f=[0,100]);const m=h({...t,keyframes:f});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=xg(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:f,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:y,repeatType:v,repeatDelay:b,type:S,onUpdate:j,finalKeyframe:A}=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 E=this.currentTime-m*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,L=a;if(y){const V=Math.min(this.currentTime,s)/f;let X=Math.floor(V),fe=V%1;!fe&&V>=1&&(fe=1),fe===1&&X--,X=Math.min(X,y+1),X%2&&(v==="reverse"?(fe=1-fe,b&&(fe-=b/f)):v==="mirror"&&(L=l)),N=Ar(0,1,fe)*f}const D=O?{done:!1,value:g[0]}:L.next(N);u&&(D.value=u(D.value));let{done:R}=D;!O&&h!==null&&(R=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return q&&S!==ip&&(D.value=yg(g,this.options,A,this.speed)),j&&j(D.value),q&&this.finish(),D}then(t,n){return this.finished.then(t,n)}get duration(){return ur(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ur(t)}get time(){return ur(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(kn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ur(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(kn.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 Ni=e=>e*180/Math.PI,sp=e=>{const t=Ni(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=>Ni(Math.atan(e[1])),skewY:e=>Ni(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,K0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),X0=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:K0,scaleY:X0,scale:e=>(K0(e)+X0(e))/2,rotateX:e=>op(Ni(Math.atan2(e[6],e[5]))),rotateY:e=>op(Ni(Math.atan2(-e[2],e[0]))),rotateZ:Y0,rotate:Y0,skewX:e=>Ni(Math.atan(e[4])),skewY:e=>Ni(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 f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=DO,s=f}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),J0=e=>e===Ws||e===ve,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 Ci=new Set;let cp=!1,dp=!1,fp=!1;function az(){if(dp){const e=Array.from(Ci).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,Ci.forEach(e=>e.complete(fp)),Ci.clear()}function iz(){Ci.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?(Ci.add(this),cp||(cp=!0,bt.read(iz),bt.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 f=a.readValue(n,l);f!=null&&(t[0]=f)}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),Ci.delete(this)}cancel(){this.state==="scheduled"&&(Ci.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:f="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const y=oz(f,s);Array.isArray(y)&&(g.easing=y);const v={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(g,v)}function lz(e){return typeof e=="function"&&"applyToOptions"in e}function KO({type:e,...t}){return lz(e)&&sz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class XO 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:f,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=l,this.options=t,lg(typeof t.type!="string");const m=KO(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=yg(s,this.options,f,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 ur(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ur(t)}get time(){return ur(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,cr):n(this)}}const uz={anticipate:VS,backInOut:US,circInOut:ZS};function JO(e){return e in uz}function QO(e){typeof e.ease=="string"&&JO(e.ease)&&(e.ease=uz[e.ease])}const im=10;class WO extends XO{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 f=new vg({...l,autoplay:!1}),h=Math.max(im,kn.now()-this.startTime),m=Ar(0,im,h-im);n.setWithVelocity(f.sample(Math.max(0,h-m)).value,f.sample(h).value,m),f.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),f=W0(u,t);return!l||!f?!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:f,name:h,motionValue:m,element:g,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=kn.now();const v={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...y},b=g?.KeyframeResolver||kg;this.keyframeResolver=new b(f,(S,j,A)=>this.onKeyframesResolved(S,j,v,!A),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:u,type:l,velocity:f,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=kn.now(),t3(t,u,l,f)||((la.instantAnimations||!h)&&g?.(yg(t,a,n)),t[0]=t[t.length-1],hp(a),a.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>i3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},b=!m&&a3(v),S=v.motionValue?.owner?.current,j=b?new WO({...v,element:S}):new vg(v);j.finished.then(()=>{this.notifyFinished()}).catch(cr),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,f=(l-1)*a;return typeof n=="function"?n(u,l):s===1?u*a:f-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:f,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const Sg=(e,t,n,a={},s,u)=>l=>{const f=wg(a,e)||{},h=f.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(),...f,delay:-m,onUpdate:v=>{t.set(v),f.onUpdate&&f.onUpdate(v)},onComplete:()=>{l(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:u?void 0:s};g3(f)||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=!f.type&&!f.ease,y&&!u&&t.get()!==void 0){const v=p3(g.keyframes,f);if(v!==void 0){bt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return f.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,x3=e=>!isNaN(parseFloat(e));class y3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=kn.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=kn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=x3(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(),bt.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=kn.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 y3(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 f=v3(u[l]);b3(e,l,f)}}const hn=e=>!!(e&&e.getVelocity);function w3(e){return!!(hn(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,...f}=t;const h=u?.reduceMotion;a&&(u=a);const m=[],g=s&&e.animationState&&e.animationState.getState()[s];for(const y in f){const v=e.getValue(y,e.latestValues[y]??null),b=f[y];if(b===void 0||g&&z3(g,y))continue;const S={delay:n,...wg(u||{},y)},j=v.get();if(j!==void 0&&!v.isAnimating&&!Array.isArray(b)&&b===j&&!S.velocity)continue;let A=!1;if(window.MotionHandoffAnimation){const N=mz(e);if(N){const L=window.MotionHandoffAnimation(N,y,bt);L!==null&&(S.startTime=L,A=!0)}}pp(e,y);const E=h??e.shouldReduceMotion;v.start(Sg(y,v,b,E&&fz.has(y)?{type:!1}:S,e,A));const O=v.animation;O&&m.push(O)}return l&&Promise.all(m).then(()=>{bt.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:f}=s;if(f){const[h,m]=f==="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 f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.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(f)}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 N3={test:e=>e==="auto",parse:e=>e},gz=e=>t=>t.test(e),xz=[Ws,ve,Er,La,eO,W4,N3],n1=e=>xz.find(gz(e));function C3(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,xp={...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:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:Nl,originX:I0,originY:I0,originZ:ve},jg={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,inset:ve,insetBlock:ve,insetBlockStart:ve,insetBlockEnd:ve,insetInline:ve,insetInlineStart:ve,insetInlineEnd:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,paddingBlock:ve,paddingBlockStart:ve,paddingBlockEnd:ve,paddingInline:ve,paddingInlineStart:ve,paddingInlineEnd:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,marginBlock:ve,marginBlockStart:ve,marginBlockEnd:ve,marginInline:ve,marginInlineStart:ve,marginInlineEnd:ve,fontSize:ve,backgroundPositionX:ve,backgroundPositionY:ve,...O3,zIndex:r1,fillOpacity:Nl,strokeOpacity:Nl,numOctaves:r1},R3={...jg,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:xp,WebkitFilter:xp},yz=e=>R3[e];function bz(e,t){let n=yz(e);return n!==xp&&(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)&&Cl(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 v=dz(y,n.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!fz.has(a)||t.length!==2)return;const[s,u]=t,l=n1(s),f=n1(u),h=Z0(s),m=Z0(u);if(h!==m&&Ba[a]){this.needsMeasurement=!0;return}if(l!==f)if(J0(l)&&J0(f))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||C3(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(([f,h])=>{t.getValue(f).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 yp(e){return OS(e)&&"offsetHeight"in e}const{schedule:Ng}=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=f=>{if(!a1(f))return;const{target:h}=f,m=t(h,f);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(f=>{f.addEventListener("pointerenter",l,s)}),u}const Sz=(e,t)=>t?e===t?!0:Sz(e,t.parentElement):!1,Cg=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 Cg(e)&&!kz()}function Z3(e,t,n={}){const[a,s,u]=wz(e,n),l=f=>{const h=f.currentTarget;if(!s1(f))return;Oc.add(h);const m=t(h,f),g=(b,S)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),Oc.has(h)&&Oc.delete(h),s1(b)&&typeof m=="function"&&m(b,{success:S})},y=b=>{g(b,h===window||h===document||n.useGlobalTarget||Sz(h,b.target))},v=b=>{g(b,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",v,s)};return a.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",l,s),yp(f)&&(f.addEventListener("focus",m=>B3(m,s)),!zz(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function _z(e){return OS(e)&&"ownerSVGElement"in e}function I3(e){return _z(e)&&e.tagName==="svg"}const H3=[...xz,It,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}),Jt=()=>({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 Nz(e){return!!(cd(e)||e.variants)}function K3(e,t,n){for(const a in t){const s=t[a],u=n[a];if(hn(s))e.addValue(a,s);else if(hn(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 Cz(e){Zc=e}function X3(){return Zc}class J3{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:u,visualState:l},f={}){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 v=kn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,bt.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=f,this.blockInitialAnimation=!!u,this.isControllingVariants=cd(n),this.isVariantNode=Nz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in y){const b=y[v];h[v]!==void 0&&hn(b)&&b.set(h[v])}}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&&bt.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):Jt()}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=K3(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,hn(a)?a.get():a)),hn(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&&!hn(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(){Ng.render(this.render)}}class Ez extends J3{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;hn(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 f=0;f<s;f++){u=n[f],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=_t(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],f=e[l];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(l.startsWith("scale")?1:0);else{const m=parseFloat(f);h=l.startsWith("scale")?m===1:m===0}if(!h||n){const m=vz(f,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,f=!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")?(f=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=aR(t,e.transform,n):a.transform&&(a.transform="none")),f){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(ve.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,f=n.x.scale*t.x,h=n.y.scale*t.y;s[0+l]/=f,s[1+l]/=h;const m=_t(f,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)(hn(a[l])||s&&hn(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,...f},h,m,g){if(Ag(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:v}=e;y.transform&&(v.transform=y.transform,delete y.transform),(v.transform||y.transformOrigin)&&(v.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const b of dR)y[b]!==void 0&&(v[b]=y[b],delete y[b]);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(hn(e[s])||hn(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=Jt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(to.has(n)){const a=yz(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 xR(e){return t=>Promise.all(t.map(({animation:n,options:a})=>j3(e,n,a)))}function yR(e){let t=xR(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:v,transitionEnd:b,...S}=y;m={...m,...S,...b}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Vz(e.parent)||{},y=[],v=new Set;let b={},S=1/0;for(let A=0;A<gR;A++){const E=pR[A],O=n[E],N=m[E]!==void 0?m[E]:g[E],L=El(N),D=E===h?O.isActive:null;D===!1&&(S=A);let R=N===g[E]&&N!==m[E]&&L;if(R&&a&&e.manuallyAnimateOnMount&&(R=!1),O.protectedKeys={...b},!O.isActive&&D===null||!N&&!O.prevProp||ud(N)||typeof N=="boolean")continue;const q=bR(O.prevProp,N);let V=q||E===h&&O.isActive&&!R&&L||A>S&&L,X=!1;const fe=Array.isArray(N)?N:[N];let se=fe.reduce(s(E),{});D===!1&&(se={});const{prevResolvedValues:le={}}=O,ee={...le,...se},oe=J=>{V=!0,v.has(J)&&(X=!0,v.delete(J)),O.needsAnimating[J]=!0;const B=e.getValue(J);B&&(B.liveStyle=!1)};for(const J in ee){const B=se[J],me=le[J];if(b.hasOwnProperty(J))continue;let T=!1;mp(B)&&mp(me)?T=!Bz(B,me):T=B!==me,T?B!=null?oe(J):v.add(J):B!==void 0&&v.has(J)?oe(J):O.protectedKeys[J]=!0}O.prevProp=N,O.prevResolvedValues=se,O.isActive&&(b={...b,...se}),a&&e.blockInitialAnimation&&(V=!1);const ae=R&&q;V&&(!ae||X)&&y.push(...fe.map(J=>{const B={type:E};if(typeof J=="string"&&a&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:me}=e,T=Ps(me,J);if(me.enteringChildren&&T){const{delayChildren:C}=T.transition||{};B.delay=cz(me.enteringChildren,e,C)}}return{animation:J,options:B}}))}if(v.size){const A={};if(typeof m.initial!="boolean"){const E=Ps(e,Array.isArray(m.initial)?m.initial[0]:m.initial);E&&E.transition&&(A.transition=E.transition)}v.forEach(E=>{const O=e.getBaseTarget(E),N=e.getValue(E);N&&(N.liveStyle=!0),A[E]=O??null}),y.push({animation:A})}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 f(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:f,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 yi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function g1(){return{animate:yi(!0),whileInView:yi(),whileHover:yi(),whileTap:yi(),whileDrag:yi(),whileFocus:yi(),exit:yi()}}function x1(e,t){e.min=t.min,e.max=t.max}function xr(e,t){x1(e.x,t.x),x1(e.y,t.y)}function y1(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 wn(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=_t(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),e.translate=_t(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 xl(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+wn(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+wn(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=_t(l.min,l.max,t/100)-l.min),typeof t!="number")return;let f=_t(u.min,u.max,a);e===u&&(f-=t),e.min=w1(e.min,t,n,f,s),e.max=w1(e.max,t,n,f,s)}function S1(e,t,[n,a,s],u,l){jR(e,t[n],t[a],t[s],t.scale,u,l)}const NR=["x","scaleX","originX"],CR=["y","scaleY","originY"];function z1(e,t,n,a){S1(e.x,t,NR,n?n.x:void 0,a?a.x:void 0),S1(e.y,t,CR,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 N1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fz(e,t){return N1(e.x,t.x)&&N1(e.y,t.y)}function C1(e){return wn(e.x)/wn(e.y)}function E1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function sr(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:v,skewX:b,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),y&&(a+=`rotateX(${y}deg) `),v&&(a+=`rotateY(${v}deg) `),b&&(a+=`skewX(${b}deg) `),S&&(a+=`skewY(${S}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(a+=`scale(${f}, ${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"||ve.test(e);function OR(e,t,n,a,s,u){s?(e.opacity=_t(0,n.opacity??1,RR(a)),e.opacityExit=_t(t.opacity??1,0,MR(a))):u&&(e.opacity=_t(t.opacity??1,n.opacity??1,a));for(let l=0;l<AR;l++){const f=`border${qz[l]}Radius`;let h=O1(t,f),m=O1(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||A1(h)===A1(m)?(e[f]=Math.max(_t(T1(h),T1(m),a),0),(Er.test(m)||Er.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||n.rotate)&&(e.rotate=_t(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,cr);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=hn(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=kn.now(),a=({timestamp:s})=>{const u=s-n;u>=t&&(Ha(a),e(u-t))};return bt.setup(a,!0),()=>Ha(a)}function Rc(e){return hn(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:f}=t.options;f===!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",bt,!(s||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&Yz(a)}function Kz({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(l={},f=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(KR),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=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.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,f){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new cg),this.eventHandlers.get(l).add(f)}notifyListeners(l,...f){const h=this.eventHandlers.get(l);h&&h.notify(...f)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=_z(l)&&!I3(l),this.instance=l;const{layoutId:f,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||f)&&(this.isLayoutDirty=!0),e){let g,y=0;const v=()=>this.root.updateBlockedByResize=!1;bt.read(()=>{y=window.innerWidth}),e(l,()=>{const b=window.innerWidth;b!==y&&(y=b,this.root.updateBlockedByResize=!0,g&&g(),g=PR(v,250),Mc.hasAnimatedSinceResize&&(Mc.hasAnimatedSinceResize=!1,this.nodes.forEach(D1)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:v,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||eM,{onLayoutAnimationStart:j,onLayoutAnimationComplete:A}=m.getProps(),E=!this.targetLayout||!Fz(this.targetLayout,b),O=!y&&v;if(this.options.layoutRoot||this.resumeFrom||O||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...wg(S,"layout"),onPlay:j,onComplete:A};(m.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(g,O)}else y||D1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}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(XR),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:f,layout:h}=this.options;if(f===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 f=kn.now();ln.delta=Ar(0,1e3/60,f-ln.timestamp),ln.timestamp=f,ln.isProcessing=!0,em.update.process(ln),em.preRender.process(ln),em.render.process(ln),ln.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ng.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qR),this.sharedNodes.forEach(JR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,bt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){bt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!wn(this.snapshot.measuredBox.x)&&!wn(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=Jt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(f=!1),f&&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,f=this.projectionDelta&&!Hz(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(f||Si(this.latestValues)||g)&&(s(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return l&&(h=this.removeTransform(h)),tM(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Jt();const f=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(nM))){const{scroll:m}=this.root;m&&(As(f.x,m.offset.x),As(f.y,m.offset.y))}return f}removeElementScroll(l){const f=Jt();if(xr(f,l),this.scroll?.wasRoot)return f;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&&xr(f,l),As(f.x,g.offset.x),As(f.y,g.offset.y))}return f}applyTransform(l,f=!1){const h=Jt();xr(h,l);for(let m=0;m<this.path.length;m++){const g=this.path[m];!f&&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 f=Jt();xr(f,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=Jt(),y=m.measurePageBox();xr(g,y),z1(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return Si(this.latestValues)&&z1(f,this.latestValues),f}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!==ln.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;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=ln.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Jt(),this.targetWithTransforms=Jt()),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):xr(this.target,this.layout.layoutBox),Oz(this.target,this.targetDelta)):xr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.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,f,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jt(),this.relativeTargetOrigin=Jt(),Hc(this.relativeTargetOrigin,f,h),xr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),f=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===ln.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;xr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,v=this.treeScale.y;eR(this.layoutCorrected,this.treeScale,this.path,f),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Jt());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(y1(this.prevProjectionDelta.x,this.projectionDelta.x),y1(this.prevProjectionDelta.y,this.projectionDelta.y)),xl(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==v||!E1(this.projectionDelta.x,this.prevProjectionDelta.x)||!E1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ts(),this.projectionDelta=Ts(),this.projectionDeltaWithTransform=Ts()}setAnimationOrigin(l,f=!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=!f;const v=Jt(),b=h?h.source:void 0,S=this.layout?this.layout.source:void 0,j=b!==S,A=this.getStack(),E=!A||A.members.length<=1,O=!!(j&&!E&&this.options.crossfade===!0&&!this.path.some(WR));this.animationProgress=0;let N;this.mixTargetDelta=L=>{const D=L/1e3;$1(y.x,l.x,D),$1(y.y,l.y,D),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hc(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QR(this.relativeTarget,this.relativeTargetOrigin,v,D),N&&ER(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=Jt()),xr(N,this.relativeTarget)),j&&(this.animationValues=g,OR(g,m,this.latestValues,D,O,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},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=bt.update(()=>{Mc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hs(0)),this.currentAnimation=DR(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),l.onUpdate&&l.onUpdate(f)},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:f,target:h,layout:m,latestValues:g}=l;if(!(!f||!h||!m)){if(this!==l&&this.layout&&m&&Xz(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Jt();const y=wn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+y;const v=wn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+v}xr(f,h),Os(f,g),xl(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(l,f){this.sharedNodes.has(l)||this.sharedNodes.set(l,new UR),this.sharedNodes.get(l).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):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:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let f=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)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,f){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(f?.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(f?.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:v,y:b}=this.projectionDelta;l.transformOrigin=`${v.origin*100}% ${b.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:A,isCSSVariable:E}=wp[S],O=y==="none"?g[S]:j(g[S],m);if(A){const N=A.length;for(let L=0;L<N;L++)l[A[L]]=O}else E?this.options.visualElement.renderState.vars[S]=O:l[S]=O}this.options.layoutId&&(l.pointerEvents=m===this?Rc(f?.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"?sr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],v=wn(y);y.min=n[g].min,y.max=y.min+v}):Xz(s,t.layoutBox,n)&&sr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],v=wn(n[g]);y.max=y.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+v)});const l=Ts();xl(l,n,t.layoutBox);const f=Ts();u?xl(f,e.applyTransform(a,!0),t.measuredBox):xl(f,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:v}=g;if(y&&v){const b=Jt();Hc(b,t.layoutBox,y.layoutBox);const S=Jt();Hc(S,n,v.layoutBox),Fz(b,S)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:f,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 KR(e){e.calcProjection()}function XR(e){e.resetSkewAndRotation()}function JR(e){e.removeLeadSnapshot()}function $1(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function L1(e,t,n,a){e.min=_t(t.min,n.min,a),e.max=_t(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:cr;function V1(e){e.min=U1(e.min),e.max=U1(e.max)}function tM(e){V1(e.x),V1(e.y)}function Xz(e,t,n){return e==="position"||e==="preserve-aspect"&&!zR(C1(t),C1(n),.2)}function nM(e){return e!==e.root&&e.scroll?.wasRoot}const rM=Kz({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},Jz=Kz({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=yp(a)&&a.offsetWidth||0,u=yp(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),f=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:v,top:b,left:S,right:j,bottom:A}=f.current;if(t||!l.current||!y||!v)return;const E=n==="left"?`left: ${S}`:`right: ${j}`,O=a==="bottom"?`bottom: ${A}`:`top: ${b}`;l.current.dataset.motionPopId=u;const N=document.createElement("style");h&&(N.nonce=h);const L=s??document.head;return L.appendChild(N),N.sheet&&N.sheet.insertRule(`
12
+ [data-motion-pop-id="${u}"] {
13
+ position: absolute !important;
14
+ width: ${y}px !important;
15
+ height: ${v}px !important;
16
+ ${E}px !important;
17
+ ${O}px !important;
18
+ }
19
+ `),()=>{L.contains(N)&&L.removeChild(N)}},[t]),d.jsx(sM,{isPresent:t,childRef:l,sizeRef:f,children:z.cloneElement(e,{ref:g})})}const lM=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:u,mode:l,anchorX:f,anchorY:h,root:m})=>{const g=ig(uM),y=z.useId();let v=!0,b=z.useMemo(()=>(v=!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&&v&&(b={...b}),z.useMemo(()=>{g.forEach((S,j)=>g.set(j,!1))},[n]),z.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=d.jsx(oM,{isPresent:n,anchorX:f,anchorY:h,root:m,children:e})),d.jsx(ld.Provider,{value:b,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:f="left",anchorY:h="top",root:m})=>{const[g,y]=Qz(l),v=z.useMemo(()=>Z1(e),[e]),b=l&&!g?[]:v.map(hc),S=z.useRef(!0),j=z.useRef(v),A=ig(()=>new Map),E=z.useRef(new Set),[O,N]=z.useState(v),[L,D]=z.useState(v);TS(()=>{S.current=!1,j.current=v;for(let V=0;V<L.length;V++){const X=hc(L[V]);b.includes(X)?(A.delete(X),E.current.delete(X)):A.get(X)!==!0&&A.set(X,!1)}},[L,b.length,b.join("-")]);const R=[];if(v!==O){let V=[...v];for(let X=0;X<L.length;X++){const fe=L[X],se=hc(fe);b.includes(se)||(V.splice(X,0,fe),R.push(fe))}return u==="wait"&&R.length&&(V=R),D(Z1(V)),N(v),null}const{forceRender:q}=z.useContext(ag);return d.jsx(d.Fragment,{children:L.map(V=>{const X=hc(V),fe=l&&!g?!1:v===L||b.includes(X),se=()=>{if(E.current.has(X))return;if(E.current.add(X),A.has(X))A.set(X,!0);else return;let le=!0;A.forEach(ee=>{ee||(le=!1)}),le&&(q?.(),D(j.current),l&&y?.(),a&&a())};return d.jsx(lM,{isPresent:fe,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:u,root:m,onExitComplete:fe?void 0:se,anchorX:f,anchorY:h,children:V},X)})})},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])};Cz(e),H1=!0}function e_(){return dM(),X3()}function fM(e){const t=e_();for(const n in e)t[n]={...t[n],...e[n]};Cz(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 xM(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)!hn(t[a])&&!Dz(a,n)&&(e[a]=t[a])}function yM({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,yM(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,v=z.useMemo(()=>hn(y)?y.get():y,[y]);return z.createElement(e,{...g,children:v})}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 v in u)s[v]=Rc(u[v]);let{initial:l,animate:f}=e;const h=cd(e),m=Nz(e);t&&m&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),f===void 0&&(f=t.animate));let g=n?n.initial===!1:!1;g=g||l===!1;const y=g?f:l;if(y&&typeof y!="boolean"&&!ud(y)){const v=Array.isArray(y)?y:[y];for(let b=0;b<v.length;b++){const S=zg(e,v[b]);if(S){const{transitionEnd:j,transition:A,...E}=S;for(const O in E){let N=E[O];if(Array.isArray(N)){const L=g?N.length-1:0;N=N[L]}N!==null&&(s[O]=N)}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}),NM=a_({scrapeMotionValuesFromProps:Uz,createRenderState:r_}),CM=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 f=l(u);typeof f=="function"&&(s.current=f)}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),f=z.useContext(Wz),h=z.useContext(ld),m=z.useContext(Rg).reducedMotion,g=z.useRef(null),y=z.useRef(!1);a=a||f.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 v=g.current,b=z.useContext(i_);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&AM(g.current,n,s,b);const S=z.useRef(!1);z.useInsertionEffect(()=>{v&&S.current&&v.update(n,h)});const j=n[hz],A=z.useRef(!!j&&!window.MotionHandoffIsComplete?.(j)&&window.MotionHasOptimisedAnimation?.(j));return TS(()=>{y.current=!0,v&&(S.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),A.current&&v.animationState&&v.animationState.animateChanges())}),z.useEffect(()=>{v&&(!A.current&&v.animationState&&v.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(j)}),A.current=!1),v.enteringChildren=void 0)}),v}function AM(e,t,n,a){const{layoutId:s,layout:u,drag:l,dragConstraints:f,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||f&&fl(f),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?NM:jM;function f(m,g){let y;const v={...z.useContext(Rg),...m,layoutId:OM(m)},{isStatic:b}=v,S=xM(m),j=l(m,b);if(!b&&ES){RM();const A=MM(v);y=A.MeasureLayout,S.visualElement=TM(e,j,v,s,A.ProjectionNode,u)}return d.jsxs(dd.Provider,{value:S,children:[y&&S.visualElement?d.jsx(y,{visualElement:S.visualElement,...v}):null,SM(e,m,EM(j,S.visualElement,g),j,b,t,u)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=z.forwardRef(f);return h[CM]=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=yR(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=>Cg(t)&&e(t,Zl(t));function yl(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:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=hm(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,j=ZM(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!j)return;const{point:A}=b,{timestamp:E}=ln;this.history.push({...A,timestamp:E});const{onStart:O,onMove:N}=this.handlers;S||(O&&O(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,b)},this.handlePointerMove=(b,S)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=fm(S,this.transformPagePoint),bt.update(this.updatePoint,!0)},this.handlePointerUp=(b,S)=>{this.end();const{onEnd:j,onSessionEnd:A,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=hm(b.type==="pointercancel"?this.lastMoveEventInfo:fm(S,this.transformPagePoint),this.history);this.startEvent&&j&&j(b,O),A&&A(b,O)},!Cg(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}=ln;this.history=[{...g,timestamp:y}];const{onSessionStart:v}=n;v&&v(t,hm(m,this.history)),this.removeListeners=Ul(yl(this.contextWindow,"pointermove",this.handlePointerMove),yl(this.contextWindow,"pointerup",this.handlePointerUp),yl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}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),bt.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=ur(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?_t(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?_t(n,e,a.max):Math.min(e,n)),e}function K1(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:K1(e.x,n,s),y:K1(e.y,t,a)}}function X1(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:X1(e.x,t.x),y:X1(e.y,t.y)}}function YM(e,t){let n=.5;const a=wn(e),s=wn(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 KM(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 XM(e=Sp){return e===!1?e=0:e===!0&&(e=Sp),{x:J1(e,"left","right"),y:J1(e,"top","bottom")}}function J1(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 JM=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=Jt(),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,v)=>{this.stopAnimation();const{drag:b,dragPropagation:S,onDragStart:j}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=P3(b),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sr(E=>{let O=this.getAxisMotionValue(E).get()||0;if(Er.test(O)){const{projection:N}=this.visualElement;if(N&&N.layout){const L=N.layout.layoutBox[E];L&&(O=wn(L)*(parseFloat(O)/100))}}this.originPoint[E]=O}),j&&bt.postRender(()=>j(y,v)),pp(this.visualElement,"transform");const{animationState:A}=this.visualElement;A&&A.setActive("whileDrag",!0)},f=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:j,onDrag:A}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=v;if(S&&this.currentDirection===null){this.currentDirection=WM(E),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),A&&A(y,v)},h=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>sr(y=>this.getAnimationState(y)==="paused"&&this.getAxisMotionValue(y).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new l_(t,{onSessionStart:u,onStart:l,onMove:f,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:f}=this.getProps();f&&bt.postRender(()=>f(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=XM(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&sr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=KM(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 f=n(Q3(l));this.hasMutatedConstraints=!!f,f&&(l=Tz(f))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=sr(g=>{if(!mc(g,n,this.currentDirection))return;let y=h&&h[g]||{};l&&(y={min:0,max:0});const v=s?200:1e6,b=s?40:1e7,S={type:"inertia",velocity:a?t[g]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(f)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return pp(this.visualElement,t),a.start(Sg(t,a,0,n,this.visualElement,!1))}stopAnimation(){sr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sr(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){sr(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:f}=s.layout.layoutBox[n],h=u.get()||0;u.set(t[n]-_t(l,f,.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};sr(l=>{const f=this.getAxisMotionValue(l);if(f&&this.constraints!==!1){const h=f.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(),sr(l=>{if(!mc(l,t,null))return;const f=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];f.set(_t(h,m,s[l]))})}addListeners(){if(!this.visualElement.current)return;JM.set(this.visualElement,this);const t=this.visualElement.current,n=yl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),y=h.target,v=y!==t&&zz(y);m&&g&&!v&&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()),bt.read(a);const l=Tl(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(sr(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(),f&&f()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:u=!1,dragElastic:l=Sp,dragMomentum:f=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:u,dragElastic:l,dragMomentum:f}}}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=cr,this.removeListeners=cr,this.controls=new QM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cr}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&&bt.postRender(()=>e(t,n))};class tD extends Ya{constructor(){super(...arguments),this.removePointerDownListener=cr}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&&bt.postRender(()=>s(u,l))}}}mount(){this.removePointerDownListener=yl(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()||bt.postRender(()=>{const f=l.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ng.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 d.jsx(nD,{...e,layoutGroup:a,switchLayoutGroup:z.useContext(i_),isPresent:t,safeToRemove:n})}const rD={pan:{Feature:tD},drag:{Feature:eD,ProjectionNode:Jz,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&&bt.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&&bt.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]},f=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(),v=m?g:y;v&&v(h)};return cD(this.node.current,l,f)}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:Jz,MeasureLayout:c_}},gD={...VM,...mD,...rD,...pD},dt=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 xD({onMenuClick:e,isDark:t,toggleTheme:n}){return d.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:[d.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.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?d.jsx(yS,{className:"w-5 h-5"}):d.jsx(gS,{className:"w-5 h-5"})}),d.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:d.jsx(gA,{className:"w-6 h-6"})})]})]})}const Pa={list:()=>xe.get("/webhooks"),get:e=>xe.get(`/webhooks/${e}`),create:e=>xe.post("/webhooks",e),update:(e,t)=>xe.put(`/webhooks/${e}`,t),delete:e=>xe.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 xe.get(`/webhooks/notifications${n}`)},unreadCount:()=>xe.get("/webhooks/notifications/unread-count"),markRead:e=>xe.post("/webhooks/notifications/read",{ids:e})},Or=({open:e,onOpenChange:t,children:n})=>e?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),d.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})=>d.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:d.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),Rr=({children:e})=>d.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})=>d.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),yD=({className:e,children:t})=>d.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),lr=({className:e,variant:t="default",size:n="default",...a})=>{const f=`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 d.jsx("button",{className:f,...a})};function bD({isOpen:e,onClose:t,onConfirm:n}){return d.jsx(Or,{open:e,onOpenChange:t,children:d.jsxs(Fs,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(Rr,{children:d.jsx(Mr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),d.jsxs("div",{children:[d.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."}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[d.jsx(lr,{variant:"outline",onClick:t,children:"Cancel"}),d.jsx(lr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Ns={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 xe.get(`/tasks${n}`)},get:e=>xe.get(`/tasks/${e}`),stats:()=>xe.get("/tasks/stats"),retry:e=>xe.post(`/tasks/${e}/retry`,{}),cancel:e=>xe.post(`/tasks/${e}/cancel`,{})};function vD({children:e}){const t=vr(),[n,a]=z.useState(()=>{const A=localStorage.getItem("theme");return A?A==="dark":!0}),[s,u]=z.useState(!1),[l,f]=z.useState(!1),{logout:h}=d_(),{data:m}=zt("/webhooks/notifications/unread-count",()=>Pa.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:y}=zt("/tasks/stats",()=>Ns.stats(),{refreshInterval:5e3}),v=(y?.pending??0)+(y?.running??0),b=async()=>{try{await xe.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(A){console.error("Failed to restart:",A),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:C0,label:"MCP Servers",path:"/mcp-servers"},{icon:Zm,label:"Usage Stats",path:"/stats"},{icon:Pc,label:"Model Pricing",path:"/model-pricing"},{icon:Cs,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:C0,label:"MCP Servers",path:"/mcp-servers"},{icon:Zm,label:"Usage Stats",path:"/stats"},{icon:Pc,label:"Model Pricing",path:"/model-pricing"},{icon:Cs,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 d.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:[d.jsx(xD,{onMenuClick:()=>u(!0),isDark:n,toggleTheme:()=>a(!n)}),d.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",d.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:[d.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[d.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.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?d.jsx(yS,{className:"w-4 h-4"}):d.jsx(gS,{className:"w-4 h-4"})})]}),d.jsxs("nav",{className:"flex-1 p-2 space-y-0.5",children:[S.map(A=>{const E=t.pathname===A.path;return d.jsxs(Va,{to:A.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${E?"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:[d.jsx(A.icon,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:A.label}),A.path==="/tasks"&&v>0&&d.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:v>99?"99+":v})]},A.path)}),d.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:[d.jsxs("div",{className:"relative shrink-0",children:[d.jsx(Sl,{className:"w-4 h-4"}),g>0&&d.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})]}),d.jsx("span",{children:"Notifications"}),g>0&&d.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")]}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>f(!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:[d.jsx(E0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Restart"})]})}),d.jsx("div",{className:"p-2",children:d.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:[d.jsx(j0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Logout"})]})})]}),d.jsx(cM,{children:s&&d.jsxs(dt.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),d.jsxs(dt.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:A=>A.stopPropagation(),children:[d.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[d.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.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:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[j.map(A=>{const E=t.pathname===A.path;return d.jsxs(Va,{to:A.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${E?"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:[d.jsx(A.icon,{className:"w-5 h-5"}),d.jsx("span",{children:A.label}),A.path==="/tasks"&&v>0&&d.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:v>99?"99+":v})]},A.path)}),d.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:[d.jsxs("div",{className:"relative",children:[d.jsx(Sl,{className:"w-5 h-5"}),g>0&&d.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})]}),d.jsx("span",{children:"Notifications"}),g>0&&d.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})]})]}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>{f(!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:[d.jsx(E0,{className:"w-5 h-5"}),d.jsx("span",{children:"Restart"})]})}),d.jsx("div",{className:"p-2",children:d.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:[d.jsx(j0,{className:"w-5 h-5"}),d.jsx("span",{children:"Logout"})]})})]})]})}),d.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[d.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),d.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"})]})]}),d.jsx(M4,{}),d.jsx(bD,{isOpen:l,onClose:()=>f(!1),onConfirm:b})]})}const kD={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},zi=({title:e,value:t,icon:n,subValue:a})=>d.jsxs(dt.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:[d.jsxs("div",{className:"flex justify-between items-start mb-4",children:[d.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),d.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"})]}),d.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&d.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),_p={fetchUsageStats:async()=>xe.get("/stats/usage"),fetchGroupedUsageStats:async()=>xe.get("/stats/usage/grouped")};function wD(){const{data:e}=zt("/api/stats/usage",_p.fetchUsageStats,{refreshInterval:5e3});return d.jsxs(d.Fragment,{children:[d.jsx(zi,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:dS,subValue:"Tokens processed"}),d.jsx(zi,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:fS,subValue:"Tokens generated"})]})}function SD(){const{data:e}=NS(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return d.jsxs(dt.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[d.jsxs(dt.div,{variants:n,children:[d.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight mb-2",children:"SYSTEM STATUS"}),d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"Overview of the Morpheus agent runtime."})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[d.jsx(zi,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:Cs,subValue:e?`PID: ${e.pid}`:""}),d.jsx(zi,{title:"Uptime",value:e?CS(e.uptimeSeconds):"-",icon:Za,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),d.jsx(zi,{title:"Version",value:e?.projectVersion||"-",icon:pS,subValue:`Node ${e?.nodeVersion||"-"}`}),d.jsx(zi,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:RT,subValue:"LLM Inference Engine"}),d.jsx(zi,{title:"Model",value:e?.llmModel||"-",icon:AT,subValue:"Active Model"}),d.jsx(wD,{})]})]})}const zD=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:u,onRenameSession:l,isOpen:f,toggleSidebar:h})=>{const[m,g]=z.useState(null),[y,v]=z.useState(""),b=z.useRef(null);z.useEffect(()=>{m&&b.current&&b.current.focus()},[m]);const S=(O,N)=>{O.stopPropagation(),g(N.id),v(N.title||"Untitled Session")},j=O=>{O?.stopPropagation(),m&&y.trim()&&(l(m,y.trim()),g(null))},A=O=>{O?.stopPropagation(),g(null)},E=O=>{O.key==="Enter"?j():O.key==="Escape"&&A()};return f?d.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:[d.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:[d.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),d.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:d.jsx(zl,{size:18})})]}),d.jsx("div",{className:"p-4",children:d.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:[d.jsx(N0,{size:18}),d.jsx("span",{children:"New Chat"})]})}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(O=>d.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:[d.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===O.id?d.jsx("div",{className:"flex items-center gap-1 w-full",onClick:N=>N.stopPropagation(),children:d.jsx("input",{ref:b,type:"text",value:y,onChange:N=>v(N.target.value),onKeyDown:E,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"})}):d.jsxs(d.Fragment,{children:[d.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"}),d.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(O.started_at).toLocaleString()})]})}),d.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===O.id?d.jsxs(d.Fragment,{children:[d.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:d.jsx(Im,{size:14})}),d.jsx("button",{onClick:A,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:d.jsx(eg,{size:14})})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:N=>S(N,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:d.jsx(Wp,{size:14})}),d.jsx("button",{onClick:N=>{N.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:d.jsx(kT,{size:14})}),d.jsx("button",{onClick:N=>{N.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:d.jsx(Ti,{size:14})})]})})]},O.id)),e.length===0&&d.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):d.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:[d.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:d.jsx(zl,{})}),d.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),d.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:d.jsx(N0,{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,ND=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CD={};function nk(e,t){return(CD.jsx?ND: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 Mn{constructor(t,n){this.attribute=n,this.property=t}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let AD=0;const $e=Ri(),Zt=Ri(),Np=Ri(),ue=Ri(),ht=Ri(),Us=Ri(),Hn=Ri();function Ri(){return 2**++AD}const Cp=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Zt,commaOrSpaceSeparated:Hn,commaSeparated:Us,number:ue,overloadedBoolean:Np,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),gm=Object.keys(Cp);class $g extends Mn{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&Cp[l])===Cp[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:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:ht,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:ue,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:ht,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Zt,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:ht,accessKey:ht,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:ht,autoFocus:$e,autoPlay:$e,blocking:ht,capture:null,charSet:null,checked:$e,cite:null,className:ht,cols:ue,colSpan:null,content:null,contentEditable:Zt,controls:$e,controlsList:ht,coords:ue|Us,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:Np,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:ht,height:ue,hidden:Np,high:ue,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:ht,itemRef:ht,itemScope:$e,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:ue,pattern:null,ping:ht,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:ht,required:$e,reversed:$e,rows:ue,rowSpan:ue,sandbox:ht,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Zt,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:$e,useMap:null,value:Zt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,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:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Zt,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:$e,disableRemotePlayback:$e,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:Hn,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:ht,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:$e,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:Hn,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:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,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:Hn,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:Hn,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:Hn,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()}}),x_=no({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:p_}),y_=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=Mn;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_,x_,y_],"html"),Lg=f_([h_,RD,g_,x_,y_],"svg");function BD(e){return e.join(" ").trim()}var ks={},xm,sk;function ZD(){if(sk)return xm;sk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
20
+ `,m="/",g="*",y="",v="comment",b="declaration";function S(A,E){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];E=E||{};var O=1,N=1;function L(oe){var ae=oe.match(t);ae&&(O+=ae.length);var P=oe.lastIndexOf(h);N=~P?oe.length-P:N+oe.length}function D(){var oe={line:O,column:N};return function(ae){return ae.position=new R(oe),X(),ae}}function R(oe){this.start=oe,this.end={line:O,column:N},this.source=E.source}R.prototype.content=A;function q(oe){var ae=new Error(E.source+":"+O+":"+N+": "+oe);if(ae.reason=oe,ae.filename=E.source,ae.line=O,ae.column=N,ae.source=A,!E.silent)throw ae}function V(oe){var ae=oe.exec(A);if(ae){var P=ae[0];return L(P),A=A.slice(P.length),ae}}function X(){V(n)}function fe(oe){var ae;for(oe=oe||[];ae=se();)ae!==!1&&oe.push(ae);return oe}function se(){var oe=D();if(!(m!=A.charAt(0)||g!=A.charAt(1))){for(var ae=2;y!=A.charAt(ae)&&(g!=A.charAt(ae)||m!=A.charAt(ae+1));)++ae;if(ae+=2,y===A.charAt(ae-1))return q("End of comment missing");var P=A.slice(2,ae-2);return N+=2,L(P),A=A.slice(ae),N+=2,oe({type:v,comment:P})}}function le(){var oe=D(),ae=V(a);if(ae){if(se(),!V(s))return q("property missing ':'");var P=V(u),J=oe({type:b,property:j(ae[0].replace(e,y)),value:P?j(P[0].replace(e,y)):y});return V(l),J}}function ee(){var oe=[];fe(oe);for(var ae;ae=le();)ae!==!1&&(oe.push(ae),fe(oe));return oe}return X(),ee()}function j(A){return A?A.replace(f,y):y}return xm=S,xm}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),f=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;f?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()},f=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,f):m=m.replace(a,f),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(f,h){f&&h&&(l[(0,n.camelCase)(f,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 mn 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 f=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=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.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}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const Ug={}.hasOwnProperty,KD=new Map,XD=/[A-Z]/g,JD=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 f=Bg(e,t);return JD.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!TD(h):!0})),S_(e,l,u,t),Vg(l,f),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),f=Bg(e,t);return S_(e,l,u,t),Vg(l,f),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,f){const m=Array.isArray(l.children)?n:t;return f?m(u,l,f):m(u,l)}}function o5(e,t){return n;function n(a,s,u,l){const f=Array.isArray(u.children),h=Pg(a);return t(s,u,l,f,{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,f]=u;e.tableCellAlignToStyle&&l==="align"&&typeof f=="string"&&QD.has(t.tagName)?a=f:n[l]=f}}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 f=l.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.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 f=a.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.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:KD;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 f=w_(e,u,l);f!==void 0&&n.push(f)}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 mn("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 f=nk(s[u])?{type:"Identifier",name:s[u]}:{type:"Literal",value:s[u]};l=l?{type:"MemberExpression",object:l,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}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 mn("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(XD,m5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function m5(e){return"-"+e.toLowerCase()}const ym={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(x5(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 x5(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 or(e,t){return e.length>0?(Dr(e,e.length,0,t),e):t}const mk={}.hasOwnProperty;function y5(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 f=u[l];v5(s[l],Array.isArray(f)?f:f?[f]:[])}}}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 Cr=Ka(/[A-Za-z]/),Fn=Ka(/[\dA-Za-z]/),k5=Ka(/[#-'*+\--9=?A-Z^-~]/);function Tp(e){return e!==null&&(e<32||e===127)}const Ap=Ka(/\d/),w5=Ka(/[\dA-Fa-f]/),S5=Ka(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function Rn(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const z5=Ka(new RegExp("\\p{P}|\\p{S}","u")),_5=Ka(/\s/);function Ka(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&&Fn(e.charCodeAt(n+1))&&Fn(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 f=e.charCodeAt(n+1);u<56320&&f>56319&&f<57344?(l=String.fromCharCode(u,f),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 mt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return Je(h)?(e.enter(n),f(h)):t(h)}function f(h){return Je(h)&&u++<s?(e.consume(h),f):(e.exit(n),t(h))}}const j5={tokenize:N5};function N5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),mt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(f)}function l(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ee(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),l)}}const C5={tokenize:E5},pk={tokenize:T5};function E5(e){const t=this,n=[];let a=0,s,u,l;return f;function f(N){if(a<n.length){const L=n[a];return t.containerState=L[1],e.attempt(L[0].continuation,h,m)(N)}return m(N)}function h(N){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&O();const L=t.events.length;let D=L,R;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){R=t.events[D][1].end;break}E(a);let q=L;for(;q<t.events.length;)t.events[q][1].end={...R},q++;return Dr(t.events,D+1,0,t.events.slice(L)),t.events.length=q,m(N)}return f(N)}function m(N){if(a===n.length){if(!s)return v(N);if(s.currentConstruct&&s.currentConstruct.concrete)return S(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pk,g,y)(N)}function g(N){return s&&O(),E(a),v(N)}function y(N){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(N)}function v(N){return t.containerState={},e.attempt(pk,b,S)(N)}function b(N){return a++,n.push([t.currentConstruct,t.containerState]),v(N)}function S(N){if(N===null){s&&O(),E(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),j(N)}function j(N){if(N===null){A(e.exit("chunkFlow"),!0),E(0),e.consume(N);return}return Ee(N)?(e.consume(N),A(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(N),j)}function A(N,L){const D=t.sliceStream(N);if(L&&D.push(null),N.previous=u,u&&(u.next=N),u=N,s.defineSkip(N.start),s.write(D),t.parser.lazy[N.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 q=t.events.length;let V=q,X,fe;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(X){fe=t.events[V][1].end;break}X=!0}for(E(a),R=q;R<t.events.length;)t.events[R][1].end={...fe},R++;Dr(t.events,V+1,0,t.events.slice(q)),t.events.length=R}}function E(N){let L=n.length;for(;L-- >N;){const D=n[L];t.containerState=D[1],D[0].exit.call(t,e)}n.length=N}function O(){s.write([null]),u=void 0,s=void 0,t.containerState._closeFlow=void 0}}function T5(e,t,n){return mt(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||Rn(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,f,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},v={...e[n][1].start};xk(y,-h),xk(v,h),l={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},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:{...f.end}},e[a][1].end={...l.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=or(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=or(m,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=or(m,Ig(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=or(m,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=or(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"),f(h)}function f(h){if(h===u)return e.consume(h),f;const m=e.exit("attentionSequence"),g=gk(h),y=!g||g===2&&s||n.includes(h),v=!s||s===2&&g||n.includes(a);return m._open=!!(u===42?y:y&&(s||!v)),m._close=!!(u===42?v:v&&(g||!y)),t(h)}}function xk(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(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(b){return Cr(b)?(e.consume(b),l):b===64?n(b):m(b)}function l(b){return b===43||b===45||b===46||Fn(b)?(a=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||Fn(b))&&a++<32?(e.consume(b),f):(a=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Tp(b)?n(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),g):k5(b)?(e.consume(b),m):n(b)}function g(b){return Fn(b)?y(b):n(b)}function y(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||Fn(b))&&a++<63){const S=b===45?v:y;return e.consume(b),S}return n(b)}}const fd={partial:!0,tokenize:D5};function D5(e,t,n){return a;function a(u){return Je(u)?mt(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||Ee(u)?t(u):n(u)}}const N_={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 f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),u}return n(l)}function u(l){return Je(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 Je(l)?mt(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt(N_,t,n)(l)}}function P5(e){e.exit("blockQuote")}const C_={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 f;function f(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=Fn,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 v=e.exit("characterReferenceValue");return l===Fn&&!Zg(a.sliceSerialize(v))?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 yk={partial:!0,tokenize:Z5},bk={concrete:!0,name:"codeFenced",tokenize:B5};function B5(e,t,n){const a=this,s={partial:!0,tokenize:D};let u=0,l=0,f;return h;function h(R){return m(R)}function m(R){const q=a.events[a.events.length-1];return u=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===f?(l++,e.consume(R),g):l<3?n(R):(e.exit("codeFencedFenceSequence"),Je(R)?mt(e,y,"whitespace")(R):y(R))}function y(R){return R===null||Ee(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(yk,j,L)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(R)):Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mt(e,b,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),v)}function b(R){return R===null||Ee(R)?y(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(R)):R===96&&R===f?n(R):(e.consume(R),S)}function j(R){return e.attempt(s,L,A)(R)}function A(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),E}function E(R){return u>0&&Je(R)?mt(e,O,"linePrefix",u+1)(R):O(R)}function O(R){return R===null||Ee(R)?e.check(yk,j,L)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||Ee(R)?(e.exit("codeFlowValue"),O(R)):(e.consume(R),N)}function L(R){return e.exit("codeFenced"),t(R)}function D(R,q,V){let X=0;return fe;function fe(ae){return R.enter("lineEnding"),R.consume(ae),R.exit("lineEnding"),se}function se(ae){return R.enter("codeFencedFence"),Je(ae)?mt(R,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):le(ae)}function le(ae){return ae===f?(R.enter("codeFencedFenceSequence"),ee(ae)):V(ae)}function ee(ae){return ae===f?(X++,R.consume(ae),ee):X>=l?(R.exit("codeFencedFenceSequence"),Je(ae)?mt(R,oe,"whitespace")(ae):oe(ae)):V(ae)}function oe(ae){return ae===null||Ee(ae)?(R.exit("codeFencedFence"),q(ae)):V(ae)}}}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"),mt(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):Ee(m)?e.attempt(I5,l,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ee(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),f)}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):Ee(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):mt(e,u,"linePrefix",5)(l)}function u(l){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(l):Ee(l)?s(l):n(l)}}const q5={name:"codeText",previous:Y5,resolve:G5,tokenize:K5};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 K5(e,t,n){let a=0,s,u;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(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)):Ee(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||Ee(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 X5{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,f,h,m;const g=new X5(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,J5(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},f=g.slice(s,n),f.unshift(a),g.splice(s,n-s+1,f))}}return Dr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function J5(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 f=l.events,h=[],m={};let g,y,v=-1,b=n,S=0,j=0;const A=[j];for(;b;){for(;e.get(++s)[1]!==b;);u.push(s),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),y&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=n;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(j=v+1,A.push(j),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):A.pop(),v=A.length;v--;){const E=f.slice(A[v],A[v+1]),O=u.pop();h.push([O,O+E.length-1]),e.splice(O,2,E)}for(h.reverse(),v=-1;++v<h.length;)m[S+h[v][0]]=S+h[v][1],S+=h[v][1]-h[v][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(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?u(f):Ee(f)?e.check(W5,l,u)(f):(e.consume(f),s)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function l(f){return e.consume(f),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"),mt(e,u,"linePrefix")}function u(l){if(l===null||Ee(l))return n(l);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function A_(e,t,n,a,s,u,l,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return y;function y(E){return E===60?(e.enter(a),e.enter(s),e.enter(u),e.consume(E),e.exit(u),v):E===null||E===32||E===41||Tp(E)?n(E):(e.enter(a),e.enter(l),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function v(E){return E===62?(e.enter(u),e.consume(E),e.exit(u),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(f),v(E)):E===null||E===60||Ee(E)?n(E):(e.consume(E),E===92?S:b)}function S(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function j(E){return!g&&(E===null||E===41||Rn(E))?(e.exit("chunkString"),e.exit(f),e.exit(l),e.exit(a),t(E)):g<m&&E===40?(e.consume(E),g++,j):E===41?(e.consume(E),g--,j):E===null||E===32||E===40||Tp(E)?n(E):(e.consume(E),E===92?A:j)}function A(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function O_(e,t,n,a,s,u){const l=this;let f=0,h;return m;function m(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(u),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(u),e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):Ee(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||Ee(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!Je(b)),b===92?v:y)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,y):y(b)}}function R_(e,t,n,a,s,u){let l;return f;function f(v){return v===34||v===39||v===40?(e.enter(a),e.enter(s),e.consume(v),e.exit(s),l=v===40?41:v,h):n(v)}function h(v){return v===l?(e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):(e.enter(u),m(v))}function m(v){return v===l?(e.exit(u),h(l)):v===null?n(v):Ee(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),mt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Ee(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:g)}function y(v){return v===l||v===92?(e.consume(v),g):g(v)}}function vl(e,t){let n;return a;function a(s){return Ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Je(s)?mt(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(b){return e.enter("definition"),l(b)}function l(b){return O_.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=Vs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return Rn(b)?vl(e,m)(b):m(b)}function m(b){return A_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(a$,y,y)(b)}function y(b){return Je(b)?mt(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Ee(b)?(e.exit("definition"),a.parser.defined.push(s),t(b)):n(b)}}function s$(e,t,n){return a;function a(f){return Rn(f)?vl(e,s)(f):n(f)}function s(f){return R_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Je(f)?mt(e,l,"whitespace")(f):l(f)}function l(f){return f===null||Ee(f)?t(f):n(f)}}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 Ee(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||Rn(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ee(g)?(e.exit("atxHeading"),t(g)):Je(g)?mt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||Rn(g)?(e.exit("atxHeadingText"),f(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:x$},m$={partial:!0,tokenize:b$},p$={partial:!0,tokenize:y$};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 x$(e,t,n){const a=this;let s,u,l,f,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),v):w===47?(e.consume(w),u=!0,j):w===63?(e.consume(w),s=3,a.interrupt?t:T):Cr(w)?(e.consume(w),l=String.fromCharCode(w),A):n(w)}function v(w){return w===45?(e.consume(w),s=2,b):w===91?(e.consume(w),s=5,f=0,S):Cr(w)?(e.consume(w),s=4,a.interrupt?t:T):n(w)}function b(w){return w===45?(e.consume(w),a.interrupt?t:T):n(w)}function S(w){const Y="CDATA[";return w===Y.charCodeAt(f++)?(e.consume(w),f===Y.length?a.interrupt?t:le:S):n(w)}function j(w){return Cr(w)?(e.consume(w),l=String.fromCharCode(w),A):n(w)}function A(w){if(w===null||w===47||w===62||Rn(w)){const Y=w===47,de=l.toLowerCase();return!Y&&!u&&vk.includes(de)?(s=1,a.interrupt?t(w):le(w)):f$.includes(l.toLowerCase())?(s=6,Y?(e.consume(w),E):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?O(w):N(w))}return w===45||Fn(w)?(e.consume(w),l+=String.fromCharCode(w),A):n(w)}function E(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function O(w){return Je(w)?(e.consume(w),O):fe(w)}function N(w){return w===47?(e.consume(w),fe):w===58||w===95||Cr(w)?(e.consume(w),L):Je(w)?(e.consume(w),N):fe(w)}function L(w){return w===45||w===46||w===58||w===95||Fn(w)?(e.consume(w),L):D(w)}function D(w){return w===61?(e.consume(w),R):Je(w)?(e.consume(w),D):N(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,q):Je(w)?(e.consume(w),R):V(w)}function q(w){return w===h?(e.consume(w),h=null,X):w===null||Ee(w)?n(w):(e.consume(w),q)}function V(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Rn(w)?D(w):(e.consume(w),V)}function X(w){return w===47||w===62||Je(w)?N(w):n(w)}function fe(w){return w===62?(e.consume(w),se):n(w)}function se(w){return w===null||Ee(w)?le(w):Je(w)?(e.consume(w),se):n(w)}function le(w){return w===45&&s===2?(e.consume(w),P):w===60&&s===1?(e.consume(w),J):w===62&&s===4?(e.consume(w),C):w===63&&s===3?(e.consume(w),T):w===93&&s===5?(e.consume(w),me):Ee(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(m$,I,ee)(w)):w===null||Ee(w)?(e.exit("htmlFlowData"),ee(w)):(e.consume(w),le)}function ee(w){return e.check(p$,oe,I)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ae}function ae(w){return w===null||Ee(w)?ee(w):(e.enter("htmlFlowData"),le(w))}function P(w){return w===45?(e.consume(w),T):le(w)}function J(w){return w===47?(e.consume(w),l="",B):le(w)}function B(w){if(w===62){const Y=l.toLowerCase();return vk.includes(Y)?(e.consume(w),C):le(w)}return Cr(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),B):le(w)}function me(w){return w===93?(e.consume(w),T):le(w)}function T(w){return w===62?(e.consume(w),C):w===45&&s===2?(e.consume(w),T):le(w)}function C(w){return w===null||Ee(w)?(e.exit("htmlFlowData"),I(w)):(e.consume(w),C)}function I(w){return e.exit("htmlFlow"),t(w)}}function y$(e,t,n){const a=this;return s;function s(l){return Ee(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 f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),D):T===63?(e.consume(T),N):Cr(T)?(e.consume(T),V):n(T)}function m(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),u=0,S):Cr(T)?(e.consume(T),O):n(T)}function g(T){return T===45?(e.consume(T),b):n(T)}function y(T){return T===null?n(T):T===45?(e.consume(T),v):Ee(T)?(l=y,J(T)):(e.consume(T),y)}function v(T){return T===45?(e.consume(T),b):y(T)}function b(T){return T===62?P(T):T===45?v(T):y(T)}function S(T){const C="CDATA[";return T===C.charCodeAt(u++)?(e.consume(T),u===C.length?j:S):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),A):Ee(T)?(l=j,J(T)):(e.consume(T),j)}function A(T){return T===93?(e.consume(T),E):j(T)}function E(T){return T===62?P(T):T===93?(e.consume(T),E):j(T)}function O(T){return T===null||T===62?P(T):Ee(T)?(l=O,J(T)):(e.consume(T),O)}function N(T){return T===null?n(T):T===63?(e.consume(T),L):Ee(T)?(l=N,J(T)):(e.consume(T),N)}function L(T){return T===62?P(T):N(T)}function D(T){return Cr(T)?(e.consume(T),R):n(T)}function R(T){return T===45||Fn(T)?(e.consume(T),R):q(T)}function q(T){return Ee(T)?(l=q,J(T)):Je(T)?(e.consume(T),q):P(T)}function V(T){return T===45||Fn(T)?(e.consume(T),V):T===47||T===62||Rn(T)?X(T):n(T)}function X(T){return T===47?(e.consume(T),P):T===58||T===95||Cr(T)?(e.consume(T),fe):Ee(T)?(l=X,J(T)):Je(T)?(e.consume(T),X):P(T)}function fe(T){return T===45||T===46||T===58||T===95||Fn(T)?(e.consume(T),fe):se(T)}function se(T){return T===61?(e.consume(T),le):Ee(T)?(l=se,J(T)):Je(T)?(e.consume(T),se):X(T)}function le(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,ee):Ee(T)?(l=le,J(T)):Je(T)?(e.consume(T),le):(e.consume(T),oe)}function ee(T){return T===s?(e.consume(T),s=void 0,ae):T===null?n(T):Ee(T)?(l=ee,J(T)):(e.consume(T),ee)}function oe(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Rn(T)?X(T):(e.consume(T),oe)}function ae(T){return T===47||T===62||Rn(T)?X(T):n(T)}function P(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function J(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return Je(T)?mt(e,me,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):me(T)}function me(T){return e.enter("htmlTextData"),l(T)}}const Hg={name:"labelEnd",resolveAll:_$,resolveTo:j$,tokenize:N$},w$={tokenize:C$},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,f;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 f=[["enter",h,t],["enter",m,t]],f=or(f,e.slice(u+1,u+a+3)),f=or(f,[["enter",g,t]]),f=or(f,Ig(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),f=or(f,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),f=or(f,e.slice(l+1)),f=or(f,[["exit",h,t]]),Dr(e,u,e.length,f),e}function N$(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 f;function f(v){return u?u._inactive?y(v):(l=a.parser.defined.includes(Vs(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):n(v)}function h(v){return v===40?e.attempt(w$,g,l?g:y)(v):v===91?e.attempt(S$,g,l?m:y)(v):l?g(v):y(v)}function m(v){return e.attempt(z$,g,y)(v)}function g(v){return t(v)}function y(v){return u._balanced=!0,n(v)}}function C$(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 Rn(y)?vl(e,u)(y):u(y)}function u(y){return y===41?g(y):A_(e,l,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return Rn(y)?vl(e,h)(y):g(y)}function f(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 Rn(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(f){return O_.call(a,e,u,l,"reference","referenceMarker","referenceString")(f)}function u(f){return a.parser.defined.includes(Vs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function l(f){return n(f)}}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(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),l):n(f)}function l(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}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"),mt(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,f(m)}function f(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Ee(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Je(m)?mt(e,f,"whitespace")(m):f(m))}}const An={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 f;function f(b){const S=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Ap(b)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Dc,n,m)(b):m(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return Ap(b)&&++l<10?(e.consume(b),h):(!a.interrupt||l<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(fd,a.interrupt?n:g,e.attempt(L$,v,y))}function g(b){return a.containerState.initialBlankLine=!0,u++,v(b)}function y(b){return Je(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function V$(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(fd,s,u);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,mt(e,t,"listItemIndent",a.containerState.size+1)(f)}function u(f){return a.containerState.furtherBlankLines||!Je(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(P$,t,l)(f))}function l(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,mt(e,e.attempt(An,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function B$(e,t,n){const a=this;return mt(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 mt(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!Je(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"),f(m)}function f(m){return m===s?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),Je(m)?mt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ee(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,mt(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_()},K$=M_("string"),X$=M_("text");function M_(e){return{resolveAll:D_(e==="text"?J$:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],u=n.attempt(s,l,f);return l;function l(g){return m(g)?u(g):f(g)}function f(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 v=-1;if(y)for(;++v<y.length;){const b=y[v];if(!b.previous||b.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 J$(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,f=0,h;for(;u--;){const m=s[u];if(typeof m=="string"){for(l=m.length;m.charCodeAt(l-1)===32;)f++,l--;if(l)break;l=-1}else if(m===-2)h=!0,f++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?l:a.start._bufferIndex+l,_index:a.start._index+u,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},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:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:N_},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:C_},r6={[-5]:vm,[-4]:vm,[-3]:vm,33:A$,38:E_,42:Op,60:[R5,v$],91:R$,92:[o$,C_],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=[],f=[];const h={attempt:q(D),check:q(R),consume:O,enter:N,exit:L,interrupt:q(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:y};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function y(se){return l=or(l,se),A(),l[l.length-1]!==null?[]:(V(t,0),m.events=Ig(u,m.events,m),m.events)}function v(se,le){return c6(b(se),le)}function b(se){return u6(l,se)}function S(){const{_bufferIndex:se,_index:le,line:ee,column:oe,offset:ae}=a;return{_bufferIndex:se,_index:le,line:ee,column:oe,offset:ae}}function j(se){s[se.line]=se.column,fe()}function A(){let se;for(;a._index<l.length;){const le=l[a._index];if(typeof le=="string")for(se=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===se&&a._bufferIndex<le.length;)E(le.charCodeAt(a._bufferIndex));else E(le)}}function E(se){g=g(se)}function O(se){Ee(se)?(a.line++,a.column=1,a.offset+=se===-3?2:1,fe()):se!==-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=se}function N(se,le){const ee=le||{};return ee.type=se,ee.start=S(),m.events.push(["enter",ee,m]),f.push(ee),ee}function L(se){const le=f.pop();return le.end=S(),m.events.push(["exit",le,m]),le}function D(se,le){V(se,le.from)}function R(se,le){le.restore()}function q(se,le){return ee;function ee(oe,ae,P){let J,B,me,T;return Array.isArray(oe)?I(oe):"tokenize"in oe?I([oe]):C(oe);function C(he){return pe;function pe(Pe){const Ae=Pe!==null&&he[Pe],pt=Pe!==null&&he.null,Rt=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(pt)?pt:pt?[pt]:[]];return I(Rt)(Pe)}}function I(he){return J=he,B=0,he.length===0?P:w(he[B])}function w(he){return pe;function pe(Pe){return T=X(),me=he,he.partial||(m.currentConstruct=he),he.name&&m.parser.constructs.disable.null.includes(he.name)?de():he.tokenize.call(le?Object.assign(Object.create(m),le):m,h,Y,de)(Pe)}}function Y(he){return se(me,T),ae}function de(he){return T.restore(),++B<J.length?w(J[B]):P}}}function V(se,le){se.resolveAll&&!u.includes(se)&&u.push(se),se.resolve&&Dr(m.events,le,m.events.length-le,se.resolve(m.events.slice(le),m)),se.resolveTo&&(m.events=se.resolveTo(m.events,m))}function X(){const se=S(),le=m.previous,ee=m.currentConstruct,oe=m.events.length,ae=Array.from(f);return{from:oe,restore:P};function P(){a=se,m.previous=le,m.currentConstruct=ee,m.events.length=oe,f=ae,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 f=l[0];typeof f=="string"?l[0]=f.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:y5([o6,...(e||{}).extensions||[]]),content:s(j5),defined:[],document:s(C5),flow:s(q$),lazy:{},string:s(K$),text:s(X$)};return a;function s(u){return l;function l(f){return l6(a,u,f)}}}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,f){const h=[];let m,g,y,v,b;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),v=m&&m.index!==void 0?m.index:u.length,b=u.charCodeAt(v),!m){t=u.slice(y);break}if(b===10&&y===v&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<v&&(h.push(u.slice(y,v)),e+=v-y),b){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=v+1}return f&&(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 x6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),y6(n)(f6(d6(n).document().write(h6()(e,t,!0))))}function y6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Qe),autolinkProtocol:X,autolinkEmail:X,atxHeading:u(Lt),blockQuote:u(pt),characterEscape:X,characterReference:X,codeFenced:u(Rt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Rt,l),codeText:u(Z,l),codeTextData:X,data:X,codeFlowValue:X,definition:u(Ne),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(qe),hardBreakEscape:u(Me),hardBreakTrailing:u(Me),htmlFlow:u(Ke,l),htmlFlowData:X,htmlText:u(Ke,l),htmlTextData:X,image:u(at),label:l,link:u(Qe),listItem:u(Gn),listItemValue:v,listOrdered:u(Qt,y),listUnordered:u(Qt),paragraph:u(Mt),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(Lt),strong:u(Gt),thematicBreak:u($i)},exit:{atxHeading:h(),atxHeadingSequence:D,autolink:h(),autolinkEmail:Ae,autolinkProtocol:Pe,blockQuote:h(),characterEscapeValue:fe,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:he,characterReference:pe,codeFenced:h(A),codeFencedFence:j,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:fe,codeIndented:h(E),codeText:h(ae),codeTextData:fe,data:fe,definition:h(),definitionDestinationString:L,definitionLabelString:O,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ee),htmlFlowData:fe,htmlText:h(oe),htmlTextData:fe,image:h(J),label:me,labelText:B,lineEnding:se,link:h(P),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:Y,resourceDestinationString:T,resourceTitleString:C,resource:I,setextHeading:h(V),setextHeadingLineSequence:q,setextHeadingText:R,strong:h(),thematicBreak:h()}};L_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let ce={type:"root",children:[]};const we={stack:[ce],tokenStack:[],config:t,enter:f,exit:m,buffer:l,resume:g,data:n},Ce=[];let He=-1;for(;++He<W.length;)if(W[He][1].type==="listOrdered"||W[He][1].type==="listUnordered")if(W[He][0]==="enter")Ce.push(He);else{const pn=Ce.pop();He=s(W,pn,He)}for(He=-1;++He<W.length;){const pn=t[W[He][0]];$_.call(pn,W[He][1].type)&&pn[W[He][1].type].call(Object.assign({sliceSerialize:W[He][2].sliceSerialize},we),W[He][1])}if(we.tokenStack.length>0){const pn=we.tokenStack[we.tokenStack.length-1];(pn[1]||Sk).call(we,void 0,pn[0])}for(ce.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})},He=-1;++He<t.transforms.length;)ce=t.transforms[He](ce)||ce;return ce}function s(W,ce,we){let Ce=ce-1,He=-1,pn=!1,$n,gn,Yt,Sn;for(;++Ce<=we;){const ut=W[Ce];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?He++:He--,Sn=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&($n&&!Sn&&!He&&!Yt&&(Yt=Ce),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!He&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||He===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if($n){let ua=Ce;for(gn=void 0;ua--;){const hr=W[ua];if(hr[1].type==="lineEnding"||hr[1].type==="lineEndingBlank"){if(hr[0]==="exit")continue;gn&&(W[gn][1].type="lineEndingBlank",pn=!0),hr[1].type="lineEnding",gn=ua}else if(!(hr[1].type==="linePrefix"||hr[1].type==="blockQuotePrefix"||hr[1].type==="blockQuotePrefixWhitespace"||hr[1].type==="blockQuoteMarker"||hr[1].type==="listItemIndent"))break}Yt&&(!gn||Yt<gn)&&($n._spread=!0),$n.end=Object.assign({},gn?W[gn][1].start:ut[1].end),W.splice(gn||Ce,0,["exit",$n,ut[2]]),Ce++,we++}if(ut[1].type==="listItemPrefix"){const ua={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};$n=ua,W.splice(Ce,0,["enter",ua,ut[2]]),Ce++,we++,Yt=void 0,Sn=!0}}}return W[ce][1]._spread=pn,we}function u(W,ce){return we;function we(Ce){f.call(this,W(Ce),Ce),ce&&ce.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function f(W,ce,we){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([ce,we||void 0]),W.position={start:Ma(ce.start),end:void 0}}function h(W){return ce;function ce(we){W&&W.call(this,we),m.call(this,we)}}function m(W,ce){const we=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==W.type&&(ce?ce.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");we.position.end=Ma(W.end)}function g(){return g5(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(W){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function b(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=W}function S(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=W}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W.replace(/(\r?\n|\r)$/g,"")}function O(W){const ce=this.resume(),we=this.stack[this.stack.length-1];we.label=ce,we.identifier=Vs(this.sliceSerialize(W)).toLowerCase()}function N(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.title=W}function L(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.url=W}function D(W){const ce=this.stack[this.stack.length-1];if(!ce.depth){const we=this.sliceSerialize(W).length;ce.depth=we}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function q(W){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function X(W){const we=this.stack[this.stack.length-1].children;let Ce=we[we.length-1];(!Ce||Ce.type!=="text")&&(Ce=gt(),Ce.position={start:Ma(W.start),end:void 0},we.push(Ce)),this.stack.push(Ce)}function fe(W){const ce=this.stack.pop();ce.value+=this.sliceSerialize(W),ce.position.end=Ma(W.end)}function se(W){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=ce.children[ce.children.length-1];we.position.end=Ma(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(X.call(this,W),fe.call(this,W))}function le(){this.data.atHardBreak=!0}function ee(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function oe(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function ae(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function P(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ce,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 ce=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ce,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function B(W){const ce=this.sliceSerialize(W),we=this.stack[this.stack.length-2];we.label=p6(ce),we.identifier=Vs(ce).toLowerCase()}function me(){const W=this.stack[this.stack.length-1],ce=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ce=W.children;we.children=Ce}else we.alt=ce}function T(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.url=W}function C(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.title=W}function I(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function Y(W){const ce=this.resume(),we=this.stack[this.stack.length-1];we.label=ce,we.identifier=Vs(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function de(W){this.data.characterReferenceType=W.type}function he(W){const ce=this.sliceSerialize(W),we=this.data.characterReferenceType;let Ce;we?(Ce=j_(ce,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Zg(ce);const He=this.stack[this.stack.length-1];He.value+=Ce}function pe(W){const ce=this.stack.pop();ce.position.end=Ma(W.end)}function Pe(W){fe.call(this,W);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(W)}function Ae(W){fe.call(this,W);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(W)}function pt(){return{type:"blockquote",children:[]}}function Rt(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function Lt(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function Ke(){return{type:"html",value:""}}function at(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function Qt(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 Mt(){return{type:"paragraph",children:[]}}function Gt(){return{type:"strong",children:[]}}function gt(){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 x6(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,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=u+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(f>1?"-"+f:""),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 N6(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 C6(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 f=-1;for(;++f<a.length;){const g=a[f];(s||f!==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)},f=Pg(t.children[1]),h=b_(t.children[t.children.length-1]);f&&h&&(l.position={start:f,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,f=l?l.length:t.children.length;let h=-1;const m=[];for(;++h<f;){const y=t.children[h],v={},b=l?l[h]:void 0;b&&(v.align=b);let S={type:"element",tagName:u,properties:v,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:N6,html:C6,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,Nk=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 f=n([],s);for(const h of l)f.push(a(h));return f}case qc:{const f=n({},s);for(const[h,m]of l)f[a(h)]=a(m);return f}case Fg:return n(new Date(l),s);case qg:{const{source:f,flags:h}=l;return n(new RegExp(f,h),s)}case Gg:{const f=n(new Map,s);for(const[h,m]of l)f.set(a(h),a(m));return f}case Yg:{const f=n(new Set,s);for(const h of l)f.add(a(h));return f}case B_:{const{name:f,message:h}=l;return n(new Nk[f](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:f}=new Uint8Array(l);return n(new DataView(f),l)}}return n(new Nk[u](l),s)};return a},Ck=e=>G6(new Map,e)(0),ws="",{toString:Y6}={},{keys:K6}=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"),X6=(e,t,n,a)=>{const s=(l,f)=>{const h=a.push(l)-1;return n.set(f,h),h},u=l=>{if(n.has(l))return n.get(l);let[f,h]=ll(l);switch(f){case hd:{let g=l;switch(h){case"bigint":f=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([f,g],l)}case kl:{if(h){let v=l;return h==="DataView"?v=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(l)),s([h,[...v]],l)}const g=[],y=s([f,g],l);for(const v of l)g.push(u(v));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([f,g],l);for(const v of K6(l))(e||!gc(ll(l[v])))&&g.push([u(v),u(l[v])]);return y}case Fg:return s([f,l.toISOString()],l);case qg:{const{source:g,flags:y}=l;return s([f,{source:g,flags:y}],l)}case Gg:{const g=[],y=s([f,g],l);for(const[v,b]of l)(e||!(gc(ll(v))||gc(ll(b))))&&g.push([u(v),u(b)]);return y}case Yg:{const g=[],y=s([f,g],l);for(const v of l)(e||!gc(ll(v)))&&g.push(u(v));return y}}const{message:m}=l;return s([f,{name:h,message:m}],l)};return u},Ek=(e,{json:t,lossy:n}={})=>{const a=[];return X6(!(t||n),!!t,new Map,a)(e),a},Gc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ck(Ek(e,t)):structuredClone(e):(e,t)=>Ck(Ek(e,t));function J6(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||J6,a=e.options.footnoteBackLabel||Q6,s=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];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(),v=ro(y.toLowerCase());let b=0;const S=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++b<=j;){S.length>0&&S.push({type:"text",value:" "});let O=typeof n=="string"?n:n(h,b);typeof O=="string"&&(O={type:"text",value:O}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,b),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const A=g[g.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const O=A.children[A.children.length-1];O&&O.type==="text"?O.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...S)}else g.push(...S);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,E),f.push(E)}if(f.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(f,!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;f(e,void 0,[])();function f(h,m,g){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=H_,S,j,A;if((!t||u(h,m,g[g.length-1]||void 0))&&(b=lL(n(h,g)),b[0]===Tk))return b;if("children"in h&&h.children){const E=h;if(E.children&&b[0]!==sL)for(j=(a?E.children.length:-1)+l,A=g.concat(E);j>-1&&j<E.children.length;){const O=E.children[j];if(S=f(O,j,A)(),S[0]===Tk)return S;j=typeof S[1]=="number"?S[1]:j+l}}return b}}}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,f,s);function f(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},f={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,v=String(g.identifier).toUpperCase();y.has(v)||y.set(v,g)}}),f;function h(g,y){const v=g.type,b=f.handlers[v];if(Rp.call(f.handlers,v)&&b)return b(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in g){const{children:j,...A}=g,E=Gc(A);return E.children=f.all(g),E}return Gc(g)}return(f.options.unknownHandler||hL)(f,g,y)}function m(g){const y=[];if("children"in g){const v=g.children;let b=-1;for(;++b<v.length;){const S=f.one(v[b],g);if(S){if(b&&v[b-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 v;for(v in m);return typeof v>"u"||e.call(m,v)},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},f=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,v,b,S,j=arguments[0],A=1,E=arguments.length,O=!1;for(typeof j=="boolean"&&(O=j,j=arguments[1]||{},A=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});A<E;++A)if(m=arguments[A],m!=null)for(g in m)y=f(j,g),v=f(m,g),j!==v&&(O&&v&&(u(v)||(b=s(v)))?(b?(b=!1,S=y&&s(y)?y:[]):S=y&&u(y)?y:{},l(j,{name:g,newValue:h(O,S,v)})):typeof v<"u"&&l(j,{name:g,newValue:v}));return j},km}var xL=gL();const wm=Ip(xL);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 yL(){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);f(null,...s);function f(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,f)(...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 f=e.length>l.length;let h;f&&l.push(s);try{h=e.apply(this,l)}catch(m){const g=m;if(f&&n)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,s):h instanceof Error?s(h):u(h))}function s(l,...f){n||(n=!0,t(l,...f))}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,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else l<0&&(u=!0,l=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(a=s):(f=-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 f=e.codePointAt(t);if(f===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),f===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,f,h;for(;++l<=e.length;){if(l<e.length)f=e.codePointAt(l);else{if(f===47)break;f=47}if(f===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 f===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:NL};function NL(){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 CL(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=CL(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 mn(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 Kg 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=yL()}copy(){const t=new Kg;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?(Cm("data",this.frozen),this.namespace[t]=n,this):OL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Cm("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=xc(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),Nm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(u,l){const f=xc(t),h=a.parse(f);a.run(h,f,function(g,y,v){if(g||!y||!v)return m(g);const b=y,S=a.stringify(b,v);DL(S)?v.value=S:v.result=S,m(g,v)});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),Nm("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,f){const h=xc(n);s.run(t,h,m);function m(g,y,v){const b=y||t;g?f(g):l?l(b):a(void 0,b,v)}}}runSync(t,n){let a=!1,s;return this.run(t,n,u),Lk("runSync","run",a),s;function u(l,f){Rk(l),s=f,a=!0}}stringify(t,n){this.freeze();const a=xc(n),s=this.compiler||this.Compiler;return Nm("stringify",s),$k(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(Cm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(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");f(m.plugins),m.settings&&(s.settings=wm(!0,s.settings,m.settings))}function f(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,v=-1;for(;++y<a.length;)if(a[y][0]===m){v=y;break}if(v===-1)a.push([m,...g]);else if(g.length>0){let[b,...S]=g;const j=a[v][1];Mp(j)&&Mp(b)&&(b=wm(!0,j,b)),a[v]=[m,b,...S]}}}}const RL=new Kg().freeze();function jm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Cm(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 xc(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,f=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:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return l?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let b;for(b in ym)if(Object.hasOwn(ym,b)&&Object.hasOwn(g.properties,b)){const S=g.properties[b],j=ym[b];(j===null||j.includes(g.tagName))&&(g.properties[b]=h(String(S||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!b&&a&&typeof y=="number"&&(b=!a(g,y,v)),b&&v&&typeof y=="number")return f&&g.children?v.children.splice(y,1,...g.children):v.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),f=()=>{l.current?.scrollIntoView({behavior:"smooth"})};z.useEffect(()=>{f()},[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)}},v=S=>{const j=S.usage_metadata;if(!j||typeof j!="object")return null;const A=j.input_tokens??j.prompt_tokens??j.input??0,E=j.output_tokens??j.completion_tokens??j.output??0,O=Number(A),N=Number(E);if(!Number.isFinite(O)&&!Number.isFinite(N))return null;const L=Number.isFinite(O)?Math.max(0,Math.round(O)):0,D=Number.isFinite(N)?Math.max(0,Math.round(N)):0;return L===0&&D===0?null:{input:L,output:D}},b=S=>S.toLocaleString("pt-BR");return a?d.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((S,j)=>{const A=v(S),E=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 d.jsxs("div",{className:`flex gap-4 ${S.type==="human"?"justify-end":"justify-start"}`,children:[S.type!=="human"&&d.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"?d.jsx(pS,{size:16}):d.jsx(z0,{size:18})}),d.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"&&d.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[d.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),d.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"&&d.jsxs(d.Fragment,{children:[d.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:d.jsx(VL,{children:S.content})}),Array.isArray(S.tool_calls)&&S.tool_calls.length>0&&d.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:[d.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),d.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"&&d.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:S.content}),A&&d.jsx("div",{className:"mt-3 flex justify-end",children:d.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${E}`,children:[d.jsx(fS,{size:12}),d.jsx("span",{children:b(A.input)}),d.jsx("span",{className:"opacity-60",children:"/"}),d.jsx("span",{children:b(A.output)}),d.jsx(dS,{size:12})]})})]}),S.type==="human"&&d.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:d.jsx(KA,{size:18})})]},j)}),n&&d.jsxs("div",{className:"flex gap-4 justify-start",children:[d.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:d.jsx(z0,{size:18})}),d.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:[d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),d.jsx("div",{ref:l})]}),d.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:d.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[d.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}),d.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:d.jsx(MA,{size:20})})]})})]}):d.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:[d.jsx(qL,{size:48,className:"mb-4 opacity-20"}),d.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},qL=({size:e,className:t})=>d.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:d.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()=>xe.get("/sessions"),createSession:async()=>xe.post("/sessions",{}),deleteSession:async e=>xe.delete(`/sessions/${e}`),renameSession:async(e,t)=>xe.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>xe.post(`/sessions/${e}/archive`,{}),getMessages:async e=>xe.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>xe.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 d.jsx(Or,{open:e,onOpenChange:t,children:d.jsxs(Fs,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(Rr,{children:d.jsx(Mr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),d.jsx("div",{className:"py-4",children:d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:s})}),d.jsxs(yD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[d.jsx(lr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),d.jsx(lr,{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,f]=z.useState(!1),[h,m]=z.useState(!0),g=z.useRef(!1);z.useEffect(()=>{g.current=l},[l]),z.useEffect(()=>{if(!n)return;const L=setInterval(async()=>{if(!g.current)try{const R=(await Da.getMessages(n)).filter(q=>q.type!=="system");u(q=>{if(R.length!==q.length)return R;const V=R.at(-1)?.created_at??0,X=q.at(-1)?.created_at??0;return V>X?R:q})}catch{}},3e3);return()=>clearInterval(L)},[n]);const[y,v]=z.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),b=async()=>{try{const L=await Da.getSessions();t(L)}catch(L){console.error("Failed to load sessions:",L)}};z.useEffect(()=>{b()},[]),z.useEffect(()=>{n?S(n):u([])},[n]);const S=async L=>{try{const D=await Da.getMessages(L);u(D.filter(R=>R.type!=="system"))}catch(D){console.error("Failed to load messages:",D)}},j=async()=>{try{const L=await Da.createSession();await b(),a(L.id)}catch(L){console.error("Failed to create session:",L)}},A=async L=>{if(!n)return;const D={type:"human",content:L};u(R=>[...R,D]),f(!0);try{await Da.sendMessage(n,L),await S(n),await b()}catch(R){console.error("Failed to send message:",R)}finally{f(!1)}},E=L=>{v({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(L),n===L&&a(null),await b()}catch(D){console.error("Failed to archive session:",D)}}})},O=L=>{v({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(L),n===L&&a(null),await b()}catch(D){console.error("Failed to delete session:",D)}}})},N=async(L,D)=>{try{await Da.renameSession(L,D),await b()}catch(R){console.error("Failed to rename session:",R)}};return d.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[d.jsx(zD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:j,onArchiveSession:E,onDeleteSession:O,onRenameSession:N,isOpen:h,toggleSidebar:()=>m(!h)}),d.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:d.jsx(FL,{messages:s,onSendMessage:A,isLoading:l,activeSessionId:n})}),d.jsx(G_,{isOpen:y.isOpen,onClose:()=>v(L=>({...L,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 zt(`/chronos${n}`,()=>xe.get(`/chronos${n}`))}function KL(e,t=50){return zt(e?`/chronos/${e}/executions?limit=${t}`:null,()=>xe.get(`/chronos/${e}/executions?limit=${t}`))}function Y_(){return zt("/config/chronos",()=>xe.get("/config/chronos"))}const Ei={createJob:e=>xe.post("/chronos",e),updateJob:(e,t)=>xe.put(`/chronos/${e}`,t),deleteJob:e=>xe.delete(`/chronos/${e}`),enableJob:e=>xe.patch(`/chronos/${e}/enable`,{}),disableJob:e=>xe.patch(`/chronos/${e}/disable`,{}),getConfig:()=>xe.get("/config/chronos"),updateConfig:e=>xe.post("/config/chronos",e),preview:(e,t,n)=>xe.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function ar({title:e,description:t,children:n}){return d.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:[d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),d.jsx("div",{className:"space-y-4",children:n})]})}const XL=(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},JL=(e,t)=>({classGroupId:e,validator:t}),K_=(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 f=l.split(Yc),h=f[0]===""&&f.length>1?1:0;return X_(f,h,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const h=a[l],m=n[l];return h?m?XL(m,h):h:m||Vk}return n[l]||Vk}}},X_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],u=n.nextPart.get(s);if(u){const m=X_(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const f=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(f))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=K_();for(const a in e){const s=e[a];Xg(s,n,a,t)}return n},Xg=(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:J_(t,e);a.classGroupId=n},i9=(e,t,n,a)=>{if(o9(e)){Xg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(JL(n,e))},s9=(e,t,n,a)=>{const s=Object.entries(e),u=s.length;for(let l=0;l<u;l++){const[f,h]=s[l];Xg(h,J_(t,f),n,a)}},J_=(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 f=n.nextPart.get(l);f||(f=K_(),n.nextPart.set(l,f)),n=f}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,f=0,h=0,m;const g=s.length;for(let j=0;j<g;j++){const A=s[j];if(l===0&&f===0){if(A===Bk){u.push(s.slice(h,j)),h=j+1;continue}if(A==="/"){m=j;continue}}A==="["?l++:A==="]"?l--:A==="("?f++:A===")"&&f--}const y=u.length===0?s:s.slice(h);let v=y,b=!1;y.endsWith($p)?(v=y.slice(0,-1),b=!0):y.startsWith($p)&&(v=y.slice(1),b=!0);const S=m&&m>h?m-h:void 0;return Zk(u,b,v,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],f=l[0]==="[",h=t.has(l);f||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=[],f=e.trim().split(h9);let h="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:j}=n(g);if(y){h=g+(h.length>0?" "+h:h);continue}let A=!!j,E=a(A?S.substring(0,j):S);if(!E){if(!A){h=g+(h.length>0?" "+h:h);continue}if(E=a(S),!E){h=g+(h.length>0?" "+h:h);continue}A=!1}const O=v.length===0?"":v.length===1?v[0]:u(v).join(":"),N=b?O+$p:O,L=N+E;if(l.indexOf(L)>-1)continue;l.push(L);const D=s(E,A);for(let R=0;R<D.length;++R){const q=D[R];l.push(N+q)}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=f,f(h)},f=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))},x9=[],Xt=e=>{const t=n=>n[e]||x9;return t.isThemeGetter=!0,t},W_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ej=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y9=/^\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=>y9.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),$a=e=>!!e&&Number.isInteger(Number(e)),Em=e=>e.endsWith("%")&&Le(e.slice(0,-1)),na=e=>b9.test(e),z9=()=>!0,_9=e=>v9.test(e)&&!k9.test(e),tj=()=>!1,j9=e=>w9.test(e),N9=e=>S9.test(e),C9=e=>!ye(e)&&!be(e),E9=e=>ao(e,aj,tj),ye=e=>W_.test(e),bi=e=>ao(e,ij,_9),Tm=e=>ao(e,M9,Le),Ik=e=>ao(e,nj,tj),T9=e=>ao(e,rj,N9),yc=e=>ao(e,sj,j9),be=e=>ej.test(e),ul=e=>io(e,ij),A9=e=>io(e,D9),Hk=e=>io(e,nj),O9=e=>io(e,aj),R9=e=>io(e,rj),bc=e=>io(e,sj,!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=ej.exec(e);return a?a[1]?t(a[1]):n:!1},nj=e=>e==="position"||e==="percentage",rj=e=>e==="image"||e==="url",aj=e=>e==="length"||e==="size"||e==="bg-size",ij=e=>e==="length",M9=e=>e==="number",D9=e=>e==="family-name",sj=e=>e==="shadow",$9=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),a=Xt("font-weight"),s=Xt("tracking"),u=Xt("leading"),l=Xt("breakpoint"),f=Xt("container"),h=Xt("spacing"),m=Xt("radius"),g=Xt("shadow"),y=Xt("inset-shadow"),v=Xt("text-shadow"),b=Xt("drop-shadow"),S=Xt("blur"),j=Xt("perspective"),A=Xt("aspect"),E=Xt("ease"),O=Xt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...L(),be,ye],R=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],V=()=>[be,ye,h],X=()=>[Ss,"full","auto",...V()],fe=()=>[$a,"none","subgrid",be,ye],se=()=>["auto",{span:["full",$a,be,ye]},$a,be,ye],le=()=>[$a,"auto",be,ye],ee=()=>["auto","min","max","fr",be,ye],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...V()],J=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],B=()=>[e,be,ye],me=()=>[...L(),Hk,Ik,{position:[be,ye]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",O9,E9,{size:[be,ye]}],I=()=>[Em,ul,bi],w=()=>["","none","full",m,be,ye],Y=()=>["",Le,ul,bi],de=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Le,Em,Hk,Ik],Pe=()=>["","none",S,be,ye],Ae=()=>["none",Le,be,ye],pt=()=>["none",Le,be,ye],Rt=()=>[Le,be,ye],Z=()=>[Ss,"full",...V()];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:[C9],"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",Le],text:[na],"text-shadow":[na],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,ye,be,A]}],container:["container"],columns:[{columns:[Le,ye,be,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:D()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{start:X()}],end:[{end:X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[$a,"auto",be,ye]}],basis:[{basis:[Ss,"full","auto",f,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Ss,"auto","initial","none",ye]}],grow:[{grow:["",Le,be,ye]}],shrink:[{shrink:["",Le,be,ye]}],order:[{order:[$a,"first","last","none",be,ye]}],"grid-cols":[{"grid-cols":fe()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":fe()}],"row-start-end":[{row:se()}],"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":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[f,"screen",...J()]}],"min-w":[{"min-w":[f,"screen","none",...J()]}],"max-w":[{"max-w":[f,"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,be,Tm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Em,ye]}],"font-family":[{font:[A9,ye,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,be,ye]}],"line-clamp":[{"line-clamp":[Le,"none",be,Tm]}],leading:[{leading:[u,...V()]}],"list-image":[{"list-image":["none",be,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",be,bi]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Le,"auto",be,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ye]}],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",be,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$a,be,ye],radial:["",be,ye],conic:[$a,be,ye]},R9,T9]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],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:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,be,ye]}],"outline-w":[{outline:["",Le,ul,bi]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,bc,yc]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",y,bc,yc]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Le,bi]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",v,bc,yc]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Le,be,ye]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[Le]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[be,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":L()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ye]}],filter:[{filter:["","none",be,ye]}],blur:[{blur:Pe()}],brightness:[{brightness:[Le,be,ye]}],contrast:[{contrast:[Le,be,ye]}],"drop-shadow":[{"drop-shadow":["","none",b,bc,yc]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Le,be,ye]}],"hue-rotate":[{"hue-rotate":[Le,be,ye]}],invert:[{invert:["",Le,be,ye]}],saturate:[{saturate:[Le,be,ye]}],sepia:[{sepia:["",Le,be,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ye]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Le,be,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Le,be,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,be,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,be,ye]}],"backdrop-invert":[{"backdrop-invert":["",Le,be,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Le,be,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Le,be,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,be,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Le,"initial",be,ye]}],ease:[{ease:["linear","initial",E,be,ye]}],delay:[{delay:[Le,be,ye]}],animate:[{animate:["none",O,be,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,be,ye]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:pt()}],"scale-x":[{"scale-x":pt()}],"scale-y":[{"scale-y":pt()}],"scale-z":[{"scale-z":pt()}],"scale-3d":["scale-3d"],skew:[{skew:Rt()}],"skew-x":[{"skew-x":Rt()}],"skew-y":[{"skew-y":Rt()}],transform:[{transform:[be,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",be,ye]}],"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":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",be,ye]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Le,ul,bi,Tm]}],stroke:[{stroke:["none",...B()]}],"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 lt({label:e,error:t,helperText:n,className:a,...s}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.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&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&d.jsx("p",{className:"text-xs text-red-500",children:t})]})}function jr({label:e,options:t,error:n,helperText:a,className:s,...u}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.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=>d.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&d.jsx("p",{className:"text-xs text-red-500",children:n})]})}function yn({label:e,error:t,helperText:n,className:a,...s}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.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&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&d.jsx("p",{className:"text-xs text-red-500",children:t})]})}function zs({label:e,checked:t,onChange:n,helperText:a,disabled:s}){return d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:Bs("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",s&&"opacity-50"),children:e}),a&&d.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),d.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:d.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 ir={fetchConfig:async()=>xe.get("/config"),updateConfig:async e=>xe.post("/config",e),getSatiConfig:async()=>xe.get("/config/sati"),updateSatiConfig:async e=>xe.post("/config/sati",e),deleteSatiConfig:async()=>xe.delete("/config/sati"),getApocConfig:async()=>xe.get("/config/apoc"),updateApocConfig:async e=>xe.post("/config/apoc",e),deleteApocConfig:async()=>xe.delete("/config/apoc"),getNeoConfig:async()=>xe.get("/config/neo"),updateNeoConfig:async e=>xe.post("/config/neo",e),deleteNeoConfig:async()=>xe.delete("/config/neo"),getTrinityConfig:async()=>xe.get("/config/trinity"),updateTrinityConfig:async e=>xe.post("/config/trinity",e),deleteTrinityConfig:async()=>xe.delete("/config/trinity"),getEncryptionStatus:async()=>xe.get("/config/encryption-status"),getEnvOverrides:async()=>xe.get("/config/env-overrides")};function te(e,t,n){function a(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const v=g[y];v in f||(f[v]=m[v].bind(f))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(f){var h;const m=n?.Parent?new u:this;a(m,f),(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:f=>n?.Parent&&f instanceof n.Parent?!0:f?._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.")}},oj=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const lj={};function qa(e){return lj}function uj(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 Jg(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(".","")),f=Number.parseInt(t.toFixed(u).replace(".",""));return l%f/10**u}const Fk=Symbol("evaluating");function et(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 Xa(...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 cj="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 dj(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 Ja(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function ze(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=Xa(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return Mi(this,"shape",l),l},checks:[]});return Ja(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=Xa(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return Mi(this,"shape",l),l},checks:[]});return Ja(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=Xa(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Mi(this,"shape",u),u}});return Ja(e,s)}function q9(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Xa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Mi(this,"shape",a),a}});return Ja(e,n)}function G9(e,t){const n=Xa(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 Ja(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=Xa(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(n)for(const m in n){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)h[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Mi(this,"shape",h),h},checks:[]});return Ja(t,l)}function K9(e,t,n){const a=Xa(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 Ja(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 fj=(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})},hj=te("$ZodError",fj),mj=te("$ZodError",fj,{Parent:Error});function X9(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 J9(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,f=0;for(;f<u.path.length;){const h=u.path[f];f===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const ex=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 f=new(s?.Err??e)(l.issues.map(h=>Ga(h,u,qa())));throw cj(f,s?.callee),f}return l.value},tx=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 f=new(s?.Err??e)(l.issues.map(h=>Ga(h,u,qa())));throw cj(f,s?.callee),f}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??hj)(u.issues.map(l=>Ga(l,s,qa())))}:{success:!0,data:u.value}},Q9=gd(mj),xd=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=xd(mj),eP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ex(e)(t,n,s)},tP=e=>(t,n,a)=>ex(e)(t,n,a),nP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return tx(e)(t,n,s)},rP=e=>async(t,n,a)=>tx(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 xd(e)(t,n,s)},oP=e=>async(t,n,a)=>xd(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,}$/,xP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yP(){return new RegExp(xP,"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}=))?$/,pj=/^[A-Za-z0-9_-]*$/,zP=/^\+[1-9]\d{6,14}$/,gj="(?:(?:\\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(`^${gj}$`);function xj(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(`^${xj(e)}$`)}function NP(e){const t=xj({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(`^${gj}T(?:${a})$`)}const CP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},EP=/^-?\d+$/,yj=/^-?\d+(?:\.\d+)?$/,TP=/^(?:true|false)$/i,AP=/^[^A-Z]*$/,OP=/^[^a-z]*$/,Dn=te("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bj={number:"number",bigint:"bigint",object:"date"},vj=te("$ZodCheckLessThan",(e,t)=>{Dn.init(e,t);const n=bj[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})}}),kj=te("$ZodCheckGreaterThan",(e,t)=>{Dn.init(e,t);const n=bj[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=te("$ZodCheckMultipleOf",(e,t)=>{Dn.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=te("$ZodCheckNumberFormat",(e,t)=>{Dn.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 f=l._zod.bag;f.format=t.format,f.minimum=s,f.maximum=u,n&&(f.pattern=EP)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,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:f,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}}f<s&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),f>u&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),DP=te("$ZodCheckMaxLength",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Jg(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=te("$ZodCheckMinLength",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Jg(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=te("$ZodCheckLengthEquals",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Jg(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),f=u>t.length;a.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),yd=te("$ZodCheckStringFormat",(e,t)=>{var n,a;Dn.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=te("$ZodCheckRegex",(e,t)=>{yd.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=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=AP),yd.init(e,t)}),VP=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=OP),yd.init(e,t)}),BP=te("$ZodCheckIncludes",(e,t)=>{Dn.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=te("$ZodCheckStartsWith",(e,t)=>{Dn.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=te("$ZodCheckEndsWith",(e,t)=>{Dn.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=te("$ZodCheckOverwrite",(e,t)=>{Dn.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},jt=te("$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,f,h)=>{let m=Rs(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,b=y._zod.check(l);if(b instanceof Promise&&h?.async===!1)throw new Zs;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,l.issues.length!==v&&(m||(m=Rs(l,v)))});else{if(l.issues.length===v)continue;m||(m=Rs(l,v))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Rs(l))return l.aborted=!0,l;const m=s(f,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,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,f)):u(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Zs;return h.then(m=>s(m,a,f))}return s(h,a,f)}}et(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}))}),nx=te("$ZodString",(e,t)=>{jt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??CP(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}}),wt=te("$ZodStringFormat",(e,t)=>{yd.init(e,t),nx.init(e,t)}),GP=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pP),wt.init(e,t)}),YP=te("$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());wt.init(e,t)}),KP=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gP),wt.init(e,t)}),XP=te("$ZodURL",(e,t)=>{wt.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})}}}),JP=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=yP()),wt.init(e,t)}),QP=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hP),wt.init(e,t)}),WP=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lP),wt.init(e,t)}),eU=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uP),wt.init(e,t)}),tU=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=cP),wt.init(e,t)}),nU=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dP),wt.init(e,t)}),rU=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fP),wt.init(e,t)}),aU=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=NP(t)),wt.init(e,t)}),iU=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_P),wt.init(e,t)}),sU=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jP(t)),wt.init(e,t)}),oU=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mP),wt.init(e,t)}),lU=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=bP),wt.init(e,t),e._zod.bag.format="ipv4"}),uU=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=vP),wt.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=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=kP),wt.init(e,t)}),dU=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=wP),wt.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 wj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const fU=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=SP),wt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{wj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function hU(e){if(!pj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return wj(n)}const mU=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=pj),wt.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=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=zP),wt.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 xU=te("$ZodJWT",(e,t)=>{wt.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})}}),Sj=te("$ZodNumber",(e,t)=>{jt.init(e,t),e._zod.pattern=e._zod.bag.pattern??yj,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}}),yU=te("$ZodNumberFormat",(e,t)=>{MP.init(e,t),Sj.init(e,t)}),bU=te("$ZodBoolean",(e,t)=>{jt.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=te("$ZodUnknown",(e,t)=>{jt.init(e,t),e._zod.parse=n=>n}),kU=te("$ZodNever",(e,t)=>{jt.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=te("$ZodArray",(e,t)=>{jt.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 f=s[l],h=t.element._zod.run({value:f,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 Kc(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 zj(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 _j(e,t,n,a,s,u){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){l.push(y);continue}const v=h.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(b=>Kc(b,n,y,t,g))):Kc(v,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=te("$ZodObject",(e,t)=>{if(jt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=pd(()=>zj(t));et(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[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=(f,h)=>{l??(l=a.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const g=[],y=l.shape;for(const v of l.keys){const b=y[v],S=b._zod.optout==="optional",j=b._zod.run({value:m[v],issues:[]},h);j instanceof Promise?g.push(j.then(A=>Kc(A,f,v,m,S))):Kc(j,f,v,m,S)}return u?_j(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),zU=te("$ZodObjectJIT",(e,t)=>{SU.init(e,t);const n=e._zod.parse,a=pd(()=>zj(t)),s=v=>{const b=new FP(["shape","payload","ctx"]),S=a.value,j=N=>{const L=qk(N);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};b.write("const input = payload.value;");const A=Object.create(null);let E=0;for(const N of S.keys)A[N]=`key_${E++}`;b.write("const newResult = {};");for(const N of S.keys){const L=A[N],D=qk(N),q=v[N]?._zod?.optout==="optional";b.write(`const ${L} = ${j(N)};`),q?b.write(`
35
+ if (${L}.issues.length) {
36
+ if (${D} in input) {
37
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
38
+ ...iss,
39
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
40
+ })));
41
+ }
42
+ }
43
+
44
+ if (${L}.value === undefined) {
45
+ if (${D} in input) {
46
+ newResult[${D}] = undefined;
47
+ }
48
+ } else {
49
+ newResult[${D}] = ${L}.value;
50
+ }
51
+
52
+ `):b.write(`
53
+ if (${L}.issues.length) {
54
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
55
+ ...iss,
56
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
57
+ })));
58
+ }
59
+
60
+ if (${L}.value === undefined) {
61
+ if (${D} in input) {
62
+ newResult[${D}] = undefined;
63
+ }
64
+ } else {
65
+ newResult[${D}] = ${L}.value;
66
+ }
67
+
68
+ `)}b.write("payload.value = newResult;"),b.write("return payload;");const O=b.compile();return(N,L)=>O(v,N,L)};let u;const l=Ol,f=!lj.jitless,m=f&&U9.value,g=t.catchall;let y;e._zod.parse=(v,b)=>{y??(y=a.value);const S=v.value;return l(S)?f&&m&&b?.async===!1&&b.jitless!==!0?(u||(u=s(t.shape)),v=u(v,b),g?_j([],S,v,b,y,e):v):n(v,b):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function Kk(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 jj=te("$ZodUnion",(e,t)=>{jt.init(e,t),et(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),et(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),et(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),et(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 f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)f.push(m),l=!0;else{if(m.issues.length===0)return m;f.push(m)}}return l?Promise.all(f).then(h=>Kk(h,s,e,u)):Kk(f,s,e,u)}}),_U=te("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,jj.init(e,t);const n=e._zod.parse;et(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[f,h]of Object.entries(l)){s[f]||(s[f]=new Set);for(const m of h)s[f].add(m)}}return s});const a=pd(()=>{const s=t.options,u=new Map;for(const l of s){const f=l._zod.propValues?.[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const h of f){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 f=a.value.get(l?.[t.discriminator]);return f?f._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=te("$ZodIntersection",(e,t)=>{jt.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])=>Xk(n,h,m)):Xk(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 Xk(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const u=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);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 NU=te("$ZodRecord",(e,t)=>{jt.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 f=new Set;for(const m of l)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.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)f.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 f of Reflect.ownKeys(s)){if(f==="__proto__")continue;let h=t.keyType._zod.run({value:f,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&yj.test(f)&&h.issues.length){const y=t.keyType._zod.run({value:Number(f),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[f]=s[f]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>Ga(y,a,qa())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:s[f],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Ms(f,y.issues)),n.value[h.value]=y.value})):(g.issues.length&&n.issues.push(...Ms(f,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),CU=te("$ZodEnum",(e,t)=>{jt.init(e,t);const n=uj(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=te("$ZodLiteral",(e,t)=>{if(jt.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=te("$ZodTransform",(e,t)=>{jt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new oj(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 Jk(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Nj=te("$ZodOptional",(e,t)=>{jt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),et(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=>Jk(u,n.value)):Jk(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),AU=te("$ZodExactOptional",(e,t)=>{Nj.init(e,t),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),OU=te("$ZodNullable",(e,t)=>{jt.init(e,t),et(e._zod,"optin",()=>t.innerType._zod.optin),et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Qg(n.source)}|null)$`):void 0}),et(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=te("$ZodDefault",(e,t)=>{jt.init(e,t),e._zod.optin="optional",et(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=te("$ZodPrefault",(e,t)=>{jt.init(e,t),e._zod.optin="optional",et(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=te("$ZodNonOptional",(e,t)=>{jt.init(e,t),et(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=te("$ZodCatch",(e,t)=>{jt.init(e,t),et(e._zod,"optin",()=>t.innerType._zod.optin),et(e._zod,"optout",()=>t.innerType._zod.optout),et(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=te("$ZodPipe",(e,t)=>{jt.init(e,t),et(e._zod,"values",()=>t.in._zod.values),et(e._zod,"optin",()=>t.in._zod.optin),et(e._zod,"optout",()=>t.out._zod.optout),et(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=te("$ZodReadonly",(e,t)=>{jt.init(e,t),et(e._zod,"propValues",()=>t.innerType._zod.propValues),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"optin",()=>t.innerType?._zod?.optin),et(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=te("$ZodCustom",(e,t)=>{Dn.init(e,t),jt.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",...ze(t)})}function IU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function rw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function HU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function FU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function qU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function GU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function YU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function KU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function XU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function JU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function QU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function WU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function e8(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function t8(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function n8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function r8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function a8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function i8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function s8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function o8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function l8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function u8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function c8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function d8(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function f8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function h8(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function m8(e,t){return new e({type:"number",checks:[],...ze(t)})}function p8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function g8(e,t){return new e({type:"boolean",...ze(t)})}function x8(e){return new e({type:"unknown"})}function y8(e,t){return new e({type:"never",...ze(t)})}function aw(e,t){return new vj({check:"less_than",...ze(t),value:e,inclusive:!1})}function Am(e,t){return new vj({check:"less_than",...ze(t),value:e,inclusive:!0})}function iw(e,t){return new kj({check:"greater_than",...ze(t),value:e,inclusive:!1})}function Om(e,t){return new kj({check:"greater_than",...ze(t),value:e,inclusive:!0})}function sw(e,t){return new RP({check:"multiple_of",...ze(t),value:e})}function Cj(e,t){return new DP({check:"max_length",...ze(t),maximum:e})}function Xc(e,t){return new $P({check:"min_length",...ze(t),minimum:e})}function Ej(e,t){return new LP({check:"length_equals",...ze(t),length:e})}function b8(e,t){return new PP({check:"string_format",format:"regex",...ze(t),pattern:e})}function v8(e){return new UP({check:"string_format",format:"lowercase",...ze(e)})}function k8(e){return new VP({check:"string_format",format:"uppercase",...ze(e)})}function w8(e,t){return new BP({check:"string_format",format:"includes",...ze(t),includes:e})}function S8(e,t){return new ZP({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function z8(e,t){return new IP({check:"string_format",format:"ends_with",...ze(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 N8(){return so(e=>e.toLowerCase())}function C8(){return so(e=>e.toUpperCase())}function E8(){return so(e=>P9(e))}function T8(e,t,n){return new e({type:"array",element:t,...ze(n)})}function A8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(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 Dn({check:"custom",...ze(t)});return n._zod.check=e,n}function Tj(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 Ht(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 f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const v=l.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,v,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),Ht(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 Aj(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 f=e.metadataRegistry.get(l[0])?.id;if(f){const h=a.get(f);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,l[0])}}const s=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(y)return{ref:v(y)};const b=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(l[1]===n)return{ref:"#"};const m=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:h,defId:m}=s(l);f.def={...f.schema},m&&(f.defId=m);const g=f.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.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 f=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(f.cycle){u(l);continue}if(f.count>1&&e.reused==="ref"){u(l);continue}}}function Oj(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 f=e.seen.get(l);if(f.ref===null)return;const h=f.def??f.schema,m={...h},g=f.ref;if(f.ref=null,g){a(g);const v=e.seen.get(g),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(b)):Object.assign(h,b),Object.assign(h,m),l._zod.parent===g)for(const j in h)j==="$ref"||j==="allOf"||j in m||delete h[j];if(b.$ref&&v.def)for(const j in h)j==="$ref"||j==="allOf"||j in v.def&&JSON.stringify(h[j])===JSON.stringify(v.def[j])&&delete h[j]}const y=l._zod.parent;if(y&&y!==g){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(h.$ref=v.schema.$ref,v.def))for(const b in h)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(h[b])===JSON.stringify(v.def[b])&&delete h[b]}e.override({zodSchema:l,jsonSchema:h,path:f.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 f=l[1];f.def&&f.defId&&(u[f.defId]=f.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:Jc(t,"input",e.processors),output:Jc(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 M8=(e,t={})=>n=>{const a=Tj({...n,processors:t});return Ht(e,a),Aj(a,e),Oj(a,e)},Jc=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=Tj({...s??{},target:u,io:t,processors:n});return Ht(e,l),Aj(l,e),Oj(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:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),f&&(s.format=D8[f]??f,s.format===""&&delete s.format,f==="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:f,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.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=uj(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:f}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=Ht(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]=Ht(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].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=Ht(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((f,h)=>Ht(f,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=Ht(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=Ht(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(u)?u.allOf:[u],...f(l)?l.allOf:[l]];n.allOf=h},K8=(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=Ht(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=Ht(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Ht(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)}},X8=(e,t,n,a)=>{const s=e._zod.def,u=Ht(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"}]},J8=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},Q8=(e,t,n,a)=>{const s=e._zod.def;Ht(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;Ht(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;Ht(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;Ht(u,t,a);const l=t.seen.get(e);l.ref=u},nV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},Rj=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},rV=te("ZodISODateTime",(e,t)=>{aU.init(e,t),Ct.init(e,t)});function aV(e){return c8(rV,e)}const iV=te("ZodISODate",(e,t)=>{iU.init(e,t),Ct.init(e,t)});function sV(e){return d8(iV,e)}const oV=te("ZodISOTime",(e,t)=>{sU.init(e,t),Ct.init(e,t)});function lV(e){return f8(oV,e)}const uV=te("ZodISODuration",(e,t)=>{oU.init(e,t),Ct.init(e,t)});function cV(e){return h8(uV,e)}const dV=(e,t)=>{hj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>J9(e,n)},flatten:{value:n=>X9(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}}})},dr=te("ZodError",dV,{Parent:Error}),fV=ex(dr),hV=tx(dr),mV=gd(dr),pV=xd(dr),gV=eP(dr),xV=tP(dr),yV=nP(dr),bV=rP(dr),vV=aP(dr),kV=iP(dr),wV=sP(dr),SV=oP(dr),Nt=te("ZodType",(e,t)=>(jt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jc(e,"input"),output:Jc(e,"output")}}),e.toJSONSchema=M8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Xa(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)=>Ja(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)=>xV(e,n,a),e.encodeAsync=async(n,a)=>yV(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(xB(n,a)),e.superRefine=n=>e.check(yB(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=>Lj([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)),Mj=te("_ZodString",(e,t)=>{nx.init(e,t),Nt.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(Xc(...a)),e.max=(...a)=>e.check(Cj(...a)),e.length=(...a)=>e.check(Ej(...a)),e.nonempty=(...a)=>e.check(Xc(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(N8()),e.toUpperCase=()=>e.check(C8()),e.slugify=()=>e.check(E8())}),zV=te("ZodString",(e,t)=>{nx.init(e,t),Mj.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(KU(NV,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(XU(CV,n)),e.guid=n=>e.check(rw(ow,n)),e.cuid=n=>e.check(JU(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 We(e){return ZU(zV,e)}const Ct=te("ZodStringFormat",(e,t)=>{wt.init(e,t),Mj.init(e,t)}),_V=te("ZodEmail",(e,t)=>{KP.init(e,t),Ct.init(e,t)}),ow=te("ZodGUID",(e,t)=>{GP.init(e,t),Ct.init(e,t)}),wc=te("ZodUUID",(e,t)=>{YP.init(e,t),Ct.init(e,t)}),jV=te("ZodURL",(e,t)=>{XP.init(e,t),Ct.init(e,t)}),NV=te("ZodEmoji",(e,t)=>{JP.init(e,t),Ct.init(e,t)}),CV=te("ZodNanoID",(e,t)=>{QP.init(e,t),Ct.init(e,t)}),EV=te("ZodCUID",(e,t)=>{WP.init(e,t),Ct.init(e,t)}),TV=te("ZodCUID2",(e,t)=>{eU.init(e,t),Ct.init(e,t)}),AV=te("ZodULID",(e,t)=>{tU.init(e,t),Ct.init(e,t)}),OV=te("ZodXID",(e,t)=>{nU.init(e,t),Ct.init(e,t)}),RV=te("ZodKSUID",(e,t)=>{rU.init(e,t),Ct.init(e,t)}),MV=te("ZodIPv4",(e,t)=>{lU.init(e,t),Ct.init(e,t)}),DV=te("ZodIPv6",(e,t)=>{uU.init(e,t),Ct.init(e,t)}),$V=te("ZodCIDRv4",(e,t)=>{cU.init(e,t),Ct.init(e,t)}),LV=te("ZodCIDRv6",(e,t)=>{dU.init(e,t),Ct.init(e,t)}),PV=te("ZodBase64",(e,t)=>{fU.init(e,t),Ct.init(e,t)}),UV=te("ZodBase64URL",(e,t)=>{mU.init(e,t),Ct.init(e,t)}),VV=te("ZodE164",(e,t)=>{pU.init(e,t),Ct.init(e,t)}),BV=te("ZodJWT",(e,t)=>{xU.init(e,t),Ct.init(e,t)}),Dj=te("ZodNumber",(e,t)=>{Sj.init(e,t),Nt.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(Dj,e)}const ZV=te("ZodNumberFormat",(e,t)=>{yU.init(e,t),Dj.init(e,t)});function lw(e){return p8(ZV,e)}const IV=te("ZodBoolean",(e,t)=>{bU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>P8(e,n,a)});function Ua(e){return g8(IV,e)}const HV=te("ZodUnknown",(e,t)=>{vU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>V8()});function uw(){return x8(HV)}const FV=te("ZodNever",(e,t)=>{kU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>U8(e,n,a)});function qV(e){return y8(FV,e)}const GV=te("ZodArray",(e,t)=>{wU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>F8(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(Xc(n,a)),e.nonempty=n=>e.check(Xc(1,n)),e.max=(n,a)=>e.check(Cj(n,a)),e.length=(n,a)=>e.check(Ej(n,a)),e.unwrap=()=>e.element});function Ys(e,t){return T8(GV,e,t)}const YV=te("ZodObject",(e,t)=>{zU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>q8(e,n,a,s),et(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(Pj,e,n[0]),e.required=(...n)=>K9(Uj,e,n[0])});function dn(e,t){const n={type:"object",shape:e??{},...ze(t)};return new YV(n)}const $j=te("ZodUnion",(e,t)=>{jj.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>G8(e,n,a,s),e.options=t.options});function Lj(e,t){return new $j({type:"union",options:e,...ze(t)})}const KV=te("ZodDiscriminatedUnion",(e,t)=>{$j.init(e,t),_U.init(e,t)});function XV(e,t,n){return new KV({type:"union",options:t,discriminator:e,...ze(n)})}const JV=te("ZodIntersection",(e,t)=>{jU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Y8(e,n,a,s)});function QV(e,t){return new JV({type:"intersection",left:e,right:t})}const WV=te("ZodRecord",(e,t)=>{NU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>K8(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,...ze(n)})}const Up=te("ZodEnum",(e,t)=>{CU.init(e,t),Nt.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:[],...ze(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:[],...ze(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,...ze(t)})}const eB=te("ZodLiteral",(e,t)=>{EU.init(e,t),Nt.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],...ze(t)})}const tB=te("ZodTransform",(e,t)=>{TU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>H8(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new oj(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 Pj=te("ZodOptional",(e,t)=>{Nj.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Rj(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function dw(e){return new Pj({type:"optional",innerType:e})}const rB=te("ZodExactOptional",(e,t)=>{AU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Rj(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function aB(e){return new rB({type:"optional",innerType:e})}const iB=te("ZodNullable",(e,t)=>{OU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>X8(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function fw(e){return new iB({type:"nullable",innerType:e})}const sB=te("ZodDefault",(e,t)=>{RU.init(e,t),Nt.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():dj(t)}})}const lB=te("ZodPrefault",(e,t)=>{MU.init(e,t),Nt.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():dj(t)}})}const Uj=te("ZodNonOptional",(e,t)=>{DU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>J8(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function cB(e,t){return new Uj({type:"nonoptional",innerType:e,...ze(t)})}const dB=te("ZodCatch",(e,t)=>{$U.init(e,t),Nt.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=te("ZodPipe",(e,t)=>{LU.init(e,t),Nt.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=te("ZodReadonly",(e,t)=>{PU.init(e,t),Nt.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=te("ZodCustom",(e,t)=>{UU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>I8(e,n)});function xB(e,t={}){return A8(gB,e,t)}function yB(e){return O8(e)}const ft={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=dn({provider:bd(["google","openai","openrouter","ollama"]).default(ft.audio.provider),model:We().min(1).default(ft.audio.model),enabled:Ua().default(ft.audio.enabled),apiKey:We().optional(),base_url:We().optional(),maxDurationSeconds:Tr().default(ft.audio.maxDurationSeconds),supportedMimeTypes:Ys(We()).default(ft.audio.supportedMimeTypes)}),Fl=dn({provider:bd(["openai","anthropic","openrouter","ollama","gemini"]).default(ft.llm.provider),model:We().min(1).default(ft.llm.model),temperature:Tr().min(0).max(1).default(ft.llm.temperature),max_tokens:Tr().int().positive().optional(),api_key:We().optional(),base_url:We().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:We().optional(),timeout_ms:Tr().int().positive().optional()}),wB=Fl,SB=Fl,zB=dn({telegram_notify_all:Ua().optional()}).optional(),_B=dn({timezone:We().default("UTC"),check_interval_ms:Tr().min(6e4).default(6e4),max_active_jobs:Tr().min(1).max(1e3).default(100)}),jB=dn({agent:dn({name:We().default(ft.agent.name),personality:We().default(ft.agent.personality)}).default(ft.agent),llm:Fl.default(ft.llm),sati:vB.optional(),neo:wB.optional(),apoc:kB.optional(),trinity:SB.optional(),webhooks:zB,audio:bB.default(ft.audio),memory:dn({limit:Tr().int().positive().optional()}).default(ft.memory),runtime:dn({async_tasks:dn({enabled:Ua().default(ft.runtime?.async_tasks.enabled)}).default(ft.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:_B.optional(),channels:dn({telegram:dn({enabled:Ua().default(!1),token:We().optional(),allowedUsers:Ys(We()).default([])}).default(ft.channels.telegram),discord:dn({enabled:Ua().default(!1),token:We().optional(),allowedUsers:Ys(We()).default([])}).default(ft.channels.discord)}).default(ft.channels),ui:dn({enabled:Ua().default(ft.ui.enabled),port:Tr().default(ft.ui.port)}).default(ft.ui),logging:dn({enabled:Ua().default(ft.logging.enabled),level:bd(["debug","info","warn","error"]).default(ft.logging.level),retention:We().default(ft.logging.retention)}).default(ft.logging)}),NB=XV("transport",[dn({transport:cw("stdio"),command:We().min(1,"Command is required for stdio transport"),args:Ys(We()).optional().default([]),env:$c(We(),We()).optional().default({}),_comment:We().optional()}),dn({transport:cw("http"),url:We().url("Valid URL is required for http transport"),headers:$c(We(),We()).optional().default({}),args:Ys(We()).optional().default([]),env:$c(We(),We()).optional().default({}),_comment:We().optional()})]);$c(We(),Lj([NB,We()]));function ie(e,t,n){function a(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const v=g[y];v in f||(f[v]=m[v].bind(f))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(f){var h;const m=n?.Parent?new u:this;a(m,f),(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:f=>n?.Parent&&f instanceof n.Parent?!0:f?._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 Vj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Bj={};function Ai(e){return Bj}function Zj(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 rx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ax(e){return e==null}function ix(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 rt(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 CB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ij="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const EB=rx(()=>{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 Hj(e){return Ml(e)?{...e}:Array.isArray(e)?[...e]:e}const TB=new Set(["string","number","symbol"]);function Ks(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 Te(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 f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}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 f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}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 f=t._zod.def.shape,h={...f};if(n)for(const m in n){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)h[m]=e?new e({type:"optional",innerType:f[m]}):f[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 Fj(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 sx(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 qj=(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})},Gj=ie("$ZodError",qj),Yj=ie("$ZodError",qj,{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,f=0;for(;f<u.path.length;){const h=u.path[f];f===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const ox=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 f=new(s?.Err??e)(l.issues.map(h=>Oi(h,u,Ai())));throw Ij(f,s?.callee),f}return l.value},lx=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 f=new(s?.Err??e)(l.issues.map(h=>Oi(h,u,Ai())));throw Ij(f,s?.callee),f}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??Gj)(u.issues.map(l=>Oi(l,s,Ai())))}:{success:!0,data:u.value}},BB=vd(Yj),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(Yj),IB=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ox(e)(t,n,s)},HB=e=>(t,n,a)=>ox(e)(t,n,a),FB=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return lx(e)(t,n,s)},qB=e=>async(t,n,a)=>lx(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),KB=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kd(e)(t,n,s)},XB=e=>async(t,n,a)=>kd(e)(t,n,a),JB=/^[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}=))?$/,Kj=/^[A-Za-z0-9_-]*$/,hZ=/^\+[1-9]\d{6,14}$/,Xj="(?:(?:\\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(`^${Xj}$`);function Jj(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(`^${Jj(e)}$`)}function gZ(e){const t=Jj({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(`^${Xj}T(?:${a})$`)}const xZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},yZ=/^[^A-Z]*$/,bZ=/^[^a-z]*$/,Lr=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vZ=ie("$ZodCheckMaxLength",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ax(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=sx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),kZ=ie("$ZodCheckMinLength",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ax(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=sx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),wZ=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ax(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=sx(s),f=u>t.length;a.issues.push({origin:l,...f?{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=ie("$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=ie("$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=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yZ),wd.init(e,t)}),_Z=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bZ),wd.init(e,t)}),jZ=ie("$ZodCheckIncludes",(e,t)=>{Lr.init(e,t);const n=Ks(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})}}),NZ=ie("$ZodCheckStartsWith",(e,t)=>{Lr.init(e,t);const n=new RegExp(`^${Ks(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})}}),CZ=ie("$ZodCheckEndsWith",(e,t)=>{Lr.init(e,t);const n=new RegExp(`.*${Ks(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=ie("$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},Ft=ie("$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,f,h)=>{let m=Ds(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,b=y._zod.check(l);if(b instanceof Promise&&h?.async===!1)throw new Is;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,l.issues.length!==v&&(m||(m=Ds(l,v)))});else{if(l.issues.length===v)continue;m||(m=Ds(l,v))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Ds(l))return l.aborted=!0,l;const m=s(f,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,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,f)):u(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Is;return h.then(m=>s(m,a,f))}return s(h,a,f)}}rt(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}))}),ux=ie("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??xZ(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}}),St=ie("$ZodStringFormat",(e,t)=>{wd.init(e,t),ux.init(e,t)}),OZ=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=aZ),St.init(e,t)}),RZ=ie("$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());St.init(e,t)}),MZ=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=iZ),St.init(e,t)}),DZ=ie("$ZodURL",(e,t)=>{St.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=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=oZ()),St.init(e,t)}),LZ=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=nZ),St.init(e,t)}),PZ=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=JB),St.init(e,t)}),UZ=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=QB),St.init(e,t)}),VZ=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=WB),St.init(e,t)}),BZ=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eZ),St.init(e,t)}),ZZ=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tZ),St.init(e,t)}),IZ=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=gZ(t)),St.init(e,t)}),HZ=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mZ),St.init(e,t)}),FZ=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pZ(t)),St.init(e,t)}),qZ=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rZ),St.init(e,t)}),GZ=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=lZ),St.init(e,t),e._zod.bag.format="ipv4"}),YZ=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=uZ),St.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})}}}),KZ=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cZ),St.init(e,t)}),XZ=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=dZ),St.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 Qj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const JZ=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=fZ),St.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Qj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function QZ(e){if(!Kj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qj(n)}const WZ=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Kj),St.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})}}),e7=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hZ),St.init(e,t)});function t7(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 n7=ie("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=n=>{t7(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),r7=ie("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),a7=ie("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function xw(e,t,n){e.issues.length&&t.issues.push(...Fj(n,e.issues)),t.value[n]=e.value}const i7=ie("$ZodArray",(e,t)=>{Ft.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 f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?u.push(h.then(m=>xw(m,n,l))):xw(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(...Fj(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Wj(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 e2(e,t,n,a,s,u){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){l.push(y);continue}const v=h.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(b=>Wc(b,n,y,t,g))):Wc(v,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 s7=ie("$ZodObject",(e,t)=>{if(Ft.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=rx(()=>Wj(t));rt(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[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=(f,h)=>{l??(l=a.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const g=[],y=l.shape;for(const v of l.keys){const b=y[v],S=b._zod.optout==="optional",j=b._zod.run({value:m[v],issues:[]},h);j instanceof Promise?g.push(j.then(A=>Wc(A,f,v,m,S))):Wc(j,f,v,m,S)}return u?e2(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),o7=ie("$ZodObjectJIT",(e,t)=>{s7.init(e,t);const n=e._zod.parse,a=rx(()=>Wj(t)),s=v=>{const b=new TZ(["shape","payload","ctx"]),S=a.value,j=N=>{const L=pw(N);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};b.write("const input = payload.value;");const A=Object.create(null);let E=0;for(const N of S.keys)A[N]=`key_${E++}`;b.write("const newResult = {};");for(const N of S.keys){const L=A[N],D=pw(N),q=v[N]?._zod?.optout==="optional";b.write(`const ${L} = ${j(N)};`),q?b.write(`
73
+ if (${L}.issues.length) {
74
+ if (${D} in input) {
75
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
76
+ ...iss,
77
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
78
+ })));
79
+ }
80
+ }
81
+
82
+ if (${L}.value === undefined) {
83
+ if (${D} in input) {
84
+ newResult[${D}] = undefined;
85
+ }
86
+ } else {
87
+ newResult[${D}] = ${L}.value;
88
+ }
89
+
90
+ `):b.write(`
91
+ if (${L}.issues.length) {
92
+ payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
93
+ ...iss,
94
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
95
+ })));
96
+ }
97
+
98
+ if (${L}.value === undefined) {
99
+ if (${D} in input) {
100
+ newResult[${D}] = undefined;
101
+ }
102
+ } else {
103
+ newResult[${D}] = ${L}.value;
104
+ }
105
+
106
+ `)}b.write("payload.value = newResult;"),b.write("return payload;");const O=b.compile();return(N,L)=>O(v,N,L)};let u;const l=Qc,f=!Bj.jitless,m=f&&EB.value,g=t.catchall;let y;e._zod.parse=(v,b)=>{y??(y=a.value);const S=v.value;return l(S)?f&&m&&b?.async===!1&&b.jitless!==!0?(u||(u=s(t.shape)),v=u(v,b),g?e2([],S,v,b,y,e):v):n(v,b):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function yw(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 l7=ie("$ZodUnion",(e,t)=>{Ft.init(e,t),rt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),rt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),rt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),rt(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=>ix(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 f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)f.push(m),l=!0;else{if(m.issues.length===0)return m;f.push(m)}}return l?Promise.all(f).then(h=>yw(h,s,e,u)):yw(f,s,e,u)}}),u7=ie("$ZodIntersection",(e,t)=>{Ft.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 f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const u=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);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 c7=ie("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=Zj(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"?Ks(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}}),d7=ie("$ZodLiteral",(e,t)=>{if(Ft.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"?Ks(a):a?Ks(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}}),f7=ie("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Vj(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 t2=ie("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",rt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),rt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ix(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)}}),h7=ie("$ZodExactOptional",(e,t)=>{t2.init(e,t),rt(e._zod,"values",()=>t.innerType._zod.values),rt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),m7=ie("$ZodNullable",(e,t)=>{Ft.init(e,t),rt(e._zod,"optin",()=>t.innerType._zod.optin),rt(e._zod,"optout",()=>t.innerType._zod.optout),rt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ix(n.source)}|null)$`):void 0}),rt(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)}),p7=ie("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",rt(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 g7=ie("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",rt(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))}),x7=ie("$ZodNonOptional",(e,t)=>{Ft.init(e,t),rt(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 y7=ie("$ZodCatch",(e,t)=>{Ft.init(e,t),rt(e._zod,"optin",()=>t.innerType._zod.optin),rt(e._zod,"optout",()=>t.innerType._zod.optout),rt(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)}}),b7=ie("$ZodPipe",(e,t)=>{Ft.init(e,t),rt(e._zod,"values",()=>t.in._zod.values),rt(e._zod,"optin",()=>t.in._zod.optin),rt(e._zod,"optout",()=>t.out._zod.optout),rt(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 v7=ie("$ZodReadonly",(e,t)=>{Ft.init(e,t),rt(e._zod,"propValues",()=>t.innerType._zod.propValues),rt(e._zod,"values",()=>t.innerType._zod.values),rt(e._zod,"optin",()=>t.innerType?._zod?.optin),rt(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 k7=ie("$ZodCustom",(e,t)=>{Lr.init(e,t),Ft.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 w7{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 S7(){return new w7}(_w=globalThis).__zod_globalRegistry??(_w.__zod_globalRegistry=S7());const ml=globalThis.__zod_globalRegistry;function z7(e,t){return new e({type:"string",...Te(t)})}function _7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function jw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function j7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function N7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}function C7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}function E7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}function T7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}function A7(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}function O7(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}function R7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}function M7(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}function D7(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}function $7(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}function L7(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}function P7(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}function U7(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}function V7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}function B7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}function Z7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}function I7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}function H7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}function F7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}function q7(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}function G7(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}function Y7(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}function K7(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}function X7(e){return new e({type:"unknown"})}function J7(e,t){return new e({type:"never",...Te(t)})}function n2(e,t){return new vZ({check:"max_length",...Te(t),maximum:e})}function ed(e,t){return new kZ({check:"min_length",...Te(t),minimum:e})}function r2(e,t){return new wZ({check:"length_equals",...Te(t),length:e})}function Q7(e,t){return new SZ({check:"string_format",format:"regex",...Te(t),pattern:e})}function W7(e){return new zZ({check:"string_format",format:"lowercase",...Te(e)})}function eI(e){return new _Z({check:"string_format",format:"uppercase",...Te(e)})}function tI(e,t){return new jZ({check:"string_format",format:"includes",...Te(t),includes:e})}function nI(e,t){return new NZ({check:"string_format",format:"starts_with",...Te(t),prefix:e})}function rI(e,t){return new CZ({check:"string_format",format:"ends_with",...Te(t),suffix:e})}function oo(e){return new EZ({check:"overwrite",tx:e})}function aI(e){return oo(t=>t.normalize(e))}function iI(){return oo(e=>e.trim())}function sI(){return oo(e=>e.toLowerCase())}function oI(){return oo(e=>e.toUpperCase())}function lI(){return oo(e=>CB(e))}function uI(e,t,n){return new e({type:"array",element:t,...Te(n)})}function cI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}function dI(e){const t=fI(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 fI(e,t){const n=new Lr({check:"custom",...Te(t)});return n._zod.check=e,n}function a2(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 un(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 f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const v=l.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,v,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),un(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"&&vn(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 i2(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 f=e.metadataRegistry.get(l[0])?.id;if(f){const h=a.get(f);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,l[0])}}const s=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(y)return{ref:v(y)};const b=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(l[1]===n)return{ref:"#"};const m=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:h,defId:m}=s(l);f.def={...f.schema},m&&(f.defId=m);const g=f.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.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 f=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(f.cycle){u(l);continue}if(f.count>1&&e.reused==="ref"){u(l);continue}}}function s2(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 f=e.seen.get(l);if(f.ref===null)return;const h=f.def??f.schema,m={...h},g=f.ref;if(f.ref=null,g){a(g);const v=e.seen.get(g),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(b)):Object.assign(h,b),Object.assign(h,m),l._zod.parent===g)for(const j in h)j==="$ref"||j==="allOf"||j in m||delete h[j];if(b.$ref&&v.def)for(const j in h)j==="$ref"||j==="allOf"||j in v.def&&JSON.stringify(h[j])===JSON.stringify(v.def[j])&&delete h[j]}const y=l._zod.parent;if(y&&y!==g){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(h.$ref=v.schema.$ref,v.def))for(const b in h)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(h[b])===JSON.stringify(v.def[b])&&delete h[b]}e.override({zodSchema:l,jsonSchema:h,path:f.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 f=l[1];f.def&&f.defId&&(u[f.defId]=f.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 vn(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 vn(a.element,n);if(a.type==="set")return vn(a.valueType,n);if(a.type==="lazy")return vn(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 vn(a.innerType,n);if(a.type==="intersection")return vn(a.left,n)||vn(a.right,n);if(a.type==="record"||a.type==="map")return vn(a.keyType,n)||vn(a.valueType,n);if(a.type==="pipe")return vn(a.in,n)||vn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(vn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(vn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(vn(s,n))return!0;return!!(a.rest&&vn(a.rest,n))}return!1}const hI=(e,t={})=>n=>{const a=a2({...n,processors:t});return un(e,a),i2(a,e),s2(a,e)},td=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=a2({...s??{},target:u,io:t,processors:n});return un(e,l),i2(l,e),s2(l,e)},mI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pI=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),f&&(s.format=mI[f]??f,s.format===""&&delete s.format,f==="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}))])}},gI=(e,t,n,a)=>{n.not={}},xI=(e,t,n,a)=>{},yI=(e,t,n,a)=>{const s=e._zod.def,u=Zj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},bI=(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},vI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wI=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=un(u.element,t,{...a,path:[...a.path,"items"]})},SI=(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]=un(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].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=un(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},zI=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((f,h)=>un(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},_I=(e,t,n,a)=>{const s=e._zod.def,u=un(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=un(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(u)?u.allOf:[u],...f(l)?l.allOf:[l]];n.allOf=h},jI=(e,t,n,a)=>{const s=e._zod.def,u=un(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"}]},NI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},CI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},EI=(e,t,n,a)=>{const s=e._zod.def;un(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)))},TI=(e,t,n,a)=>{const s=e._zod.def;un(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},AI=(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;un(u,t,a);const l=t.seen.get(e);l.ref=u},OI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},o2=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},RI=ie("ZodISODateTime",(e,t)=>{IZ.init(e,t),Et.init(e,t)});function MI(e){return q7(RI,e)}const DI=ie("ZodISODate",(e,t)=>{HZ.init(e,t),Et.init(e,t)});function $I(e){return G7(DI,e)}const LI=ie("ZodISOTime",(e,t)=>{FZ.init(e,t),Et.init(e,t)});function PI(e){return Y7(LI,e)}const UI=ie("ZodISODuration",(e,t)=>{qZ.init(e,t),Et.init(e,t)});function VI(e){return K7(UI,e)}const l2=(e,t)=>{Gj.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}}})},BI=ie("ZodError",l2),fr=ie("ZodError",l2,{Parent:Error}),ZI=ox(fr),II=lx(fr),HI=vd(fr),FI=kd(fr),qI=IB(fr),GI=HB(fr),YI=FB(fr),KI=qB(fr),XI=GB(fr),JI=YB(fr),QI=KB(fr),WI=XB(fr),qt=ie("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:td(e,"input"),output:td(e,"output")}}),e.toJSONSchema=hI(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)=>ZI(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>HI(e,n,a),e.parseAsync=async(n,a)=>II(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>FI(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>qI(e,n,a),e.decode=(n,a)=>GI(e,n,a),e.encodeAsync=async(n,a)=>YI(e,n,a),e.decodeAsync=async(n,a)=>KI(e,n,a),e.safeEncode=(n,a)=>XI(e,n,a),e.safeDecode=(n,a)=>JI(e,n,a),e.safeEncodeAsync=async(n,a)=>QI(e,n,a),e.safeDecodeAsync=async(n,a)=>WI(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=>c2([e,n]),e.and=n=>NH(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)),u2=ie("_ZodString",(e,t)=>{ux.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>pI(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(Q7(...a)),e.includes=(...a)=>e.check(tI(...a)),e.startsWith=(...a)=>e.check(nI(...a)),e.endsWith=(...a)=>e.check(rI(...a)),e.min=(...a)=>e.check(ed(...a)),e.max=(...a)=>e.check(n2(...a)),e.length=(...a)=>e.check(r2(...a)),e.nonempty=(...a)=>e.check(ed(1,...a)),e.lowercase=a=>e.check(W7(a)),e.uppercase=a=>e.check(eI(a)),e.trim=()=>e.check(iI()),e.normalize=(...a)=>e.check(aI(...a)),e.toLowerCase=()=>e.check(sI()),e.toUpperCase=()=>e.check(oI()),e.slugify=()=>e.check(lI())}),eH=ie("ZodString",(e,t)=>{ux.init(e,t),u2.init(e,t),e.email=n=>e.check(_7(tH,n)),e.url=n=>e.check(T7(nH,n)),e.jwt=n=>e.check(F7(xH,n)),e.emoji=n=>e.check(A7(rH,n)),e.guid=n=>e.check(jw(Nw,n)),e.uuid=n=>e.check(j7(_c,n)),e.uuidv4=n=>e.check(N7(_c,n)),e.uuidv6=n=>e.check(C7(_c,n)),e.uuidv7=n=>e.check(E7(_c,n)),e.nanoid=n=>e.check(O7(aH,n)),e.guid=n=>e.check(jw(Nw,n)),e.cuid=n=>e.check(R7(iH,n)),e.cuid2=n=>e.check(M7(sH,n)),e.ulid=n=>e.check(D7(oH,n)),e.base64=n=>e.check(Z7(mH,n)),e.base64url=n=>e.check(I7(pH,n)),e.xid=n=>e.check($7(lH,n)),e.ksuid=n=>e.check(L7(uH,n)),e.ipv4=n=>e.check(P7(cH,n)),e.ipv6=n=>e.check(U7(dH,n)),e.cidrv4=n=>e.check(V7(fH,n)),e.cidrv6=n=>e.check(B7(hH,n)),e.e164=n=>e.check(H7(gH,n)),e.datetime=n=>e.check(MI(n)),e.date=n=>e.check($I(n)),e.time=n=>e.check(PI(n)),e.duration=n=>e.check(VI(n))});function Rm(e){return z7(eH,e)}const Et=ie("ZodStringFormat",(e,t)=>{St.init(e,t),u2.init(e,t)}),tH=ie("ZodEmail",(e,t)=>{MZ.init(e,t),Et.init(e,t)}),Nw=ie("ZodGUID",(e,t)=>{OZ.init(e,t),Et.init(e,t)}),_c=ie("ZodUUID",(e,t)=>{RZ.init(e,t),Et.init(e,t)}),nH=ie("ZodURL",(e,t)=>{DZ.init(e,t),Et.init(e,t)}),rH=ie("ZodEmoji",(e,t)=>{$Z.init(e,t),Et.init(e,t)}),aH=ie("ZodNanoID",(e,t)=>{LZ.init(e,t),Et.init(e,t)}),iH=ie("ZodCUID",(e,t)=>{PZ.init(e,t),Et.init(e,t)}),sH=ie("ZodCUID2",(e,t)=>{UZ.init(e,t),Et.init(e,t)}),oH=ie("ZodULID",(e,t)=>{VZ.init(e,t),Et.init(e,t)}),lH=ie("ZodXID",(e,t)=>{BZ.init(e,t),Et.init(e,t)}),uH=ie("ZodKSUID",(e,t)=>{ZZ.init(e,t),Et.init(e,t)}),cH=ie("ZodIPv4",(e,t)=>{GZ.init(e,t),Et.init(e,t)}),dH=ie("ZodIPv6",(e,t)=>{YZ.init(e,t),Et.init(e,t)}),fH=ie("ZodCIDRv4",(e,t)=>{KZ.init(e,t),Et.init(e,t)}),hH=ie("ZodCIDRv6",(e,t)=>{XZ.init(e,t),Et.init(e,t)}),mH=ie("ZodBase64",(e,t)=>{JZ.init(e,t),Et.init(e,t)}),pH=ie("ZodBase64URL",(e,t)=>{WZ.init(e,t),Et.init(e,t)}),gH=ie("ZodE164",(e,t)=>{e7.init(e,t),Et.init(e,t)}),xH=ie("ZodJWT",(e,t)=>{n7.init(e,t),Et.init(e,t)}),yH=ie("ZodUnknown",(e,t)=>{r7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xI()});function Cw(){return X7(yH)}const bH=ie("ZodNever",(e,t)=>{a7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gI(e,n,a)});function vH(e){return J7(bH,e)}const kH=ie("ZodArray",(e,t)=>{i7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>wI(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(n2(n,a)),e.length=(n,a)=>e.check(r2(n,a)),e.unwrap=()=>e.element});function wH(e,t){return uI(kH,e,t)}const SH=ie("ZodObject",(e,t)=>{o7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>SI(e,n,a,s),rt(e,"shape",()=>t.shape),e.keyof=()=>CH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Cw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Cw()}),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(d2,e,n[0]),e.required=(...n)=>PB(f2,e,n[0])});function zH(e,t){const n={type:"object",shape:e??{},...Te(t)};return new SH(n)}const _H=ie("ZodUnion",(e,t)=>{l7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>zI(e,n,a,s),e.options=t.options});function c2(e,t){return new _H({type:"union",options:e,...Te(t)})}const jH=ie("ZodIntersection",(e,t)=>{u7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_I(e,n,a,s)});function NH(e,t){return new jH({type:"intersection",left:e,right:t})}const Zp=ie("ZodEnum",(e,t)=>{c7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>yI(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:[],...Te(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:[],...Te(s),entries:u})}});function CH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Zp({type:"enum",entries:n,...Te(t)})}const EH=ie("ZodLiteral",(e,t)=>{d7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>bI(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],...Te(t)})}const TH=ie("ZodTransform",(e,t)=>{f7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>kI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Vj(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 d2=ie("ZodOptional",(e,t)=>{t2.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>o2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Tw(e){return new d2({type:"optional",innerType:e})}const OH=ie("ZodExactOptional",(e,t)=>{h7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>o2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function RH(e){return new OH({type:"optional",innerType:e})}const MH=ie("ZodNullable",(e,t)=>{m7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>jI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Aw(e){return new MH({type:"nullable",innerType:e})}const DH=ie("ZodDefault",(e,t)=>{p7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>CI(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():Hj(t)}})}const LH=ie("ZodPrefault",(e,t)=>{g7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>EI(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():Hj(t)}})}const f2=ie("ZodNonOptional",(e,t)=>{x7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>NI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function UH(e,t){return new f2({type:"nonoptional",innerType:e,...Te(t)})}const VH=ie("ZodCatch",(e,t)=>{y7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>TI(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=ie("ZodPipe",(e,t)=>{b7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>AI(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=ie("ZodReadonly",(e,t)=>{v7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>OI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function HH(e){return new IH({type:"readonly",innerType:e})}const FH=ie("ZodCustom",(e,t)=>{k7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vI(e,n)});function qH(e,t={}){return cI(FH,e,t)}function GH(e){return dI(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"}],KH=[{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 XH(){const{data:e,error:t}=zt("/api/config",ir.fetchConfig),{data:n}=zt("/api/config/sati",ir.getSatiConfig),{data:a}=zt("/api/config/apoc",ir.getApocConfig),{data:s}=zt("/api/config/neo",ir.getNeoConfig),{data:u}=zt("/api/config/trinity",ir.getTrinityConfig),{data:l}=zt("/api/config/encryption-status",()=>ir.getEncryptionStatus()),{data:f}=zt("/api/config/env-overrides",()=>ir.getEnvOverrides()),{data:h}=Y_(),[m,g]=z.useState(null),[y,v]=z.useState(!1),[b,S]=z.useState(null),[j,A]=z.useState(null),[E,O]=z.useState(null),[N,L]=z.useState(null),[D,R]=z.useState(null),[q,V]=z.useState("general"),[X,fe]=z.useState("oracle"),[se,le]=z.useState(!1),[ee,oe]=z.useState({}),[ae,P]=z.useState(null);z.useEffect(()=>{e&&!b&&S(e)},[e]),z.useEffect(()=>{n&&!j&&A(n)},[n]),z.useEffect(()=>{a&&!N?L(a):!a&&!N&&b&&L({...b.apoc??b.llm,temperature:b.apoc?.temperature??.2,timeout_ms:b.apoc?.timeout_ms??3e4})},[a,b]),z.useEffect(()=>{s&&!E?O(s):!s&&!E&&b&&O({...b.neo??b.llm,temperature:b.neo?.temperature??.2})},[s,b]),z.useEffect(()=>{u&&!D?R(u):!u&&!D&&b&&R({...b.trinity??b.llm,temperature:b.trinity?.temperature??.2})},[u,b]),z.useEffect(()=>{h&&!m&&g(h)},[h]);const J=JSON.stringify(e)!==JSON.stringify(b)||JSON.stringify(n)!==JSON.stringify(j)||JSON.stringify(s)!==JSON.stringify(E)||JSON.stringify(a)!==JSON.stringify(N)||JSON.stringify(u)!==JSON.stringify(D),B=(Z,Ne)=>{if(!l?.apiKeysEncrypted)return null;const{morpheusSecretSet:qe,apiKeysEncrypted:Lt}=l,Me=Lt[Z];return!Ne?d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-azure-surface border border-azure-border text-azure-text-secondary dark:bg-matrix-primary/10 dark:border-matrix-primary dark:text-matrix-tertiary",children:"No API key"}):f&&f[me(Z)]?null:qe?Me?d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-emerald-100 border border-emerald-300 text-emerald-800 dark:bg-emerald-900/30 dark:border-emerald-700 dark:text-emerald-400",title:"API key encrypted with AES-256-GCM",children:"🔒 Encrypted"}):d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-amber-100 border border-amber-300 text-amber-800 dark:bg-amber-900/30 dark:border-amber-700 dark:text-amber-400",title:"Re-save this configuration to encrypt the API key",children:"⚠️ Re-save to encrypt"}):d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-amber-100 border border-amber-300 text-amber-800 dark:bg-amber-900/30 dark:border-amber-700 dark:text-amber-400",title:"Set MORPHEUS_SECRET to enable encryption",children:"⚠️ Plaintext"})},me=Z=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[Z],T=Z=>!f||!f[Z]?null:d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-blue-100 border border-blue-300 text-blue-800 dark:bg-blue-900/30 dark:border-blue-700 dark:text-blue-400",title:"This field is set by an environment variable and cannot be edited",children:"🔒 Env Var"}),C=Z=>!!(f&&f[Z]),I=(Z,Ne)=>{if(!b)return;const qe=JSON.parse(JSON.stringify(b));let Lt=qe;for(let Me=0;Me<Z.length-1;Me++)Lt=Lt[Z[Me]];Lt[Z[Z.length-1]]=Ne,S(qe);try{jB.parse(qe),oe({})}catch(Me){if(Me instanceof BI){const Ke={};Me.errors.forEach(at=>{const Qe=at.path.join(".");Ke[Qe]=at.message}),oe(Ke)}}},w=(Z,Ne)=>{j&&A({...j,[Z]:Ne})},Y=(Z,Ne)=>{N&&L({...N,[Z]:Ne})},de=(Z,Ne)=>{E&&O({...E,[Z]:Ne})},he=(Z,Ne)=>{D&&R({...D,[Z]:Ne})},pe=()=>{!b||!D||R({...D,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Pe=()=>{!b||!j||A({...j,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Ae=()=>{!b||!N||L({...N,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},pt=()=>{!b||!E||O({...E,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Rt=async()=>{if(b){le(!0),P(null);try{await ir.updateConfig(b),j&&await ir.updateSatiConfig(j),E&&await ir.updateNeoConfig(E),N&&await ir.updateApocConfig(N),D&&await ir.updateTrinityConfig(D),On("/api/config"),On("/api/config/sati"),On("/api/config/neo"),On("/api/config/apoc"),On("/api/config/trinity"),P({type:"success",message:"Settings saved successfully. Restart Morpheus daemon for changes to take effect."})}catch(Z){if(P({type:"error",message:Z.message}),Z.details&&Array.isArray(Z.details)){const Ne={};Z.details.forEach(qe=>{const Lt=qe.path.join(".");Ne[Lt]=qe.message}),oe(Ne)}}finally{le(!1)}}};return t?d.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):b?d.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Zaion Settings"}),d.jsx("button",{onClick:Rt,disabled:!J||Object.keys(ee).length>0||se,className:`px-4 py-2 rounded font-medium transition-colors ${J&&Object.keys(ee).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:se?"Saving...":"Save Changes"})]}),ae&&d.jsx("div",{className:`p-4 rounded border ${ae.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:ae.message}),d.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:d.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:YH.map(Z=>d.jsx("button",{onClick:()=>V(Z.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${q===Z.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:Z.label},Z.id))})}),d.jsxs("div",{className:"space-y-6",children:[q==="general"&&d.jsxs(ar,{title:"Agent Identity",children:[d.jsx(lt,{label:"Agent Name",value:b.agent.name,onChange:Z=>I(["agent","name"],Z.target.value),error:ee["agent.name"]}),d.jsx(lt,{label:"Personality",value:b.agent.personality,onChange:Z=>I(["agent","personality"],Z.target.value),error:ee["agent.personality"]})]}),q==="agents"&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:KH.map(Z=>d.jsx("button",{onClick:()=>fe(Z.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${X===Z.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:Z.label},Z.id))}),X==="oracle"&&d.jsxs(ar,{title:"Oracle Agent",children:[d.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"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("llm.provider")]}),d.jsx(jr,{label:"",value:b.llm.provider,onChange:Z=>I(["llm","provider"],Z.target.value),options:cl,error:ee["llm.provider"],disabled:C("llm.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("llm.model")]}),d.jsx(lt,{label:"",value:b.llm.model,onChange:Z=>I(["llm","model"],Z.target.value),disabled:C("llm.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("llm.temperature")]}),d.jsx(yn,{label:"",value:b.llm.temperature,onChange:Z=>I(["llm","temperature"],parseFloat(Z.target.value)),step:.1,min:0,max:1,error:ee["llm.temperature"],disabled:C("llm.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),T("llm.max_tokens")]}),d.jsx(yn,{label:"",value:b.llm.max_tokens??"",onChange:Z=>I(["llm","max_tokens"],Z.target.value?parseInt(Z.target.value):void 0),min:1,error:ee["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:C("llm.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),T("llm.context_window")]}),d.jsx(yn,{label:"",value:b.llm.context_window??100,onChange:Z=>I(["llm","context_window"],parseInt(Z.target.value)),min:1,step:1,error:ee["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:C("llm.context_window")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("llm.api_key"),B("oracle",b.llm.api_key)]})]}),d.jsx(lt,{label:"",type:"password",value:b.llm.api_key||"",onChange:Z=>I(["llm","api_key"],Z.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("llm.api_key")}),b.llm.provider==="openrouter"&&d.jsx(lt,{label:"Base URL",value:b.llm.base_url||"https://openrouter.ai/api/v1",onChange:Z=>I(["llm","base_url"],Z.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),X==="sati"&&d.jsxs(ar,{title:"Sati Agent",children:[d.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"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:Pe,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"}),d.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&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("sati.provider")]}),d.jsx(jr,{label:"",value:j.provider,onChange:Z=>w("provider",Z.target.value),options:cl,disabled:C("sati.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("sati.model")]}),d.jsx(lt,{label:"",value:j.model,onChange:Z=>w("model",Z.target.value),disabled:C("sati.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("sati.api_key"),B("sati",j.api_key)]})]}),d.jsx(lt,{label:"",type:"password",value:j.api_key||"",onChange:Z=>w("api_key",Z.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("sati.api_key")}),j.provider==="openrouter"&&d.jsx(lt,{label:"Base URL",value:j.base_url||"https://openrouter.ai/api/v1",onChange:Z=>w("base_url",Z.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(yn,{label:"Memory Limit",value:j.memory_limit??10,onChange:Z=>w("memory_limit",parseInt(Z.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),d.jsx(zs,{label:"Enable Archived Sessions in Memory Retrieval",checked:j.enabled_archived_sessions??!0,onChange:Z=>w("enabled_archived_sessions",Z)})]})]}),X==="neo"&&d.jsxs(ar,{title:"Neo Agent",children:[d.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"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:pt,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"}),d.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"})]}),E&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("neo.provider")]}),d.jsx(jr,{label:"",value:E.provider,onChange:Z=>de("provider",Z.target.value),options:cl,disabled:C("neo.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("neo.model")]}),d.jsx(lt,{label:"",value:E.model,onChange:Z=>de("model",Z.target.value),disabled:C("neo.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("neo.temperature")]}),d.jsx(yn,{label:"",value:E.temperature,onChange:Z=>de("temperature",parseFloat(Z.target.value)),step:.1,min:0,max:1,disabled:C("neo.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),T("neo.max_tokens")]}),d.jsx(yn,{label:"",value:E.max_tokens??"",onChange:Z=>de("max_tokens",Z.target.value?parseInt(Z.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:C("neo.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),T("neo.context_window")]}),d.jsx(yn,{label:"",value:E.context_window??100,onChange:Z=>de("context_window",parseInt(Z.target.value)),min:1,step:1,disabled:C("neo.context_window")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("neo.api_key"),B("neo",E.api_key)]})]}),d.jsx(lt,{label:"",type:"password",value:E.api_key||"",onChange:Z=>de("api_key",Z.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("neo.api_key")}),E.provider==="openrouter"&&d.jsx(lt,{label:"Base URL",value:E.base_url||"https://openrouter.ai/api/v1",onChange:Z=>de("base_url",Z.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),X==="trinity"&&d.jsxs(ar,{title:"Trinity Agent",children:[d.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)"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:pe,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"}),d.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"})]}),D&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("trinity.provider")]}),d.jsx(jr,{label:"",value:D.provider,onChange:Z=>he("provider",Z.target.value),options:cl,disabled:C("trinity.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("trinity.model")]}),d.jsx(lt,{label:"",value:D.model,onChange:Z=>he("model",Z.target.value),disabled:C("trinity.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("trinity.temperature")]}),d.jsx(yn,{label:"",value:D.temperature,onChange:Z=>he("temperature",parseFloat(Z.target.value)),step:.1,min:0,max:1,disabled:C("trinity.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),T("trinity.max_tokens")]}),d.jsx(yn,{label:"",value:D.max_tokens??"",onChange:Z=>he("max_tokens",Z.target.value?parseInt(Z.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:C("trinity.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("trinity.api_key"),B("trinity",D.api_key)]})]}),d.jsx(lt,{label:"",type:"password",value:D.api_key||"",onChange:Z=>he("api_key",Z.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("trinity.api_key")}),D.provider==="openrouter"&&d.jsx(lt,{label:"Base URL",value:D.base_url||"https://openrouter.ai/api/v1",onChange:Z=>he("base_url",Z.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),X==="apoc"&&d.jsxs(ar,{title:"Apoc Agent",children:[d.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"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:Ae,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"}),d.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&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("apoc.provider")]}),d.jsx(jr,{label:"",value:N.provider,onChange:Z=>Y("provider",Z.target.value),options:cl,disabled:C("apoc.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("apoc.model")]}),d.jsx(lt,{label:"",value:N.model,onChange:Z=>Y("model",Z.target.value),disabled:C("apoc.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("apoc.temperature")]}),d.jsx(yn,{label:"",value:N.temperature,onChange:Z=>Y("temperature",parseFloat(Z.target.value)),step:.1,min:0,max:1,disabled:C("apoc.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("apoc.api_key"),B("apoc",N.api_key)]})]}),d.jsx(lt,{label:"",type:"password",value:N.api_key||"",onChange:Z=>Y("api_key",Z.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("apoc.api_key")}),N.provider==="openrouter"&&d.jsx(lt,{label:"Base URL",value:N.base_url||"https://openrouter.ai/api/v1",onChange:Z=>Y("base_url",Z.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(lt,{label:"Working Directory",value:N.working_dir||"",onChange:Z=>Y("working_dir",Z.target.value),placeholder:"/home/user/projects",helperText:"Root directory for file and shell operations. Leave empty to use process working directory."}),d.jsx(yn,{label:"Timeout (ms)",value:N.timeout_ms??3e4,onChange:Z=>Y("timeout_ms",parseInt(Z.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),q==="audio"&&d.jsxs(ar,{title:"Audio Transcription",children:[d.jsx(zs,{label:"Enable Audio",checked:b.audio.enabled,onChange:Z=>I(["audio","enabled"],Z)}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("audio.provider")]}),d.jsx(jr,{label:"",value:b.audio.provider||"google",onChange:Z=>I(["audio","provider"],Z.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:ee["audio.provider"],disabled:C("audio.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model"}),T("audio.model")]}),d.jsx(lt,{label:"",value:b.audio.model,onChange:Z=>I(["audio","model"],Z.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:ee["audio.model"],disabled:C("audio.model")}),b.audio.provider==="ollama"&&d.jsx(lt,{label:"Base URL",value:b.audio.base_url||"",onChange:Z=>I(["audio","base_url"],Z.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("audio.apiKey"),B("audio",b.audio.apiKey)]})]}),d.jsx(lt,{label:"",type:"password",value:b.audio.apiKey||"",onChange:Z=>I(["audio","apiKey"],Z.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:C("audio.apiKey")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Duration (Seconds)"}),T("audio.maxDurationSeconds")]}),d.jsx(yn,{label:"",value:b.audio.maxDurationSeconds,onChange:Z=>I(["audio","maxDurationSeconds"],parseInt(Z.target.value)),min:1,disabled:C("audio.maxDurationSeconds")}),d.jsx(lt,{label:"Supported Mime Types",value:b.audio.supportedMimeTypes.join(", "),onChange:Z=>I(["audio","supportedMimeTypes"],Z.target.value.split(",").map(Ne=>Ne.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),q==="channels"&&d.jsxs(d.Fragment,{children:[d.jsxs(ar,{title:"Telegram",children:[d.jsx(zs,{label:"Enable Telegram",checked:b.channels.telegram.enabled,onChange:Z=>I(["channels","telegram","enabled"],Z)}),b.channels.telegram.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(lt,{label:"Bot Token",type:"password",value:b.channels.telegram.token||"",onChange:Z=>I(["channels","telegram","token"],Z.target.value)}),d.jsx(lt,{label:"Allowed Users (comma separated)",value:b.channels.telegram.allowedUsers.join(", "),onChange:Z=>I(["channels","telegram","allowedUsers"],Z.target.value.split(",").map(Ne=>Ne.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),d.jsxs(ar,{title:"Discord",children:[d.jsx(zs,{label:"Enable Discord",checked:b.channels.discord.enabled,onChange:Z=>I(["channels","discord","enabled"],Z)}),b.channels.discord.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(lt,{label:"Bot Token",type:"password",value:b.channels.discord.token||"",onChange:Z=>I(["channels","discord","token"],Z.target.value)}),d.jsx(lt,{label:"Allowed Users (comma separated)",value:(b.channels.discord.allowedUsers??[]).join(", "),onChange:Z=>I(["channels","discord","allowedUsers"],Z.target.value.split(",").map(Ne=>Ne.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),q==="ui"&&d.jsxs(ar,{title:"Dashboard",children:[d.jsx(zs,{label:"Enable Web UI",checked:b.ui.enabled,onChange:Z=>I(["ui","enabled"],Z)}),d.jsx(yn,{label:"Port",value:b.ui.port,onChange:Z=>I(["ui","port"],parseInt(Z.target.value)),disabled:!0,helperText:"Requires restart to change."})]}),q==="logging"&&d.jsxs(ar,{title:"Logging",children:[d.jsx(zs,{label:"Enable Logging",checked:b.logging.enabled,onChange:Z=>I(["logging","enabled"],Z)}),d.jsx(jr,{label:"Log Level",value:b.logging.level,onChange:Z=>I(["logging","level"],Z.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),q==="chronos"&&m&&d.jsxs(ar,{title:"Chronos — Temporal Intent Engine",children:[d.jsx(jr,{label:"Timezone",value:m.timezone,onChange:Z=>g({...m,timezone:Z.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"}]}),d.jsx(yn,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:Z=>g({...m,check_interval_ms:Number(Z.target.value)*1e3}),min:60}),d.jsx(yn,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:Z=>g({...m,max_active_jobs:Number(Z.target.value)}),min:1,max:1e3}),d.jsx("div",{className:"flex justify-end pt-2",children:d.jsx("button",{onClick:async()=>{v(!0),P(null);try{await Ei.updateConfig(m),On("/api/config/chronos"),P({type:"success",message:"Chronos settings saved."})}catch(Z){P({type:"error",message:Z.message})}finally{v(!1)}},disabled:y,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:y?"Saving…":"Save Chronos Settings"})})]})]})]}):d.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function JH(){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]),d.jsxs(dt.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:[d.jsxs("div",{className:"shrink-0",children:[d.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"SYSTEM LOGS"}),d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"View runtime logs."})]}),d.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:[d.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:[d.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=>d.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:[d.jsx(tA,{className:"w-4 h-4 shrink-0"}),d.jsxs("div",{className:"flex flex-col overflow-hidden",children:[d.jsx("span",{className:"truncate font-bold",children:l.name}),d.jsxs("span",{className:"text-xs opacity-70",children:[(l.size/1024).toFixed(1)," KB"]})]})]},l.name))]}),d.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:[d.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:[d.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=>d.jsx("option",{value:l.name,children:l.name},l.name))}),d.jsx("span",{className:"hidden md:block text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm truncate",children:t}),d.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:d.jsx(xS,{className:"w-4 h-4"})})]}),d.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,f)=>{const h=l.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s?(.*)/s);return h?d.jsxs("div",{children:[d.jsxs("span",{className:"hidden md:inline opacity-50",children:[h[1]," "]}),d.jsx("span",{children:h[2]})]},f):d.jsx("div",{children:l},f)}):d.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,f]=z.useState("");if(z.useEffect(()=>{async function g(){try{const[y,v]=await Promise.all([_p.fetchUsageStats(),_p.fetchGroupedUsageStats()]);t(y),a(v)}catch(y){f("Failed to load usage statistics"),console.error(y)}finally{u(!1)}}g()},[]),s)return d.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 d.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 d.jsxs(dt.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between border-b border-azure-border dark:border-matrix-primary pb-4",children:d.jsxs("div",{children:[d.jsxs("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight font-mono flex items-center gap-2",children:[d.jsx(Zm,{className:"w-6 h-6"}),"USAGE_ANALYTICS"]}),d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1 font-mono text-sm",children:"Resource consumption tracking and metrics"})]})}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[d.jsxs(dt.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:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(zl,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),d.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),d.jsxs(dt.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:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx($s,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),d.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),d.jsxs(dt.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:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(Pc,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),d.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),d.jsxs(dt.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:[d.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:d.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[d.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:d.jsxs("tr",{children:[d.jsx("th",{className:"p-4",children:"Provider"}),d.jsx("th",{className:"p-4",children:"Model"}),d.jsx("th",{className:"p-4 text-right",children:"Messages"}),d.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),d.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),d.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?d.jsx("tr",{children:d.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)=>d.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),d.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),d.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=vr(),l=f=>{f.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 d.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:d.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:[d.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"}),d.jsxs("form",{onSubmit:l,className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),d.jsx("input",{type:"password",value:e,onChange:f=>t(f.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&&d.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),d.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"})]}),d.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=vr();return t?d.jsx(d.Fragment,{children:e}):d.jsx(iS,{to:"/login",state:{from:n},replace:!0})},tF=({className:e,...t})=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),nF=({...e})=>d.jsx("thead",{...e}),rF=({...e})=>d.jsx("tbody",{...e}),Mm=({...e})=>d.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})=>d.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})=>d.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 d.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 d.jsx("div",{className:s,...n})},Dm=({className:e,...t})=>d.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})=>d.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),aF=({className:e,...t})=>d.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),$m=({className:e,...t})=>d.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 d.jsx("div",{className:s,...n})},sF=({className:e,...t})=>d.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),h2=({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 d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),d.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&&d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&d.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&d.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:d.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:d.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),d.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},oF=({isOpen:e,onClose:t,memory:n})=>n?d.jsx(h2,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(UA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),d.jsx("div",{children:d.jsx(nd,{variant:"outline",children:n.category})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(GA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),d.jsx("div",{children:d.jsx(nd,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(hS,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Za,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(sd,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(iA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(uA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),d.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&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),d.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})]}),d.jsx("div",{className:"flex justify-end pt-4",children:d.jsx(lr,{onClick:t,children:"Close"})})]})}):null,m2=({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"})=>d.jsx(h2,{isOpen:e,onClose:t,title:a,size:"md",children:d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(lr,{variant:"outline",onClick:t,children:l}),d.jsx(lr,{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),xe.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),xe.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),xe.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),f=z.useCallback(h=>(t(!0),a(null),xe.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:f,loading:e,error:n}},uF=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(!0),[s,u]=z.useState([]),[l,f]=z.useState(""),[h,m]=z.useState("all"),[g,y]=z.useState("all"),[v,b]=z.useState(null),[S,j]=z.useState(!1),[A,E]=z.useState(null),[O,N]=z.useState(!1),[L,D]=z.useState(null),[R,q]=z.useState(!1),{get:V,del:X,post:fe}=lF();z.useEffect(()=>{se()},[]);const se=async()=>{try{a(!0);const C=await V("/sati/memories");t(C),b(null)}catch(C){b("Failed to load memories. Please try again."),console.error("Error fetching memories:",C)}finally{a(!1)}},le=()=>{s.length===B.length?u([]):u(B.map(C=>C.id))},ee=C=>{s.includes(C)?u(s.filter(I=>I!==C)):u([...s,C])},oe=async()=>{if(s.length!==0)try{await fe("/sati/memories/bulk-delete",{ids:s}),await se(),u([]),j(!1)}catch(C){b("Failed to delete memories. Please try again."),console.error("Error deleting memories:",C)}},ae=C=>{D(C),q(!0)},P=async()=>{if(L)try{await X(`/sati/memories/${L}`),await se()}catch(C){b("Failed to delete memory. Please try again."),console.error("Error deleting memory:",C)}finally{D(null),q(!1)}},J=C=>{E(C),N(!0)},B=e.filter(C=>{const I=C.summary.toLowerCase().includes(l.toLowerCase())||C.details?.toLowerCase().includes(l.toLowerCase())||C.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||C.category===h,Y=g==="all"||C.importance===g;return I&&w&&Y&&!C.archived}),me=Array.from(new Set(e.map(C=>C.category))),T=Array.from(new Set(e.map(C=>C.importance)));return n?d.jsx(Dm,{className:"w-full",children:d.jsx($m,{className:"flex justify-center items-center h-64",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Sati Memories"}),d.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&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[s.length," selected"]}),d.jsxs(lr,{variant:"destructive",size:"sm",onClick:()=>j(!0),disabled:s.length===0,children:[d.jsx(Ti,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),v&&d.jsx(iF,{variant:"destructive",children:d.jsx(sF,{children:v})}),d.jsxs(Dm,{children:[d.jsx(Mw,{className:"border-b border-azure-border dark:border-matrix-primary",children:d.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[d.jsxs("div",{className:"flex flex-col relative w-full",children:[d.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"}),d.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:C=>f(C.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"})]}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[d.jsxs("select",{value:h,onChange:C=>m(C.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:[d.jsx("option",{value:"all",children:"All Categories"}),me.map(C=>d.jsx("option",{value:C,children:C},C))]}),d.jsxs("select",{value:g,onChange:C=>y(C.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:[d.jsx("option",{value:"all",children:"All Importance"}),T.map(C=>d.jsx("option",{value:C,children:C},C))]})]})]})}),d.jsx($m,{className:"p-0",children:d.jsxs(tF,{children:[d.jsx(nF,{children:d.jsxs(Mm,{className:"hover:bg-transparent",children:[d.jsx(_s,{className:"w-12",children:d.jsx(Rw,{checked:B.length>0&&s.length===B.length,onCheckedChange:le})}),d.jsx(_s,{children:"Summary"}),d.jsx(_s,{children:"Category"}),d.jsx(_s,{children:"Importance"}),d.jsx(_s,{children:"Created"}),d.jsx(_s,{className:"w-32",children:"Actions"})]})}),d.jsx(rF,{children:B.length===0?d.jsx(Mm,{children:d.jsx(vi,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):B.map(C=>d.jsxs(Mm,{children:[d.jsx(vi,{children:d.jsx(Rw,{checked:s.includes(C.id),onCheckedChange:()=>ee(C.id)})}),d.jsx(vi,{className:"font-medium max-w-xs truncate",children:C.summary}),d.jsx(vi,{children:d.jsx(nd,{variant:"outline",children:C.category})}),d.jsx(vi,{children:d.jsx(nd,{variant:C.importance==="critical"?"destructive":C.importance==="high"?"default":C.importance==="medium"?"secondary":"outline",children:C.importance})}),d.jsx(vi,{children:d.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(hS,{className:"w-4 h-4"}),new Date(C.created_at).toLocaleDateString()]})}),d.jsx(vi,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(lr,{variant:"ghost",size:"sm",onClick:()=>J(C),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.jsx(sd,{className:"w-4 h-4"})}),d.jsx(lr,{variant:"ghost",size:"sm",onClick:()=>ae(C.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},C.id))})]})})]}),S&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs(Dm,{className:"w-full max-w-md mx-4",children:[d.jsx(Mw,{children:d.jsx(aF,{children:"Delete Memories"})}),d.jsxs($m,{children:[d.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",s.length," ","memory(ies)? This action cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(lr,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),d.jsx(lr,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),d.jsx(oF,{isOpen:O,onClose:()=>N(!1),memory:A}),d.jsx(m2,{isOpen:R,onClose:()=>q(!1),onConfirm:P,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,""]),f=h=>{const m=s.filter((g,y)=>y!==h);n(m.filter(g=>g.trim().length>0))};return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),s.map((h,m)=>d.jsxs("div",{className:"flex gap-2",children:[d.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)}),d.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:()=>f(m),children:"Remove"})]},`${e}-${m}`)),d.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 v=[...u];v[m]={...v[m],[g]:y},n(v.filter(b=>b.key.trim().length>0||b.value.trim().length>0))},f=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((y,v)=>v!==m);n(g.filter(y=>y.key.trim().length>0||y.value.trim().length>0))};return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),u.map((m,g)=>d.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[d.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)}),d.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)}),d.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}`)),d.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:f,children:"Add entry"})]})},dF=({transport:e,command:t,url:n,args:a,env:s,headers:u,onCommandChange:l,onUrlChange:f,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>d.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",d.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"})]}),d.jsx(cF,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",d.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=>f(y.target.value),placeholder:"https://example.com/mcp"})]}),d.jsx(Dw,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&d.jsx(Dw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),fF=zH({name:Rm().min(1,"Name is required"),transport:c2([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??""),[f,h]=z.useState(n?.config.transport??"stdio"),[m,g]=z.useState(n?.config.transport==="stdio"?n.config.command:""),[y,v]=z.useState(n?.config.transport==="http"?n.config.url:""),[b,S]=z.useState(n?.config.args??[]),[j,A]=z.useState(jc(n?.config.env)),[E,O]=z.useState(n?.config.transport==="http"?jc(n.config.headers):[]),[N,L]=z.useState(null);z.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),v(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),A(jc(n?.config.env)),O(n?.config.transport==="http"?jc(n.config.headers):[]),L(null))},[e,n]);const D=t==="create",R=async()=>{const V=fF.safeParse({name:u,transport:f,command:m,url:y});if(!V.success){L(V.error.issues[0]?.message??"Invalid form");return}if(f==="stdio"&&(!m||m.trim().length===0)){L("Command is required for stdio transport.");return}if(f==="http"&&(!y||y.trim().length===0)){L("URL is required for http transport.");return}const X=f==="stdio"?{transport:"stdio",command:m.trim(),args:b.length>0?b:void 0,env:j.length>0?Lm(j):void 0}:{transport:"http",url:y.trim(),headers:E.length>0?Lm(E):void 0,env:j.length>0?Lm(j):void 0};L(null),await s(u.trim(),X)},q=z.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return d.jsx(Or,{open:e,onOpenChange:a,children:d.jsxs(Fs,{children:[d.jsx(Rr,{children:d.jsx(Mr,{children:q})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",d.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:V=>l(V.target.value),placeholder:"coolify",disabled:!D})]}),d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",d.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:f,onChange:V=>h(V.target.value),children:[d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),d.jsx(dF,{transport:f,command:m,url:y,args:b,env:j,headers:E,onCommandChange:g,onUrlChange:v,onArgsChange:S,onEnvChange:A,onHeadersChange:O}),N&&d.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:N}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.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"}),d.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})=>d.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:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"text-lg font-semibold text-azure-text-primary break-words dark:text-matrix-highlight",children:e.name}),d.jsx("div",{className:"text-xs uppercase tracking-wide text-azure-text-muted dark:text-matrix-secondary",children:e.config.transport})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[t&&d.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"}),d.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"})]})]}),d.jsxs("div",{className:"mt-4 space-y-2 text-sm text-azure-text-secondary dark:text-matrix-secondary",children:[e.config.transport==="stdio"&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Command:"})," ",e.config.command]}),e.config.transport==="http"&&d.jsxs("div",{className:"break-all",children:[d.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&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Args:"})," ",e.config.args.join(" ")]}),t&&!t.ok&&t.error&&d.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})]}),d.jsxs("div",{className:"mt-4 flex gap-2",children:[d.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"}),d.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}=zt("/api/mcp/servers",()=>wi.fetchServers()),[s,u]=z.useState(""),[l,f]=z.useState("all"),[h,m]=z.useState(!1),[g,y]=z.useState(null),[v,b]=z.useState(!1),[S,j]=z.useState(null),[A,E]=z.useState(null),[O,N]=z.useState({}),[L,D]=z.useState(!1),[R,q]=z.useState(!1),V=e?.servers??[],X=z.useMemo(()=>V.filter(B=>{const me=B.name.toLowerCase().includes(s.toLowerCase()),T=l==="all"||B.config.transport===l;return me&&T}),[V,s,l]),fe=()=>{y(null),m(!0)},se=B=>{y(B),m(!0)},le=async(B,me)=>{try{g?await wi.updateServer(g.name,me):await wi.addServer(B,me),m(!1),y(null),await n(),E({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(T){E({type:"error",message:T.message||"Failed to save MCP server."})}},ee=async B=>{j(B),b(!0)},oe=async()=>{if(S)try{await wi.deleteServer(S.name),await n(),b(!1),j(null),E({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(B){E({type:"error",message:B.message||"Failed to delete MCP server."})}},ae=async()=>{D(!0);try{const B=await wi.fetchStatus(),me={};for(const T of B.servers)me[T.name]=T;N(me)}catch(B){E({type:"error",message:B.message||"Failed to check MCP status."})}finally{D(!1)}},P=async()=>{q(!0);try{await wi.reloadTools(),E({type:"success",message:"MCP tools reloaded successfully."})}catch(B){E({type:"error",message:B.message||"Failed to reload MCP tools."})}finally{q(!1)}},J=async(B,me)=>{try{await wi.toggleServer(B.name,me),await n(),E({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(T){E({type:"error",message:T.message||"Failed to toggle MCP server."})}};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Manage MCP servers stored in mcps.json."})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"button",disabled:L,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:ae,children:L?"Checking…":"Check Status"}),d.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:P,children:R?"Reloading…":"Reload MCPs"}),d.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"})]})]}),A&&d.jsx("div",{className:`p-4 rounded border ${A.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:A.message}),d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[d.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:B=>u(B.target.value),placeholder:"Search by name"}),d.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:B=>f(B.target.value),children:[d.jsx("option",{value:"all",children:"All"}),d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),a&&d.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&d.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&X.length===0&&d.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."}),d.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:X.map(B=>d.jsx(mF,{server:B,probeResult:O[B.name],onEdit:se,onDelete:ee,onToggle:J},`${B.name}-${B.enabled?"on":"off"}`))}),d.jsx(hF,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:le}),d.jsx(Or,{open:v,onOpenChange:b,children:d.jsxs(Fs,{children:[d.jsx(Rr,{children:d.jsx(Mr,{children:"Confirm Deletion"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",d.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',S?.name,'"']}),"? This action cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.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:()=>b(!1),children:"Cancel"}),d.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:()=>xe.get("/model-pricing"),upsert:e=>xe.post("/model-pricing",e),update:(e,t,n)=>xe.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>xe.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}},xF=["anthropic","openai","google","openrouter","ollama","other"],Lw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),yF=()=>{const{data:e=[],mutate:t}=zt("/api/model-pricing",()=>Pm.list()),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Lw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[v,b]=z.useState(!1),S=(N,L)=>{y({type:N,message:L}),setTimeout(()=>y(null),3e3)},j=()=>{u(null),f(Lw()),a(!0)},A=N=>{u(N),f({...N}),a(!0)},E=async()=>{if(!(!l.provider.trim()||!l.model.trim())){b(!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{b(!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 d.jsxs(dt.div,{variants:gF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(dt.div,{variants:$w,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Pc,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Model Pricing"}),d.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."})]})]}),d.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:[d.jsx(od,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&d.jsx(dt.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}),d.jsx(dt.div,{variants:$w,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(N=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:N},N))})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.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(N=>d.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:[d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:N.provider}),d.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:N.model}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.input_price_per_1m.toFixed(4)]}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.output_price_per_1m.toFixed(4)]}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>A(N),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:d.jsx(Wp,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(N),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:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},`${N.provider}/${N.model}`))})]})}),d.jsx(Or,{open:n,onOpenChange:a,children:d.jsxs(Fs,{children:[d.jsx(Rr,{children:d.jsx(Mr,{children:s?"Edit Pricing":"Add Pricing"})}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),s?d.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}):d.jsxs("select",{value:l.provider,onChange:N=>f({...l,provider:N.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:[d.jsx("option",{value:"",children:"Select provider..."}),xF.map(N=>d.jsx("option",{value:N,children:N},N))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),s?d.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}):d.jsx("input",{type:"text",value:l.model,onChange:N=>f({...l,model:N.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"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),d.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:N=>f({...l,input_price_per_1m:parseFloat(N.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),d.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:N=>f({...l,output_price_per_1m:parseFloat(N.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"})]})]}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[d.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"}),d.jsx("button",{onClick:E,disabled:v||!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:v?"Saving...":"Save"})]})]})]})}),d.jsx(Or,{open:!!h,onOpenChange:N=>!N&&m(null),children:d.jsxs(Fs,{children:[d.jsx(Rr,{children:d.jsx(Mr,{children:"Delete Pricing Entry"})}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",d.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.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"}),d.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}=zt("/webhooks",()=>Pa.list(),{refreshInterval:1e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Uw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[v,b]=z.useState(!1),[S,j]=z.useState(null),[A,E]=z.useState(null),O=(ee,oe)=>{y({type:ee,message:oe}),setTimeout(()=>y(null),3500)},N=()=>{u(null),f(Uw()),E(null),a(!0)},L=ee=>{u(ee),f({name:ee.name,prompt:ee.prompt,notification_channels:ee.notification_channels}),E(null),a(!0)},D=ee=>/^[a-z0-9-_]+$/.test(ee),R=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!D(l.name)){E("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){E("Select at least one notification channel.");return}E(null),b(!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(ee){const oe=ee?.message||"Failed to save webhook.";E(oe)}finally{b(!1)}}},q=async ee=>{try{await Pa.update(ee.id,{enabled:!ee.enabled}),await t()}catch{O("error","Failed to toggle webhook.")}},V=async()=>{if(h)try{await Pa.delete(h.id),await t(),m(null),O("success","Webhook deleted.")}catch{O("error","Failed to delete webhook.")}},X=ee=>`${window.location.origin}/api/webhooks/trigger/${ee}`,fe=ee=>`curl -X POST ${X(ee.name)} \\
109
+ -H "x-api-key: ${ee.api_key}" \\
110
+ -H "Content-Type: application/json" \\
111
+ -d '{"event":"your_payload"}'`,se=async(ee,oe)=>{await navigator.clipboard.writeText(ee),j(oe),setTimeout(()=>j(null),2e3)},le=ee=>{const oe=l.notification_channels.includes(ee);f({...l,notification_channels:oe?l.notification_channels.filter(ae=>ae!==ee):[...l.notification_channels,ee]})};return d.jsxs(dt.div,{variants:bF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(dt.div,{variants:Pw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Gm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Webhooks"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.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:[d.jsx(Sl,{className:"w-4 h-4"}),"Notifications"]}),d.jsxs("button",{onClick:N,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:[d.jsx(od,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&d.jsx(dt.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}),d.jsx(dt.div,{variants:Pw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(ee=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ee},ee))})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",d.jsx("button",{onClick:N,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ee=>d.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:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:ee.name})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[ee.api_key.slice(0,16),"…"]}),d.jsx("button",{onClick:()=>se(fe(ee),`curl-${ee.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-${ee.id}`?d.jsx(Im,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(qm,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:()=>se(ee.api_key,`key-${ee.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-${ee.id}`?d.jsx(Im,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(KT,{className:"w-3.5 h-3.5"})})]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"flex gap-1 flex-wrap",children:ee.notification_channels.map(oe=>d.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))})}),d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ee.trigger_count}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("button",{onClick:()=>q(ee),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ee.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:ee.enabled?d.jsxs(d.Fragment,{children:[d.jsx(HA,{className:"w-3.5 h-3.5"})," Enabled"]}):d.jsxs(d.Fragment,{children:[d.jsx(ZA,{className:"w-3.5 h-3.5"})," Disabled"]})})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>L(ee),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:d.jsx(Wp,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(ee),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:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},ee.id))})]})})}),d.jsxs(Or,{open:n,onOpenChange:a,children:[d.jsx(Rr,{children:d.jsx(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Webhook":"New Webhook"})}),d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",d.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),d.jsx("input",{type:"text",value:l.name,onChange:ee=>{f({...l,name:ee.target.value.toLowerCase().replace(/\s+/g,"-")}),E(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&&d.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",d.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),d.jsx("textarea",{rows:5,value:l.prompt,onChange:ee=>f({...l,prompt:ee.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"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),d.jsx("div",{className:"flex gap-4",children:vF.map(ee=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(ee),onChange:()=>le(ee),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),d.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:ee})]},ee))})]}),A&&d.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:A}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[d.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"}),d.jsx("button",{onClick:R,disabled:v||!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:v?"Saving…":s?"Update":"Create"})]})]})]}),d.jsxs(Or,{open:!!h,onOpenChange:ee=>!ee&&m(null),children:[d.jsx(Rr,{children:d.jsx(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",d.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.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"}),d.jsx("button",{onClick:V,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"?d.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[d.jsx(mS,{className:"w-4 h-4"}),d.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?d.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[d.jsx(Hm,{className:"w-4 h-4"}),d.jsx("span",{className:"text-xs",children:"Failed"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[d.jsx(Za,{className:"w-4 h-4 animate-pulse"}),d.jsx("span",{className:"text-xs",children:"Pending"})]}),Nc=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}=zt(["/webhooks/notifications",e],()=>Pa.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=s.filter(g=>!g.read).length,f=async g=>{g.length!==0&&(await Pa.markRead(g),await u())},h=()=>{const g=s.filter(y=>!y.read).map(y=>y.id);f(g)},m=async g=>{a(g),g.read||await f([g.id])};return d.jsxs(dt.div,{variants:wF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(dt.div,{variants:Vw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Sl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),l>0&&d.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})]}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Notifications"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.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:[d.jsx(zT,{className:"w-4 h-4"}),"Back to Webhooks"]}),d.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:[d.jsx(rA,{className:"w-4 h-4"}),"Unread only"]}),l>0&&d.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:[d.jsx(LT,{className:"w-4 h-4"}),"Mark all read"]})]})]}),d.jsx(dt.div,{variants:Vw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),d.jsx("tbody",{children:s.length===0?d.jsx("tr",{children:d.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=>d.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:[d.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&d.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),d.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(Bw,{status:g.status})}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:Nc(g.created_at)}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?Nc(g.completed_at):"—"}),d.jsx("td",{className:"px-4 py-3",children:d.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:d.jsx(sd,{className:"w-4 h-4"})})})]},g.id))})]})})}),d.jsxs(Or,{open:!!n,onOpenChange:g=>!g&&a(null),children:[d.jsx(Rr,{children:d.jsxs(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Sl,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[d.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[d.jsx(Bw,{status:n.status}),d.jsx("span",{children:Nc(n.created_at)}),n.completed_at&&d.jsxs("span",{children:["→ ",Nc(n.completed_at)]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),d.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)})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),d.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??d.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),d.jsx("div",{className:"flex justify-end pt-2",children:d.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}}},Cc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},jF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function NF({status:e}){return e==="completed"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[d.jsx(mS,{className:"w-4 h-4"}),"Completed"]}):e==="failed"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600 dark:text-red-400",children:[d.jsx(Hm,{className:"w-4 h-4"}),"Failed"]}):e==="running"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[d.jsx(hA,{className:"w-4 h-4 animate-spin"}),"Running"]}):e==="cancelled"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[d.jsx(Hm,{className:"w-4 h-4"}),"Cancelled"]}):d.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[d.jsx(Za,{className:"w-4 h-4"}),"Pending"]})}const Zw=e=>e?new Date(e).toLocaleString():"—";function CF(){const[e,t]=z.useState(""),[n,a]=z.useState(""),[s,u]=z.useState(""),[l,f]=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}=zt("/tasks/stats",()=>Ns.stats(),{refreshInterval:5e3}),{data:v=[],mutate:b}=zt(["/tasks",g],()=>Ns.list(g),{refreshInterval:3e3});return d.jsxs(dt.div,{variants:_F,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(dt.div,{variants:Cc,className:"flex items-center gap-3",children:[d.jsx(Fm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Tasks"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),d.jsxs(dt.div,{variants:Cc,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[d.jsx(js,{label:"Pending",value:y?.pending??0}),d.jsx(js,{label:"Running",value:y?.running??0}),d.jsx(js,{label:"Completed",value:y?.completed??0}),d.jsx(js,{label:"Failed",value:y?.failed??0}),d.jsx(js,{label:"Cancelled",value:y?.cancelled??0}),d.jsx(js,{label:"Total",value:y?.total??0})]}),d.jsxs(dt.div,{variants:Cc,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:[d.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:[d.jsx("option",{value:"",children:"All status"}),Object.entries(jF).map(([S,j])=>d.jsx("option",{value:S,children:j},S))]}),d.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:[d.jsx("option",{value:"",children:"All agents"}),d.jsx("option",{value:"apoc",children:"Apoc"}),d.jsx("option",{value:"neo",children:"Neo"})]}),d.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:[d.jsx("option",{value:"",children:"All channels"}),d.jsx("option",{value:"telegram",children:"Telegram"}),d.jsx("option",{value:"ui",children:"UI"}),d.jsx("option",{value:"api",children:"API"}),d.jsx("option",{value:"webhook",children:"Webhook"}),d.jsx("option",{value:"cli",children:"CLI"})]}),d.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=>f(S.target.value),placeholder:"Filter by session id"})]}),d.jsx(dt.div,{variants:Cc,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Task ID","Status","Agent","Channel","Session","Attempts","Created","Finished","Actions"].map(S=>d.jsx("th",{className:"text-left px-4 py-3 font-semibold text-azure-text-secondary dark:text-matrix-dim",children:S},S))})}),d.jsx("tbody",{children:v.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:9,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:"No tasks found."})}):v.map(S=>d.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:[d.jsx("td",{className:"px-4 py-3 font-mono",children:S.id.slice(0,8)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(NF,{status:S.status})}),d.jsx("td",{className:"px-4 py-3",children:S.agent.toUpperCase()}),d.jsx("td",{className:"px-4 py-3",children:S.origin_channel.toUpperCase()}),d.jsx("td",{className:"px-4 py-3 font-mono",children:S.session_id}),d.jsxs("td",{className:"px-4 py-3",children:[S.attempt_count,"/",S.max_attempts]}),d.jsx("td",{className:"px-4 py-3",children:Zw(S.created_at)}),d.jsx("td",{className:"px-4 py-3",children:Zw(S.finished_at)}),d.jsxs("td",{className:"px-4 py-3 flex items-center gap-1",children:[d.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:d.jsx(sd,{className:"w-4 h-4"})}),(S.status==="pending"||S.status==="running")&&d.jsx("button",{onClick:async()=>{await Ns.cancel(S.id),await b()},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:d.jsx(NT,{className:"w-4 h-4"})})]})]},S.id))})]})}),d.jsxs(Or,{open:!!h,onOpenChange:S=>!S&&m(null),children:[d.jsx(Rr,{children:d.jsx(Mr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Task Details"})}),h&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[70vh] text-sm",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-azure-text-secondary dark:text-matrix-dim",children:[d.jsxs("div",{children:[d.jsx("b",{children:"ID:"})," ",d.jsx("span",{className:"font-mono",children:h.id})]}),d.jsxs("div",{children:[d.jsx("b",{children:"Status:"})," ",h.status]}),d.jsxs("div",{children:[d.jsx("b",{children:"Agent:"})," ",h.agent]}),d.jsxs("div",{children:[d.jsx("b",{children:"Origin:"})," ",h.origin_channel]}),d.jsxs("div",{children:[d.jsx("b",{children:"Session:"})," ",d.jsx("span",{className:"font-mono",children:h.session_id})]}),d.jsxs("div",{children:[d.jsx("b",{children:"Attempts:"})," ",h.attempt_count,"/",h.max_attempts]})]}),d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1",children:"Input"}),d.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&&d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1",children:"Output"}),d.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&&d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1 text-red-600 dark:text-red-400",children:"Error"}),d.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")&&d.jsxs("div",{className:"flex justify-end gap-2",children:[(h.status==="pending"||h.status==="running")&&d.jsx("button",{onClick:async()=>{await Ns.cancel(h.id),m(null),await b()},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"&&d.jsx("button",{onClick:async()=>{await Ns.retry(h.id),m(null),await b()},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 d.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:[d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:e}),d.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 xe.get("/trinity/databases")}function AF(){const{data:e,error:t}=zt("/trinity/databases",TF,{refreshInterval:3e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Iw),[h,m]=z.useState(!1),[g,y]=z.useState(null),[v,b]=z.useState({}),[S,j]=z.useState(null),[A,E]=z.useState({}),[O,N]=z.useState(null),[L,D]=z.useState(null),[R,q]=z.useState(null),[V,X]=z.useState(!1),fe=()=>{u(null),f(Iw),X(!1),y(null),a(!0)},se=w=>{u(w),f({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}),X(!!w.connection_string),y(null),a(!0)},le=async()=>{if(m(!0),y(null),!V&&!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};V?(!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 xe.put(`/trinity/databases/${s.id}`,w):await xe.post("/trinity/databases",w),await On("/trinity/databases"),a(!1)}catch(w){y(w.message||"Failed to save database")}finally{m(!1)}},ee=w=>{q(w)},oe=async()=>{if(!R)return;const w=R.id;D(w);try{await xe.delete(`/trinity/databases/${w}`),await On("/trinity/databases")}catch(Y){alert(`Delete failed: ${Y.message}`)}finally{D(null),q(null)}},ae=async w=>{j(w);try{const Y=await xe.post(`/trinity/databases/${w}/test`,{});E(de=>({...de,[w]:Y.success}))}catch{E(Y=>({...Y,[w]:!1}))}finally{j(null)}},P=async w=>{N(w);try{await xe.post(`/trinity/databases/${w}/refresh-schema`,{}),await On("/trinity/databases")}catch(Y){alert(`Schema refresh failed: ${Y.message}`)}finally{N(null)}},J=w=>{b(Y=>({...Y,[w]:!Y[w]}))},B=w=>{w!=="mongodb"&&X(!1),f(Y=>({...Y,type:w,port:Um[w]?String(Um[w]):""}))},me=w=>{f(Y=>({...Y,[w]:!Y[w]}))};if(t)return d.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const T="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",C="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",I=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(de=>w[de.key]).map(de=>de.badge);return d.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx($s,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Trinity Databases"})]}),d.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:[d.jsx(od,{className:"w-4 h-4"}),"Register Database"]})]}),d.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?d.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:[d.jsx($s,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),d.jsx("p",{className:"font-medium",children:"No databases registered"}),d.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):d.jsx("div",{className:"space-y-4",children:e.map(w=>{const Y=w.schema_json?JSON.parse(w.schema_json):null,de=!!Y?.databases,he=de?Y.databases.reduce((Ne,qe)=>Ne+qe.tables.length,0):Y?.tables?.length??0,pe=de?Y.databases.length:0,Pe=w.type==="mongodb"?"collection":"table",Ae=w.type==="mongodb"?"collections":"tables",pt=A[w.id],Rt=v[w.id],Z=I(w);return d.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[d.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[d.jsx($s,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),d.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}),pt===!0&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[d.jsx(Fh,{className:"w-3 h-3"})," Connected"]}),pt===!1&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[d.jsx(QA,{className:"w-3 h-3"})," Failed"]}),Z.length>0&&d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(A0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),Z.map(Ne=>d.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:Ne},Ne))]})]}),d.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",de&&pe>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",pe," database",pe!==1?"s":""," · ",he," ",he!==1?Ae:Pe]}),!de&&he>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",he," ",he!==1?Ae:Pe]}),w.schema_updated_at&&d.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),d.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d.jsx("button",{onClick:()=>ae(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?d.jsx(Fh,{className:"w-4 h-4 animate-pulse"}):d.jsx(Fh,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>P(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:d.jsx(xS,{className:`w-4 h-4 ${O===w.id?"animate-spin":""}`})}),d.jsx("button",{onClick:()=>se(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"}),d.jsx("button",{onClick:()=>ee(w),disabled:L===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:d.jsx(Ti,{className:"w-4 h-4"})}),Y&&d.jsx("button",{onClick:()=>J(w.id),title:Rt?"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:Rt?d.jsx(VT,{className:"w-4 h-4"}):d.jsx(ZT,{className:"w-4 h-4"})})]})]}),Rt&&Y&&d.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[d.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:de?`${pe} database${pe!==1?"s":""} — ${he} ${he!==1?Ae:Pe} total`:`Schema — ${he} ${he!==1?Ae:Pe}`}),d.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:de?Y.databases?.map(Ne=>d.jsxs("div",{className:"text-xs",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[d.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:Ne.name}),d.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",Ne.tables.length," ",Ne.tables.length!==1?Ae:Pe,")"]})]}),d.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[Ne.tables.map(qe=>d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:qe.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:qe.columns?.map(Lt=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{children:Lt.name}),d.jsx("span",{className:"opacity-50 ml-2",children:Lt.type}),Lt.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},Lt.name))})]},qe.name)),Ne.tables.length===0&&d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ae]})]})]},Ne.name)):Y.tables?.map(Ne=>d.jsxs("div",{className:"text-xs",children:[d.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:Ne.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:Ne.columns?.map(qe=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:qe.name}),d.jsx("span",{className:"opacity-50 ml-2",children:qe.type}),qe.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},qe.name))})]},Ne.name))})]})]},w.id)})}):d.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),d.jsx(G_,{isOpen:!!R,onClose:()=>q(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&&d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),d.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:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Database":"Register Database"}),d.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:d.jsx(eg,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Name *"}),d.jsx("input",{className:T,value:l.name,onChange:w=>f(Y=>({...Y,name:w.target.value})),placeholder:"My Production DB"})]}),d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Type *"}),d.jsxs("select",{className:T,value:l.type,onChange:w=>B(w.target.value),children:[d.jsx("option",{value:"postgresql",children:"PostgreSQL"}),d.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),d.jsx("option",{value:"sqlite",children:"SQLite"}),d.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{type:"button",onClick:()=>X(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${V?"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"}),d.jsx("button",{type:"button",onClick:()=>X(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${V?"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"&&V?d.jsxs("div",{children:[d.jsxs("label",{className:C,children:["Connection String ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:T,type:"password",value:l.connection_string,onChange:w=>f(Y=>({...Y,connection_string:w.target.value})),placeholder:s?"unchanged":"mongodb://user:pass@host:27017/dbname"}),d.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."})]}):d.jsxs(d.Fragment,{children:[l.type!=="sqlite"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Host"}),d.jsx("input",{className:T,value:l.host,onChange:w=>f(Y=>({...Y,host:w.target.value})),placeholder:"localhost"})]}),d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Port"}),d.jsx("input",{className:T,type:"number",value:l.port,onChange:w=>f(Y=>({...Y,port:w.target.value})),placeholder:String(Um[l.type]||"")})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:C,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),d.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=>f(Y=>({...Y,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Username"}),d.jsx("input",{className:T,value:l.username,onChange:w=>f(Y=>({...Y,username:w.target.value})),placeholder:"postgres"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:C,children:["Password ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:T,type:"password",value:l.password,onChange:w=>f(Y=>({...Y,password:w.target.value})),placeholder:s?"unchanged":"••••••••"}),d.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."})]})]})]}),d.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(A0,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),d.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),d.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."}),d.jsx("div",{className:"space-y-2",children:EF[l.type]?.map(({key:w,label:Y,description:de})=>d.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[d.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[d.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>me(w),className:"sr-only"}),d.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]&&d.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:d.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:Y}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:de})]})]},w))})]}),g&&d.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),d.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[d.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"}),d.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}=KL(e,50);return n?d.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?d.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary italic",children:"No executions yet."}):d.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary dark:bg-zinc-900 overflow-hidden",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Triggered At"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Completed At"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Status"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Error"})]})}),d.jsx("tbody",{children:t.map(a=>d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0",children:[d.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:new Date(a.triggered_at).toLocaleString()}),d.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:a.completed_at?new Date(a.completed_at).toLocaleString():"—"}),d.jsx("td",{className:"px-3 py-2",children:d.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold uppercase ${OF[a.status]}`,children:a.status})}),d.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 d.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),[f,h]=z.useState(null),m=async y=>{l(y.id);try{y.enabled?await Ei.disableJob(y.id):await Ei.enableJob(y.id),await On(v=>typeof v=="string"&&v.startsWith("/chronos"))}finally{l(null)}},g=async()=>{if(f){l(f.id);try{await Ei.deleteJob(f.id),await On(y=>typeof y=="string"&&y.startsWith("/chronos"))}finally{l(null),h(null)}}};return n?d.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?d.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 ",d.jsx("strong",{className:"dark:text-matrix-highlight",children:"New Job"})," to get started."]}):d.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary overflow-hidden",children:[d.jsxs("table",{className:"w-full text-sm font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900",children:[d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Prompt"}),d.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"}),d.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"}),d.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"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Status"}),d.jsx("th",{className:"px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium text-right",children:"Actions"})]})}),d.jsx("tbody",{children:t.map(y=>d.jsxs(d.Fragment,{children:[d.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:[d.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary max-w-xs",children:[d.jsx("span",{title:y.prompt,children:Hw(y.prompt,50)}),d.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:y.created_by})]}),d.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden md:table-cell text-xs",children:[d.jsx("div",{className:"capitalize",children:y.schedule_type}),d.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:y.schedule_expression,children:y.schedule_expression})]}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Fw(y.next_run_at)}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Fw(y.last_run_at)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(MF,{enabled:y.enabled})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.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?d.jsx(HT,{className:"w-4 h-4"}):d.jsx(oA,{className:"w-4 h-4"})}),d.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:d.jsx(SA,{className:"w-4 h-4"})}),d.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?d.jsx(kA,{className:"w-4 h-4"}):d.jsx(jA,{className:"w-4 h-4"})}),d.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:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},y.id),a===y.id&&d.jsx("tr",{className:"bg-azure-surface dark:bg-zinc-900/50",children:d.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[d.jsx("div",{className:"text-xs font-bold dark:text-matrix-highlight mb-2",children:"Execution History"}),d.jsx(RF,{jobId:y.id})]})},`${y.id}-history`)]}))})]}),d.jsx(m2,{isOpen:!!f,onClose:()=>h(null),onConfirm:g,title:"Delete Chronos Job",message:f?`Delete job "${Hw(f.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),f=z.useRef(null);return z.useEffect(()=>{if(!e.trim()){s(null),l(null);return}return f.current&&clearTimeout(f.current),f.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),()=>{f.current&&clearTimeout(f.current)}},[e,t,n]),e.trim()?d.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?d.jsxs("p",{className:"text-red-500 dark:text-red-400 flex items-center gap-1.5",children:[d.jsx("span",{children:"⚠"})," ",u]}):a?d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(Za,{className:"w-3.5 h-3.5 text-azure-primary dark:text-matrix-highlight shrink-0"}),d.jsx("span",{className:"font-medium dark:text-matrix-highlight",children:"Next run:"}),d.jsx("span",{children:new Date(a.next_run_at).toLocaleString()})]}),a.human_readable&&d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary/70 pl-5",children:a.human_readable}),a.next_occurrences.length>0&&d.jsx("div",{className:"pl-5 space-y-0.5",children:a.next_occurrences.map((h,m)=>d.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",m+2,": ",h]},m))})]}):d.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,f]=z.useState(""),[h,m]=z.useState("once"),[g,y]=z.useState(""),[v,b]=z.useState("UTC"),[S,j]=z.useState([]),[A,E]=z.useState(null),[O,N]=z.useState(!1),L=R=>{j(q=>q.includes(R)?q.filter(V=>V!==R):[...q,R])};z.useEffect(()=>{a?(f(a.prompt),m(a.schedule_type),y(a.schedule_expression),b(a.timezone),j(a.notify_channels??[])):(f(""),m("once"),y(""),b(u?.timezone??"UTC"),j([])),E(null)},[a,e,u?.timezone]);const D=async()=>{if(E(null),!l.trim()){E("Prompt is required");return}if(!g.trim()){E("Schedule expression is required");return}N(!0);try{if(s&&a){const R={prompt:l,schedule_expression:g,timezone:v,notify_channels:S};await Ei.updateJob(a.id,R)}else{const R={prompt:l,schedule_type:h,schedule_expression:g,timezone:v,notify_channels:S};await Ei.createJob(R)}await On(R=>typeof R=="string"&&R.startsWith("/chronos")),n(),t()}catch(R){E(R.message??"Failed to save job")}finally{N(!1)}};return e?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),d.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:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[d.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"}),d.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:d.jsx(eg,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx(lt,{label:"Prompt",value:l,onChange:R=>f(R.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&d.jsx(jr,{label:"Schedule Type",value:h,onChange:R=>m(R.target.value),options:UF}),d.jsxs("div",{children:[d.jsx(lt,{label:"Schedule Expression",value:g,onChange:R=>y(R.target.value),placeholder:VF[h]}),d.jsx($F,{scheduleExpression:g,scheduleType:h,timezone:v})]}),d.jsx(jr,{label:"Timezone",value:v,onChange:R=>b(R.target.value),options:LF.map(R=>({value:R,label:R}))}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:["Notify Channels ",d.jsx("span",{className:"text-xs font-normal opacity-60",children:"(empty = all active channels)"})]}),d.jsx("div",{className:"flex gap-4",children:PF.map(({value:R,label:q})=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:S.includes(R),onChange:()=>L(R),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),d.jsx("span",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary capitalize",children:q})]},R))})]}),A&&d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:A})]}),d.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-azure-border dark:border-matrix-primary",children:[d.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"}),d.jsx("button",{onClick:D,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=f=>{a(f),t(!0)},u=()=>{t(!1),a(null)},l=()=>{On(f=>typeof f=="string"&&f.startsWith("/chronos"))};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Za,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Chronos"}),d.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"})]})]}),d.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:[d.jsx(od,{className:"w-4 h-4"}),"New Job"]})]}),d.jsx(DF,{onEdit:s}),d.jsx(BF,{isOpen:e,onClose:u,onCreated:l,editJob:n})]})}function IF(){return d.jsx(aT,{children:d.jsxs(k0,{children:[d.jsx(on,{path:"/login",element:d.jsx(WH,{})}),d.jsx(on,{path:"/*",element:d.jsx(eF,{children:d.jsx(vD,{children:d.jsxs(k0,{children:[d.jsx(on,{path:"/",element:d.jsx(SD,{})}),d.jsx(on,{path:"/chat",element:d.jsx(GL,{})}),d.jsx(on,{path:"/zaion",element:d.jsx(XH,{})}),d.jsx(on,{path:"/logs",element:d.jsx(JH,{})}),d.jsx(on,{path:"/stats",element:d.jsx(QH,{})}),d.jsx(on,{path:"/sati-memories",element:d.jsx(uF,{})}),d.jsx(on,{path:"/mcp-servers",element:d.jsx(pF,{})}),d.jsx(on,{path:"/model-pricing",element:d.jsx(yF,{})}),d.jsx(on,{path:"/webhooks",element:d.jsx(kF,{})}),d.jsx(on,{path:"/notifications",element:d.jsx(zF,{})}),d.jsx(on,{path:"/tasks",element:d.jsx(CF,{})}),d.jsx(on,{path:"/trinity-databases",element:d.jsx(AF,{})}),d.jsx(on,{path:"/chronos",element:d.jsx(ZF,{})}),d.jsx(on,{path:"*",element:d.jsx(iS,{to:"/",replace:!0})})]})})})})]})})}PC.createRoot(document.getElementById("root")).render(d.jsx(z.StrictMode,{children:d.jsx(IF,{})}));