morpheus-cli 0.7.7 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -5
- package/dist/cli/commands/smiths.js +110 -0
- package/dist/cli/commands/start.js +20 -0
- package/dist/cli/index.js +2 -0
- package/dist/config/manager.js +22 -0
- package/dist/config/schemas.js +16 -0
- package/dist/http/api.js +3 -0
- package/dist/http/routers/smiths.js +188 -0
- package/dist/runtime/display.js +3 -0
- package/dist/runtime/oracle.js +16 -3
- package/dist/runtime/smiths/connection.js +295 -0
- package/dist/runtime/smiths/delegator.js +214 -0
- package/dist/runtime/smiths/index.js +4 -0
- package/dist/runtime/smiths/registry.js +265 -0
- package/dist/runtime/smiths/types.js +6 -0
- package/dist/runtime/tasks/worker.js +18 -0
- package/dist/runtime/tools/index.js +1 -0
- package/dist/runtime/tools/morpheus-tools.js +122 -0
- package/dist/runtime/tools/smith-tool.js +147 -0
- package/dist/types/config.js +8 -0
- package/dist/ui/assets/index-Clx8mDZ2.js +117 -0
- package/dist/ui/assets/index-KRT9p6jS.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/sw.js +1 -1
- package/package.json +3 -1
- package/dist/ui/assets/index-B6deYCij.css +0 -1
- package/dist/ui/assets/index-BTQ0jjvm.js +0 -117
|
@@ -0,0 +1,117 @@
|
|
|
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 Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zh={exports:{}},sl={};var m0;function UC(){if(m0)return sl;m0=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 sl.Fragment=t,sl.jsx=n,sl.jsxs=n,sl}var p0;function VC(){return p0||(p0=1,Zh.exports=UC()),Zh.exports}var d=VC(),Ih={exports:{}},De={};var g0;function BC(){if(g0)return De;g0=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"),b=Symbol.iterator;function v(j){return j===null||typeof j!="object"?null:(j=b&&j[b]||j["@@iterator"],typeof j=="function"?j:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,C={};function E(j,F,w){this.props=j,this.context=F,this.refs=C,this.updater=w||S}E.prototype.isReactComponent={},E.prototype.setState=function(j,F){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,F,"setState")},E.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function A(){}A.prototype=E.prototype;function T(j,F,w){this.props=j,this.context=F,this.refs=C,this.updater=w||S}var L=T.prototype=new A;L.constructor=T,N(L,E.prototype),L.isPureReactComponent=!0;var U=Array.isArray;function D(){}var Z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function J(j,F,w){var G=w.ref;return{$$typeof:e,type:j,key:F,ref:G!==void 0?G:null,props:w}}function ue(j,F){return J(j.type,F,j.props)}function le(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function re(j){var F={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(w){return F[w]})}var ae=/\/+/g;function te(j,F){return typeof j=="object"&&j!==null&&j.key!=null?re(""+j.key):F.toString(36)}function se(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(D,D):(j.status="pending",j.then(function(F){j.status==="pending"&&(j.status="fulfilled",j.value=F)},function(F){j.status==="pending"&&(j.status="rejected",j.reason=F)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function V(j,F,w,G,he){var me=typeof j;(me==="undefined"||me==="boolean")&&(j=null);var fe=!1;if(j===null)fe=!0;else switch(me){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(j.$$typeof){case e:case t:fe=!0;break;case g:return fe=j._init,V(fe(j._payload),F,w,G,he)}}if(fe)return he=he(j),fe=G===""?"."+te(j,0):G,U(he)?(w="",fe!=null&&(w=fe.replace(ae,"$&/")+"/"),V(he,F,w,"",function(bt){return bt})):he!=null&&(le(he)&&(he=ue(he,w+(he.key==null||j&&j.key===he.key?"":(""+he.key).replace(ae,"$&/")+"/")+fe)),F.push(he)),1;fe=0;var Ze=G===""?".":G+":";if(U(j))for(var Te=0;Te<j.length;Te++)G=j[Te],me=Ze+te(G,Te),fe+=V(G,F,w,me,he);else if(Te=v(j),typeof Te=="function")for(j=Te.call(j),Te=0;!(G=j.next()).done;)G=G.value,me=Ze+te(G,Te++),fe+=V(G,F,w,me,he);else if(me==="object"){if(typeof j.then=="function")return V(se(j),F,w,G,he);throw F=String(j),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return fe}function Q(j,F,w){if(j==null)return j;var G=[],he=0;return V(j,G,"","",function(me){return F.call(w,me,he++)}),G}function Y(j){if(j._status===-1){var F=j._result;F=F(),F.then(function(w){(j._status===0||j._status===-1)&&(j._status=1,j._result=w)},function(w){(j._status===0||j._status===-1)&&(j._status=2,j._result=w)}),j._status===-1&&(j._status=0,j._result=F)}if(j._status===1)return j._result.default;throw j._result}var be=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},O={map:Q,forEach:function(j,F,w){Q(j,function(){F.apply(this,arguments)},w)},count:function(j){var F=0;return Q(j,function(){F++}),F},toArray:function(j){return Q(j,function(F){return F})||[]},only:function(j){if(!le(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return De.Activity=y,De.Children=O,De.Component=E,De.Fragment=n,De.Profiler=s,De.PureComponent=T,De.StrictMode=a,De.Suspense=h,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,De.__COMPILER_RUNTIME={__proto__:null,c:function(j){return Z.H.useMemoCache(j)}},De.cache=function(j){return function(){return j.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(j,F,w){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var G=N({},j.props),he=j.key;if(F!=null)for(me in F.key!==void 0&&(he=""+F.key),F)!R.call(F,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&F.ref===void 0||(G[me]=F[me]);var me=arguments.length-2;if(me===1)G.children=w;else if(1<me){for(var fe=Array(me),Ze=0;Ze<me;Ze++)fe[Ze]=arguments[Ze+2];G.children=fe}return J(j.type,he,G)},De.createContext=function(j){return j={$$typeof:l,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:u,_context:j},j},De.createElement=function(j,F,w){var G,he={},me=null;if(F!=null)for(G in F.key!==void 0&&(me=""+F.key),F)R.call(F,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(he[G]=F[G]);var fe=arguments.length-2;if(fe===1)he.children=w;else if(1<fe){for(var Ze=Array(fe),Te=0;Te<fe;Te++)Ze[Te]=arguments[Te+2];he.children=Ze}if(j&&j.defaultProps)for(G in fe=j.defaultProps,fe)he[G]===void 0&&(he[G]=fe[G]);return J(j,me,he)},De.createRef=function(){return{current:null}},De.forwardRef=function(j){return{$$typeof:f,render:j}},De.isValidElement=le,De.lazy=function(j){return{$$typeof:g,_payload:{_status:-1,_result:j},_init:Y}},De.memo=function(j,F){return{$$typeof:m,type:j,compare:F===void 0?null:F}},De.startTransition=function(j){var F=Z.T,w={};Z.T=w;try{var G=j(),he=Z.S;he!==null&&he(w,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(D,be)}catch(me){be(me)}finally{F!==null&&w.types!==null&&(F.types=w.types),Z.T=F}},De.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},De.use=function(j){return Z.H.use(j)},De.useActionState=function(j,F,w){return Z.H.useActionState(j,F,w)},De.useCallback=function(j,F){return Z.H.useCallback(j,F)},De.useContext=function(j){return Z.H.useContext(j)},De.useDebugValue=function(){},De.useDeferredValue=function(j,F){return Z.H.useDeferredValue(j,F)},De.useEffect=function(j,F){return Z.H.useEffect(j,F)},De.useEffectEvent=function(j){return Z.H.useEffectEvent(j)},De.useId=function(){return Z.H.useId()},De.useImperativeHandle=function(j,F,w){return Z.H.useImperativeHandle(j,F,w)},De.useInsertionEffect=function(j,F){return Z.H.useInsertionEffect(j,F)},De.useLayoutEffect=function(j,F){return Z.H.useLayoutEffect(j,F)},De.useMemo=function(j,F){return Z.H.useMemo(j,F)},De.useOptimistic=function(j,F){return Z.H.useOptimistic(j,F)},De.useReducer=function(j,F,w){return Z.H.useReducer(j,F,w)},De.useRef=function(j){return Z.H.useRef(j)},De.useState=function(j){return Z.H.useState(j)},De.useSyncExternalStore=function(j,F,w){return Z.H.useSyncExternalStore(j,F,w)},De.useTransition=function(){return Z.H.useTransition()},De.version="19.2.4",De}var x0;function dd(){return x0||(x0=1,Ih.exports=BC()),Ih.exports}var z=dd();const Xp=Kp(z);var Hh={exports:{}},ol={},Fh={exports:{}},qh={};var y0;function ZC(){return y0||(y0=1,(function(e){function t(V,Q){var Y=V.length;V.push(Q);e:for(;0<Y;){var be=Y-1>>>1,O=V[be];if(0<s(O,Q))V[be]=Q,V[Y]=O,Y=be;else break e}}function n(V){return V.length===0?null:V[0]}function a(V){if(V.length===0)return null;var Q=V[0],Y=V.pop();if(Y!==Q){V[0]=Y;e:for(var be=0,O=V.length,j=O>>>1;be<j;){var F=2*(be+1)-1,w=V[F],G=F+1,he=V[G];if(0>s(w,Y))G<O&&0>s(he,w)?(V[be]=he,V[G]=Y,be=G):(V[be]=w,V[F]=Y,be=F);else if(G<O&&0>s(he,Y))V[be]=he,V[G]=Y,be=G;else break e}}return Q}function s(V,Q){var Y=V.sortIndex-Q.sortIndex;return Y!==0?Y:V.id-Q.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,b=3,v=!1,S=!1,N=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function L(V){for(var Q=n(m);Q!==null;){if(Q.callback===null)a(m);else if(Q.startTime<=V)a(m),Q.sortIndex=Q.expirationTime,t(h,Q);else break;Q=n(m)}}function U(V){if(N=!1,L(V),!S)if(n(h)!==null)S=!0,D||(D=!0,re());else{var Q=n(m);Q!==null&&se(U,Q.startTime-V)}}var D=!1,Z=-1,R=5,J=-1;function ue(){return C?!0:!(e.unstable_now()-J<R)}function le(){if(C=!1,D){var V=e.unstable_now();J=V;var Q=!0;try{e:{S=!1,N&&(N=!1,A(Z),Z=-1),v=!0;var Y=b;try{t:{for(L(V),y=n(h);y!==null&&!(y.expirationTime>V&&ue());){var be=y.callback;if(typeof be=="function"){y.callback=null,b=y.priorityLevel;var O=be(y.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){y.callback=O,L(V),Q=!0;break t}y===n(h)&&a(h),L(V)}else a(h);y=n(h)}if(y!==null)Q=!0;else{var j=n(m);j!==null&&se(U,j.startTime-V),Q=!1}}break e}finally{y=null,b=Y,v=!1}Q=void 0}}finally{Q?re():D=!1}}}var re;if(typeof T=="function")re=function(){T(le)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,te=ae.port2;ae.port1.onmessage=le,re=function(){te.postMessage(null)}}else re=function(){E(le,0)};function se(V,Q){Z=E(function(){V(e.unstable_now())},Q)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(V){switch(b){case 1:case 2:case 3:var Q=3;break;default:Q=b}var Y=b;b=Q;try{return V()}finally{b=Y}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(V,Q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var Y=b;b=V;try{return Q()}finally{b=Y}},e.unstable_scheduleCallback=function(V,Q,Y){var be=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?be+Y:be):Y=be,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Y+O,V={id:g++,callback:Q,priorityLevel:V,startTime:Y,expirationTime:O,sortIndex:-1},Y>be?(V.sortIndex=Y,t(m,V),n(h)===null&&V===n(m)&&(N?(A(Z),Z=-1):N=!0,se(U,Y-be))):(V.sortIndex=O,t(h,V),S||v||(S=!0,D||(D=!0,re()))),V},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(V){var Q=b;return function(){var Y=b;b=Q;try{return V.apply(this,arguments)}finally{b=Y}}}})(qh)),qh}var b0;function IC(){return b0||(b0=1,Fh.exports=ZC()),Fh.exports}var Gh={exports:{}},hn={};var v0;function HC(){if(v0)return hn;v0=1;var e=dd();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 hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,hn.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)},hn.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()}},hn.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))},hn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},hn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:v}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:b,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},hn.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)},hn.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})}},hn.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)},hn.requestFormReset=function(h){a.d.r(h)},hn.unstable_batchedUpdates=function(h,m){return h(m)},hn.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},hn.useFormStatus=function(){return l.H.useHostTransitionStatus()},hn.version="19.2.4",hn}var k0;function FC(){if(k0)return Gh.exports;k0=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(),Gh.exports=HC(),Gh.exports}var w0;function qC(){if(w0)return ol;w0=1;var e=IC(),t=dd(),n=FC();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,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),le=Symbol.iterator;function re(r){return r===null||typeof r!="object"?null:(r=le&&r[le]||r["@@iterator"],typeof r=="function"?r:null)}var ae=Symbol.for("react.client.reference");function te(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ae?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case N:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList";case J:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case T:return r.displayName||"Context";case A: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 Z:return i=r.displayName||null,i!==null?i:te(r.type)||"Memo";case R:i=r._payload,r=r._init;try{return te(r(i))}catch{}}return null}var se=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},be=[],O=-1;function j(r){return{current:r}}function F(r){0>O||(r.current=be[O],be[O]=null,O--)}function w(r,i){O++,be[O]=r.current,r.current=i}var G=j(null),he=j(null),me=j(null),fe=j(null);function Ze(r,i){switch(w(me,i),w(he,r),w(G,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Lv(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Lv(i),r=Pv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}F(G),w(G,r)}function Te(){F(G),F(he),F(me)}function bt(r){r.memoizedState!==null&&w(fe,r);var i=G.current,o=Pv(i,r.type);i!==o&&(w(he,r),w(G,o))}function Ae(r){he.current===r&&(F(G),F(he)),fe.current===r&&(F(fe),nl._currentValue=Y)}var Oe,Se;function rt(r){if(Oe===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);Oe=i&&i[1]||"",Se=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Oe+r+Se}var Rt=!1;function $e(r,i){if(!r||Rt)return"";Rt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(X){var q=X}Reflect.construct(r,[],ie)}else{try{ie.call()}catch(X){q=X}r.call(ie.prototype)}}else{try{throw Error()}catch(X){q=X}(ie=r())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(X){if(X&&q&&typeof X.stack=="string")return[X.stack,q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),k=x[0],_=x[1];if(k&&_){var $=k.split(`
|
|
4
|
+
`),H=_.split(`
|
|
5
|
+
`);for(p=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;p<H.length&&!H[p].includes("DetermineComponentFrameRoot");)p++;if(c===$.length||p===H.length)for(c=$.length-1,p=H.length-1;1<=c&&0<=p&&$[c]!==H[p];)p--;for(;1<=c&&0<=p;c--,p--)if($[c]!==H[p]){if(c!==1||p!==1)do if(c--,p--,0>p||$[c]!==H[p]){var W=`
|
|
6
|
+
`+$[c].replace(" at new "," at ");return r.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",r.displayName)),W}while(1<=c&&0<=p);break}}}finally{Rt=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?rt(o):""}function Fe(r,i){switch(r.tag){case 26:case 27:case 5:return rt(r.type);case 16:return rt("Lazy");case 13:return r.child!==i&&i!==null?rt("Suspense Fallback"):rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return $e(r.type,!1);case 11:return $e(r.type.render,!1);case 1:return $e(r.type,!0);case 31:return rt("Activity");default:return""}}function ft(r){try{var i="",o=null;do i+=Fe(r,o),o=r,r=r.return;while(r);return i}catch(c){return`
|
|
7
|
+
Error generating stack: `+c.message+`
|
|
8
|
+
`+c.stack}}var at=Object.prototype.hasOwnProperty,Bt=e.unstable_scheduleCallback,En=e.unstable_cancelCallback,Nt=e.unstable_shouldYield,M=e.unstable_requestPaint,_e=e.unstable_now,Lt=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,ge=e.unstable_NormalPriority,Ee=e.unstable_LowPriority,qe=e.unstable_IdlePriority,kn=e.log,In=e.unstable_setDisableYieldValue,wn=null,Jt=null;function An(r){if(typeof kn=="function"&&In(r),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(wn,r)}catch{}}var ht=Math.clz32?Math.clz32:_2,ha=Math.log,vr=Math.LN2;function _2(r){return r>>>=0,r===0?32:31-(ha(r)/vr|0)|0}var Ql=256,Wl=262144,eu=4194304;function oi(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 tu(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=oi(c):(k&=_,k!==0?p=oi(k):o||(o=_&~r,o!==0&&(p=oi(o))))):(_=c&~x,_!==0?p=oi(_):k!==0?p=oi(k):o||(o=c&~r,o!==0&&(p=oi(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 po(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function j2(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 yx(){var r=eu;return eu<<=1,(eu&62914560)===0&&(eu=4194304),r}function Td(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function go(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function N2(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,$=r.expirationTimes,H=r.hiddenUpdates;for(o=k&~o;0<o;){var W=31-ht(o),ie=1<<W;_[W]=0,$[W]=-1;var q=H[W];if(q!==null)for(H[W]=null,W=0;W<q.length;W++){var X=q[W];X!==null&&(X.lane&=-536870913)}o&=~ie}c!==0&&bx(r,c,0),x!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=x&~(k&~i))}function bx(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ht(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|o&261930}function vx(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var c=31-ht(o),p=1<<c;p&i|r[c]&i&&(r[c]|=i),o&=~p}}function kx(r,i){var o=i&-i;return o=(o&42)!==0?1:Ed(o),(o&(r.suspendedLanes|i))!==0?0:o}function Ed(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 Ad(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function wx(){var r=Q.p;return r!==0?r:(r=window.event,r===void 0?32:o0(r.type))}function Sx(r,i){var o=Q.p;try{return Q.p=r,i()}finally{Q.p=o}}var ma=Math.random().toString(36).slice(2),sn="__reactFiber$"+ma,On="__reactProps$"+ma,Vi="__reactContainer$"+ma,Od="__reactEvents$"+ma,C2="__reactListeners$"+ma,T2="__reactHandles$"+ma,zx="__reactResources$"+ma,xo="__reactMarker$"+ma;function Rd(r){delete r[sn],delete r[On],delete r[Od],delete r[C2],delete r[T2]}function Bi(r){var i=r[sn];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Vi]||o[sn]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Fv(r);r!==null;){if(o=r[sn])return o;r=Fv(r)}return i}r=o,o=r.parentNode}return null}function Zi(r){if(r=r[sn]||r[Vi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function yo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Ii(r){var i=r[zx];return i||(i=r[zx]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function nn(r){r[xo]=!0}var _x=new Set,jx={};function li(r,i){Hi(r,i),Hi(r+"Capture",i)}function Hi(r,i){for(jx[r]=i,r=0;r<i.length;r++)_x.add(i[r])}var E2=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]*$"),Nx={},Cx={};function A2(r){return at.call(Cx,r)?!0:at.call(Nx,r)?!1:E2.test(r)?Cx[r]=!0:(Nx[r]=!0,!1)}function nu(r,i,o){if(A2(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 ru(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 Zr(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 er(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Tx(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function O2(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 Md(r){if(!r._valueTracker){var i=Tx(r)?"checked":"value";r._valueTracker=O2(r,i,""+r[i])}}function Ex(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),c="";return r&&(c=Tx(r)?r.checked?"true":"false":r.value),r=c,r!==o?(i.setValue(r),!0):!1}function au(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 R2=/[\n"\\]/g;function tr(r){return r.replace(R2,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Dd(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=""+er(i)):r.value!==""+er(i)&&(r.value=""+er(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?$d(r,k,er(i)):o!=null?$d(r,k,er(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=""+er(_):r.removeAttribute("name")}function Ax(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)){Md(r);return}o=o!=null?""+er(o):"",i=i!=null?""+er(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),Md(r)}function $d(r,i,o){i==="number"&&au(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Fi(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=""+er(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 Ox(r,i,o){if(i!=null&&(i=""+er(i),i!==r.value&&(r.value=i),o==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=o!=null?""+er(o):""}function Rx(r,i,o,c){if(i==null){if(c!=null){if(o!=null)throw Error(a(92));if(se(c)){if(1<c.length)throw Error(a(93));c=c[0]}o=c}o==null&&(o=""),i=o}o=er(i),r.defaultValue=o,c=r.textContent,c===o&&c!==""&&c!==null&&(r.value=c),Md(r)}function qi(r,i){if(i){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=i;return}}r.textContent=i}var M2=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 Mx(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||M2.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Dx(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&&Mx(r,p,c)}else for(var x in i)i.hasOwnProperty(x)&&Mx(r,x,i[x])}function Ld(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 D2=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"]]),$2=/^[\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 iu(r){return $2.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ir(){}var Pd=null;function Ud(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Gi=null,Yi=null;function $x(r){var i=Zi(r);if(i&&(r=i.stateNode)){var o=r[On]||null;e:switch(r=i.stateNode,i.type){case"input":if(Dd(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="'+tr(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var c=o[i];if(c!==r&&c.form===r.form){var p=c[On]||null;if(!p)throw Error(a(90));Dd(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&&Ex(c)}break e;case"textarea":Ox(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Fi(r,!!o.multiple,i,!1)}}}var Vd=!1;function Lx(r,i,o){if(Vd)return r(i,o);Vd=!0;try{var c=r(i);return c}finally{if(Vd=!1,(Gi!==null||Yi!==null)&&(qu(),Gi&&(i=Gi,r=Yi,Yi=Gi=null,$x(i),r)))for(i=0;i<r.length;i++)$x(r[i])}}function bo(r,i){var o=r.stateNode;if(o===null)return null;var c=o[On]||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 Hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bd=!1;if(Hr)try{var vo={};Object.defineProperty(vo,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",vo,vo),window.removeEventListener("test",vo,vo)}catch{Bd=!1}var pa=null,Zd=null,su=null;function Px(){if(su)return su;var r,i=Zd,o=i.length,c,p="value"in pa?pa.value:pa.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 su=p.slice(r,1<c?1-c:void 0)}function ou(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 lu(){return!0}function Ux(){return!1}function Rn(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)?lu:Ux,this.isPropagationStopped=Ux,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=lu)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=lu)},persist:function(){},isPersistent:lu}),i}var ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uu=Rn(ui),ko=y({},ui,{view:0,detail:0}),L2=Rn(ko),Id,Hd,wo,cu=y({},ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qd,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!==wo&&(wo&&r.type==="mousemove"?(Id=r.screenX-wo.screenX,Hd=r.screenY-wo.screenY):Hd=Id=0,wo=r),Id)},movementY:function(r){return"movementY"in r?r.movementY:Hd}}),Vx=Rn(cu),P2=y({},cu,{dataTransfer:0}),U2=Rn(P2),V2=y({},ko,{relatedTarget:0}),Fd=Rn(V2),B2=y({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),Z2=Rn(B2),I2=y({},ui,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),H2=Rn(I2),F2=y({},ui,{data:0}),Bx=Rn(F2),q2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G2={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"},Y2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K2(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Y2[r])?!!i[r]:!1}function qd(){return K2}var X2=y({},ko,{key:function(r){if(r.key){var i=q2[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ou(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?G2[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qd,charCode:function(r){return r.type==="keypress"?ou(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ou(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),J2=Rn(X2),Q2=y({},cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zx=Rn(Q2),W2=y({},ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qd}),eN=Rn(W2),tN=y({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),nN=Rn(tN),rN=y({},cu,{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}),aN=Rn(rN),iN=y({},ui,{newState:0,oldState:0}),sN=Rn(iN),oN=[9,13,27,32],Gd=Hr&&"CompositionEvent"in window,So=null;Hr&&"documentMode"in document&&(So=document.documentMode);var lN=Hr&&"TextEvent"in window&&!So,Ix=Hr&&(!Gd||So&&8<So&&11>=So),Hx=" ",Fx=!1;function qx(r,i){switch(r){case"keyup":return oN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ki=!1;function uN(r,i){switch(r){case"compositionend":return Gx(i);case"keypress":return i.which!==32?null:(Fx=!0,Hx);case"textInput":return r=i.data,r===Hx&&Fx?null:r;default:return null}}function cN(r,i){if(Ki)return r==="compositionend"||!Gd&&qx(r,i)?(r=Px(),su=Zd=pa=null,Ki=!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 Ix&&i.locale!=="ko"?null:i.data;default:return null}}var dN={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 Yx(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!dN[r.type]:i==="textarea"}function Kx(r,i,o,c){Gi?Yi?Yi.push(c):Yi=[c]:Gi=c,i=Wu(i,"onChange"),0<i.length&&(o=new uu("onChange","change",null,o,c),r.push({event:o,listeners:i}))}var zo=null,_o=null;function fN(r){Av(r,0)}function du(r){var i=yo(r);if(Ex(i))return r}function Xx(r,i){if(r==="change")return i}var Jx=!1;if(Hr){var Yd;if(Hr){var Kd="oninput"in document;if(!Kd){var Qx=document.createElement("div");Qx.setAttribute("oninput","return;"),Kd=typeof Qx.oninput=="function"}Yd=Kd}else Yd=!1;Jx=Yd&&(!document.documentMode||9<document.documentMode)}function Wx(){zo&&(zo.detachEvent("onpropertychange",ey),_o=zo=null)}function ey(r){if(r.propertyName==="value"&&du(_o)){var i=[];Kx(i,_o,r,Ud(r)),Lx(fN,i)}}function hN(r,i,o){r==="focusin"?(Wx(),zo=i,_o=o,zo.attachEvent("onpropertychange",ey)):r==="focusout"&&Wx()}function mN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return du(_o)}function pN(r,i){if(r==="click")return du(i)}function gN(r,i){if(r==="input"||r==="change")return du(i)}function xN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Hn=typeof Object.is=="function"?Object.is:xN;function jo(r,i){if(Hn(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(!at.call(i,p)||!Hn(r[p],i[p]))return!1}return!0}function ty(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ny(r,i){var o=ty(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=ty(o)}}function ry(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?ry(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function ay(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=au(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=au(r.document)}return i}function Xd(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 yN=Hr&&"documentMode"in document&&11>=document.documentMode,Xi=null,Jd=null,No=null,Qd=!1;function iy(r,i,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Qd||Xi==null||Xi!==au(c)||(c=Xi,"selectionStart"in c&&Xd(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}),No&&jo(No,c)||(No=c,c=Wu(Jd,"onSelect"),0<c.length&&(i=new uu("onSelect","select",null,i,o),r.push({event:i,listeners:c}),i.target=Xi)))}function ci(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var Ji={animationend:ci("Animation","AnimationEnd"),animationiteration:ci("Animation","AnimationIteration"),animationstart:ci("Animation","AnimationStart"),transitionrun:ci("Transition","TransitionRun"),transitionstart:ci("Transition","TransitionStart"),transitioncancel:ci("Transition","TransitionCancel"),transitionend:ci("Transition","TransitionEnd")},Wd={},sy={};Hr&&(sy=document.createElement("div").style,"AnimationEvent"in window||(delete Ji.animationend.animation,delete Ji.animationiteration.animation,delete Ji.animationstart.animation),"TransitionEvent"in window||delete Ji.transitionend.transition);function di(r){if(Wd[r])return Wd[r];if(!Ji[r])return r;var i=Ji[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in sy)return Wd[r]=i[o];return r}var oy=di("animationend"),ly=di("animationiteration"),uy=di("animationstart"),bN=di("transitionrun"),vN=di("transitionstart"),kN=di("transitioncancel"),cy=di("transitionend"),dy=new Map,ef="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(" ");ef.push("scrollEnd");function kr(r,i){dy.set(r,i),li(i,[r])}var fu=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)},nr=[],Qi=0,tf=0;function hu(){for(var r=Qi,i=tf=Qi=0;i<r;){var o=nr[i];nr[i++]=null;var c=nr[i];nr[i++]=null;var p=nr[i];nr[i++]=null;var x=nr[i];if(nr[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&&fy(o,p,x)}}function mu(r,i,o,c){nr[Qi++]=r,nr[Qi++]=i,nr[Qi++]=o,nr[Qi++]=c,tf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function nf(r,i,o,c){return mu(r,i,o,c),pu(r)}function fi(r,i){return mu(r,null,null,i),pu(r)}function fy(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-ht(o),r=x.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=o|536870912),x):null}function pu(r){if(50<Ko)throw Ko=0,fh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Wi={};function wN(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 Fn(r,i,o,c){return new wN(r,i,o,c)}function rf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Fr(r,i){var o=r.alternate;return o===null?(o=Fn(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 hy(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 gu(r,i,o,c,p,x){var k=0;if(c=r,typeof r=="function")rf(r)&&(k=1);else if(typeof r=="string")k=NC(r,o,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case J:return r=Fn(31,o,i,p),r.elementType=J,r.lanes=x,r;case N:return hi(o.children,p,x,i);case C:k=8,p|=24;break;case E:return r=Fn(12,o,i,p|2),r.elementType=E,r.lanes=x,r;case U:return r=Fn(13,o,i,p),r.elementType=U,r.lanes=x,r;case D:return r=Fn(19,o,i,p),r.elementType=D,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case T:k=10;break e;case A:k=9;break e;case L:k=11;break e;case Z:k=14;break e;case R:k=16,c=null;break e}k=29,o=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Fn(k,o,i,p),i.elementType=r,i.type=c,i.lanes=x,i}function hi(r,i,o,c){return r=Fn(7,r,c,i),r.lanes=o,r}function af(r,i,o){return r=Fn(6,r,null,i),r.lanes=o,r}function my(r){var i=Fn(18,null,null,0);return i.stateNode=r,i}function sf(r,i,o){return i=Fn(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var py=new WeakMap;function rr(r,i){if(typeof r=="object"&&r!==null){var o=py.get(r);return o!==void 0?o:(i={value:r,source:i,stack:ft(i)},py.set(r,i),i)}return{value:r,source:i,stack:ft(i)}}var es=[],ts=0,xu=null,Co=0,ar=[],ir=0,ga=null,Er=1,Ar="";function qr(r,i){es[ts++]=Co,es[ts++]=xu,xu=r,Co=i}function gy(r,i,o){ar[ir++]=Er,ar[ir++]=Ar,ar[ir++]=ga,ga=r;var c=Er;r=Ar;var p=32-ht(c)-1;c&=~(1<<p),o+=1;var x=32-ht(i)+p;if(30<x){var k=p-p%5;x=(c&(1<<k)-1).toString(32),c>>=k,p-=k,Er=1<<32-ht(i)+p|o<<p|c,Ar=x+r}else Er=1<<x|o<<p|c,Ar=r}function of(r){r.return!==null&&(qr(r,1),gy(r,1,0))}function lf(r){for(;r===xu;)xu=es[--ts],es[ts]=null,Co=es[--ts],es[ts]=null;for(;r===ga;)ga=ar[--ir],ar[ir]=null,Ar=ar[--ir],ar[ir]=null,Er=ar[--ir],ar[ir]=null}function xy(r,i){ar[ir++]=Er,ar[ir++]=Ar,ar[ir++]=ga,Er=i.id,Ar=i.overflow,ga=r}var on=null,vt=null,Xe=!1,xa=null,sr=!1,uf=Error(a(519));function ya(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw To(rr(i,r)),uf}function yy(r){var i=r.stateNode,o=r.type,c=r.memoizedProps;switch(i[sn]=r,i[On]=c,o){case"dialog":He("cancel",i),He("close",i);break;case"iframe":case"object":case"embed":He("load",i);break;case"video":case"audio":for(o=0;o<Jo.length;o++)He(Jo[o],i);break;case"source":He("error",i);break;case"img":case"image":case"link":He("error",i),He("load",i);break;case"details":He("toggle",i);break;case"input":He("invalid",i),Ax(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":He("invalid",i);break;case"textarea":He("invalid",i),Rx(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||Dv(i.textContent,o)?(c.popover!=null&&(He("beforetoggle",i),He("toggle",i)),c.onScroll!=null&&He("scroll",i),c.onScrollEnd!=null&&He("scrollend",i),c.onClick!=null&&(i.onclick=Ir),i=!0):i=!1,i||ya(r,!0)}function by(r){for(on=r.return;on;)switch(on.tag){case 5:case 31:case 13:sr=!1;return;case 27:case 3:sr=!0;return;default:on=on.return}}function ns(r){if(r!==on)return!1;if(!Xe)return by(r),Xe=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||Nh(r.type,r.memoizedProps)),o=!o),o&&vt&&ya(r),by(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vt=Hv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vt=Hv(r)}else i===27?(i=vt,Oa(r.type)?(r=Oh,Oh=null,vt=r):vt=i):vt=on?lr(r.stateNode.nextSibling):null;return!0}function mi(){vt=on=null,Xe=!1}function cf(){var r=xa;return r!==null&&(Ln===null?Ln=r:Ln.push.apply(Ln,r),xa=null),r}function To(r){xa===null?xa=[r]:xa.push(r)}var df=j(null),pi=null,Gr=null;function ba(r,i,o){w(df,i._currentValue),i._currentValue=o}function Yr(r){r._currentValue=df.current,F(df)}function ff(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 hf(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 $=0;$<i.length;$++)if(_.context===i[$]){x.lanes|=o,_=x.alternate,_!==null&&(_.lanes|=o),ff(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),ff(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 rs(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;Hn(p.pendingProps.value,k.value)||(r!==null?r.push(_):r=[_])}}else if(p===fe.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(nl):r=[nl])}p=p.return}r!==null&&hf(i,r,o,c),i.flags|=262144}function yu(r){for(r=r.firstContext;r!==null;){if(!Hn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function gi(r){pi=r,Gr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function ln(r){return vy(pi,r)}function bu(r,i){return pi===null&&gi(r),vy(r,i)}function vy(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Gr===null){if(r===null)throw Error(a(308));Gr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Gr=Gr.next=i;return o}var SN=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()})}},zN=e.unstable_scheduleCallback,_N=e.unstable_NormalPriority,Zt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mf(){return{controller:new SN,data:new Map,refCount:0}}function Eo(r){r.refCount--,r.refCount===0&&zN(_N,function(){r.controller.abort()})}var Ao=null,pf=0,as=0,is=null;function jN(r,i){if(Ao===null){var o=Ao=[];pf=0,as=yh(),is={status:"pending",value:void 0,then:function(c){o.push(c)}}}return pf++,i.then(ky,ky),i}function ky(){if(--pf===0&&Ao!==null){is!==null&&(is.status="fulfilled");var r=Ao;Ao=null,as=0,is=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function NN(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 wy=V.S;V.S=function(r,i){iv=_e(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&jN(r,i),wy!==null&&wy(r,i)};var xi=j(null);function gf(){var r=xi.current;return r!==null?r:mt.pooledCache}function vu(r,i){i===null?w(xi,xi.current):w(xi,i.pool)}function Sy(){var r=gf();return r===null?null:{parent:Zt._currentValue,pool:r}}var ss=Error(a(460)),xf=Error(a(474)),ku=Error(a(542)),wu={then:function(){}};function zy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function _y(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(Ir,Ir),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Ny(r),r;default:if(typeof i.status=="string")i.then(Ir,Ir);else{if(r=mt,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,Ny(r),r}throw bi=i,ss}}function yi(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(bi=o,ss):o}}var bi=null;function jy(){if(bi===null)throw Error(a(459));var r=bi;return bi=null,r}function Ny(r){if(r===ss||r===ku)throw Error(a(483))}var os=null,Oo=0;function Su(r){var i=Oo;return Oo+=1,os===null&&(os=[]),_y(os,r,i)}function Ro(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function zu(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Cy(r){function i(B,P){if(r){var I=B.deletions;I===null?(B.deletions=[P],B.flags|=16):I.push(P)}}function o(B,P){if(!r)return null;for(;P!==null;)i(B,P),P=P.sibling;return null}function c(B){for(var P=new Map;B!==null;)B.key!==null?P.set(B.key,B):P.set(B.index,B),B=B.sibling;return P}function p(B,P){return B=Fr(B,P),B.index=0,B.sibling=null,B}function x(B,P,I){return B.index=I,r?(I=B.alternate,I!==null?(I=I.index,I<P?(B.flags|=67108866,P):I):(B.flags|=67108866,P)):(B.flags|=1048576,P)}function k(B){return r&&B.alternate===null&&(B.flags|=67108866),B}function _(B,P,I,ne){return P===null||P.tag!==6?(P=af(I,B.mode,ne),P.return=B,P):(P=p(P,I),P.return=B,P)}function $(B,P,I,ne){var Ne=I.type;return Ne===N?W(B,P,I.props.children,ne,I.key):P!==null&&(P.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===R&&yi(Ne)===P.type)?(P=p(P,I.props),Ro(P,I),P.return=B,P):(P=gu(I.type,I.key,I.props,null,B.mode,ne),Ro(P,I),P.return=B,P)}function H(B,P,I,ne){return P===null||P.tag!==4||P.stateNode.containerInfo!==I.containerInfo||P.stateNode.implementation!==I.implementation?(P=sf(I,B.mode,ne),P.return=B,P):(P=p(P,I.children||[]),P.return=B,P)}function W(B,P,I,ne,Ne){return P===null||P.tag!==7?(P=hi(I,B.mode,ne,Ne),P.return=B,P):(P=p(P,I),P.return=B,P)}function ie(B,P,I){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=af(""+P,B.mode,I),P.return=B,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case v:return I=gu(P.type,P.key,P.props,null,B.mode,I),Ro(I,P),I.return=B,I;case S:return P=sf(P,B.mode,I),P.return=B,P;case R:return P=yi(P),ie(B,P,I)}if(se(P)||re(P))return P=hi(P,B.mode,I,null),P.return=B,P;if(typeof P.then=="function")return ie(B,Su(P),I);if(P.$$typeof===T)return ie(B,bu(B,P),I);zu(B,P)}return null}function q(B,P,I,ne){var Ne=P!==null?P.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return Ne!==null?null:_(B,P,""+I,ne);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return I.key===Ne?$(B,P,I,ne):null;case S:return I.key===Ne?H(B,P,I,ne):null;case R:return I=yi(I),q(B,P,I,ne)}if(se(I)||re(I))return Ne!==null?null:W(B,P,I,ne,null);if(typeof I.then=="function")return q(B,P,Su(I),ne);if(I.$$typeof===T)return q(B,P,bu(B,I),ne);zu(B,I)}return null}function X(B,P,I,ne,Ne){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return B=B.get(I)||null,_(P,B,""+ne,Ne);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return B=B.get(ne.key===null?I:ne.key)||null,$(P,B,ne,Ne);case S:return B=B.get(ne.key===null?I:ne.key)||null,H(P,B,ne,Ne);case R:return ne=yi(ne),X(B,P,I,ne,Ne)}if(se(ne)||re(ne))return B=B.get(I)||null,W(P,B,ne,Ne,null);if(typeof ne.then=="function")return X(B,P,I,Su(ne),Ne);if(ne.$$typeof===T)return X(B,P,I,bu(P,ne),Ne);zu(P,ne)}return null}function ye(B,P,I,ne){for(var Ne=null,We=null,ze=P,Pe=P=0,Ye=null;ze!==null&&Pe<I.length;Pe++){ze.index>Pe?(Ye=ze,ze=null):Ye=ze.sibling;var et=q(B,ze,I[Pe],ne);if(et===null){ze===null&&(ze=Ye);break}r&&ze&&et.alternate===null&&i(B,ze),P=x(et,P,Pe),We===null?Ne=et:We.sibling=et,We=et,ze=Ye}if(Pe===I.length)return o(B,ze),Xe&&qr(B,Pe),Ne;if(ze===null){for(;Pe<I.length;Pe++)ze=ie(B,I[Pe],ne),ze!==null&&(P=x(ze,P,Pe),We===null?Ne=ze:We.sibling=ze,We=ze);return Xe&&qr(B,Pe),Ne}for(ze=c(ze);Pe<I.length;Pe++)Ye=X(ze,B,Pe,I[Pe],ne),Ye!==null&&(r&&Ye.alternate!==null&&ze.delete(Ye.key===null?Pe:Ye.key),P=x(Ye,P,Pe),We===null?Ne=Ye:We.sibling=Ye,We=Ye);return r&&ze.forEach(function(La){return i(B,La)}),Xe&&qr(B,Pe),Ne}function Ce(B,P,I,ne){if(I==null)throw Error(a(151));for(var Ne=null,We=null,ze=P,Pe=P=0,Ye=null,et=I.next();ze!==null&&!et.done;Pe++,et=I.next()){ze.index>Pe?(Ye=ze,ze=null):Ye=ze.sibling;var La=q(B,ze,et.value,ne);if(La===null){ze===null&&(ze=Ye);break}r&&ze&&La.alternate===null&&i(B,ze),P=x(La,P,Pe),We===null?Ne=La:We.sibling=La,We=La,ze=Ye}if(et.done)return o(B,ze),Xe&&qr(B,Pe),Ne;if(ze===null){for(;!et.done;Pe++,et=I.next())et=ie(B,et.value,ne),et!==null&&(P=x(et,P,Pe),We===null?Ne=et:We.sibling=et,We=et);return Xe&&qr(B,Pe),Ne}for(ze=c(ze);!et.done;Pe++,et=I.next())et=X(ze,B,Pe,et.value,ne),et!==null&&(r&&et.alternate!==null&&ze.delete(et.key===null?Pe:et.key),P=x(et,P,Pe),We===null?Ne=et:We.sibling=et,We=et);return r&&ze.forEach(function(PC){return i(B,PC)}),Xe&&qr(B,Pe),Ne}function dt(B,P,I,ne){if(typeof I=="object"&&I!==null&&I.type===N&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case v:e:{for(var Ne=I.key;P!==null;){if(P.key===Ne){if(Ne=I.type,Ne===N){if(P.tag===7){o(B,P.sibling),ne=p(P,I.props.children),ne.return=B,B=ne;break e}}else if(P.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===R&&yi(Ne)===P.type){o(B,P.sibling),ne=p(P,I.props),Ro(ne,I),ne.return=B,B=ne;break e}o(B,P);break}else i(B,P);P=P.sibling}I.type===N?(ne=hi(I.props.children,B.mode,ne,I.key),ne.return=B,B=ne):(ne=gu(I.type,I.key,I.props,null,B.mode,ne),Ro(ne,I),ne.return=B,B=ne)}return k(B);case S:e:{for(Ne=I.key;P!==null;){if(P.key===Ne)if(P.tag===4&&P.stateNode.containerInfo===I.containerInfo&&P.stateNode.implementation===I.implementation){o(B,P.sibling),ne=p(P,I.children||[]),ne.return=B,B=ne;break e}else{o(B,P);break}else i(B,P);P=P.sibling}ne=sf(I,B.mode,ne),ne.return=B,B=ne}return k(B);case R:return I=yi(I),dt(B,P,I,ne)}if(se(I))return ye(B,P,I,ne);if(re(I)){if(Ne=re(I),typeof Ne!="function")throw Error(a(150));return I=Ne.call(I),Ce(B,P,I,ne)}if(typeof I.then=="function")return dt(B,P,Su(I),ne);if(I.$$typeof===T)return dt(B,P,bu(B,I),ne);zu(B,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,P!==null&&P.tag===6?(o(B,P.sibling),ne=p(P,I),ne.return=B,B=ne):(o(B,P),ne=af(I,B.mode,ne),ne.return=B,B=ne),k(B)):o(B,P)}return function(B,P,I,ne){try{Oo=0;var Ne=dt(B,P,I,ne);return os=null,Ne}catch(ze){if(ze===ss||ze===ku)throw ze;var We=Fn(29,ze,null,B.mode);return We.lanes=ne,We.return=B,We}}}var vi=Cy(!0),Ty=Cy(!1),va=!1;function yf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bf(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 ka(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function wa(r,i,o){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=pu(r),fy(r,null,o),i}return mu(r,c,i,o),pu(r)}function Mo(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,vx(r,o)}}function vf(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 kf=!1;function Do(){if(kf){var r=is;if(r!==null)throw r}}function $o(r,i,o,c){kf=!1;var p=r.updateQueue;va=!1;var x=p.firstBaseUpdate,k=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var $=_,H=$.next;$.next=null,k===null?x=H:k.next=H,k=$;var W=r.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==k&&(_===null?W.firstBaseUpdate=H:_.next=H,W.lastBaseUpdate=$))}if(x!==null){var ie=p.baseState;k=0,W=H=$=null,_=x;do{var q=_.lane&-536870913,X=q!==_.lane;if(X?(Ge&q)===q:(c&q)===q){q!==0&&q===as&&(kf=!0),W!==null&&(W=W.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ye=r,Ce=_;q=i;var dt=o;switch(Ce.tag){case 1:if(ye=Ce.payload,typeof ye=="function"){ie=ye.call(dt,ie,q);break e}ie=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ce.payload,q=typeof ye=="function"?ye.call(dt,ie,q):ye,q==null)break e;ie=y({},ie,q);break e;case 2:va=!0}}q=_.callback,q!==null&&(r.flags|=64,X&&(r.flags|=8192),X=p.callbacks,X===null?p.callbacks=[q]:X.push(q))}else X={lane:q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},W===null?(H=W=X,$=ie):W=W.next=X,k|=q;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;X=_,_=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);W===null&&($=ie),p.baseState=$,p.firstBaseUpdate=H,p.lastBaseUpdate=W,x===null&&(p.shared.lanes=0),Na|=k,r.lanes=k,r.memoizedState=ie}}function Ey(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Ay(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)Ey(o[r],i)}var ls=j(null),_u=j(0);function Oy(r,i){r=ra,w(_u,r),w(ls,i),ra=r|i.baseLanes}function wf(){w(_u,ra),w(ls,ls.current)}function Sf(){ra=_u.current,F(ls),F(_u)}var qn=j(null),or=null;function Sa(r){var i=r.alternate;w(Pt,Pt.current&1),w(qn,r),or===null&&(i===null||ls.current!==null||i.memoizedState!==null)&&(or=r)}function zf(r){w(Pt,Pt.current),w(qn,r),or===null&&(or=r)}function Ry(r){r.tag===22?(w(Pt,Pt.current),w(qn,r),or===null&&(or=r)):za()}function za(){w(Pt,Pt.current),w(qn,qn.current)}function Gn(r){F(qn),or===r&&(or=null),F(Pt)}var Pt=j(0);function ju(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Eh(o)||Ah(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 Kr=0,Le=null,ut=null,It=null,Nu=!1,us=!1,ki=!1,Cu=0,Lo=0,cs=null,CN=0;function Mt(){throw Error(a(321))}function _f(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!Hn(r[o],i[o]))return!1;return!0}function jf(r,i,o,c,p,x){return Kr=x,Le=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=r===null||r.memoizedState===null?gb:Bf,ki=!1,x=o(c,p),ki=!1,us&&(x=Dy(i,o,c,p)),My(r),x}function My(r){V.H=Vo;var i=ut!==null&&ut.next!==null;if(Kr=0,It=ut=Le=null,Nu=!1,Lo=0,cs=null,i)throw Error(a(300));r===null||Ht||(r=r.dependencies,r!==null&&yu(r)&&(Ht=!0))}function Dy(r,i,o,c){Le=r;var p=0;do{if(us&&(cs=null),Lo=0,us=!1,25<=p)throw Error(a(301));if(p+=1,It=ut=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}V.H=xb,x=i(o,c)}while(us);return x}function TN(){var r=V.H,i=r.useState()[0];return i=typeof i.then=="function"?Po(i):i,r=r.useState()[0],(ut!==null?ut.memoizedState:null)!==r&&(Le.flags|=1024),i}function Nf(){var r=Cu!==0;return Cu=0,r}function Cf(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function Tf(r){if(Nu){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Nu=!1}Kr=0,It=ut=Le=null,us=!1,Lo=Cu=0,cs=null}function Sn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Le.memoizedState=It=r:It=It.next=r,It}function Ut(){if(ut===null){var r=Le.alternate;r=r!==null?r.memoizedState:null}else r=ut.next;var i=It===null?Le.memoizedState:It.next;if(i!==null)It=i,ut=r;else{if(r===null)throw Le.alternate===null?Error(a(467)):Error(a(310));ut=r,r={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},It===null?Le.memoizedState=It=r:It=It.next=r}return It}function Tu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(r){var i=Lo;return Lo+=1,cs===null&&(cs=[]),r=_y(cs,r,i),i=Le,(It===null?i.memoizedState:It.next)===null&&(i=i.alternate,V.H=i===null||i.memoizedState===null?gb:Bf),r}function Eu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Po(r);if(r.$$typeof===T)return ln(r)}throw Error(a(438,String(r)))}function Ef(r){var i=null,o=Le.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var c=Le.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=Tu(),Le.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]=ue;return i.index++,o}function Xr(r,i){return typeof i=="function"?i(r):i}function Au(r){var i=Ut();return Af(i,ut,r)}function Af(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,$=null,H=i,W=!1;do{var ie=H.lane&-536870913;if(ie!==H.lane?(Ge&ie)===ie:(Kr&ie)===ie){var q=H.revertLane;if(q===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),ie===as&&(W=!0);else if((Kr&q)===q){H=H.next,q===as&&(W=!0);continue}else ie={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},$===null?(_=$=ie,k=x):$=$.next=ie,Le.lanes|=q,Na|=q;ie=H.action,ki&&o(x,ie),x=H.hasEagerState?H.eagerState:o(x,ie)}else q={lane:ie,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},$===null?(_=$=q,k=x):$=$.next=q,Le.lanes|=ie,Na|=ie;H=H.next}while(H!==null&&H!==i);if($===null?k=x:$.next=_,!Hn(x,r.memoizedState)&&(Ht=!0,W&&(o=is,o!==null)))throw o;r.memoizedState=x,r.baseState=k,r.baseQueue=$,c.lastRenderedState=x}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function Of(r){var i=Ut(),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);Hn(x,i.memoizedState)||(Ht=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,c]}function $y(r,i,o){var c=Le,p=Ut(),x=Xe;if(x){if(o===void 0)throw Error(a(407));o=o()}else o=i();var k=!Hn((ut||p).memoizedState,o);if(k&&(p.memoizedState=o,Ht=!0),p=p.queue,Df(Uy.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||It!==null&&It.memoizedState.tag&1){if(c.flags|=2048,ds(9,{destroy:void 0},Py.bind(null,c,p,o,i),null),mt===null)throw Error(a(349));x||(Kr&127)!==0||Ly(c,i,o)}return o}function Ly(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=Le.updateQueue,i===null?(i=Tu(),Le.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function Py(r,i,o,c){i.value=o,i.getSnapshot=c,Vy(i)&&By(r)}function Uy(r,i,o){return o(function(){Vy(i)&&By(r)})}function Vy(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!Hn(r,o)}catch{return!0}}function By(r){var i=fi(r,2);i!==null&&Pn(i,r,2)}function Rf(r){var i=Sn();if(typeof r=="function"){var o=r;if(r=o(),ki){An(!0);try{o()}finally{An(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:r},i}function Zy(r,i,o,c){return r.baseState=o,Af(r,ut,typeof c=="function"?c:Xr)}function EN(r,i,o,c,p){if(Mu(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)}};V.T!==null?o(!0):x.isTransition=!1,c(x),o=i.pending,o===null?(x.next=i.pending=x,Iy(i,x)):(x.next=o.next,i.pending=o.next=x)}}function Iy(r,i){var o=i.action,c=i.payload,p=r.state;if(i.isTransition){var x=V.T,k={};V.T=k;try{var _=o(p,c),$=V.S;$!==null&&$(k,_),Hy(r,i,_)}catch(H){Mf(r,i,H)}finally{x!==null&&k.types!==null&&(x.types=k.types),V.T=x}}else try{x=o(p,c),Hy(r,i,x)}catch(H){Mf(r,i,H)}}function Hy(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Fy(r,i,c)},function(c){return Mf(r,i,c)}):Fy(r,i,o)}function Fy(r,i,o){i.status="fulfilled",i.value=o,qy(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,Iy(r,o)))}function Mf(r,i,o){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=o,qy(i),i=i.next;while(i!==c)}r.action=null}function qy(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Gy(r,i){return i}function Yy(r,i){if(Xe){var o=mt.formState;if(o!==null){e:{var c=Le;if(Xe){if(vt){t:{for(var p=vt,x=sr;p.nodeType!==8;){if(!x){p=null;break t}if(p=lr(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){vt=lr(p.nextSibling),c=p.data==="F!";break e}}ya(c)}c=!1}c&&(i=o[0])}}return o=Sn(),o.memoizedState=o.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gy,lastRenderedState:i},o.queue=c,o=hb.bind(null,Le,c),c.dispatch=o,c=Rf(!1),x=Vf.bind(null,Le,!1,c.queue),c=Sn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,o=EN.bind(null,Le,p,x,o),p.dispatch=o,c.memoizedState=r,[i,o,!1]}function Ky(r){var i=Ut();return Xy(i,ut,r)}function Xy(r,i,o){if(i=Af(r,i,Gy)[0],r=Au(Xr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Po(i)}catch(k){throw k===ss?ku:k}else c=i;i=Ut();var p=i.queue,x=p.dispatch;return o!==i.memoizedState&&(Le.flags|=2048,ds(9,{destroy:void 0},AN.bind(null,p,o),null)),[c,x,r]}function AN(r,i){r.action=i}function Jy(r){var i=Ut(),o=ut;if(o!==null)return Xy(i,o,r);Ut(),i=i.memoizedState,o=Ut();var c=o.queue.dispatch;return o.memoizedState=r,[i,c,!1]}function ds(r,i,o,c){return r={tag:r,create:o,deps:c,inst:i,next:null},i=Le.updateQueue,i===null&&(i=Tu(),Le.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 Qy(){return Ut().memoizedState}function Ou(r,i,o,c){var p=Sn();Le.flags|=r,p.memoizedState=ds(1|i,{destroy:void 0},o,c===void 0?null:c)}function Ru(r,i,o,c){var p=Ut();c=c===void 0?null:c;var x=p.memoizedState.inst;ut!==null&&c!==null&&_f(c,ut.memoizedState.deps)?p.memoizedState=ds(i,x,o,c):(Le.flags|=r,p.memoizedState=ds(1|i,x,o,c))}function Wy(r,i){Ou(8390656,8,r,i)}function Df(r,i){Ru(2048,8,r,i)}function ON(r){Le.flags|=4;var i=Le.updateQueue;if(i===null)i=Tu(),Le.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function eb(r){var i=Ut().memoizedState;return ON({ref:i,nextImpl:r}),function(){if((tt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function tb(r,i){return Ru(4,2,r,i)}function nb(r,i){return Ru(4,4,r,i)}function rb(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 ab(r,i,o){o=o!=null?o.concat([r]):null,Ru(4,4,rb.bind(null,i,r),o)}function $f(){}function ib(r,i){var o=Ut();i=i===void 0?null:i;var c=o.memoizedState;return i!==null&&_f(i,c[1])?c[0]:(o.memoizedState=[r,i],r)}function sb(r,i){var o=Ut();i=i===void 0?null:i;var c=o.memoizedState;if(i!==null&&_f(i,c[1]))return c[0];if(c=r(),ki){An(!0);try{r()}finally{An(!1)}}return o.memoizedState=[c,i],c}function Lf(r,i,o){return o===void 0||(Kr&1073741824)!==0&&(Ge&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=ov(),Le.lanes|=r,Na|=r,o)}function ob(r,i,o,c){return Hn(o,i)?o:ls.current!==null?(r=Lf(r,o,c),Hn(r,i)||(Ht=!0),r):(Kr&42)===0||(Kr&1073741824)!==0&&(Ge&261930)===0?(Ht=!0,r.memoizedState=o):(r=ov(),Le.lanes|=r,Na|=r,i)}function lb(r,i,o,c,p){var x=Q.p;Q.p=x!==0&&8>x?x:8;var k=V.T,_={};V.T=_,Vf(r,!1,i,o);try{var $=p(),H=V.S;if(H!==null&&H(_,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var W=NN($,c);Uo(r,i,W,Xn(r))}else Uo(r,i,c,Xn(r))}catch(ie){Uo(r,i,{then:function(){},status:"rejected",reason:ie},Xn())}finally{Q.p=x,k!==null&&_.types!==null&&(k.types=_.types),V.T=k}}function RN(){}function Pf(r,i,o,c){if(r.tag!==5)throw Error(a(476));var p=ub(r).queue;lb(r,p,i,Y,o===null?RN:function(){return cb(r),o(c)})}function ub(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:Y},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:o},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function cb(r){var i=ub(r);i.next===null&&(i=r.alternate.memoizedState),Uo(r,i.next.queue,{},Xn())}function Uf(){return ln(nl)}function db(){return Ut().memoizedState}function fb(){return Ut().memoizedState}function MN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=Xn();r=ka(o);var c=wa(i,r,o);c!==null&&(Pn(c,i,o),Mo(c,i,o)),i={cache:mf()},r.payload=i;return}i=i.return}}function DN(r,i,o){var c=Xn();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Mu(r)?mb(i,o):(o=nf(r,i,o,c),o!==null&&(Pn(o,r,c),pb(o,i,c)))}function hb(r,i,o){var c=Xn();Uo(r,i,o,c)}function Uo(r,i,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Mu(r))mb(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=_,Hn(_,k))return mu(r,i,p,0),mt===null&&hu(),!1}catch{}if(o=nf(r,i,p,c),o!==null)return Pn(o,r,c),pb(o,i,c),!0}return!1}function Vf(r,i,o,c){if(c={lane:2,revertLane:yh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Mu(r)){if(i)throw Error(a(479))}else i=nf(r,o,c,2),i!==null&&Pn(i,r,2)}function Mu(r){var i=r.alternate;return r===Le||i!==null&&i===Le}function mb(r,i){us=Nu=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function pb(r,i,o){if((o&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,vx(r,o)}}var Vo={readContext:ln,use:Eu,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};Vo.useEffectEvent=Mt;var gb={readContext:ln,use:Eu,useCallback:function(r,i){return Sn().memoizedState=[r,i===void 0?null:i],r},useContext:ln,useEffect:Wy,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,Ou(4194308,4,rb.bind(null,i,r),o)},useLayoutEffect:function(r,i){return Ou(4194308,4,r,i)},useInsertionEffect:function(r,i){Ou(4,2,r,i)},useMemo:function(r,i){var o=Sn();i=i===void 0?null:i;var c=r();if(ki){An(!0);try{r()}finally{An(!1)}}return o.memoizedState=[c,i],c},useReducer:function(r,i,o){var c=Sn();if(o!==void 0){var p=o(i);if(ki){An(!0);try{o(i)}finally{An(!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=DN.bind(null,Le,r),[c.memoizedState,r]},useRef:function(r){var i=Sn();return r={current:r},i.memoizedState=r},useState:function(r){r=Rf(r);var i=r.queue,o=hb.bind(null,Le,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:$f,useDeferredValue:function(r,i){var o=Sn();return Lf(o,r,i)},useTransition:function(){var r=Rf(!1);return r=lb.bind(null,Le,r.queue,!0,!1),Sn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var c=Le,p=Sn();if(Xe){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),mt===null)throw Error(a(349));(Ge&127)!==0||Ly(c,i,o)}p.memoizedState=o;var x={value:o,getSnapshot:i};return p.queue=x,Wy(Uy.bind(null,c,x,r),[r]),c.flags|=2048,ds(9,{destroy:void 0},Py.bind(null,c,x,o,i),null),o},useId:function(){var r=Sn(),i=mt.identifierPrefix;if(Xe){var o=Ar,c=Er;o=(c&~(1<<32-ht(c)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Cu++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=CN++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Uf,useFormState:Yy,useActionState:Yy,useOptimistic:function(r){var i=Sn();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=Vf.bind(null,Le,!0,o),o.dispatch=i,[r,i]},useMemoCache:Ef,useCacheRefresh:function(){return Sn().memoizedState=MN.bind(null,Le)},useEffectEvent:function(r){var i=Sn(),o={impl:r};return i.memoizedState=o,function(){if((tt&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Bf={readContext:ln,use:Eu,useCallback:ib,useContext:ln,useEffect:Df,useImperativeHandle:ab,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:sb,useReducer:Au,useRef:Qy,useState:function(){return Au(Xr)},useDebugValue:$f,useDeferredValue:function(r,i){var o=Ut();return ob(o,ut.memoizedState,r,i)},useTransition:function(){var r=Au(Xr)[0],i=Ut().memoizedState;return[typeof r=="boolean"?r:Po(r),i]},useSyncExternalStore:$y,useId:db,useHostTransitionStatus:Uf,useFormState:Ky,useActionState:Ky,useOptimistic:function(r,i){var o=Ut();return Zy(o,ut,r,i)},useMemoCache:Ef,useCacheRefresh:fb};Bf.useEffectEvent=eb;var xb={readContext:ln,use:Eu,useCallback:ib,useContext:ln,useEffect:Df,useImperativeHandle:ab,useInsertionEffect:tb,useLayoutEffect:nb,useMemo:sb,useReducer:Of,useRef:Qy,useState:function(){return Of(Xr)},useDebugValue:$f,useDeferredValue:function(r,i){var o=Ut();return ut===null?Lf(o,r,i):ob(o,ut.memoizedState,r,i)},useTransition:function(){var r=Of(Xr)[0],i=Ut().memoizedState;return[typeof r=="boolean"?r:Po(r),i]},useSyncExternalStore:$y,useId:db,useHostTransitionStatus:Uf,useFormState:Jy,useActionState:Jy,useOptimistic:function(r,i){var o=Ut();return ut!==null?Zy(o,ut,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:fb};xb.useEffectEvent=eb;function Zf(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 If={enqueueSetState:function(r,i,o){r=r._reactInternals;var c=Xn(),p=ka(c);p.payload=i,o!=null&&(p.callback=o),i=wa(r,p,c),i!==null&&(Pn(i,r,c),Mo(i,r,c))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var c=Xn(),p=ka(c);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=wa(r,p,c),i!==null&&(Pn(i,r,c),Mo(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=Xn(),c=ka(o);c.tag=2,i!=null&&(c.callback=i),i=wa(r,c,o),i!==null&&(Pn(i,r,o),Mo(i,r,o))}};function yb(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?!jo(o,c)||!jo(p,x):!0}function bb(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&&If.enqueueReplaceState(i,i.state,null)}function wi(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 vb(r){fu(r)}function kb(r){console.error(r)}function wb(r){fu(r)}function Du(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function Sb(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 Hf(r,i,o){return o=ka(o),o.tag=3,o.payload={element:null},o.callback=function(){Du(r,i)},o}function zb(r){return r=ka(r),r.tag=3,r}function _b(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(){Sb(i,o,c)}}var k=o.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){Sb(i,o,c),typeof p!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function $N(r,i,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=o.alternate,i!==null&&rs(i,o,p,!0),o=qn.current,o!==null){switch(o.tag){case 31:case 13:return or===null?Gu():o.alternate===null&&Dt===0&&(Dt=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===wu?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([c]):i.add(c),ph(r,c,p)),!1;case 22:return o.flags|=65536,c===wu?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)),ph(r,c,p)),!1}throw Error(a(435,o.tag))}return ph(r,c,p),Gu(),!1}if(Xe)return i=qn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==uf&&(r=Error(a(422),{cause:c}),To(rr(r,o)))):(c!==uf&&(i=Error(a(423),{cause:c}),To(rr(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=rr(c,o),p=Hf(r.stateNode,c,p),vf(r,p),Dt!==4&&(Dt=2)),!1;var x=Error(a(520),{cause:c});if(x=rr(x,o),Yo===null?Yo=[x]:Yo.push(x),Dt!==4&&(Dt=2),i===null)return!0;c=rr(c,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=p&-p,o.lanes|=r,r=Hf(o.stateNode,c,r),vf(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"&&(Ca===null||!Ca.has(x))))return o.flags|=65536,p&=-p,o.lanes|=p,p=zb(p),_b(p,r,o,c),vf(o,p),!1}o=o.return}while(o!==null);return!1}var Ff=Error(a(461)),Ht=!1;function un(r,i,o,c){i.child=r===null?Ty(i,null,o,c):vi(i,r.child,o,c)}function jb(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 gi(i),c=jf(r,i,o,k,x,p),_=Nf(),r!==null&&!Ht?(Cf(r,i,p),Jr(r,i,p)):(Xe&&_&&of(i),i.flags|=1,un(r,i,c,p),i.child)}function Nb(r,i,o,c,p){if(r===null){var x=o.type;return typeof x=="function"&&!rf(x)&&x.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=x,Cb(r,i,x,c,p)):(r=gu(o.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(x=r.child,!Wf(r,p)){var k=x.memoizedProps;if(o=o.compare,o=o!==null?o:jo,o(k,c)&&r.ref===i.ref)return Jr(r,i,p)}return i.flags|=1,r=Fr(x,c),r.ref=i.ref,r.return=i,i.child=r}function Cb(r,i,o,c,p){if(r!==null){var x=r.memoizedProps;if(jo(x,c)&&r.ref===i.ref)if(Ht=!1,i.pendingProps=c=x,Wf(r,p))(r.flags&131072)!==0&&(Ht=!0);else return i.lanes=r.lanes,Jr(r,i,p)}return qf(r,i,o,c,p)}function Tb(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 Eb(r,i,x,o,c)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&vu(i,x!==null?x.cachePool:null),x!==null?Oy(i,x):wf(),Ry(i);else return c=i.lanes=536870912,Eb(r,i,x!==null?x.baseLanes|o:o,o,c)}else x!==null?(vu(i,x.cachePool),Oy(i,x),za(),i.memoizedState=null):(r!==null&&vu(i,null),wf(),za());return un(r,i,p,o),i.child}function Bo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Eb(r,i,o,c,p){var x=gf();return x=x===null?null:{parent:Zt._currentValue,pool:x},i.memoizedState={baseLanes:o,cachePool:x},r!==null&&vu(i,null),wf(),Ry(i),r!==null&&rs(r,i,c,!0),i.childLanes=p,null}function $u(r,i){return i=Pu({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Ab(r,i,o){return vi(i,r.child,null,o),r=$u(i,i.pendingProps),r.flags|=2,Gn(i),i.memoizedState=null,r}function LN(r,i,o){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Xe){if(c.mode==="hidden")return r=$u(i,c),i.lanes=536870912,Bo(null,r);if(zf(i),(r=vt)?(r=Iv(r,sr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ga!==null?{id:Er,overflow:Ar}:null,retryLane:536870912,hydrationErrors:null},o=my(r),o.return=i,i.child=o,on=i,vt=null)):r=null,r===null)throw ya(i);return i.lanes=536870912,null}return $u(i,c)}var x=r.memoizedState;if(x!==null){var k=x.dehydrated;if(zf(i),p)if(i.flags&256)i.flags&=-257,i=Ab(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ht||rs(r,i,o,!1),p=(o&r.childLanes)!==0,Ht||p){if(c=mt,c!==null&&(k=kx(c,o),k!==0&&k!==x.retryLane))throw x.retryLane=k,fi(r,k),Pn(c,r,k),Ff;Gu(),i=Ab(r,i,o)}else r=x.treeContext,vt=lr(k.nextSibling),on=i,Xe=!0,xa=null,sr=!1,r!==null&&xy(i,r),i=$u(i,c),i.flags|=4096;return i}return r=Fr(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Lu(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 qf(r,i,o,c,p){return gi(i),o=jf(r,i,o,c,void 0,p),c=Nf(),r!==null&&!Ht?(Cf(r,i,p),Jr(r,i,p)):(Xe&&c&&of(i),i.flags|=1,un(r,i,o,p),i.child)}function Ob(r,i,o,c,p,x){return gi(i),i.updateQueue=null,o=Dy(i,c,o,p),My(r),c=Nf(),r!==null&&!Ht?(Cf(r,i,x),Jr(r,i,x)):(Xe&&c&&of(i),i.flags|=1,un(r,i,o,x),i.child)}function Rb(r,i,o,c,p){if(gi(i),i.stateNode===null){var x=Wi,k=o.contextType;typeof k=="object"&&k!==null&&(x=ln(k)),x=new o(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=If,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},yf(i),k=o.contextType,x.context=typeof k=="object"&&k!==null?ln(k):Wi,x.state=i.memoizedState,k=o.getDerivedStateFromProps,typeof k=="function"&&(Zf(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&&If.enqueueReplaceState(x,x.state,null),$o(i,c,x,p),Do(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){x=i.stateNode;var _=i.memoizedProps,$=wi(o,_);x.props=$;var H=x.context,W=o.contextType;k=Wi,typeof W=="object"&&W!==null&&(k=ln(W));var ie=o.getDerivedStateFromProps;W=typeof ie=="function"||typeof x.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,W||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(_||H!==k)&&bb(i,x,c,k),va=!1;var q=i.memoizedState;x.state=q,$o(i,c,x,p),Do(),H=i.memoizedState,_||q!==H||va?(typeof ie=="function"&&(Zf(i,o,ie,c),H=i.memoizedState),($=va||yb(i,o,$,c,q,H,k))?(W||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=H),x.props=c,x.state=H,x.context=k,c=$):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,bf(r,i),k=i.memoizedProps,W=wi(o,k),x.props=W,ie=i.pendingProps,q=x.context,H=o.contextType,$=Wi,typeof H=="object"&&H!==null&&($=ln(H)),_=o.getDerivedStateFromProps,(H=typeof _=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==ie||q!==$)&&bb(i,x,c,$),va=!1,q=i.memoizedState,x.state=q,$o(i,c,x,p),Do();var X=i.memoizedState;k!==ie||q!==X||va||r!==null&&r.dependencies!==null&&yu(r.dependencies)?(typeof _=="function"&&(Zf(i,o,_,c),X=i.memoizedState),(W=va||yb(i,o,W,c,q,X,$)||r!==null&&r.dependencies!==null&&yu(r.dependencies))?(H||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,X,$),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,X,$)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=X),x.props=c,x.state=X,x.context=$,c=W):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&q===r.memoizedState||(i.flags|=1024),c=!1)}return x=c,Lu(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=vi(i,r.child,null,p),i.child=vi(i,null,o,p)):un(r,i,o,p),i.memoizedState=x.state,r=i.child):r=Jr(r,i,p),r}function Mb(r,i,o,c){return mi(),i.flags|=256,un(r,i,o,c),i.child}var Gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yf(r){return{baseLanes:r,cachePool:Sy()}}function Kf(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Kn),r}function Db(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:(Pt.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Xe){if(p?Sa(i):za(),(r=vt)?(r=Iv(r,sr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ga!==null?{id:Er,overflow:Ar}:null,retryLane:536870912,hydrationErrors:null},o=my(r),o.return=i,i.child=o,on=i,vt=null)):r=null,r===null)throw ya(i);return Ah(r)?i.lanes=32:i.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(za(),p=i.mode,_=Pu({mode:"hidden",children:_},p),c=hi(c,p,o,null),_.return=i,c.return=i,_.sibling=c,i.child=_,c=i.child,c.memoizedState=Yf(o),c.childLanes=Kf(r,k,o),i.memoizedState=Gf,Bo(null,c)):(Sa(i),Xf(i,_))}var $=r.memoizedState;if($!==null&&(_=$.dehydrated,_!==null)){if(x)i.flags&256?(Sa(i),i.flags&=-257,i=Jf(r,i,o)):i.memoizedState!==null?(za(),i.child=r.child,i.flags|=128,i=null):(za(),_=c.fallback,p=i.mode,c=Pu({mode:"visible",children:c.children},p),_=hi(_,p,o,null),_.flags|=2,c.return=i,_.return=i,c.sibling=_,i.child=c,vi(i,r.child,null,o),c=i.child,c.memoizedState=Yf(o),c.childLanes=Kf(r,k,o),i.memoizedState=Gf,i=Bo(null,c));else if(Sa(i),Ah(_)){if(k=_.nextSibling&&_.nextSibling.dataset,k)var H=k.dgst;k=H,c=Error(a(419)),c.stack="",c.digest=k,To({value:c,source:null,stack:null}),i=Jf(r,i,o)}else if(Ht||rs(r,i,o,!1),k=(o&r.childLanes)!==0,Ht||k){if(k=mt,k!==null&&(c=kx(k,o),c!==0&&c!==$.retryLane))throw $.retryLane=c,fi(r,c),Pn(k,r,c),Ff;Eh(_)||Gu(),i=Jf(r,i,o)}else Eh(_)?(i.flags|=192,i.child=r.child,i=null):(r=$.treeContext,vt=lr(_.nextSibling),on=i,Xe=!0,xa=null,sr=!1,r!==null&&xy(i,r),i=Xf(i,c.children),i.flags|=4096);return i}return p?(za(),_=c.fallback,p=i.mode,$=r.child,H=$.sibling,c=Fr($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,H!==null?_=Fr(H,_):(_=hi(_,p,o,null),_.flags|=2),_.return=i,c.return=i,c.sibling=_,i.child=c,Bo(null,c),c=i.child,_=r.child.memoizedState,_===null?_=Yf(o):(p=_.cachePool,p!==null?($=Zt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=Sy(),_={baseLanes:_.baseLanes|o,cachePool:p}),c.memoizedState=_,c.childLanes=Kf(r,k,o),i.memoizedState=Gf,Bo(r.child,c)):(Sa(i),o=r.child,r=o.sibling,o=Fr(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 Xf(r,i){return i=Pu({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Pu(r,i){return r=Fn(22,r,null,i),r.lanes=0,r}function Jf(r,i,o){return vi(i,r.child,null,o),r=Xf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function $b(r,i,o){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),ff(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 Lb(r,i,o){var c=i.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var k=Pt.current,_=(k&2)!==0;if(_?(k=k&1|2,i.flags|=128):k&=1,w(Pt,k),un(r,i,c,o),c=Xe?Co:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&$b(r,o,i);else if(r.tag===19)$b(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&&ju(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&&ju(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 Jr(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),Na|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(rs(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=Fr(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=Fr(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function Wf(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&yu(r)))}function PN(r,i,o){switch(i.tag){case 3:Ze(i,i.stateNode.containerInfo),ba(i,Zt,r.memoizedState.cache),mi();break;case 27:case 5:bt(i);break;case 4:Ze(i,i.stateNode.containerInfo);break;case 10:ba(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,zf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Sa(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Db(r,i,o):(Sa(i),r=Jr(r,i,o),r!==null?r.sibling:null);Sa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(o&i.childLanes)!==0,c||(rs(r,i,o,!1),c=(o&i.childLanes)!==0),p){if(c)return Lb(r,i,o);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w(Pt,Pt.current),c)break;return null;case 22:return i.lanes=0,Tb(r,i,o,i.pendingProps);case 24:ba(i,Zt,r.memoizedState.cache)}return Jr(r,i,o)}function Pb(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Ht=!0;else{if(!Wf(r,o)&&(i.flags&128)===0)return Ht=!1,PN(r,i,o);Ht=(r.flags&131072)!==0}else Ht=!1,Xe&&(i.flags&1048576)!==0&&gy(i,Co,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=yi(i.elementType),i.type=r,typeof r=="function")rf(r)?(c=wi(r,c),i.tag=1,i=Rb(null,i,r,c,o)):(i.tag=0,i=qf(null,i,r,c,o));else{if(r!=null){var p=r.$$typeof;if(p===L){i.tag=11,i=jb(null,i,r,c,o);break e}else if(p===Z){i.tag=14,i=Nb(null,i,r,c,o);break e}}throw i=te(r)||r,Error(a(306,i,""))}}return i;case 0:return qf(r,i,i.type,i.pendingProps,o);case 1:return c=i.type,p=wi(c,i.pendingProps),Rb(r,i,c,p,o);case 3:e:{if(Ze(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;p=x.element,bf(r,i),$o(i,c,null,o);var k=i.memoizedState;if(c=k.cache,ba(i,Zt,c),c!==x.cache&&hf(i,[Zt],o,!0),Do(),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=Mb(r,i,c,o);break e}else if(c!==p){p=rr(Error(a(424)),i),To(p),i=Mb(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,vt=lr(r.firstChild),on=i,Xe=!0,xa=null,sr=!0,o=Ty(i,null,c,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(mi(),c===p){i=Jr(r,i,o);break e}un(r,i,c,o)}i=i.child}return i;case 26:return Lu(r,i),r===null?(o=Kv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Xe||(o=i.type,r=i.pendingProps,c=ec(me.current).createElement(o),c[sn]=i,c[On]=r,cn(c,o,r),nn(c),i.stateNode=c):i.memoizedState=Kv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return bt(i),r===null&&Xe&&(c=i.stateNode=qv(i.type,i.pendingProps,me.current),on=i,sr=!0,p=vt,Oa(i.type)?(Oh=p,vt=lr(c.firstChild)):vt=p),un(r,i,i.pendingProps.children,o),Lu(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Xe&&((p=c=vt)&&(c=mC(c,i.type,i.pendingProps,sr),c!==null?(i.stateNode=c,on=i,vt=lr(c.firstChild),sr=!1,p=!0):p=!1),p||ya(i)),bt(i),p=i.type,x=i.pendingProps,k=r!==null?r.memoizedProps:null,c=x.children,Nh(p,x)?c=null:k!==null&&Nh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=jf(r,i,TN,null,null,o),nl._currentValue=p),Lu(r,i),un(r,i,c,o),i.child;case 6:return r===null&&Xe&&((r=o=vt)&&(o=pC(o,i.pendingProps,sr),o!==null?(i.stateNode=o,on=i,vt=null,r=!0):r=!1),r||ya(i)),null;case 13:return Db(r,i,o);case 4:return Ze(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=vi(i,null,c,o):un(r,i,c,o),i.child;case 11:return jb(r,i,i.type,i.pendingProps,o);case 7:return un(r,i,i.pendingProps,o),i.child;case 8:return un(r,i,i.pendingProps.children,o),i.child;case 12:return un(r,i,i.pendingProps.children,o),i.child;case 10:return c=i.pendingProps,ba(i,i.type,c.value),un(r,i,c.children,o),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,gi(i),p=ln(p),c=c(p),i.flags|=1,un(r,i,c,o),i.child;case 14:return Nb(r,i,i.type,i.pendingProps,o);case 15:return Cb(r,i,i.type,i.pendingProps,o);case 19:return Lb(r,i,o);case 31:return LN(r,i,o);case 22:return Tb(r,i,o,i.pendingProps);case 24:return gi(i),c=ln(Zt),r===null?(p=gf(),p===null&&(p=mt,x=mf(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),i.memoizedState={parent:c,cache:p},yf(i),ba(i,Zt,p)):((r.lanes&o)!==0&&(bf(r,i),$o(i,null,null,o),Do()),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),ba(i,Zt,c)):(c=x.cache,ba(i,Zt,c),c!==p.cache&&hf(i,[Zt],o,!0))),un(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Qr(r){r.flags|=4}function eh(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(dv())r.flags|=8192;else throw bi=wu,xf}else r.flags&=-16777217}function Ub(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!e0(i))if(dv())r.flags|=8192;else throw bi=wu,xf}function Uu(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?yx():536870912,r.lanes|=i,ps|=i)}function Zo(r,i){if(!Xe)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 kt(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 UN(r,i,o){var c=i.pendingProps;switch(lf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return o=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Yr(Zt),Te(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(ns(i)?Qr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,cf())),kt(i),null;case 26:var p=i.type,x=i.memoizedState;return r===null?(Qr(i),x!==null?(kt(i),Ub(i,x)):(kt(i),eh(i,p,null,c,o))):x?x!==r.memoizedState?(Qr(i),kt(i),Ub(i,x)):(kt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&Qr(i),kt(i),eh(i,p,r,c,o)),null;case 27:if(Ae(i),o=me.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Qr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return kt(i),null}r=G.current,ns(i)?yy(i):(r=qv(p,c,o),i.stateNode=r,Qr(i))}return kt(i),null;case 5:if(Ae(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Qr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return kt(i),null}if(x=G.current,ns(i))yy(i);else{var k=ec(me.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[sn]=i,x[On]=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(cn(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&&Qr(i)}}return kt(i),eh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&Qr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=me.current,ns(i)){if(r=i.stateNode,o=i.memoizedProps,c=null,p=on,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[sn]=i,r=!!(r.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Dv(r.nodeValue,o)),r||ya(i,!0)}else r=ec(r).createTextNode(c),r[sn]=i,i.stateNode=r}return kt(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(c=ns(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[sn]=i}else mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),r=!1}else o=cf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(Gn(i),i):(Gn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return kt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=ns(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[sn]=i}else mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),p=!1}else p=cf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Gn(i),i):(Gn(i),null)}return Gn(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),Uu(i,i.updateQueue),kt(i),null);case 4:return Te(),r===null&&wh(i.stateNode.containerInfo),kt(i),null;case 10:return Yr(i.type),kt(i),null;case 19:if(F(Pt),c=i.memoizedState,c===null)return kt(i),null;if(p=(i.flags&128)!==0,x=c.rendering,x===null)if(p)Zo(c,!1);else{if(Dt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(x=ju(r),x!==null){for(i.flags|=128,Zo(c,!1),r=x.updateQueue,i.updateQueue=r,Uu(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)hy(o,r),o=o.sibling;return w(Pt,Pt.current&1|2),Xe&&qr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&_e()>Hu&&(i.flags|=128,p=!0,Zo(c,!1),i.lanes=4194304)}else{if(!p)if(r=ju(x),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Uu(i,r),Zo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Xe)return kt(i),null}else 2*_e()-c.renderingStartTime>Hu&&o!==536870912&&(i.flags|=128,p=!0,Zo(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=_e(),r.sibling=null,o=Pt.current,w(Pt,p?o&1|2:o&1),Xe&&qr(i,c.treeForkCount),r):(kt(i),null);case 22:case 23:return Gn(i),Sf(),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&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),o=i.updateQueue,o!==null&&Uu(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&&F(xi),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Yr(Zt),kt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function VN(r,i){switch(lf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Yr(Zt),Te(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Ae(i),null;case 31:if(i.memoizedState!==null){if(Gn(i),i.alternate===null)throw Error(a(340));mi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Gn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));mi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return F(Pt),null;case 4:return Te(),null;case 10:return Yr(i.type),null;case 22:case 23:return Gn(i),Sf(),r!==null&&F(xi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Yr(Zt),null;case 25:return null;default:return null}}function Vb(r,i){switch(lf(i),i.tag){case 3:Yr(Zt),Te();break;case 26:case 27:case 5:Ae(i);break;case 4:Te();break;case 31:i.memoizedState!==null&&Gn(i);break;case 13:Gn(i);break;case 19:F(Pt);break;case 10:Yr(i.type);break;case 22:case 23:Gn(i),Sf(),r!==null&&F(xi);break;case 24:Yr(Zt)}}function Io(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(_){ot(i,i.return,_)}}function _a(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 $=o,H=_;try{H()}catch(W){ot(p,$,W)}}}c=c.next}while(c!==x)}}catch(W){ot(i,i.return,W)}}function Bb(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{Ay(i,o)}catch(c){ot(r,r.return,c)}}}function Zb(r,i,o){o.props=wi(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(c){ot(r,i,c)}}function Ho(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){ot(r,i,p)}}function Or(r,i){var o=r.ref,c=r.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){ot(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){ot(r,i,p)}else o.current=null}function Ib(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){ot(r,r.return,p)}}function th(r,i,o){try{var c=r.stateNode;lC(c,r.type,o,i),c[On]=i}catch(p){ot(r,r.return,p)}}function Hb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Oa(r.type)||r.tag===4}function nh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Hb(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&&Oa(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 rh(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=Ir));else if(c!==4&&(c===27&&Oa(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(rh(r,i,o),r=r.sibling;r!==null;)rh(r,i,o),r=r.sibling}function Vu(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&&Oa(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Vu(r,i,o),r=r.sibling;r!==null;)Vu(r,i,o),r=r.sibling}function Fb(r){var i=r.stateNode,o=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);cn(i,c,o),i[sn]=r,i[On]=o}catch(x){ot(r,r.return,x)}}var Wr=!1,Ft=!1,ah=!1,qb=typeof WeakSet=="function"?WeakSet:Set,rn=null;function BN(r,i){if(r=r.containerInfo,_h=oc,r=ay(r),Xd(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,$=-1,H=0,W=0,ie=r,q=null;t:for(;;){for(var X;ie!==o||p!==0&&ie.nodeType!==3||(_=k+p),ie!==x||c!==0&&ie.nodeType!==3||($=k+c),ie.nodeType===3&&(k+=ie.nodeValue.length),(X=ie.firstChild)!==null;)q=ie,ie=X;for(;;){if(ie===r)break t;if(q===o&&++H===p&&(_=k),q===x&&++W===c&&($=k),(X=ie.nextSibling)!==null)break;ie=q,q=ie.parentNode}ie=X}o=_===-1||$===-1?null:{start:_,end:$}}else o=null}o=o||{start:0,end:0}}else o=null;for(jh={focusedElem:r,selectionRange:o},oc=!1,rn=i;rn!==null;)if(i=rn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,rn=r;else for(;rn!==null;){switch(i=rn,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 ye=wi(o.type,p);r=c.getSnapshotBeforeUpdate(ye,x),c.__reactInternalSnapshotBeforeUpdate=r}catch(Ce){ot(o,o.return,Ce)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)Th(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Th(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,rn=r;break}rn=i.return}}function Gb(r,i,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:ta(r,o),c&4&&Io(5,o);break;case 1:if(ta(r,o),c&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(k){ot(o,o.return,k)}else{var p=wi(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){ot(o,o.return,k)}}c&64&&Bb(o),c&512&&Ho(o,o.return);break;case 3:if(ta(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{Ay(r,i)}catch(k){ot(o,o.return,k)}}break;case 27:i===null&&c&4&&Fb(o);case 26:case 5:ta(r,o),i===null&&c&4&&Ib(o),c&512&&Ho(o,o.return);break;case 12:ta(r,o);break;case 31:ta(r,o),c&4&&Xb(r,o);break;case 13:ta(r,o),c&4&&Jb(r,o),c&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=XN.bind(null,o),gC(r,o))));break;case 22:if(c=o.memoizedState!==null||Wr,!c){i=i!==null&&i.memoizedState!==null||Ft,p=Wr;var x=Ft;Wr=c,(Ft=i)&&!x?na(r,o,(o.subtreeFlags&8772)!==0):ta(r,o),Wr=p,Ft=x}break;case 30:break;default:ta(r,o)}}function Yb(r){var i=r.alternate;i!==null&&(r.alternate=null,Yb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Rd(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 St=null,Mn=!1;function ea(r,i,o){for(o=o.child;o!==null;)Kb(r,i,o),o=o.sibling}function Kb(r,i,o){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(wn,o)}catch{}switch(o.tag){case 26:Ft||Or(o,i),ea(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Ft||Or(o,i);var c=St,p=Mn;Oa(o.type)&&(St=o.stateNode,Mn=!1),ea(r,i,o),Wo(o.stateNode),St=c,Mn=p;break;case 5:Ft||Or(o,i);case 6:if(c=St,p=Mn,St=null,ea(r,i,o),St=c,Mn=p,St!==null)if(Mn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(o.stateNode)}catch(x){ot(o,i,x)}else try{St.removeChild(o.stateNode)}catch(x){ot(o,i,x)}break;case 18:St!==null&&(Mn?(r=St,Bv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),Ss(r)):Bv(St,o.stateNode));break;case 4:c=St,p=Mn,St=o.stateNode.containerInfo,Mn=!0,ea(r,i,o),St=c,Mn=p;break;case 0:case 11:case 14:case 15:_a(2,o,i),Ft||_a(4,o,i),ea(r,i,o);break;case 1:Ft||(Or(o,i),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Zb(o,i,c)),ea(r,i,o);break;case 21:ea(r,i,o);break;case 22:Ft=(c=Ft)||o.memoizedState!==null,ea(r,i,o),Ft=c;break;default:ea(r,i,o)}}function Xb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Ss(r)}catch(o){ot(i,i.return,o)}}}function Jb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Ss(r)}catch(o){ot(i,i.return,o)}}function ZN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new qb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new qb),i;default:throw Error(a(435,r.tag))}}function Bu(r,i){var o=ZN(r);i.forEach(function(c){if(!o.has(c)){o.add(c);var p=JN.bind(null,r,c);c.then(p,p)}})}function Dn(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(Oa(_.type)){St=_.stateNode,Mn=!1;break e}break;case 5:St=_.stateNode,Mn=!1;break e;case 3:case 4:St=_.stateNode.containerInfo,Mn=!0;break e}_=_.return}if(St===null)throw Error(a(160));Kb(x,k,p),St=null,Mn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Qb(i,r),i=i.sibling}var wr=null;function Qb(r,i){var o=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Dn(i,r),$n(r),c&4&&(_a(3,r,r.return),Io(3,r),_a(5,r,r.return));break;case 1:Dn(i,r),$n(r),c&512&&(Ft||o===null||Or(o,o.return)),c&64&&Wr&&(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=wr;if(Dn(i,r),$n(r),c&512&&(Ft||o===null||Or(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[xo]||x[sn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),cn(x,c,o),x[sn]=r,nn(x),c=x;break e;case"link":var k=Qv("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),cn(x,c,o),p.head.appendChild(x);break;case"meta":if(k=Qv("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),cn(x,c,o),p.head.appendChild(x);break;default:throw Error(a(468,c))}x[sn]=r,nn(x),c=x}r.stateNode=c}else Wv(p,r.type,r.stateNode);else r.stateNode=Jv(p,c,r.memoizedProps);else x!==c?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,c===null?Wv(p,r.type,r.stateNode):Jv(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&th(r,r.memoizedProps,o.memoizedProps)}break;case 27:Dn(i,r),$n(r),c&512&&(Ft||o===null||Or(o,o.return)),o!==null&&c&4&&th(r,r.memoizedProps,o.memoizedProps);break;case 5:if(Dn(i,r),$n(r),c&512&&(Ft||o===null||Or(o,o.return)),r.flags&32){p=r.stateNode;try{qi(p,"")}catch(ye){ot(r,r.return,ye)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,th(r,p,o!==null?o.memoizedProps:p)),c&1024&&(ah=!0);break;case 6:if(Dn(i,r),$n(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,o=r.stateNode;try{o.nodeValue=c}catch(ye){ot(r,r.return,ye)}}break;case 3:if(rc=null,p=wr,wr=tc(i.containerInfo),Dn(i,r),wr=p,$n(r),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Ss(i.containerInfo)}catch(ye){ot(r,r.return,ye)}ah&&(ah=!1,Wb(r));break;case 4:c=wr,wr=tc(r.stateNode.containerInfo),Dn(i,r),$n(r),wr=c;break;case 12:Dn(i,r),$n(r);break;case 31:Dn(i,r),$n(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Bu(r,c)));break;case 13:Dn(i,r),$n(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Iu=_e()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Bu(r,c)));break;case 22:p=r.memoizedState!==null;var $=o!==null&&o.memoizedState!==null,H=Wr,W=Ft;if(Wr=H||p,Ft=W||$,Dn(i,r),Ft=W,Wr=H,$n(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||$||Wr||Ft||Si(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){$=o=i;try{if(x=$.stateNode,p)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{_=$.stateNode;var ie=$.memoizedProps.style,q=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;_.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(ye){ot($,$.return,ye)}}}else if(i.tag===6){if(o===null){$=i;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(ye){ot($,$.return,ye)}}}else if(i.tag===18){if(o===null){$=i;try{var X=$.stateNode;p?Zv(X,!0):Zv($.stateNode,!1)}catch(ye){ot($,$.return,ye)}}}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,Bu(r,o))));break;case 19:Dn(i,r),$n(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Bu(r,c)));break;case 30:break;case 21:break;default:Dn(i,r),$n(r)}}function $n(r){var i=r.flags;if(i&2){try{for(var o,c=r.return;c!==null;){if(Hb(c)){o=c;break}c=c.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,x=nh(r);Vu(r,x,p);break;case 5:var k=o.stateNode;o.flags&32&&(qi(k,""),o.flags&=-33);var _=nh(r);Vu(r,_,k);break;case 3:case 4:var $=o.stateNode.containerInfo,H=nh(r);rh(r,H,$);break;default:throw Error(a(161))}}catch(W){ot(r,r.return,W)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Wb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Wb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ta(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Gb(r,i.alternate,i),i=i.sibling}function Si(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:_a(4,i,i.return),Si(i);break;case 1:Or(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&Zb(i,i.return,o),Si(i);break;case 27:Wo(i.stateNode);case 26:case 5:Or(i,i.return),Si(i);break;case 22:i.memoizedState===null&&Si(i);break;case 30:Si(i);break;default:Si(i)}r=r.sibling}}function na(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:na(p,x,o),Io(4,x);break;case 1:if(na(p,x,o),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(H){ot(c,c.return,H)}if(c=x,p=c.updateQueue,p!==null){var _=c.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)Ey($[p],_)}catch(H){ot(c,c.return,H)}}o&&k&64&&Bb(x),Ho(x,x.return);break;case 27:Fb(x);case 26:case 5:na(p,x,o),o&&c===null&&k&4&&Ib(x),Ho(x,x.return);break;case 12:na(p,x,o);break;case 31:na(p,x,o),o&&k&4&&Xb(p,x);break;case 13:na(p,x,o),o&&k&4&&Jb(p,x);break;case 22:x.memoizedState===null&&na(p,x,o),Ho(x,x.return);break;case 30:break;default:na(p,x,o)}i=i.sibling}}function ih(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&&Eo(o))}function sh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r))}function Sr(r,i,o,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ev(r,i,o,c),i=i.sibling}function ev(r,i,o,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Sr(r,i,o,c),p&2048&&Io(9,i);break;case 1:Sr(r,i,o,c);break;case 3:Sr(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&&Eo(r)));break;case 12:if(p&2048){Sr(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($){ot(i,i.return,$)}}else Sr(r,i,o,c);break;case 31:Sr(r,i,o,c);break;case 13:Sr(r,i,o,c);break;case 23:break;case 22:x=i.stateNode,k=i.alternate,i.memoizedState!==null?x._visibility&2?Sr(r,i,o,c):Fo(r,i):x._visibility&2?Sr(r,i,o,c):(x._visibility|=2,fs(r,i,o,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&ih(k,i);break;case 24:Sr(r,i,o,c),p&2048&&sh(i.alternate,i);break;default:Sr(r,i,o,c)}}function fs(r,i,o,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=r,k=i,_=o,$=c,H=k.flags;switch(k.tag){case 0:case 11:case 15:fs(x,k,_,$,p),Io(8,k);break;case 23:break;case 22:var W=k.stateNode;k.memoizedState!==null?W._visibility&2?fs(x,k,_,$,p):Fo(x,k):(W._visibility|=2,fs(x,k,_,$,p)),p&&H&2048&&ih(k.alternate,k);break;case 24:fs(x,k,_,$,p),p&&H&2048&&sh(k.alternate,k);break;default:fs(x,k,_,$,p)}i=i.sibling}}function Fo(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:Fo(o,c),p&2048&&ih(c.alternate,c);break;case 24:Fo(o,c),p&2048&&sh(c.alternate,c);break;default:Fo(o,c)}i=i.sibling}}var qo=8192;function hs(r,i,o){if(r.subtreeFlags&qo)for(r=r.child;r!==null;)tv(r,i,o),r=r.sibling}function tv(r,i,o){switch(r.tag){case 26:hs(r,i,o),r.flags&qo&&r.memoizedState!==null&&CC(o,wr,r.memoizedState,r.memoizedProps);break;case 5:hs(r,i,o);break;case 3:case 4:var c=wr;wr=tc(r.stateNode.containerInfo),hs(r,i,o),wr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=qo,qo=16777216,hs(r,i,o),qo=c):hs(r,i,o));break;default:hs(r,i,o)}}function nv(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 Go(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];rn=c,av(c,r)}nv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)rv(r),r=r.sibling}function rv(r){switch(r.tag){case 0:case 11:case 15:Go(r),r.flags&2048&&_a(9,r,r.return);break;case 3:Go(r);break;case 12:Go(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Zu(r)):Go(r);break;default:Go(r)}}function Zu(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];rn=c,av(c,r)}nv(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:_a(8,i,i.return),Zu(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,Zu(i));break;default:Zu(i)}r=r.sibling}}function av(r,i){for(;rn!==null;){var o=rn;switch(o.tag){case 0:case 11:case 15:_a(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:Eo(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,rn=c;else e:for(o=r;rn!==null;){c=rn;var p=c.sibling,x=c.return;if(Yb(c),c===o){rn=null;break e}if(p!==null){p.return=x,rn=p;break e}rn=x}}}var IN={getCacheForType:function(r){var i=ln(Zt),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return ln(Zt).controller.signal}},HN=typeof WeakMap=="function"?WeakMap:Map,tt=0,mt=null,Ie=null,Ge=0,st=0,Yn=null,ja=!1,ms=!1,oh=!1,ra=0,Dt=0,Na=0,zi=0,lh=0,Kn=0,ps=0,Yo=null,Ln=null,uh=!1,Iu=0,iv=0,Hu=1/0,Fu=null,Ca=null,Qt=0,Ta=null,gs=null,aa=0,ch=0,dh=null,sv=null,Ko=0,fh=null;function Xn(){return(tt&2)!==0&&Ge!==0?Ge&-Ge:V.T!==null?yh():wx()}function ov(){if(Kn===0)if((Ge&536870912)===0||Xe){var r=Wl;Wl<<=1,(Wl&3932160)===0&&(Wl=262144),Kn=r}else Kn=536870912;return r=qn.current,r!==null&&(r.flags|=32),Kn}function Pn(r,i,o){(r===mt&&(st===2||st===9)||r.cancelPendingCommit!==null)&&(xs(r,0),Ea(r,Ge,Kn,!1)),go(r,o),((tt&2)===0||r!==mt)&&(r===mt&&((tt&2)===0&&(zi|=o),Dt===4&&Ea(r,Ge,Kn,!1)),Rr(r))}function lv(r,i,o){if((tt&6)!==0)throw Error(a(327));var c=!o&&(i&127)===0&&(i&r.expiredLanes)===0||po(r,i),p=c?GN(r,i):mh(r,i,!0),x=c;do{if(p===0){ms&&!c&&Ea(r,i,0,!1);break}else{if(o=r.current.alternate,x&&!FN(o)){p=mh(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=Yo;var $=_.current.memoizedState.isDehydrated;if($&&(xs(_,k).flags|=256),k=mh(_,k,!1),k!==2){if(oh&&!$){_.errorRecoveryDisabledLanes|=x,zi|=x,p=4;break e}x=Ln,Ln=p,x!==null&&(Ln===null?Ln=x:Ln.push.apply(Ln,x))}p=k}if(x=!1,p!==2)continue}}if(p===1){xs(r,0),Ea(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:Ea(c,i,Kn,!ja);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Iu+300-_e(),10<p)){if(Ea(c,i,Kn,!ja),tu(c,0,!0)!==0)break e;aa=i,c.timeoutHandle=Uv(uv.bind(null,c,o,Ln,Fu,uh,i,Kn,zi,ps,ja,x,"Throttled",-0,0),p);break e}uv(c,o,Ln,Fu,uh,i,Kn,zi,ps,ja,x,null,-0,0)}}break}while(!0);Rr(r)}function uv(r,i,o,c,p,x,k,_,$,H,W,ie,q,X){if(r.timeoutHandle=-1,ie=i.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ir},tv(i,x,ie);var ye=(x&62914560)===x?Iu-_e():(x&4194048)===x?iv-_e():0;if(ye=TC(ie,ye),ye!==null){aa=x,r.cancelPendingCommit=ye(xv.bind(null,r,i,x,o,c,p,k,_,$,W,ie,null,q,X)),Ea(r,x,k,!H);return}}xv(r,i,x,o,c,p,k,_,$)}function FN(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(!Hn(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 Ea(r,i,o,c){i&=~lh,i&=~zi,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var x=31-ht(p),k=1<<x;c[x]=-1,p&=~k}o!==0&&bx(r,o,i)}function qu(){return(tt&6)===0?(Xo(0),!1):!0}function hh(){if(Ie!==null){if(st===0)var r=Ie.return;else r=Ie,Gr=pi=null,Tf(r),os=null,Oo=0,r=Ie;for(;r!==null;)Vb(r.alternate,r),r=r.return;Ie=null}}function xs(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,dC(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),aa=0,hh(),mt=r,Ie=o=Fr(r.current,null),Ge=i,st=0,Yn=null,ja=!1,ms=po(r,i),oh=!1,ps=Kn=lh=zi=Na=Dt=0,Ln=Yo=null,uh=!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-ht(c),x=1<<p;i|=r[p],c&=~x}return ra=i,hu(),o}function cv(r,i){Le=null,V.H=Vo,i===ss||i===ku?(i=jy(),st=3):i===xf?(i=jy(),st=4):st=i===Ff?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Yn=i,Ie===null&&(Dt=1,Du(r,rr(i,r.current)))}function dv(){var r=qn.current;return r===null?!0:(Ge&4194048)===Ge?or===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?r===or:!1}function fv(){var r=V.H;return V.H=Vo,r===null?Vo:r}function hv(){var r=V.A;return V.A=IN,r}function Gu(){Dt=4,ja||(Ge&4194048)!==Ge&&qn.current!==null||(ms=!0),(Na&134217727)===0&&(zi&134217727)===0||mt===null||Ea(mt,Ge,Kn,!1)}function mh(r,i,o){var c=tt;tt|=2;var p=fv(),x=hv();(mt!==r||Ge!==i)&&(Fu=null,xs(r,i)),i=!1;var k=Dt;e:do try{if(st!==0&&Ie!==null){var _=Ie,$=Yn;switch(st){case 8:hh(),k=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(i=!0);var H=st;if(st=0,Yn=null,ys(r,_,$,H),o&&ms){k=0;break e}break;default:H=st,st=0,Yn=null,ys(r,_,$,H)}}qN(),k=Dt;break}catch(W){cv(r,W)}while(!0);return i&&r.shellSuspendCounter++,Gr=pi=null,tt=c,V.H=p,V.A=x,Ie===null&&(mt=null,Ge=0,hu()),k}function qN(){for(;Ie!==null;)mv(Ie)}function GN(r,i){var o=tt;tt|=2;var c=fv(),p=hv();mt!==r||Ge!==i?(Fu=null,Hu=_e()+500,xs(r,i)):ms=po(r,i);e:do try{if(st!==0&&Ie!==null){i=Ie;var x=Yn;t:switch(st){case 1:st=0,Yn=null,ys(r,i,x,1);break;case 2:case 9:if(zy(x)){st=0,Yn=null,pv(i);break}i=function(){st!==2&&st!==9||mt!==r||(st=7),Rr(r)},x.then(i,i);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:zy(x)?(st=0,Yn=null,pv(i)):(st=0,Yn=null,ys(r,i,x,7));break;case 5:var k=null;switch(Ie.tag){case 26:k=Ie.memoizedState;case 5:case 27:var _=Ie;if(k?e0(k):_.stateNode.complete){st=0,Yn=null;var $=_.sibling;if($!==null)Ie=$;else{var H=_.return;H!==null?(Ie=H,Yu(H)):Ie=null}break t}}st=0,Yn=null,ys(r,i,x,5);break;case 6:st=0,Yn=null,ys(r,i,x,6);break;case 8:hh(),Dt=6;break e;default:throw Error(a(462))}}YN();break}catch(W){cv(r,W)}while(!0);return Gr=pi=null,V.H=c,V.A=p,tt=o,Ie!==null?0:(mt=null,Ge=0,hu(),Dt)}function YN(){for(;Ie!==null&&!Nt();)mv(Ie)}function mv(r){var i=Pb(r.alternate,r,ra);r.memoizedProps=r.pendingProps,i===null?Yu(r):Ie=i}function pv(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=Ob(o,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=Ob(o,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:Tf(i);default:Vb(o,i),i=Ie=hy(i,ra),i=Pb(o,i,ra)}r.memoizedProps=r.pendingProps,i===null?Yu(r):Ie=i}function ys(r,i,o,c){Gr=pi=null,Tf(i),os=null,Oo=0;var p=i.return;try{if($N(r,p,i,o,Ge)){Dt=1,Du(r,rr(o,r.current)),Ie=null;return}}catch(x){if(p!==null)throw Ie=p,x;Dt=1,Du(r,rr(o,r.current)),Ie=null;return}i.flags&32768?(Xe||c===1?r=!0:ms||(Ge&536870912)!==0?r=!1:(ja=r=!0,(c===2||c===9||c===3||c===6)&&(c=qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),gv(i,r)):Yu(i)}function Yu(r){var i=r;do{if((i.flags&32768)!==0){gv(i,ja);return}r=i.return;var o=UN(i.alternate,i,ra);if(o!==null){Ie=o;return}if(i=i.sibling,i!==null){Ie=i;return}Ie=i=r}while(i!==null);Dt===0&&(Dt=5)}function gv(r,i){do{var o=VN(r.alternate,r);if(o!==null){o.flags&=32767,Ie=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Ie=r;return}Ie=r=o}while(r!==null);Dt=6,Ie=null}function xv(r,i,o,c,p,x,k,_,$){r.cancelPendingCommit=null;do Ku();while(Qt!==0);if((tt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=tf,N2(r,o,x,k,_,$),r===mt&&(Ie=mt=null,Ge=0),gs=i,Ta=r,aa=o,ch=x,dh=p,sv=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,QN(ge,function(){return wv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=V.T,V.T=null,p=Q.p,Q.p=2,k=tt,tt|=4;try{BN(r,i,o)}finally{tt=k,Q.p=p,V.T=c}}Qt=1,yv(),bv(),vv()}}function yv(){if(Qt===1){Qt=0;var r=Ta,i=gs,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=V.T,V.T=null;var c=Q.p;Q.p=2;var p=tt;tt|=4;try{Qb(i,r);var x=jh,k=ay(r.containerInfo),_=x.focusedElem,$=x.selectionRange;if(k!==_&&_&&_.ownerDocument&&ry(_.ownerDocument.documentElement,_)){if($!==null&&Xd(_)){var H=$.start,W=$.end;if(W===void 0&&(W=H),"selectionStart"in _)_.selectionStart=H,_.selectionEnd=Math.min(W,_.value.length);else{var ie=_.ownerDocument||document,q=ie&&ie.defaultView||window;if(q.getSelection){var X=q.getSelection(),ye=_.textContent.length,Ce=Math.min($.start,ye),dt=$.end===void 0?Ce:Math.min($.end,ye);!X.extend&&Ce>dt&&(k=dt,dt=Ce,Ce=k);var B=ny(_,Ce),P=ny(_,dt);if(B&&P&&(X.rangeCount!==1||X.anchorNode!==B.node||X.anchorOffset!==B.offset||X.focusNode!==P.node||X.focusOffset!==P.offset)){var I=ie.createRange();I.setStart(B.node,B.offset),X.removeAllRanges(),Ce>dt?(X.addRange(I),X.extend(P.node,P.offset)):(I.setEnd(P.node,P.offset),X.addRange(I))}}}}for(ie=[],X=_;X=X.parentNode;)X.nodeType===1&&ie.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ie.length;_++){var ne=ie[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}oc=!!_h,jh=_h=null}finally{tt=p,Q.p=c,V.T=o}}r.current=i,Qt=2}}function bv(){if(Qt===2){Qt=0;var r=Ta,i=gs,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=V.T,V.T=null;var c=Q.p;Q.p=2;var p=tt;tt|=4;try{Gb(r,i.alternate,i)}finally{tt=p,Q.p=c,V.T=o}}Qt=3}}function vv(){if(Qt===4||Qt===3){Qt=0,M();var r=Ta,i=gs,o=aa,c=sv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Qt=5:(Qt=0,gs=Ta=null,kv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ca=null),Ad(o),i=i.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(wn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=V.T,p=Q.p,Q.p=2,V.T=null;try{for(var x=r.onRecoverableError,k=0;k<c.length;k++){var _=c[k];x(_.value,{componentStack:_.stack})}}finally{V.T=i,Q.p=p}}(aa&3)!==0&&Ku(),Rr(r),p=r.pendingLanes,(o&261930)!==0&&(p&42)!==0?r===fh?Ko++:(Ko=0,fh=r):Ko=0,Xo(0)}}function kv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Eo(i)))}function Ku(){return yv(),bv(),vv(),wv()}function wv(){if(Qt!==5)return!1;var r=Ta,i=ch;ch=0;var o=Ad(aa),c=V.T,p=Q.p;try{Q.p=32>o?32:o,V.T=null,o=dh,dh=null;var x=Ta,k=aa;if(Qt=0,gs=Ta=null,aa=0,(tt&6)!==0)throw Error(a(331));var _=tt;if(tt|=4,rv(x.current),ev(x,x.current,k,o),tt=_,Xo(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(wn,x)}catch{}return!0}finally{Q.p=p,V.T=c,kv(r,i)}}function Sv(r,i,o){i=rr(o,i),i=Hf(r.stateNode,i,2),r=wa(r,i,2),r!==null&&(go(r,2),Rr(r))}function ot(r,i,o){if(r.tag===3)Sv(r,r,o);else for(;i!==null;){if(i.tag===3){Sv(i,r,o);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ca===null||!Ca.has(c))){r=rr(o,r),o=zb(2),c=wa(i,o,2),c!==null&&(_b(o,c,i,r),go(c,2),Rr(c));break}}i=i.return}}function ph(r,i,o){var c=r.pingCache;if(c===null){c=r.pingCache=new HN;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)||(oh=!0,p.add(o),r=KN.bind(null,r,i,o),i.then(r,r))}function KN(r,i,o){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,mt===r&&(Ge&o)===o&&(Dt===4||Dt===3&&(Ge&62914560)===Ge&&300>_e()-Iu?(tt&2)===0&&xs(r,0):lh|=o,ps===Ge&&(ps=0)),Rr(r)}function zv(r,i){i===0&&(i=yx()),r=fi(r,i),r!==null&&(go(r,i),Rr(r))}function XN(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),zv(r,o)}function JN(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),zv(r,o)}function QN(r,i){return Bt(r,i)}var Xu=null,bs=null,gh=!1,Ju=!1,xh=!1,Aa=0;function Rr(r){r!==bs&&r.next===null&&(bs===null?Xu=bs=r:bs=bs.next=r),Ju=!0,gh||(gh=!0,eC())}function Xo(r,i){if(!xh&&Ju){xh=!0;do for(var o=!1,c=Xu;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-ht(42|r)+1)-1,x&=p&~(k&~_),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,Cv(c,x))}else x=Ge,x=tu(c,c===mt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||po(c,x)||(o=!0,Cv(c,x));c=c.next}while(o);xh=!1}}function WN(){_v()}function _v(){Ju=gh=!1;var r=0;Aa!==0&&cC()&&(r=Aa);for(var i=_e(),o=null,c=Xu;c!==null;){var p=c.next,x=jv(c,i);x===0?(c.next=null,o===null?Xu=p:o.next=p,p===null&&(bs=o)):(o=c,(r!==0||(x&3)!==0)&&(Ju=!0)),c=p}Qt!==0&&Qt!==5||Xo(r),Aa!==0&&(Aa=0)}function jv(r,i){for(var o=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var k=31-ht(x),_=1<<k,$=p[k];$===-1?((_&o)===0||(_&c)!==0)&&(p[k]=j2(_,i)):$<=i&&(r.expiredLanes|=_),x&=~_}if(i=mt,o=Ge,o=tu(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,o===0||r===i&&(st===2||st===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&En(c),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||po(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(c!==null&&En(c),Ad(o)){case 2:case 8:o=ce;break;case 32:o=ge;break;case 268435456:o=qe;break;default:o=ge}return c=Nv.bind(null,r),o=Bt(o,c),r.callbackPriority=i,r.callbackNode=o,i}return c!==null&&c!==null&&En(c),r.callbackPriority=2,r.callbackNode=null,2}function Nv(r,i){if(Qt!==0&&Qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(Ku()&&r.callbackNode!==o)return null;var c=Ge;return c=tu(r,r===mt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(lv(r,c,i),jv(r,_e()),r.callbackNode!=null&&r.callbackNode===o?Nv.bind(null,r):null)}function Cv(r,i){if(Ku())return null;lv(r,i,!0)}function eC(){fC(function(){(tt&6)!==0?Bt(K,WN):_v()})}function yh(){if(Aa===0){var r=as;r===0&&(r=Ql,Ql<<=1,(Ql&261888)===0&&(Ql=256)),Aa=r}return Aa}function Tv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:iu(""+r)}function Ev(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 tC(r,i,o,c,p){if(i==="submit"&&o&&o.stateNode===p){var x=Tv((p[On]||null).action),k=c.submitter;k&&(i=(i=k[On]||null)?Tv(i.formAction):k.getAttribute("formAction"),i!==null&&(x=i,k=null));var _=new uu("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Aa!==0){var $=k?Ev(p,k):new FormData(p);Pf(o,{pending:!0,data:$,method:p.method,action:x},null,$)}}else typeof x=="function"&&(_.preventDefault(),$=k?Ev(p,k):new FormData(p),Pf(o,{pending:!0,data:$,method:p.method,action:x},x,$))},currentTarget:p}]})}}for(var bh=0;bh<ef.length;bh++){var vh=ef[bh],nC=vh.toLowerCase(),rC=vh[0].toUpperCase()+vh.slice(1);kr(nC,"on"+rC)}kr(oy,"onAnimationEnd"),kr(ly,"onAnimationIteration"),kr(uy,"onAnimationStart"),kr("dblclick","onDoubleClick"),kr("focusin","onFocus"),kr("focusout","onBlur"),kr(bN,"onTransitionRun"),kr(vN,"onTransitionStart"),kr(kN,"onTransitionCancel"),kr(cy,"onTransitionEnd"),Hi("onMouseEnter",["mouseout","mouseover"]),Hi("onMouseLeave",["mouseout","mouseover"]),Hi("onPointerEnter",["pointerout","pointerover"]),Hi("onPointerLeave",["pointerout","pointerover"]),li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),li("onBeforeInput",["compositionend","keypress","textInput","paste"]),li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="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(" "),aC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jo));function Av(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],$=_.instance,H=_.currentTarget;if(_=_.listener,$!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=H;try{x(p)}catch(W){fu(W)}p.currentTarget=null,x=$}else for(k=0;k<c.length;k++){if(_=c[k],$=_.instance,H=_.currentTarget,_=_.listener,$!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=H;try{x(p)}catch(W){fu(W)}p.currentTarget=null,x=$}}}}function He(r,i){var o=i[Od];o===void 0&&(o=i[Od]=new Set);var c=r+"__bubble";o.has(c)||(Ov(i,r,2,!1),o.add(c))}function kh(r,i,o){var c=0;i&&(c|=4),Ov(o,r,c,i)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function wh(r){if(!r[Qu]){r[Qu]=!0,_x.forEach(function(o){o!=="selectionchange"&&(aC.has(o)||kh(o,!1,r),kh(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Qu]||(i[Qu]=!0,kh("selectionchange",!1,i))}}function Ov(r,i,o,c){switch(o0(i)){case 2:var p=OC;break;case 8:p=RC;break;default:p=Lh}o=p.bind(null,i,o,r),p=void 0,!Bd||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 Sh(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 $=k.tag;if(($===3||$===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;_!==null;){if(k=Bi(_),k===null)return;if($=k.tag,$===5||$===6||$===26||$===27){c=x=k;continue e}_=_.parentNode}}c=c.return}Lx(function(){var H=x,W=Ud(o),ie=[];e:{var q=dy.get(r);if(q!==void 0){var X=uu,ye=r;switch(r){case"keypress":if(ou(o)===0)break e;case"keydown":case"keyup":X=J2;break;case"focusin":ye="focus",X=Fd;break;case"focusout":ye="blur",X=Fd;break;case"beforeblur":case"afterblur":X=Fd;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":X=Vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=U2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=eN;break;case oy:case ly:case uy:X=Z2;break;case cy:X=nN;break;case"scroll":case"scrollend":X=L2;break;case"wheel":X=aN;break;case"copy":case"cut":case"paste":X=H2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Zx;break;case"toggle":case"beforetoggle":X=sN}var Ce=(i&4)!==0,dt=!Ce&&(r==="scroll"||r==="scrollend"),B=Ce?q!==null?q+"Capture":null:q;Ce=[];for(var P=H,I;P!==null;){var ne=P;if(I=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||I===null||B===null||(ne=bo(P,B),ne!=null&&Ce.push(Qo(P,ne,I))),dt)break;P=P.return}0<Ce.length&&(q=new X(q,ye,null,o,W),ie.push({event:q,listeners:Ce}))}}if((i&7)===0){e:{if(q=r==="mouseover"||r==="pointerover",X=r==="mouseout"||r==="pointerout",q&&o!==Pd&&(ye=o.relatedTarget||o.fromElement)&&(Bi(ye)||ye[Vi]))break e;if((X||q)&&(q=W.window===W?W:(q=W.ownerDocument)?q.defaultView||q.parentWindow:window,X?(ye=o.relatedTarget||o.toElement,X=H,ye=ye?Bi(ye):null,ye!==null&&(dt=u(ye),Ce=ye.tag,ye!==dt||Ce!==5&&Ce!==27&&Ce!==6)&&(ye=null)):(X=null,ye=H),X!==ye)){if(Ce=Vx,ne="onMouseLeave",B="onMouseEnter",P="mouse",(r==="pointerout"||r==="pointerover")&&(Ce=Zx,ne="onPointerLeave",B="onPointerEnter",P="pointer"),dt=X==null?q:yo(X),I=ye==null?q:yo(ye),q=new Ce(ne,P+"leave",X,o,W),q.target=dt,q.relatedTarget=I,ne=null,Bi(W)===H&&(Ce=new Ce(B,P+"enter",ye,o,W),Ce.target=I,Ce.relatedTarget=dt,ne=Ce),dt=ne,X&&ye)t:{for(Ce=iC,B=X,P=ye,I=0,ne=B;ne;ne=Ce(ne))I++;ne=0;for(var Ne=P;Ne;Ne=Ce(Ne))ne++;for(;0<I-ne;)B=Ce(B),I--;for(;0<ne-I;)P=Ce(P),ne--;for(;I--;){if(B===P||P!==null&&B===P.alternate){Ce=B;break t}B=Ce(B),P=Ce(P)}Ce=null}else Ce=null;X!==null&&Rv(ie,q,X,Ce,!1),ye!==null&&dt!==null&&Rv(ie,dt,ye,Ce,!0)}}e:{if(q=H?yo(H):window,X=q.nodeName&&q.nodeName.toLowerCase(),X==="select"||X==="input"&&q.type==="file")var We=Xx;else if(Yx(q))if(Jx)We=gN;else{We=mN;var ze=hN}else X=q.nodeName,!X||X.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?H&&Ld(H.elementType)&&(We=Xx):We=pN;if(We&&(We=We(r,H))){Kx(ie,We,o,W);break e}ze&&ze(r,q,H),r==="focusout"&&H&&q.type==="number"&&H.memoizedProps.value!=null&&$d(q,"number",q.value)}switch(ze=H?yo(H):window,r){case"focusin":(Yx(ze)||ze.contentEditable==="true")&&(Xi=ze,Jd=H,No=null);break;case"focusout":No=Jd=Xi=null;break;case"mousedown":Qd=!0;break;case"contextmenu":case"mouseup":case"dragend":Qd=!1,iy(ie,o,W);break;case"selectionchange":if(yN)break;case"keydown":case"keyup":iy(ie,o,W)}var Pe;if(Gd)e:{switch(r){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Ki?qx(r,o)&&(Ye="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Ye="onCompositionStart");Ye&&(Ix&&o.locale!=="ko"&&(Ki||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Ki&&(Pe=Px()):(pa=W,Zd="value"in pa?pa.value:pa.textContent,Ki=!0)),ze=Wu(H,Ye),0<ze.length&&(Ye=new Bx(Ye,r,null,o,W),ie.push({event:Ye,listeners:ze}),Pe?Ye.data=Pe:(Pe=Gx(o),Pe!==null&&(Ye.data=Pe)))),(Pe=lN?uN(r,o):cN(r,o))&&(Ye=Wu(H,"onBeforeInput"),0<Ye.length&&(ze=new Bx("onBeforeInput","beforeinput",null,o,W),ie.push({event:ze,listeners:Ye}),ze.data=Pe)),tC(ie,r,H,o,W)}Av(ie,i)})}function Qo(r,i,o){return{instance:r,listener:i,currentTarget:o}}function Wu(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=bo(r,o),p!=null&&c.unshift(Qo(r,p,x)),p=bo(r,i),p!=null&&c.push(Qo(r,p,x))),r.tag===3)return c;r=r.return}return[]}function iC(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Rv(r,i,o,c,p){for(var x=i._reactName,k=[];o!==null&&o!==c;){var _=o,$=_.alternate,H=_.stateNode;if(_=_.tag,$!==null&&$===c)break;_!==5&&_!==26&&_!==27||H===null||($=H,p?(H=bo(o,x),H!=null&&k.unshift(Qo(o,H,$))):p||(H=bo(o,x),H!=null&&k.push(Qo(o,H,$)))),o=o.return}k.length!==0&&r.push({event:i,listeners:k})}var sC=/\r\n?/g,oC=/\u0000|\uFFFD/g;function Mv(r){return(typeof r=="string"?r:""+r).replace(sC,`
|
|
9
|
+
`).replace(oC,"")}function Dv(r,i){return i=Mv(i),Mv(r)===i}function ct(r,i,o,c,p,x){switch(o){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||qi(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&qi(r,""+c);break;case"className":ru(r,"class",c);break;case"tabIndex":ru(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ru(r,o,c);break;case"style":Dx(r,c,x);break;case"data":if(i!=="object"){ru(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=iu(""+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"&&ct(r,i,"name",p.name,p,null),ct(r,i,"formEncType",p.formEncType,p,null),ct(r,i,"formMethod",p.formMethod,p,null),ct(r,i,"formTarget",p.formTarget,p,null)):(ct(r,i,"encType",p.encType,p,null),ct(r,i,"method",p.method,p,null),ct(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=iu(""+c),r.setAttribute(o,c);break;case"onClick":c!=null&&(r.onclick=Ir);break;case"onScroll":c!=null&&He("scroll",r);break;case"onScrollEnd":c!=null&&He("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=iu(""+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":He("beforetoggle",r),He("toggle",r),nu(r,"popover",c);break;case"xlinkActuate":Zr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Zr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Zr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Zr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Zr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Zr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Zr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Zr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Zr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":nu(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=D2.get(o)||o,nu(r,o,c))}}function zh(r,i,o,c,p,x){switch(o){case"style":Dx(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"?qi(r,c):(typeof c=="number"||typeof c=="bigint")&&qi(r,""+c);break;case"onScroll":c!=null&&He("scroll",r);break;case"onScrollEnd":c!=null&&He("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jx.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[On]||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,""):nu(r,o,c)}}}function cn(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",r),He("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:ct(r,i,x,k,o,null)}}p&&ct(r,i,"srcSet",o.srcSet,o,null),c&&ct(r,i,"src",o.src,o,null);return;case"input":He("invalid",r);var _=x=k=p=null,$=null,H=null;for(c in o)if(o.hasOwnProperty(c)){var W=o[c];if(W!=null)switch(c){case"name":p=W;break;case"type":k=W;break;case"checked":$=W;break;case"defaultChecked":H=W;break;case"value":x=W;break;case"defaultValue":_=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:ct(r,i,c,W,o,null)}}Ax(r,x,_,$,H,k,p,!1);return;case"select":He("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:ct(r,i,p,_,o,null)}i=x,o=k,r.multiple=!!c,i!=null?Fi(r,!!c,i,!1):o!=null&&Fi(r,!!c,o,!0);return;case"textarea":He("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:ct(r,i,k,_,o,null)}Rx(r,c,p,x);return;case"option":for($ in o)o.hasOwnProperty($)&&(c=o[$],c!=null)&&($==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":ct(r,i,$,c,o,null));return;case"dialog":He("beforetoggle",r),He("toggle",r),He("cancel",r),He("close",r);break;case"iframe":case"object":He("load",r);break;case"video":case"audio":for(c=0;c<Jo.length;c++)He(Jo[c],r);break;case"image":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"embed":case"source":case"link":He("error",r),He("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in o)if(o.hasOwnProperty(H)&&(c=o[H],c!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ct(r,i,H,c,o,null)}return;default:if(Ld(i)){for(W in o)o.hasOwnProperty(W)&&(c=o[W],c!==void 0&&zh(r,i,W,c,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(c=o[_],c!=null&&ct(r,i,_,c,o,null))}function lC(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,$=null,H=null,W=null;for(X in o){var ie=o[X];if(o.hasOwnProperty(X)&&ie!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":$=ie;default:c.hasOwnProperty(X)||ct(r,i,X,null,c,ie)}}for(var q in c){var X=c[q];if(ie=o[q],c.hasOwnProperty(q)&&(X!=null||ie!=null))switch(q){case"type":x=X;break;case"name":p=X;break;case"checked":H=X;break;case"defaultChecked":W=X;break;case"value":k=X;break;case"defaultValue":_=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:X!==ie&&ct(r,i,q,X,c,ie)}}Dd(r,k,_,$,H,W,x,p);return;case"select":X=k=_=q=null;for(x in o)if($=o[x],o.hasOwnProperty(x)&&$!=null)switch(x){case"value":break;case"multiple":X=$;default:c.hasOwnProperty(x)||ct(r,i,x,null,c,$)}for(p in c)if(x=c[p],$=o[p],c.hasOwnProperty(p)&&(x!=null||$!=null))switch(p){case"value":q=x;break;case"defaultValue":_=x;break;case"multiple":k=x;default:x!==$&&ct(r,i,p,x,c,$)}i=_,o=k,c=X,q!=null?Fi(r,!!o,q,!1):!!c!=!!o&&(i!=null?Fi(r,!!o,i,!0):Fi(r,!!o,o?[]:"",!1));return;case"textarea":X=q=null;for(_ in o)if(p=o[_],o.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:ct(r,i,_,null,c,p)}for(k in c)if(p=c[k],x=o[k],c.hasOwnProperty(k)&&(p!=null||x!=null))switch(k){case"value":q=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&&ct(r,i,k,p,c,x)}Ox(r,q,X);return;case"option":for(var ye in o)q=o[ye],o.hasOwnProperty(ye)&&q!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?r.selected=!1:ct(r,i,ye,null,c,q));for($ in c)q=c[$],X=o[$],c.hasOwnProperty($)&&q!==X&&(q!=null||X!=null)&&($==="selected"?r.selected=q&&typeof q!="function"&&typeof q!="symbol":ct(r,i,$,q,c,X));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 Ce in o)q=o[Ce],o.hasOwnProperty(Ce)&&q!=null&&!c.hasOwnProperty(Ce)&&ct(r,i,Ce,null,c,q);for(H in c)if(q=c[H],X=o[H],c.hasOwnProperty(H)&&q!==X&&(q!=null||X!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,i));break;default:ct(r,i,H,q,c,X)}return;default:if(Ld(i)){for(var dt in o)q=o[dt],o.hasOwnProperty(dt)&&q!==void 0&&!c.hasOwnProperty(dt)&&zh(r,i,dt,void 0,c,q);for(W in c)q=c[W],X=o[W],!c.hasOwnProperty(W)||q===X||q===void 0&&X===void 0||zh(r,i,W,q,c,X);return}}for(var B in o)q=o[B],o.hasOwnProperty(B)&&q!=null&&!c.hasOwnProperty(B)&&ct(r,i,B,null,c,q);for(ie in c)q=c[ie],X=o[ie],!c.hasOwnProperty(ie)||q===X||q==null&&X==null||ct(r,i,ie,q,c,X)}function $v(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uC(){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&&_&&$v(k)){for(k=0,_=p.responseEnd,c+=1;c<o.length;c++){var $=o[c],H=$.startTime;if(H>_)break;var W=$.transferSize,ie=$.initiatorType;W&&$v(ie)&&($=$.responseEnd,k+=W*($<_?1:(_-H)/($-H)))}if(--c,i+=8*(x+k)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var _h=null,jh=null;function ec(r){return r.nodeType===9?r:r.ownerDocument}function Lv(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 Pv(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 Nh(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 Ch=null;function cC(){var r=window.event;return r&&r.type==="popstate"?r===Ch?!1:(Ch=r,!0):(Ch=null,!1)}var Uv=typeof setTimeout=="function"?setTimeout:void 0,dC=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,fC=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(r){return Vv.resolve(null).then(r).catch(hC)}:Uv;function hC(r){setTimeout(function(){throw r})}function Oa(r){return r==="head"}function Bv(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),Ss(i);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")Wo(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,Wo(o);for(var x=o.firstChild;x;){var k=x.nextSibling,_=x.nodeName;x[xo]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=k}}else o==="body"&&Wo(r.ownerDocument.body);o=p}while(o);Ss(i)}function Zv(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 Th(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":Th(o),Rd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function mC(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[xo])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=lr(r.nextSibling),r===null)break}return null}function pC(r,i,o){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=lr(r.nextSibling),r===null))return null;return r}function Iv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=lr(r.nextSibling),r===null))return null;return r}function Eh(r){return r.data==="$?"||r.data==="$~"}function Ah(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function gC(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 lr(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 Oh=null;function Hv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="/$"||o==="/&"){if(i===0)return lr(r.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}r=r.nextSibling}return null}function Fv(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 qv(r,i,o){switch(i=ec(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 Wo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Rd(r)}var ur=new Map,Gv=new Set;function tc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ia=Q.d;Q.d={f:xC,r:yC,D:bC,C:vC,L:kC,m:wC,X:zC,S:SC,M:_C};function xC(){var r=ia.f(),i=qu();return r||i}function yC(r){var i=Zi(r);i!==null&&i.tag===5&&i.type==="form"?cb(i):ia.r(r)}var vs=typeof document>"u"?null:document;function Yv(r,i,o){var c=vs;if(c&&typeof i=="string"&&i){var p=tr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Gv.has(p)||(Gv.add(p),r={rel:r,crossOrigin:o,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),cn(i,"link",r),nn(i),c.head.appendChild(i)))}}function bC(r){ia.D(r),Yv("dns-prefetch",r,null)}function vC(r,i){ia.C(r,i),Yv("preconnect",r,i)}function kC(r,i,o){ia.L(r,i,o);var c=vs;if(c&&r&&i){var p='link[rel="preload"][as="'+tr(i)+'"]';i==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+tr(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+tr(o.imageSizes)+'"]')):p+='[href="'+tr(r)+'"]';var x=p;switch(i){case"style":x=ks(r);break;case"script":x=ws(r)}ur.has(x)||(r=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),ur.set(x,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(el(x))||i==="script"&&c.querySelector(tl(x))||(i=c.createElement("link"),cn(i,"link",r),nn(i),c.head.appendChild(i)))}}function wC(r,i){ia.m(r,i);var o=vs;if(o&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+tr(c)+'"][href="'+tr(r)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ws(r)}if(!ur.has(x)&&(r=y({rel:"modulepreload",href:r},i),ur.set(x,r),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(tl(x)))return}c=o.createElement("link"),cn(c,"link",r),nn(c),o.head.appendChild(c)}}}function SC(r,i,o){ia.S(r,i,o);var c=vs;if(c&&r){var p=Ii(c).hoistableStyles,x=ks(r);i=i||"default";var k=p.get(x);if(!k){var _={loading:0,preload:null};if(k=c.querySelector(el(x)))_.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},o),(o=ur.get(x))&&Rh(r,o);var $=k=c.createElement("link");nn($),cn($,"link",r),$._p=new Promise(function(H,W){$.onload=H,$.onerror=W}),$.addEventListener("load",function(){_.loading|=1}),$.addEventListener("error",function(){_.loading|=2}),_.loading|=4,nc(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:_},p.set(x,k)}}}function zC(r,i){ia.X(r,i);var o=vs;if(o&&r){var c=Ii(o).hoistableScripts,p=ws(r),x=c.get(p);x||(x=o.querySelector(tl(p)),x||(r=y({src:r,async:!0},i),(i=ur.get(p))&&Mh(r,i),x=o.createElement("script"),nn(x),cn(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function _C(r,i){ia.M(r,i);var o=vs;if(o&&r){var c=Ii(o).hoistableScripts,p=ws(r),x=c.get(p);x||(x=o.querySelector(tl(p)),x||(r=y({src:r,async:!0,type:"module"},i),(i=ur.get(p))&&Mh(r,i),x=o.createElement("script"),nn(x),cn(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Kv(r,i,o,c){var p=(p=me.current)?tc(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=ks(o.href),o=Ii(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=ks(o.href);var x=Ii(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(el(r)))&&!x._p&&(k.instance=x,k.state.loading=5),ur.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},ur.set(r,o),x||jC(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=ws(o),o=Ii(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 ks(r){return'href="'+tr(r)+'"'}function el(r){return'link[rel="stylesheet"]['+r+"]"}function Xv(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function jC(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}),cn(i,"link",o),nn(i),r.head.appendChild(i))}function ws(r){return'[src="'+tr(r)+'"]'}function tl(r){return"script[async]"+r}function Jv(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+tr(o.href)+'"]');if(c)return i.instance=c,nn(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"),nn(c),cn(c,"style",p),nc(c,o.precedence,r),i.instance=c;case"stylesheet":p=ks(o.href);var x=r.querySelector(el(p));if(x)return i.state.loading|=4,i.instance=x,nn(x),x;c=Xv(o),(p=ur.get(p))&&Rh(c,p),x=(r.ownerDocument||r).createElement("link"),nn(x);var k=x;return k._p=new Promise(function(_,$){k.onload=_,k.onerror=$}),cn(x,"link",c),i.state.loading|=4,nc(x,o.precedence,r),i.instance=x;case"script":return x=ws(o.src),(p=r.querySelector(tl(x)))?(i.instance=p,nn(p),p):(c=o,(p=ur.get(x))&&(c=y({},o),Mh(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),nn(p),cn(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,nc(c,o.precedence,r));return i.instance}function nc(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 Rh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Mh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var rc=null;function Qv(r,i,o){if(rc===null){var c=new Map,p=rc=new Map;p.set(o,c)}else p=rc,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[xo]||x[sn]||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 Wv(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function NC(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 e0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function CC(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=ks(c.href),x=i.querySelector(el(p));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ac.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=x,nn(x);return}x=i.ownerDocument||i,c=Xv(c),(p=ur.get(p))&&Rh(c,p),x=x.createElement("link"),nn(x);var k=x;k._p=new Promise(function(_,$){k.onload=_,k.onerror=$}),cn(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=ac.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var Dh=0;function TC(r,i){return r.stylesheets&&r.count===0&&sc(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var c=setTimeout(function(){if(r.stylesheets&&sc(r,r.stylesheets),r.unsuspend){var x=r.unsuspend;r.unsuspend=null,x()}},6e4+i);0<r.imgBytes&&Dh===0&&(Dh=62500*uC());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&sc(r,r.stylesheets),r.unsuspend)){var x=r.unsuspend;r.unsuspend=null,x()}},(r.imgBytes>Dh?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ic=null;function sc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ic=new Map,i.forEach(EC,r),ic=null,ac.call(r))}function EC(r,i){if(!(i.state.loading&4)){var o=ic.get(r);if(o)var c=o.get(null);else{o=new Map,ic.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=ac.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 nl={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function AC(r,i,o,c,p,x,k,_,$){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=Td(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Td(0),this.hiddenUpdates=Td(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function t0(r,i,o,c,p,x,k,_,$,H,W,ie){return r=new AC(r,i,o,k,$,H,W,ie,_),i=1,x===!0&&(i|=24),x=Fn(3,null,null,i),r.current=x,x.stateNode=r,i=mf(),i.refCount++,r.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:o,cache:i},yf(x),r}function n0(r){return r?(r=Wi,r):Wi}function r0(r,i,o,c,p,x){p=n0(p),c.context===null?c.context=p:c.pendingContext=p,c=ka(i),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=wa(r,c,i),o!==null&&(Pn(o,r,i),Mo(o,r,i))}function a0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function $h(r,i){a0(r,i),(r=r.alternate)&&a0(r,i)}function i0(r){if(r.tag===13||r.tag===31){var i=fi(r,67108864);i!==null&&Pn(i,r,67108864),$h(r,67108864)}}function s0(r){if(r.tag===13||r.tag===31){var i=Xn();i=Ed(i);var o=fi(r,i);o!==null&&Pn(o,r,i),$h(r,i)}}var oc=!0;function OC(r,i,o,c){var p=V.T;V.T=null;var x=Q.p;try{Q.p=2,Lh(r,i,o,c)}finally{Q.p=x,V.T=p}}function RC(r,i,o,c){var p=V.T;V.T=null;var x=Q.p;try{Q.p=8,Lh(r,i,o,c)}finally{Q.p=x,V.T=p}}function Lh(r,i,o,c){if(oc){var p=Ph(c);if(p===null)Sh(r,i,c,lc,o),l0(r,c);else if(DC(p,r,i,o,c))c.stopPropagation();else if(l0(r,c),i&4&&-1<MC.indexOf(r)){for(;p!==null;){var x=Zi(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=oi(x.pendingLanes);if(k!==0){var _=x;for(_.pendingLanes|=2,_.entangledLanes|=2;k;){var $=1<<31-ht(k);_.entanglements[1]|=$,k&=~$}Rr(x),(tt&6)===0&&(Hu=_e()+500,Xo(0))}}break;case 31:case 13:_=fi(x,2),_!==null&&Pn(_,x,2),qu(),$h(x,2)}if(x=Ph(c),x===null&&Sh(r,i,c,lc,o),x===p)break;p=x}p!==null&&c.stopPropagation()}else Sh(r,i,c,null,o)}}function Ph(r){return r=Ud(r),Uh(r)}var lc=null;function Uh(r){if(lc=null,r=Bi(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 lc=r,null}function o0(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(Lt()){case K:return 2;case ce:return 8;case ge:case Ee:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Vh=!1,Ra=null,Ma=null,Da=null,rl=new Map,al=new Map,$a=[],MC="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 l0(r,i){switch(r){case"focusin":case"focusout":Ra=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":rl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(i.pointerId)}}function il(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=Zi(i),i!==null&&i0(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function DC(r,i,o,c,p){switch(i){case"focusin":return Ra=il(Ra,r,i,o,c,p),!0;case"dragenter":return Ma=il(Ma,r,i,o,c,p),!0;case"mouseover":return Da=il(Da,r,i,o,c,p),!0;case"pointerover":var x=p.pointerId;return rl.set(x,il(rl.get(x)||null,r,i,o,c,p)),!0;case"gotpointercapture":return x=p.pointerId,al.set(x,il(al.get(x)||null,r,i,o,c,p)),!0}return!1}function u0(r){var i=Bi(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,Sx(r.priority,function(){s0(o)});return}}else if(i===31){if(i=f(o),i!==null){r.blockedOn=i,Sx(r.priority,function(){s0(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 uc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=Ph(r.nativeEvent);if(o===null){o=r.nativeEvent;var c=new o.constructor(o.type,o);Pd=c,o.target.dispatchEvent(c),Pd=null}else return i=Zi(o),i!==null&&i0(i),r.blockedOn=o,!1;i.shift()}return!0}function c0(r,i,o){uc(r)&&o.delete(i)}function $C(){Vh=!1,Ra!==null&&uc(Ra)&&(Ra=null),Ma!==null&&uc(Ma)&&(Ma=null),Da!==null&&uc(Da)&&(Da=null),rl.forEach(c0),al.forEach(c0)}function cc(r,i){r.blockedOn===i&&(r.blockedOn=null,Vh||(Vh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$C)))}var dc=null;function d0(r){dc!==r&&(dc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){dc===r&&(dc=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(Uh(c||o)===null)continue;break}var x=Zi(o);x!==null&&(r.splice(i,3),i-=3,Pf(x,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function Ss(r){function i($){return cc($,r)}Ra!==null&&cc(Ra,r),Ma!==null&&cc(Ma,r),Da!==null&&cc(Da,r),rl.forEach(i),al.forEach(i);for(var o=0;o<$a.length;o++){var c=$a[o];c.blockedOn===r&&(c.blockedOn=null)}for(;0<$a.length&&(o=$a[0],o.blockedOn===null);)u0(o),o.blockedOn===null&&$a.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[On]||null;if(typeof x=="function")k||d0(o);else if(k){var _=null;if(x&&x.hasAttribute("formAction")){if(p=x,k=x[On]||null)_=k.formAction;else if(Uh(p)!==null)continue}else _=k.action;typeof _=="function"?o[c+1]=_:(o.splice(c,3),c-=3),d0(o)}}}function f0(){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 Bh(r){this._internalRoot=r}fc.prototype.render=Bh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,c=Xn();r0(o,c,r,i,null,null)},fc.prototype.unmount=Bh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;r0(r.current,2,null,r,null,null),qu(),i[Vi]=null}};function fc(r){this._internalRoot=r}fc.prototype.unstable_scheduleHydration=function(r){if(r){var i=wx();r={blockedOn:null,target:r,priority:i};for(var o=0;o<$a.length&&i!==0&&i<$a[o].priority;o++);$a.splice(o,0,r),o===0&&u0(r)}};var h0=t.version;if(h0!=="19.2.4")throw Error(a(527,h0,"19.2.4"));Q.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 LC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hc.isDisabled&&hc.supportsFiber)try{wn=hc.inject(LC),Jt=hc}catch{}}return ol.createRoot=function(r,i){if(!s(r))throw Error(a(299));var o=!1,c="",p=vb,x=kb,k=wb;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=t0(r,1,!1,null,null,o,c,null,p,x,k,f0),r[Vi]=i.current,wh(r),new Bh(i)},ol.hydrateRoot=function(r,i,o){if(!s(r))throw Error(a(299));var c=!1,p="",x=vb,k=kb,_=wb,$=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&&($=o.formState)),i=t0(r,1,!0,i,o??null,c,p,$,x,k,_,f0),i.context=n0(null),o=i.current,c=Xn(),c=Ed(c),p=ka(c),p.callback=null,wa(o,p,c),o=c,i.current.lanes=o,go(i,o),Rr(i),r[Vi]=i.current,wh(r),new fc(i)},ol.version="19.2.4",ol}var S0;function GC(){if(S0)return Hh.exports;S0=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(),Hh.exports=qC(),Hh.exports}var YC=GC();var z0="popstate";function KC(e={}){function t(a,s){let{pathname:u,search:l,hash:f}=a.location;return qm("",{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:Nl(s)}return JC(t,n,null,e)}function zt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XC(){return Math.random().toString(36).substring(2,10)}function _0(e,t){return{usr:e.state,key:e.key,idx:t}}function qm(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?to(t):t,state:n,key:t&&t.key||a||XC()}}function Nl({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 to(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 JC(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 C=g(),E=C==null?null:C-m;m=C,h&&h({action:f,location:N.location,delta:E})}function b(C,E){f="PUSH";let A=qm(N.location,C,E);m=g()+1;let T=_0(A,m),L=N.createHref(A);try{l.pushState(T,"",L)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;s.location.assign(L)}u&&h&&h({action:f,location:N.location,delta:1})}function v(C,E){f="REPLACE";let A=qm(N.location,C,E);m=g();let T=_0(A,m),L=N.createHref(A);l.replaceState(T,"",L),u&&h&&h({action:f,location:N.location,delta:0})}function S(C){return QC(C)}let N={get action(){return f},get location(){return e(s,l)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(z0,y),h=C,()=>{s.removeEventListener(z0,y),h=null}},createHref(C){return t(s,C)},createURL:S,encodeLocation(C){let E=S(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:v,go(C){return l.go(C)}};return N}function QC(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),zt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Nl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function tS(e,t,n="/"){return WC(e,t,n,!1)}function WC(e,t,n,a){let s=typeof t=="string"?to(t):t,u=da(s.pathname||"/",n);if(u==null)return null;let l=nS(e);eT(l);let f=null;for(let h=0;f==null&&h<l.length;++h){let m=dT(u);f=uT(l[h],m,a)}return f}function nS(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;zt(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=ua([a,g.relativePath]),b=n.concat(g);l.children&&l.children.length>0&&(zt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),nS(l.children,t,b,y,h)),!(l.path==null&&!l.index)&&t.push({path:y,score:oT(y,l.index),routesMeta:b})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))u(l,f);else for(let h of rS(l.path))u(l,f,!0,h)}),t}function rS(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=rS(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 eT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var tT=/^:[\w-]+$/,nT=3,rT=2,aT=1,iT=10,sT=-2,j0=e=>e==="*";function oT(e,t){let n=e.split("/"),a=n.length;return n.some(j0)&&(a+=sT),t&&(a+=rT),n.filter(s=>!j0(s)).reduce((s,u)=>s+(tT.test(u)?nT:u===""?aT:iT),a)}function lT(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 uT(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=Fc({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),b=h.route;if(!y&&m&&n&&!a[a.length-1].route.index&&(y=Fc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!y)return null;Object.assign(s,y.params),l.push({params:s,pathname:ua([u,y.pathname]),pathnameBase:pT(ua([u,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(u=ua([u,y.pathnameBase]))}return l}function Fc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=cT(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},b)=>{if(g==="*"){let S=f[b]||"";l=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const v=f[b];return y&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function cT(e,t=!1,n=!0){Cr(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 dT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cr(!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 da(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 fT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function hT(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?to(e):e,u;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?u=N0(n.substring(1),"/"):u=N0(n,t)):u=t,{pathname:u,search:gT(a),hash:xT(s)}}function N0(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 Yh(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 mT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jp(e){let t=mT(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=to(e):(s={...e},zt(!s.pathname||!s.pathname.includes("?"),Yh("?","pathname","search",s)),zt(!s.pathname||!s.pathname.includes("#"),Yh("#","pathname","hash",s)),zt(!s.search||!s.search.includes("#"),Yh("#","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 b=l.split("/");for(;b[0]==="..";)b.shift(),y-=1;s.pathname=b.join("/")}f=y>=0?t[y]:"/"}let h=hT(s,f),m=l&&l!=="/"&&l.endsWith("/"),g=(u||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var ua=e=>e.join("/").replace(/\/\/+/g,"/"),pT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,yT=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 bT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function vT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var aS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function iS(e,t){let n=e;if(typeof n!="string"||!fT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(aS)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),f=da(l.pathname,t);l.origin===u.origin&&f!=null?n=f+l.search+l.hash:s=!0}catch{Cr(!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 sS=["POST","PUT","PATCH","DELETE"];new Set(sS);var kT=["GET",...sS];new Set(kT);var no=z.createContext(null);no.displayName="DataRouter";var fd=z.createContext(null);fd.displayName="DataRouterState";var wT=z.createContext(!1),oS=z.createContext({isTransitioning:!1});oS.displayName="ViewTransition";var ST=z.createContext(new Map);ST.displayName="Fetchers";var zT=z.createContext(null);zT.displayName="Await";var Wn=z.createContext(null);Wn.displayName="Navigation";var Zl=z.createContext(null);Zl.displayName="Location";var Vr=z.createContext({outlet:null,matches:[],isDataRoute:!1});Vr.displayName="Route";var Wp=z.createContext(null);Wp.displayName="RouteError";var lS="REACT_ROUTER_ERROR",_T="REDIRECT",jT="ROUTE_ERROR_RESPONSE";function NT(e){if(e.startsWith(`${lS}:${_T}:{`))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 CT(e){if(e.startsWith(`${lS}:${jT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new yT(t.status,t.statusText,t.data)}catch{}}function TT(e,{relative:t}={}){zt(ro(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=z.useContext(Wn),{hash:s,pathname:u,search:l}=Il(e,{relative:t}),f=u;return n!=="/"&&(f=u==="/"?n:ua([n,u])),a.createHref({pathname:f,search:l,hash:s})}function ro(){return z.useContext(Zl)!=null}function Tr(){return zt(ro(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Zl).location}var uS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cS(e){z.useContext(Wn).static||z.useLayoutEffect(e)}function eg(){let{isDataRoute:e}=z.useContext(Vr);return e?ZT():ET()}function ET(){zt(ro(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(no),{basename:t,navigator:n}=z.useContext(Wn),{matches:a}=z.useContext(Vr),{pathname:s}=Tr(),u=JSON.stringify(Jp(a)),l=z.useRef(!1);return cS(()=>{l.current=!0}),z.useCallback((h,m={})=>{if(Cr(l.current,uS),!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:ua([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,u,s,e])}z.createContext(null);function Il(e,{relative:t}={}){let{matches:n}=z.useContext(Vr),{pathname:a}=Tr(),s=JSON.stringify(Jp(n));return z.useMemo(()=>Qp(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function AT(e,t){return dS(e,t)}function dS(e,t,n,a,s){zt(ro(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=z.useContext(Wn),{matches:l}=z.useContext(Vr),f=l[l.length-1],h=f?f.params:{},m=f?f.pathname:"/",g=f?f.pathnameBase:"/",y=f&&f.route;{let A=y&&y.path||"";hS(m,!y||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${A}">) 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="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=Tr(),v;if(t){let A=typeof t=="string"?to(t):t;zt(g==="/"||A.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 "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=b;let S=v.pathname||"/",N=S;if(g!=="/"){let A=g.replace(/^\//,"").split("/");N="/"+S.replace(/^\//,"").split("/").slice(A.length).join("/")}let C=tS(e,{pathname:N});Cr(y||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Cr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=$T(C&&C.map(A=>Object.assign({},A,{params:Object.assign({},h,A.params),pathname:ua([g,u.encodeLocation?u.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:ua([g,u.encodeLocation?u.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),l,n,a,s);return t&&E?z.createElement(Zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},E):E}function OT(){let e=BT(),t=bT(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 RT=z.createElement(OT,null),fS=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=CT(e.digest);n&&(e=n)}let t=e!==void 0?z.createElement(Vr.Provider,{value:this.props.routeContext},z.createElement(Wp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(MT,{error:e},t):t}};fS.contextType=wT;var Kh=new WeakMap;function MT({children:e,error:t}){let{basename:n}=z.useContext(Wn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=NT(t.digest);if(a){let s=Kh.get(t);if(s)throw s;let u=iS(a.location,n);if(aS&&!Kh.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 Kh.set(t,l),l}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function DT({routeContext:e,match:t,children:n}){let a=z.useContext(no);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),z.createElement(Vr.Provider,{value:e},n)}function $T(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);zt(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:b,errors:v}=n,S=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!v||v[y.route.id]===void 0);if(y.route.lazy||S){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:vT(n.matches),errorInfo:y})}:void 0;return u.reduceRight((g,y,b)=>{let v,S=!1,N=null,C=null;n&&(v=l&&y.route.id?l[y.route.id]:void 0,N=y.route.errorElement||RT,f&&(h<0&&b===0?(hS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):h===b&&(S=!0,C=y.route.hydrateFallbackElement||null)));let E=t.concat(u.slice(0,b+1)),A=()=>{let T;return v?T=N:S?T=C:y.route.Component?T=z.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=g,z.createElement(DT,{match:y,routeContext:{outlet:g,matches:E,isDataRoute:n!=null},children:T})};return n&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?z.createElement(fS,{location:n.location,revalidation:n.revalidation,component:N,error:v,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:m}):A()},null)}function tg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function LT(e){let t=z.useContext(no);return zt(t,tg(e)),t}function PT(e){let t=z.useContext(fd);return zt(t,tg(e)),t}function UT(e){let t=z.useContext(Vr);return zt(t,tg(e)),t}function ng(e){let t=UT(e),n=t.matches[t.matches.length-1];return zt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function VT(){return ng("useRouteId")}function BT(){let e=z.useContext(Wp),t=PT("useRouteError"),n=ng("useRouteError");return e!==void 0?e:t.errors?.[n]}function ZT(){let{router:e}=LT("useNavigate"),t=ng("useNavigate"),n=z.useRef(!1);return cS(()=>{n.current=!0}),z.useCallback(async(s,u={})=>{Cr(n.current,uS),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...u}))},[e,t])}var C0={};function hS(e,t,n){!t&&!C0[e]&&(C0[e]=!0,Cr(!1,n))}z.memo(IT);function IT({routes:e,future:t,state:n,onError:a}){return dS(e,void 0,n,a,t)}function mS({to:e,replace:t,state:n,relative:a}){zt(ro(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=z.useContext(Wn);Cr(!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(Vr),{pathname:l}=Tr(),f=eg(),h=Qp(e,Jp(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 an(e){zt(!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 HT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:u=!1,unstable_useTransitions:l}){zt(!ro(),"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=to(n));let{pathname:m="/",search:g="",hash:y="",state:b=null,key:v="default"}=n,S=z.useMemo(()=>{let N=da(m,f);return N==null?null:{location:{pathname:N,search:g,hash:y,state:b,key:v},navigationType:a}},[f,m,g,y,b,v,a]);return Cr(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(Wn.Provider,{value:h},z.createElement(Zl.Provider,{children:t,value:S}))}function T0({children:e,location:t}){return AT(Gm(e),t)}function Gm(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,Gm(a.props.children,u));return}zt(a.type===an,`[${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>`),zt(!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=Gm(a.props.children,u)),n.push(l)}),n}var $c="get",Lc="application/x-www-form-urlencoded";function hd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function FT(e){return hd(e)&&e.tagName.toLowerCase()==="button"}function qT(e){return hd(e)&&e.tagName.toLowerCase()==="form"}function GT(e){return hd(e)&&e.tagName.toLowerCase()==="input"}function YT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KT(e,t){return e.button===0&&(!t||t==="_self")&&!YT(e)}var mc=null;function XT(){if(mc===null)try{new FormData(document.createElement("form"),0),mc=!1}catch{mc=!0}return mc}var JT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xh(e){return e!=null&&!JT.has(e)?(Cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lc}"`),null):e}function QT(e,t){let n,a,s,u,l;if(qT(e)){let f=e.getAttribute("action");a=f?da(f,t):null,n=e.getAttribute("method")||$c,s=Xh(e.getAttribute("enctype"))||Lc,u=new FormData(e)}else if(FT(e)||GT(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?da(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||$c,s=Xh(e.getAttribute("formenctype"))||Xh(f.getAttribute("enctype"))||Lc,u=new FormData(f,e),!XT()){let{name:m,type:g,value:y}=e;if(g==="image"){let b=m?`${m}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else m&&u.append(m,y)}}else{if(hd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=$c,a=null,s=Lc,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 rg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function WT(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&&da(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function eE(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 tE(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 nE(e,t,n){let a=await Promise.all(e.map(async s=>{let u=t.routes[s.route.id];if(u){let l=await eE(u,n);return l.links?l.links():[]}return[]}));return sE(a.flat(1).filter(tE).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function E0(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 rE(e,t,{includeHydrateFallback:n}={}){return aE(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 aE(e){return[...new Set(e)]}function iE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function sE(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let u=JSON.stringify(iE(s));return n.has(u)||(n.add(u),a.push({key:u,link:s})),a},[])}function pS(){let e=z.useContext(no);return rg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oE(){let e=z.useContext(fd);return rg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ag=z.createContext(void 0);ag.displayName="FrameworkContext";function gS(){let e=z.useContext(ag);return rg(e,"You must render this element inside a <HydratedRouter> element"),e}function lE(e,t){let n=z.useContext(ag),[a,s]=z.useState(!1),[u,l]=z.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:y}=t,b=z.useRef(null);z.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let N=E=>{E.forEach(A=>{l(A.isIntersecting)})},C=new IntersectionObserver(N,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),z.useEffect(()=>{if(a){let N=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(N)}}},[a]);let v=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[u,b,{}]:[u,b,{onFocus:ll(f,v),onBlur:ll(h,S),onMouseEnter:ll(m,v),onMouseLeave:ll(g,S),onTouchStart:ll(y,v)}]:[!1,b,{}]}function ll(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function uE({page:e,...t}){let{router:n}=pS(),a=z.useMemo(()=>tS(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?z.createElement(dE,{page:e,matches:a,...t}):null}function cE(e){let{manifest:t,routeModules:n}=gS(),[a,s]=z.useState([]);return z.useEffect(()=>{let u=!1;return nE(e,t,n).then(l=>{u||s(l)}),()=>{u=!0}},[e,t,n]),a}function dE({page:e,matches:t,...n}){let a=Tr(),{future:s,manifest:u,routeModules:l}=gS(),{basename:f}=pS(),{loaderData:h,matches:m}=oE(),g=z.useMemo(()=>E0(e,t,m,u,a,"data"),[e,t,m,u,a]),y=z.useMemo(()=>E0(e,t,m,u,a,"assets"),[e,t,m,u,a]),b=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let N=new Set,C=!1;if(t.forEach(A=>{let T=u.routes[A.route.id];!T||!T.hasLoader||(!g.some(L=>L.route.id===A.route.id)&&A.route.id in h&&l[A.route.id]?.shouldRevalidate||T.hasClientLoader?C=!0:N.add(A.route.id))}),N.size===0)return[];let E=WT(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return C&&N.size>0&&E.searchParams.set("_routes",t.filter(A=>N.has(A.route.id)).map(A=>A.route.id).join(",")),[E.pathname+E.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),v=z.useMemo(()=>rE(y,u),[y,u]),S=cE(y);return z.createElement(z.Fragment,null,b.map(N=>z.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...n})),v.map(N=>z.createElement("link",{key:N,rel:"modulepreload",href:N,...n})),S.map(({key:N,link:C})=>z.createElement("link",{key:N,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function fE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var hE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{hE&&(window.__reactRouterVersion="7.13.0")}catch{}function mE({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=z.useRef();s.current==null&&(s.current=KC({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(HT,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:n})}var xS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ha=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:b,...v},S){let{basename:N,unstable_useTransitions:C}=z.useContext(Wn),E=typeof m=="string"&&xS.test(m),A=iS(m,N);m=A.to;let T=TT(m,{relative:s}),[L,U,D]=lE(a,v),Z=yE(m,{replace:l,state:f,target:h,preventScrollReset:g,relative:s,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function R(ue){t&&t(ue),ue.defaultPrevented||Z(ue)}let J=z.createElement("a",{...v,...D,href:A.absoluteURL||T,onClick:A.isExternal||u?t:R,ref:fE(S,U),target:h,"data-discover":!E&&n==="render"?"true":void 0});return L&&!E?z.createElement(z.Fragment,null,J,z.createElement(uE,{page:T})):J});Ha.displayName="Link";var pE=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=Il(l,{relative:m.relative}),b=Tr(),v=z.useContext(fd),{navigator:S,basename:N}=z.useContext(Wn),C=v!=null&&SE(y)&&f===!0,E=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,A=b.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),T=T?T.toLowerCase():null,E=E.toLowerCase()),T&&N&&(T=da(T,N)||T);const L=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let U=A===E||!s&&A.startsWith(E)&&A.charAt(L)==="/",D=T!=null&&(T===E||!s&&T.startsWith(E)&&T.charAt(E.length)==="/"),Z={isActive:U,isPending:D,isTransitioning:C},R=U?t:void 0,J;typeof a=="function"?J=a(Z):J=[a,U?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let ue=typeof u=="function"?u(Z):u;return z.createElement(Ha,{...m,"aria-current":R,className:J,ref:g,style:ue,to:l,viewTransition:f},typeof h=="function"?h(Z):h)});pE.displayName="NavLink";var gE=z.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:u,method:l=$c,action:f,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...v},S)=>{let{unstable_useTransitions:N}=z.useContext(Wn),C=kE(),E=wE(f,{relative:m}),A=l.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&xS.test(f),L=U=>{if(h&&h(U),U.defaultPrevented)return;U.preventDefault();let D=U.nativeEvent.submitter,Z=D?.getAttribute("formmethod")||l,R=()=>C(D||U.currentTarget,{fetcherKey:t,method:Z,navigate:n,replace:s,state:u,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b});N&&n!==!1?z.startTransition(()=>R()):R()};return z.createElement("form",{ref:S,method:A,action:E,onSubmit:a?h:L,...v,"data-discover":!T&&e==="render"?"true":void 0})});gE.displayName="Form";function xE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yS(e){let t=z.useContext(no);return zt(t,xE(e)),t}function yE(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=eg(),g=Tr(),y=Il(e,{relative:u});return z.useCallback(b=>{if(KT(b,t)){b.preventDefault();let v=n!==void 0?n:Nl(g)===Nl(y),S=()=>m(e,{replace:v,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 bE=0,vE=()=>`__${String(++bE)}__`;function kE(){let{router:e}=yS("useSubmit"),{basename:t}=z.useContext(Wn),n=VT(),a=e.fetch,s=e.navigate;return z.useCallback(async(u,l={})=>{let{action:f,method:h,encType:m,formData:g,body:y}=QT(u,t);if(l.navigate===!1){let b=l.fetcherKey||vE();await a(b,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 wE(e,{relative:t}={}){let{basename:n}=z.useContext(Wn),a=z.useContext(Vr);zt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Il(e||".",{relative:t})},l=Tr();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:ua([n,u.pathname])),Nl(u)}function SE(e,{relative:t}={}){let n=z.useContext(oS);zt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=yS("useViewTransitionState"),s=Il(e,{relative:t});if(!n.isTransitioning)return!1;let u=da(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=da(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Fc(s.pathname,l)!=null||Fc(s.pathname,u)!=null}const bS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const zE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const _E=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const A0=e=>{const t=_E(e);return t.charAt(0).toUpperCase()+t.slice(1)};var jE={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 NE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const CE=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,...jE,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:bS("lucide",s),...!u&&!NE(f)&&{"aria-hidden":"true"},...f},[...l.map(([m,g])=>z.createElement(m,g)),...Array.isArray(u)?u:[u]]));const xe=(e,t)=>{const n=z.forwardRef(({className:a,...s},u)=>z.createElement(CE,{ref:u,iconNode:t,className:bS(`lucide-${zE(A0(e))}`,`lucide-${e}`,a),...s}));return n.displayName=A0(e),n};const TE=[["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"}]],Rs=xe("activity",TE);const EE=[["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"}]],AE=xe("archive",EE);const OE=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],vS=xe("arrow-down",OE);const RE=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ME=xe("arrow-left",RE);const DE=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],kS=xe("arrow-up",DE);const $E=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],LE=xe("ban",$E);const PE=[["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"}]],Cl=xe("bell",PE);const UE=[["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"}]],O0=xe("bot",UE);const VE=[["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"}]],BE=xe("box",VE);const ZE=[["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"}]],IE=xe("brain",ZE);const HE=[["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"}]],wS=xe("calendar",HE);const FE=[["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"}]],Ym=xe("chart-column",FE);const qE=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],GE=xe("check-check",qE);const YE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Km=xe("check",YE);const KE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],XE=xe("chevron-down",KE);const JE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],QE=xe("chevron-right",JE);const WE=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eA=xe("chevron-up",WE);const tA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],nA=xe("circle-alert",tA);const rA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aA=xe("circle-check-big",rA);const iA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],SS=xe("circle-check",iA);const sA=[["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"}]],Xm=xe("circle-x",sA);const oA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ga=xe("clock",oA);const lA=[["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"}]],uA=xe("copy",lA);const cA=[["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"}]],zS=xe("cpu",cA);const dA=[["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"}]],Zs=xe("database",dA);const fA=[["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"}]],qc=xe("dollar-sign",fA);const hA=[["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"}]],Hl=xe("eye",hA);const mA=[["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"}]],pA=xe("file-text",mA);const gA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],xA=xe("folder-open",gA);const yA=[["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"}]],bA=xe("funnel",yA);const vA=[["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"}]],kA=xe("hash",vA);const wA=[["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"}]],SA=xe("history",wA);const zA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_A=xe("info",zA);const jA=[["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"}]],R0=xe("layout-dashboard",jA);const NA=[["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"}]],Jm=xe("list-checks",NA);const CA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],TA=xe("loader-circle",CA);const EA=[["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"}]],M0=xe("log-out",EA);const AA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],OA=xe("menu",AA);const RA=[["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"}]],D0=xe("message-square-plus",RA);const MA=[["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"}]],Tl=xe("message-square",MA);const DA=[["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"}]],_S=xe("moon",DA);const $A=[["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"}]],LA=xe("pause",$A);const PA=[["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"}]],UA=xe("pen",PA);const VA=[["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"}]],ig=xe("pencil",VA);const BA=[["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"}]],ZA=xe("play",BA);const IA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],md=xe("plus",IA);const HA=[["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"}]],$0=xe("puzzle",HA);const FA=[["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"}]],Ms=xe("refresh-cw",FA);const qA=[["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"}]],L0=xe("rotate-ccw",qA);const GA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],YA=xe("search",GA);const KA=[["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"}]],XA=xe("send",KA);const JA=[["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"}]],P0=xe("settings",JA);const QA=[["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"}]],U0=xe("shield-check",QA);const WA=[["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"}]],jS=xe("sun",WA);const e4=[["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"}]],sg=xe("tag",e4);const t4=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Qm=xe("terminal",t4);const n4=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],NS=xe("toggle-left",n4);const r4=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],CS=xe("toggle-right",r4);const a4=[["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"}]],Mi=xe("trash-2",a4);const i4=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],s4=xe("trending-up",i4);const o4=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],pc=xe("upload",o4);const l4=[["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"}]],og=xe("user",l4);const u4=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],El=xe("wand-sparkles",u4);const c4=[["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"}]],Wm=xe("webhook",c4);const d4=[["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"}]],f4=xe("wifi-off",d4);const h4=[["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"}]],Jh=xe("wifi",h4);const m4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lg=xe("x",m4);var Qh={exports:{}},Wh={};var V0;function p4(){if(V0)return Wh;V0=1;var e=dd();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function f(y,b){var v=b(),S=a({inst:{value:v,getSnapshot:b}}),N=S[0].inst,C=S[1];return u(function(){N.value=v,N.getSnapshot=b,h(N)&&C({inst:N})},[y,v,b]),s(function(){return h(N)&&C({inst:N}),y(function(){h(N)&&C({inst:N})})},[y]),l(v),v}function h(y){var b=y.getSnapshot;y=y.value;try{var v=b();return!n(y,v)}catch{return!0}}function m(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Wh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Wh}var B0;function g4(){return B0||(B0=1,Qh.exports=p4()),Qh.exports}var Z0=g4();const TS=0,ES=1,AS=2,I0=3;var H0=Object.prototype.hasOwnProperty;function ep(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--&&ep(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(H0.call(e,n)&&++a&&!H0.call(t,n)||!(n in t)||!ep(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const oa=new WeakMap,la=()=>{},xn=la(),tp=Object,Je=e=>e===xn,Dr=e=>typeof e=="function",Ya=(e,t)=>({...e,...t}),OS=e=>Dr(e.then),em={},gc={},ug="undefined",Fl=typeof window!=ug,np=typeof document!=ug,x4=Fl&&"Deno"in window,y4=()=>Fl&&typeof window.requestAnimationFrame!=ug,RS=(e,t)=>{const n=oa.get(e);return[()=>!Je(t)&&e.get(t)||em,a=>{if(!Je(t)){const s=e.get(t);t in gc||(gc[t]=s),n[5](t,Ya(s,a),s||em)}},n[6],()=>!Je(t)&&t in gc?gc[t]:!Je(t)&&e.get(t)||em]};let rp=!0;const b4=()=>rp,[ap,ip]=Fl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[la,la],v4=()=>{const e=np&&document.visibilityState;return Je(e)||e!=="hidden"},k4=e=>(np&&document.addEventListener("visibilitychange",e),ap("focus",e),()=>{np&&document.removeEventListener("visibilitychange",e),ip("focus",e)}),w4=e=>{const t=()=>{rp=!0,e()},n=()=>{rp=!1};return ap("online",t),ap("offline",n),()=>{ip("online",t),ip("offline",n)}},S4={isOnline:b4,isVisible:v4},z4={initFocus:k4,initReconnect:w4},F0=!Xp.useId,Is=!Fl||x4,_4=e=>y4()?window.requestAnimationFrame(e):setTimeout(e,1),tm=Is?z.useEffect:z.useLayoutEffect,nm=typeof navigator<"u"&&navigator.connection,q0=!Is&&nm&&(["slow-2g","2g"].includes(nm.effectiveType)||nm.saveData),xc=new WeakMap,j4=e=>tp.prototype.toString.call(e),rm=(e,t)=>e===`[object ${t}]`;let N4=0;const sp=e=>{const t=typeof e,n=j4(e),a=rm(n,"Date"),s=rm(n,"RegExp"),u=rm(n,"Object");let l,f;if(tp(e)===e&&!a&&!s){if(l=xc.get(e),l)return l;if(l=++N4+"~",xc.set(e,l),Array.isArray(e)){for(l="@",f=0;f<e.length;f++)l+=sp(e[f])+",";xc.set(e,l)}if(u){l="#";const h=tp.keys(e).sort();for(;!Je(f=h.pop());)Je(e[f])||(l+=f+":"+sp(e[f])+",");xc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},cg=e=>{if(Dr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?sp(e):"",[e,t]};let C4=0;const op=()=>++C4;async function MS(...e){const[t,n,a,s]=e,u=Ya({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let l=u.populateCache;const f=u.rollbackOnError;let h=u.optimisticData;const m=b=>typeof f=="function"?f(b):f!==!1,g=u.throwOnError;if(Dr(n)){const b=n,v=[],S=t.keys();for(const N of S)!/^\$(inf|sub)\$/.test(N)&&b(t.get(N)._k)&&v.push(N);return Promise.all(v.map(y))}return y(n);async function y(b){const[v]=cg(b);if(!v)return;const[S,N]=RS(t,v),[C,E,A,T]=oa.get(t),L=()=>{const te=C[v];return(Dr(u.revalidate)?u.revalidate(S().data,b):u.revalidate!==!1)&&(delete A[v],delete T[v],te&&te[0])?te[0](AS).then(()=>S().data):S().data};if(e.length<3)return L();let U=a,D,Z=!1;const R=op();E[v]=[R,0];const J=!Je(h),ue=S(),le=ue.data,re=ue._c,ae=Je(re)?le:re;if(J&&(h=Dr(h)?h(ae,le):h,N({data:h,_c:ae})),Dr(U))try{U=U(ae)}catch(te){D=te,Z=!0}if(U&&OS(U))if(U=await U.catch(te=>{D=te,Z=!0}),R!==E[v][0]){if(Z)throw D;return U}else Z&&J&&m(D)&&(l=!0,N({data:ae,_c:xn}));if(l&&!Z)if(Dr(l)){const te=l(U,ae);N({data:te,error:xn,_c:xn})}else N({data:U,error:xn,_c:xn});if(E[v][1]=op(),Promise.resolve(L()).then(()=>{N({_c:xn})}),Z){if(g)throw D;return}return U}}const G0=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},T4=(e,t)=>{if(!oa.has(e)){const n=Ya(z4,t),a=Object.create(null),s=MS.bind(xn,e);let u=la;const l=Object.create(null),f=(g,y)=>{const b=l[g]||[];return l[g]=b,b.push(y),()=>b.splice(b.indexOf(y),1)},h=(g,y,b)=>{e.set(g,y);const v=l[g];if(v)for(const S of v)S(y,b)},m=()=>{if(!oa.has(e)&&(oa.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,f]),!Is)){const g=n.initFocus(setTimeout.bind(xn,G0.bind(xn,a,TS))),y=n.initReconnect(setTimeout.bind(xn,G0.bind(xn,a,ES)));u=()=>{g&&g(),y&&y(),oa.delete(e)}}};return m(),[e,s,m,u]}return[e,oa.get(e)[4]]},E4=(e,t,n,a,s)=>{const u=n.errorRetryCount,l=s.retryCount,f=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Je(u)&&l>u||setTimeout(a,f,s)},A4=ep,[DS,jn]=T4(new Map),O4=Ya({onLoadingSlow:la,onSuccess:la,onError:la,onErrorRetry:E4,onDiscarded:la,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:q0?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:q0?5e3:3e3,compare:A4,isPaused:()=>!1,cache:DS,mutate:jn,fallback:{}},S4),R4=(e,t)=>{const n=Ya(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=Ya(s,l))}return n},M4=z.createContext({}),D4="$inf$",$S=Fl&&window.__SWR_DEVTOOLS_USE__,$4=$S?window.__SWR_DEVTOOLS_USE__:[],L4=()=>{$S&&(window.__SWR_DEVTOOLS_REACT__=Xp)},P4=e=>Dr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],U4=()=>{const e=z.useContext(M4);return z.useMemo(()=>Ya(O4,e),[e])},V4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=cg(t),[,,,f]=oa.get(DS);if(l.startsWith(D4))return n(...u);const h=f[l];return Je(h)?n(...u):(delete f[l],h)}),a),B4=$4.concat(V4),Z4=e=>function(...n){const a=U4(),[s,u,l]=P4(n),f=R4(a,l);let h=e;const{use:m}=f,g=(m||[]).concat(B4);for(let y=g.length;y--;)h=g[y](h);return h(s,u||f.fetcher||null,f)},I4=(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())}};L4();const am=Xp.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}}),im={dedupe:!0},Y0=Promise.resolve(xn),H4=(e,t,n)=>{const{cache:a,compare:s,suspense:u,fallbackData:l,revalidateOnMount:f,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[S,N,C,E]=oa.get(a),[A,T]=cg(e),L=z.useRef(!1),U=z.useRef(!1),D=z.useRef(A),Z=z.useRef(t),R=z.useRef(n),J=()=>R.current,ue=()=>J().isVisible()&&J().isOnline(),[le,re,ae,te]=RS(a,A),se=z.useRef({}).current,V=Je(l)?Je(n.fallback)?xn:n.fallback[A]:l,Q=($e,Fe)=>{for(const ft in se){const at=ft;if(at==="data"){if(!s($e[at],Fe[at])&&(!Je($e[at])||!s(me,Fe[at])))return!1}else if(Fe[at]!==$e[at])return!1}return!0},Y=z.useMemo(()=>{const $e=!A||!t?!1:Je(f)?J().isPaused()||u?!1:h!==!1:f,Fe=M=>{const _e=Ya(M);return delete _e._k,$e?{isValidating:!0,isLoading:!0,..._e}:_e},ft=le(),at=te(),Bt=Fe(ft),En=ft===at?Bt:Fe(at);let Nt=Bt;return[()=>{const M=Fe(le());return Q(M,Nt)?(Nt.data=M.data,Nt.isLoading=M.isLoading,Nt.isValidating=M.isValidating,Nt.error=M.error,Nt):(Nt=M,M)},()=>En]},[a,A]),be=Z0.useSyncExternalStore(z.useCallback($e=>ae(A,(Fe,ft)=>{Q(ft,Fe)||$e()}),[a,A]),Y[0],Y[1]),O=!L.current,j=S[A]&&S[A].length>0,F=be.data,w=Je(F)?V&&OS(V)?am(V):V:F,G=be.error,he=z.useRef(w),me=b?Je(F)?Je(he.current)?w:he.current:F:w,fe=A&&Je(w),Ze=!Is&&Z0.useSyncExternalStore(()=>la,()=>!1,()=>!0);v&&Ze&&!u&&fe&&console.warn(`Missing pre-initiated data for serialized key "${A}" 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 Te=j&&!Je(G)?!1:O&&!Je(f)?f:J().isPaused()?!1:u?Je(w)?!1:h:Je(w)||h,bt=!!(A&&t&&O&&Te),Ae=Je(be.isValidating)?bt:be.isValidating,Oe=Je(be.isLoading)?bt:be.isLoading,Se=z.useCallback(async $e=>{const Fe=Z.current;if(!A||!Fe||U.current||J().isPaused())return!1;let ft,at,Bt=!0;const En=$e||{},Nt=!C[A]||!En.dedupe,M=()=>F0?!U.current&&A===D.current&&L.current:A===D.current,_e={isValidating:!1,isLoading:!1},Lt=()=>{re(_e)},K=()=>{const ge=C[A];ge&&ge[1]===at&&delete C[A]},ce={isValidating:!0};Je(le().data)&&(ce.isLoading=!0);try{if(Nt&&(re(ce),n.loadingTimeout&&Je(le().data)&&setTimeout(()=>{Bt&&M()&&J().onLoadingSlow(A,n)},n.loadingTimeout),C[A]=[Fe(T),op()]),[ft,at]=C[A],ft=await ft,Nt&&setTimeout(K,n.dedupingInterval),!C[A]||C[A][1]!==at)return Nt&&M()&&J().onDiscarded(A),!1;_e.error=xn;const ge=N[A];if(!Je(ge)&&(at<=ge[0]||at<=ge[1]||ge[1]===0))return Lt(),Nt&&M()&&J().onDiscarded(A),!1;const Ee=le().data;_e.data=s(Ee,ft)?Ee:ft,Nt&&M()&&J().onSuccess(ft,A,n)}catch(ge){K();const Ee=J(),{shouldRetryOnError:qe}=Ee;Ee.isPaused()||(_e.error=ge,Nt&&M()&&(Ee.onError(ge,A,Ee),(qe===!0||Dr(qe)&&qe(ge))&&(!J().revalidateOnFocus||!J().revalidateOnReconnect||ue())&&Ee.onErrorRetry(ge,A,Ee,kn=>{const In=S[A];In&&In[0]&&In[0](I0,kn)},{retryCount:(En.retryCount||0)+1,dedupe:!0})))}return Bt=!1,Lt(),!0},[A,a]),rt=z.useCallback((...$e)=>MS(a,D.current,...$e),[]);if(tm(()=>{Z.current=t,R.current=n,Je(F)||(he.current=F)}),tm(()=>{if(!A)return;const $e=Se.bind(xn,im);let Fe=0;J().revalidateOnFocus&&(Fe=Date.now()+J().focusThrottleInterval);const at=I4(A,S,(Bt,En={})=>{if(Bt==TS){const Nt=Date.now();J().revalidateOnFocus&&Nt>Fe&&ue()&&(Fe=Nt+J().focusThrottleInterval,$e())}else if(Bt==ES)J().revalidateOnReconnect&&ue()&&$e();else{if(Bt==AS)return Se();if(Bt==I0)return Se(En)}});return U.current=!1,D.current=A,L.current=!0,re({_k:T}),Te&&(C[A]||(Je(w)||Is?$e():_4($e))),()=>{U.current=!0,at()}},[A]),tm(()=>{let $e;function Fe(){const at=Dr(m)?m(le().data):m;at&&$e!==-1&&($e=setTimeout(ft,at))}function ft(){!le().error&&(g||J().isVisible())&&(y||J().isOnline())?Se(im).then(Fe):Fe()}return Fe(),()=>{$e&&(clearTimeout($e),$e=-1)}},[m,g,y,A]),z.useDebugValue(me),u){if(!F0&&Is&&fe)throw new Error("Fallback data is required when using Suspense in SSR.");fe&&(Z.current=t,R.current=n,U.current=!1);const $e=E[A],Fe=!Je($e)&&fe?rt($e):Y0;if(am(Fe),!Je(G)&&fe)throw G;const ft=fe?Se(im):Y0;!Je(me)&&fe&&(ft.status="fulfilled",ft.value=!0),am(ft)}return{mutate:rt,get data(){return se.data=!0,me},get error(){return se.error=!0,G},get isValidating(){return se.isValidating=!0,Ae},get isLoading(){return se.isLoading=!0,Oe}}},xt=Z4(H4),F4="x-architect-pass",zs="/api";class Fa{static instance;constructor(){}static getInstance(){return Fa.instance||(Fa.instance=new Fa),Fa.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[F4]=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(`${zs}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${zs}${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(`${zs}${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(`${zs}${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(`${zs}${t}`,{method:"DELETE",headers:this.getHeaders()});return this.handleResponse(n)}async uploadFile(t,n,a="file"){const s=new FormData;s.append(a,n);const u=await fetch(`${zs}${t}`,{method:"POST",headers:this.getHeaders(),body:s});return this.handleResponse(u)}}const pe=Fa.getInstance(),Al="/api",dg=e=>{const t=e.startsWith(Al)?e.substring(Al.length):e;return pe.get(t)};function LS(){return xt(`${Al}/status`,dg,{refreshInterval:5e3})}function q4(){return xt(`${Al}/logs`,dg)}function G4(e){return xt(e?`${Al}/logs/${e}?limit=1000`:null,dg,{refreshInterval:2e3})}function PS(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 Y4(){const{data:e}=LS();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?PS(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 fg=z.createContext({});function hg(e){const t=z.useRef(null);return t.current===null&&(t.current=e()),t.current}const US=typeof window<"u",VS=US?z.useLayoutEffect:z.useEffect,pd=z.createContext(null);function mg(e,t){e.indexOf(t)===-1&&e.push(t)}function pg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Pr=(e,t,n)=>n>t?t:n<e?e:n;let gg=()=>{};const fa={},BS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ZS(e){return typeof e=="object"&&e!==null}const IS=e=>/^0[^.\s]+$/u.test(e);function xg(e){let t;return()=>(t===void 0&&(t=e()),t)}const mr=e=>e,K4=(e,t)=>n=>t(e(n)),ql=(...e)=>e.reduce(K4),Ol=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class yg{constructor(){this.subscriptions=[]}add(t){return mg(this.subscriptions,t),()=>pg(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 ca=e=>e*1e3,hr=e=>e/1e3;function HS(e,t){return t?e*(1e3/t):0}const FS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,X4=1e-7,J4=12;function Q4(e,t,n,a,s){let u,l,f=0;do l=t+(n-t)/2,u=FS(l,a,s)-e,u>0?n=l:t=l;while(Math.abs(u)>X4&&++f<J4);return l}function Gl(e,t,n,a){if(e===t&&n===a)return mr;const s=u=>Q4(u,0,1,e,n);return u=>u===0||u===1?u:FS(s(u),t,a)}const qS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,GS=e=>t=>1-e(1-t),YS=Gl(.33,1.53,.69,.99),bg=GS(YS),KS=qS(bg),XS=e=>(e*=2)<1?.5*bg(e):.5*(2-Math.pow(2,-10*(e-1))),vg=e=>1-Math.sin(Math.acos(e)),JS=GS(vg),QS=qS(vg),W4=Gl(.42,0,1,1),e3=Gl(0,0,.58,1),WS=Gl(.42,0,.58,1),t3=e=>Array.isArray(e)&&typeof e[0]!="number",ez=e=>Array.isArray(e)&&typeof e[0]=="number",n3={linear:mr,easeIn:W4,easeInOut:WS,easeOut:e3,circIn:vg,circInOut:QS,circOut:JS,backIn:bg,backInOut:KS,backOut:YS,anticipate:XS},r3=e=>typeof e=="string",K0=e=>{if(ez(e)){gg(e.length===4);const[t,n,a,s]=e;return Gl(t,n,a,s)}else if(r3(e))return n3[e];return e},yc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function a3(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,b=!1)=>{const S=b&&s?n:a;return y&&l.add(g),S.has(g)||S.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(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 i3=40;function tz(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,l=yc.reduce((T,L)=>(T[L]=a3(u),T),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:g,update:y,preRender:b,render:v,postRender:S}=l,N=()=>{const T=fa.useManualTiming?s.timestamp:performance.now();n=!1,fa.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(T-s.timestamp,i3),1)),s.timestamp=T,s.isProcessing=!0,f.process(s),h.process(s),m.process(s),g.process(s),y.process(s),b.process(s),v.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(N))},C=()=>{n=!0,a=!0,s.isProcessing||e(N)};return{schedule:yc.reduce((T,L)=>{const U=l[L];return T[L]=(D,Z=!1,R=!1)=>(n||C(),U.schedule(D,Z,R)),T},{}),cancel:T=>{for(let L=0;L<yc.length;L++)l[yc[L]].cancel(T)},state:s,steps:l}}const{schedule:wt,cancel:Ka,state:dn,steps:sm}=tz(typeof requestAnimationFrame<"u"?requestAnimationFrame:mr,!0);let Pc;function s3(){Pc=void 0}const Nn={now:()=>(Pc===void 0&&Nn.set(dn.isProcessing||fa.useManualTiming?dn.timestamp:performance.now()),Pc),set:e=>{Pc=e,queueMicrotask(s3)}},nz=e=>t=>typeof t=="string"&&t.startsWith(e),rz=nz("--"),o3=nz("var(--"),kg=e=>o3(e)?l3.test(e.split("/*")[0].trim()):!1,l3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function X0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ao={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Rl={...ao,transform:e=>Pr(0,1,e)},bc={...ao,default:1},vl=e=>Math.round(e*1e5)/1e5,wg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function u3(e){return e==null}const c3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Sg=(e,t)=>n=>!!(typeof n=="string"&&c3.test(n)&&n.startsWith(e)||t&&!u3(n)&&Object.prototype.hasOwnProperty.call(n,t)),az=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,u,l,f]=a.match(wg);return{[e]:parseFloat(s),[t]:parseFloat(u),[n]:parseFloat(l),alpha:f!==void 0?parseFloat(f):1}},d3=e=>Pr(0,255,e),om={...ao,transform:e=>Math.round(d3(e))},Ei={test:Sg("rgb","red"),parse:az("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+om.transform(e)+", "+om.transform(t)+", "+om.transform(n)+", "+vl(Rl.transform(a))+")"};function f3(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 lp={test:Sg("#"),parse:f3,transform:Ei.transform},Yl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Za=Yl("deg"),Lr=Yl("%"),we=Yl("px"),h3=Yl("vh"),m3=Yl("vw"),J0={...Lr,parse:e=>Lr.parse(e)/100,transform:e=>Lr.transform(e*100)},Ds={test:Sg("hsl","hue"),parse:az("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Lr.transform(vl(t))+", "+Lr.transform(vl(n))+", "+vl(Rl.transform(a))+")"},Gt={test:e=>Ei.test(e)||lp.test(e)||Ds.test(e),parse:e=>Ei.test(e)?Ei.parse(e):Ds.test(e)?Ds.parse(e):lp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ei.transform(e):Ds.transform(e),getAnimatableNone:e=>{const t=Gt.parse(e);return t.alpha=0,Gt.transform(t)}},p3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function g3(e){return isNaN(e)&&typeof e=="string"&&(e.match(wg)?.length||0)+(e.match(p3)?.length||0)>0}const iz="number",sz="color",x3="var",y3="var(",Q0="${}",b3=/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 Ml(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let u=0;const f=t.replace(b3,h=>(Gt.test(h)?(a.color.push(u),s.push(sz),n.push(Gt.parse(h))):h.startsWith(y3)?(a.var.push(u),s.push(x3),n.push(h)):(a.number.push(u),s.push(iz),n.push(parseFloat(h))),++u,Q0)).split(Q0);return{values:n,split:f,indexes:a,types:s}}function oz(e){return Ml(e).values}function lz(e){const{split:t,types:n}=Ml(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===iz?u+=vl(s[l]):f===sz?u+=Gt.transform(s[l]):u+=s[l]}return u}}const v3=e=>typeof e=="number"?0:Gt.test(e)?Gt.getAnimatableNone(e):e;function k3(e){const t=oz(e);return lz(e)(t.map(v3))}const Xa={test:g3,parse:oz,createTransformer:lz,getAnimatableNone:k3};function lm(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 w3({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=lm(h,f,e+1/3),u=lm(h,f,e),l=lm(h,f,e-1/3)}return{red:Math.round(s*255),green:Math.round(u*255),blue:Math.round(l*255),alpha:a}}function Gc(e,t){return n=>n>0?t:e}const Ct=(e,t,n)=>e+(t-e)*n,um=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},S3=[lp,Ei,Ds],z3=e=>S3.find(t=>t.test(e));function W0(e){const t=z3(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=w3(n)),n}const e1=(e,t)=>{const n=W0(e),a=W0(t);if(!n||!a)return Gc(e,t);const s={...n};return u=>(s.red=um(n.red,a.red,u),s.green=um(n.green,a.green,u),s.blue=um(n.blue,a.blue,u),s.alpha=Ct(n.alpha,a.alpha,u),Ei.transform(s))},up=new Set(["none","hidden"]);function _3(e,t){return up.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function j3(e,t){return n=>Ct(e,t,n)}function zg(e){return typeof e=="number"?j3:typeof e=="string"?kg(e)?Gc:Gt.test(e)?e1:T3:Array.isArray(e)?uz:typeof e=="object"?Gt.test(e)?e1:N3:Gc}function uz(e,t){const n=[...e],a=n.length,s=e.map((u,l)=>zg(u)(u,t[l]));return u=>{for(let l=0;l<a;l++)n[l]=s[l](u);return n}}function N3(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=zg(e[s])(e[s],t[s]));return s=>{for(const u in a)n[u]=a[u](s);return n}}function C3(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 T3=(e,t)=>{const n=Xa.createTransformer(t),a=Ml(e),s=Ml(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?up.has(e)&&!s.values.length||up.has(t)&&!a.values.length?_3(e,t):ql(uz(C3(a,s),s.values),n):Gc(e,t)};function cz(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ct(e,t,n):zg(e)(e,t)}const E3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>wt.update(t,n),stop:()=>Ka(t),now:()=>dn.isProcessing?dn.timestamp:Nn.now()}},dz=(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)})`},Yc=2e4;function _g(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<Yc;)t+=n,a=e.next(t);return t>=Yc?1/0:t}function A3(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(_g(a),Yc);return{type:"keyframes",ease:u=>a.next(s*u).value/t,duration:hr(s)}}const O3=5;function fz(e,t,n){const a=Math.max(t-O3,0);return HS(n-e(a),t-a)}const $t={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},cm=.001;function R3({duration:e=$t.duration,bounce:t=$t.bounce,velocity:n=$t.velocity,mass:a=$t.mass}){let s,u,l=1-t;l=Pr($t.minDamping,$t.maxDamping,l),e=Pr($t.minDuration,$t.maxDuration,hr(e)),l<1?(s=m=>{const g=m*l,y=g*e,b=g-n,v=cp(m,l),S=Math.exp(-y);return cm-b/v*S},u=m=>{const y=m*l*e,b=y*n+n,v=Math.pow(l,2)*Math.pow(m,2)*e,S=Math.exp(-y),N=cp(Math.pow(m,2),l);return(-s(m)+cm>0?-1:1)*((b-v)*S)/N}):(s=m=>{const g=Math.exp(-m*e),y=(m-n)*e+1;return-cm+g*y},u=m=>{const g=Math.exp(-m*e),y=(n-m)*(e*e);return g*y});const f=5/e,h=D3(s,u,f);if(e=ca(e),isNaN(h))return{stiffness:$t.stiffness,damping:$t.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const M3=12;function D3(e,t,n){let a=n;for(let s=1;s<M3;s++)a=a-e(a)/t(a);return a}function cp(e,t){return e*Math.sqrt(1-t*t)}const $3=["duration","bounce"],L3=["stiffness","damping","mass"];function t1(e,t){return t.some(n=>e[n]!==void 0)}function P3(e){let t={velocity:$t.velocity,stiffness:$t.stiffness,damping:$t.damping,mass:$t.mass,isResolvedFromDuration:!1,...e};if(!t1(e,L3)&&t1(e,$3))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,u=2*Pr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:$t.mass,stiffness:s,damping:u}}else{const n=R3(e);t={...t,...n,mass:$t.mass},t.isResolvedFromDuration=!0}return t}function Kc(e=$t.visualDuration,t=$t.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:b,isResolvedFromDuration:v}=P3({...n,velocity:-hr(n.velocity||0)}),S=b||0,N=m/(2*Math.sqrt(h*g)),C=l-u,E=hr(Math.sqrt(h/g)),A=Math.abs(C)<5;a||(a=A?$t.restSpeed.granular:$t.restSpeed.default),s||(s=A?$t.restDelta.granular:$t.restDelta.default);let T;if(N<1){const U=cp(E,N);T=D=>{const Z=Math.exp(-N*E*D);return l-Z*((S+N*E*C)/U*Math.sin(U*D)+C*Math.cos(U*D))}}else if(N===1)T=U=>l-Math.exp(-E*U)*(C+(S+E*C)*U);else{const U=E*Math.sqrt(N*N-1);T=D=>{const Z=Math.exp(-N*E*D),R=Math.min(U*D,300);return l-Z*((S+N*E*C)*Math.sinh(R)+U*C*Math.cosh(R))/U}}const L={calculatedDuration:v&&y||null,next:U=>{const D=T(U);if(v)f.done=U>=y;else{let Z=U===0?S:0;N<1&&(Z=U===0?ca(S):fz(T,U,D));const R=Math.abs(Z)<=a,J=Math.abs(l-D)<=s;f.done=R&&J}return f.value=f.done?l:D,f},toString:()=>{const U=Math.min(_g(L),Yc),D=dz(Z=>L.next(U*Z).value,U,30);return U+"ms "+D},toTransition:()=>{}};return L}Kc.applyToOptions=e=>{const t=A3(e,100,Kc);return e.ease=t.ease,e.duration=ca(t.duration),e.type="keyframes",e};function dp({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],b={done:!1,value:y},v=R=>f!==void 0&&R<f||h!==void 0&&R>h,S=R=>f===void 0?h:h===void 0||Math.abs(f-R)<Math.abs(h-R)?f:h;let N=n*t;const C=y+N,E=l===void 0?C:l(C);E!==C&&(N=E-y);const A=R=>-N*Math.exp(-R/a),T=R=>E+A(R),L=R=>{const J=A(R),ue=T(R);b.done=Math.abs(J)<=m,b.value=b.done?E:ue};let U,D;const Z=R=>{v(b.value)&&(U=R,D=Kc({keyframes:[b.value,S(b.value)],velocity:fz(T,R,b.value),damping:s,stiffness:u,restDelta:m,restSpeed:g}))};return Z(0),{calculatedDuration:null,next:R=>{let J=!1;return!D&&U===void 0&&(J=!0,L(R),Z(R)),U!==void 0&&R>=U?D.next(R-U):(!J&&L(R),b)}}}function U3(e,t,n){const a=[],s=n||fa.mix||cz,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]||mr:t;f=ql(h,f)}a.push(f)}return a}function V3(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const u=e.length;if(gg(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=U3(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 b=Ol(e[y],e[y+1],g);return f[y](b)};return n?g=>m(Pr(e[0],e[u-1],g)):m}function B3(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Ol(0,t,a);e.push(Ct(n,1,s))}}function Z3(e){const t=[0];return B3(t,e.length-1),t}function I3(e,t){return e.map(n=>n*t)}function H3(e,t){return e.map(()=>t||WS).splice(0,e.length-1)}function kl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=t3(a)?a.map(K0):K0(a),u={done:!1,value:t[0]},l=I3(n&&n.length===t.length?n:Z3(t),e),f=V3(l,t,{ease:Array.isArray(s)?s:H3(t,s)});return{calculatedDuration:e,next:h=>(u.value=f(h),u.done=h>=e,u)}}const F3=e=>e!==null;function jg(e,{repeat:t,repeatType:n="loop"},a,s=1){const u=e.filter(F3),f=s<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!f||a===void 0?u[f]:a}const q3={decay:dp,inertia:dp,tween:kl,keyframes:kl,spring:Kc};function hz(e){typeof e.type=="string"&&(e.type=q3[e.type])}class Ng{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 G3=e=>e/100;class Cg extends Ng{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!==Nn.now()&&this.tick(Nn.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;hz(t);const{type:n=kl,repeat:a=0,repeatDelay:s=0,repeatType:u,velocity:l=0}=t;let{keyframes:f}=t;const h=n||kl;h!==kl&&typeof f[0]!="number"&&(this.mixKeyframes=ql(G3,cz(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=_g(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:b,repeatDelay:v,type:S,onUpdate:N,finalKeyframe:C}=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),A=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,L=a;if(y){const R=Math.min(this.currentTime,s)/f;let J=Math.floor(R),ue=R%1;!ue&&R>=1&&(ue=1),ue===1&&J--,J=Math.min(J,y+1),J%2&&(b==="reverse"?(ue=1-ue,v&&(ue-=v/f)):b==="mirror"&&(L=l)),T=Pr(0,1,ue)*f}const U=A?{done:!1,value:g[0]}:L.next(T);u&&(U.value=u(U.value));let{done:D}=U;!A&&h!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const Z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return Z&&S!==dp&&(U.value=jg(g,this.options,C,this.speed)),N&&N(U.value),Z&&this.finish(),U}then(t,n){return this.finished.then(t,n)}get duration(){return hr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hr(t)}get time(){return hr(this.currentTime)}set time(t){t=ca(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(Nn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=hr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=E3,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(Nn.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 Y3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ai=e=>e*180/Math.PI,fp=e=>{const t=Ai(Math.atan2(e[1],e[0]));return hp(t)},K3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fp,rotateZ:fp,skewX:e=>Ai(Math.atan(e[1])),skewY:e=>Ai(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},hp=e=>(e=e%360,e<0&&(e+=360),e),n1=fp,r1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),a1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),X3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:r1,scaleY:a1,scale:e=>(r1(e)+a1(e))/2,rotateX:e=>hp(Ai(Math.atan2(e[6],e[5]))),rotateY:e=>hp(Ai(Math.atan2(-e[2],e[0]))),rotateZ:n1,rotate:n1,skewX:e=>Ai(Math.atan(e[4])),skewY:e=>Ai(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function mp(e){return e.includes("scale")?1:0}function pp(e,t){if(!e||e==="none")return mp(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=X3,s=n;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=K3,s=f}if(!s)return mp(t);const u=a[t],l=s[1].split(",").map(Q3);return typeof u=="function"?u(l):l[u]}const J3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return pp(n,t)};function Q3(e){return parseFloat(e.trim())}const io=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],so=new Set(io),i1=e=>e===ao||e===we,W3=new Set(["x","y","z"]),eO=io.filter(e=>!W3.has(e));function tO(e){const t=[];return eO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const qa={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})=>pp(t,"x"),y:(e,{transform:t})=>pp(t,"y")};qa.translateX=qa.x;qa.translateY=qa.y;const Oi=new Set;let gp=!1,xp=!1,yp=!1;function mz(){if(xp){const e=Array.from(Oi).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=tO(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)})}xp=!1,gp=!1,Oi.forEach(e=>e.complete(yp)),Oi.clear()}function pz(){Oi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xp=!0)})}function nO(){yp=!0,pz(),mz(),yp=!1}class Tg{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?(Oi.add(this),gp||(gp=!0,wt.read(pz),wt.resolveKeyframes(mz))):(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])}Y3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Oi.delete(this)}cancel(){this.state==="scheduled"&&(Oi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rO=e=>e.startsWith("--");function aO(e,t,n){rO(t)?e.style.setProperty(t,n):e.style[t]=n}const iO=xg(()=>window.ScrollTimeline!==void 0),sO={};function oO(e,t){const n=xg(e);return()=>sO[t]??n()}const gz=oO(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),gl=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,s1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gl([0,.65,.55,1]),circOut:gl([.55,0,1,.45]),backIn:gl([.31,.01,.66,-.59]),backOut:gl([.33,1.53,.69,.99])};function xz(e,t){if(e)return typeof e=="function"?gz()?dz(e,t):"ease-out":ez(e)?gl(e):Array.isArray(e)?e.map(n=>xz(n,t)||s1.easeOut):s1[e]}function lO(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=xz(f,s);Array.isArray(y)&&(g.easing=y);const b={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(g,b)}function yz(e){return typeof e=="function"&&"applyToOptions"in e}function uO({type:e,...t}){return yz(e)&&gz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class cO extends Ng{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,gg(typeof t.type!="string");const m=uO(t);this.animation=lO(n,a,s,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=jg(s,this.options,f,this.speed);this.updateMotionValue?this.updateMotionValue(g):aO(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 hr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hr(t)}get time(){return hr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ca(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&&iO()?(this.animation.timeline=t,mr):n(this)}}const bz={anticipate:XS,backInOut:KS,circInOut:QS};function dO(e){return e in bz}function fO(e){typeof e.ease=="string"&&dO(e.ease)&&(e.ease=bz[e.ease])}const dm=10;class hO extends cO{constructor(t){fO(t),hz(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 Cg({...l,autoplay:!1}),h=Math.max(dm,Nn.now()-this.startTime),m=Pr(0,dm,h-dm);n.setWithVelocity(f.sample(Math.max(0,h-m)).value,f.sample(h).value,m),f.stop()}}const o1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Xa.test(e)||e==="0")&&!e.startsWith("url("));function mO(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 pO(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=o1(s,t),f=o1(u,t);return!l||!f?!1:mO(e)||(n==="spring"||yz(n))&&a}function bp(e){e.duration=0,e.type="keyframes"}const gO=new Set(["opacity","clipPath","filter","transform"]),xO=xg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function yO(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 xO()&&n&&gO.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&u!==0&&l!=="inertia"}const bO=40;class vO extends Ng{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=Nn.now();const b={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...y},v=g?.KeyframeResolver||Tg;this.keyframeResolver=new v(f,(S,N,C)=>this.onKeyframesResolved(S,N,b,!C),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=Nn.now(),pO(t,u,l,f)||((fa.instantAnimations||!h)&&g?.(jg(t,a,n)),t[0]=t[t.length-1],bp(a),a.repeat=0);const b={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>bO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&yO(b),S=b.motionValue?.owner?.current,N=v?new hO({...b,element:S}):new Cg(b);N.finished.then(()=>{this.notifyFinished()}).catch(mr),this.pendingTimeline&&(this.stopTimeline=N.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=N}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(),nO()),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 vz(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 kO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wO(e){const t=kO.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function kz(e,t,n=1){const[a,s]=wO(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const l=u.trim();return BS(l)?parseFloat(l):l}return kg(s)?kz(s,t,n+1):s}const SO={type:"spring",stiffness:500,damping:25,restSpeed:10},zO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_O={type:"keyframes",duration:.8},jO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},NO=(e,{keyframes:t})=>t.length>2?_O:so.has(e)?e.startsWith("scale")?zO(t[1]):SO:jO,CO=e=>e!==null;function TO(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(CO),u=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[u]}function Eg(e,t){return e?.[t]??e?.default??e}function EO({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 Ag=(e,t,n,a={},s,u)=>l=>{const f=Eg(a,e)||{},h=f.delay||a.delay||0;let{elapsed:m=0}=a;m=m-ca(h);const g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:b=>{t.set(b),f.onUpdate&&f.onUpdate(b)},onComplete:()=>{l(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:u?void 0:s};EO(f)||Object.assign(g,NO(e,g)),g.duration&&(g.duration=ca(g.duration)),g.repeatDelay&&(g.repeatDelay=ca(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(bp(g),g.delay===0&&(y=!0)),(fa.instantAnimations||fa.skipAnimations)&&(y=!0,bp(g),g.delay=0),g.allowFlatten=!f.type&&!f.ease,y&&!u&&t.get()!==void 0){const b=TO(g.keyframes,f);if(b!==void 0){wt.update(()=>{g.onUpdate(b),g.onComplete()});return}}return f.isSync?new Cg(g):new vO(g)};function l1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Og(e,t,n,a){if(typeof t=="function"){const[s,u]=l1(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]=l1(a);t=t(n!==void 0?n:e.custom,s,u)}return t}function Hs(e,t,n){const a=e.getProps();return Og(a,t,n!==void 0?n:a.custom,e)}const wz=new Set(["width","height","top","left","right","bottom",...io]),u1=30,AO=e=>!isNaN(parseFloat(e));class OO{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=Nn.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=Nn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=AO(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 yg);const a=this.events[t].add(n);return t==="change"?()=>{a(),wt.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=Nn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>u1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,u1);return HS(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 Xs(e,t){return new OO(e,t)}const vp=e=>Array.isArray(e);function RO(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xs(n))}function MO(e){return vp(e)?e[e.length-1]||0:e}function DO(e,t){const n=Hs(e,t);let{transitionEnd:a={},transition:s={},...u}=n||{};u={...u,...a};for(const l in u){const f=MO(u[l]);RO(e,l,f)}}const bn=e=>!!(e&&e.getVelocity);function $O(e){return!!(bn(e)&&e.add)}function kp(e,t){const n=e.getValue("willChange");if($O(n))return n.add(t);if(!n&&fa.WillChange){const a=new fa.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Rg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const LO="framerAppearId",Sz="data-"+Rg(LO);function zz(e){return e.props[Sz]}function PO({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function _z(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 b=e.getValue(y,e.latestValues[y]??null),v=f[y];if(v===void 0||g&&PO(g,y))continue;const S={delay:n,...Eg(u||{},y)},N=b.get();if(N!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===N&&!S.velocity)continue;let C=!1;if(window.MotionHandoffAnimation){const T=zz(e);if(T){const L=window.MotionHandoffAnimation(T,y,wt);L!==null&&(S.startTime=L,C=!0)}}kp(e,y);const E=h??e.shouldReduceMotion;b.start(Ag(y,b,v,E&&wz.has(y)?{type:!1}:S,e,C));const A=b.animation;A&&m.push(A)}return l&&Promise.all(m).then(()=>{wt.update(()=>{l&&DO(e,l)})}),m}function wp(e,t,n={}){const a=Hs(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(_z(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:y}=s;return UO(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 UO(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(wp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+vz(e.variantChildren,h,a,s,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function VO(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(u=>wp(e,u,n));a=Promise.all(s)}else if(typeof t=="string")a=wp(e,t,n);else{const s=typeof t=="function"?Hs(e,t,n.custom):t;a=Promise.all(_z(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const BO={test:e=>e==="auto",parse:e=>e},jz=e=>t=>t.test(e),Nz=[ao,we,Lr,Za,m3,h3,BO],c1=e=>Nz.find(jz(e));function ZO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||IS(e):!0}const IO=new Set(["brightness","contrast","saturate","opacity"]);function HO(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(wg)||[];if(!a)return e;const s=n.replace(a,"");let u=IO.has(t)?1:0;return a!==n&&(u*=100),t+"("+u+s+")"}const FO=/\b([a-z-]*)\(.*?\)/gu,Sp={...Xa,getAnimatableNone:e=>{const t=e.match(FO);return t?t.map(HO).join(" "):e}},d1={...ao,transform:Math.round},qO={rotate:Za,rotateX:Za,rotateY:Za,rotateZ:Za,scale:bc,scaleX:bc,scaleY:bc,scaleZ:bc,skew:Za,skewX:Za,skewY:Za,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Rl,originX:J0,originY:J0,originZ:we},Mg={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,inset:we,insetBlock:we,insetBlockStart:we,insetBlockEnd:we,insetInline:we,insetInlineStart:we,insetInlineEnd:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,paddingBlock:we,paddingBlockStart:we,paddingBlockEnd:we,paddingInline:we,paddingInlineStart:we,paddingInlineEnd:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,marginBlock:we,marginBlockStart:we,marginBlockEnd:we,marginInline:we,marginInlineStart:we,marginInlineEnd:we,fontSize:we,backgroundPositionX:we,backgroundPositionY:we,...qO,zIndex:d1,fillOpacity:Rl,strokeOpacity:Rl,numOctaves:d1},GO={...Mg,color:Gt,backgroundColor:Gt,outlineColor:Gt,fill:Gt,stroke:Gt,borderColor:Gt,borderTopColor:Gt,borderRightColor:Gt,borderBottomColor:Gt,borderLeftColor:Gt,filter:Sp,WebkitFilter:Sp},Cz=e=>GO[e];function Tz(e,t){let n=Cz(e);return n!==Sp&&(n=Xa),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const YO=new Set(["auto","none","0"]);function KO(e,t,n){let a=0,s;for(;a<e.length&&!s;){const u=e[a];typeof u=="string"&&!YO.has(u)&&Ml(u).values.length&&(s=e[a]),a++}if(s&&n)for(const u of t)e[u]=Tz(n,s)}class XO extends Tg{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(),kg(y))){const b=kz(y,n.current);b!==void 0&&(t[g]=b),g===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!wz.has(a)||t.length!==2)return;const[s,u]=t,l=c1(s),f=c1(u),h=X0(s),m=X0(u);if(h!==m&&qa[a]){this.needsMeasurement=!0;return}if(l!==f)if(i1(l)&&i1(f))for(let g=0;g<t.length;g++){const y=t[g];typeof y=="string"&&(t[g]=parseFloat(y))}else qa[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||ZO(t[s]))&&a.push(s);a.length&&KO(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=qa[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]=qa[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 JO(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 Ez=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function zp(e){return ZS(e)&&"offsetHeight"in e}const{schedule:Dg}=tz(queueMicrotask,!1),Nr={x:!1,y:!1};function Az(){return Nr.x||Nr.y}function QO(e){return e==="x"||e==="y"?Nr[e]?null:(Nr[e]=!0,()=>{Nr[e]=!1}):Nr.x||Nr.y?null:(Nr.x=Nr.y=!0,()=>{Nr.x=Nr.y=!1})}function Oz(e,t){const n=JO(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function f1(e){return!(e.pointerType==="touch"||Az())}function WO(e,t,n={}){const[a,s,u]=Oz(e,n),l=f=>{if(!f1(f))return;const{target:h}=f,m=t(h,f);if(typeof m!="function"||!h)return;const g=y=>{f1(y)&&(m(y),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,s)};return a.forEach(f=>{f.addEventListener("pointerenter",l,s)}),u}const Rz=(e,t)=>t?e===t?!0:Rz(e,t.parentElement):!1,$g=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,eR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Mz(e){return eR.has(e.tagName)||e.isContentEditable===!0}const Uc=new WeakSet;function h1(e){return t=>{t.key==="Enter"&&e(t)}}function fm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const tR=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=h1(()=>{if(Uc.has(n))return;fm(n,"down");const s=h1(()=>{fm(n,"up")}),u=()=>fm(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 m1(e){return $g(e)&&!Az()}function nR(e,t,n={}){const[a,s,u]=Oz(e,n),l=f=>{const h=f.currentTarget;if(!m1(f))return;Uc.add(h);const m=t(h,f),g=(v,S)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),Uc.has(h)&&Uc.delete(h),m1(v)&&typeof m=="function"&&m(v,{success:S})},y=v=>{g(v,h===window||h===document||n.useGlobalTarget||Rz(h,v.target))},b=v=>{g(v,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",b,s)};return a.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",l,s),zp(f)&&(f.addEventListener("focus",m=>tR(m,s)),!Mz(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function Dz(e){return ZS(e)&&"ownerSVGElement"in e}function rR(e){return Dz(e)&&e.tagName==="svg"}const aR=[...Nz,Gt,Xa],iR=e=>aR.find(jz(e)),p1=()=>({translate:0,scale:1,origin:0,originPoint:0}),$s=()=>({x:p1(),y:p1()}),g1=()=>({min:0,max:0}),en=()=>({x:g1(),y:g1()}),_p={current:null},$z={current:!1},sR=typeof window<"u";function oR(){if($z.current=!0,!!sR)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_p.current=e.matches;e.addEventListener("change",t),t()}else _p.current=!1}const lR=new WeakMap;function gd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Dl(e){return typeof e=="string"||Array.isArray(e)}const Lg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pg=["initial",...Lg];function xd(e){return gd(e.animate)||Pg.some(t=>Dl(e[t]))}function Lz(e){return!!(xd(e)||e.variants)}function uR(e,t,n){for(const a in t){const s=t[a],u=n[a];if(bn(s))e.addValue(a,s);else if(bn(u))e.addValue(a,Xs(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,Xs(l!==void 0?l:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const x1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xc={};function Pz(e){Xc=e}function cR(){return Xc}class dR{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=Tg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=Nn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,wt.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=xd(n),this.isVariantNode=Lz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in y){const v=y[b];h[b]!==void 0&&bn(v)&&v.set(h[b])}}mount(t){this.current=t,lR.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:($z.current||oR(),this.shouldReduceMotion=_p.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ka(this.notifyUpdate),Ka(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=so.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.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 Xc){const n=Xc[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):en()}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<x1.length;a++){const s=x1[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=uR(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=Xs(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"&&(BS(a)||IS(a))?a=parseFloat(a):!iR(a)&&Xa.test(n)&&(a=Tz(t,n)),this.setBaseTarget(t,bn(a)?a.get():a)),bn(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=Og(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&&!bn(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 yg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Dg.render(this.render)}}class Uz extends dR{constructor(){super(...arguments),this.KeyframeResolver=XO}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;bn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ei{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Vz({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function fR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hR(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 hm(e){return e===void 0||e===1}function jp({scale:e,scaleX:t,scaleY:n}){return!hm(e)||!hm(t)||!hm(n)}function Ci(e){return jp(e)||Bz(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Bz(e){return y1(e.x)||y1(e.y)}function y1(e){return e&&e!=="0%"}function Jc(e,t,n){const a=e-n,s=t*a;return n+s}function b1(e,t,n,a,s){return s!==void 0&&(e=Jc(e,s,a)),Jc(e,n,a)+t}function Np(e,t=0,n=1,a,s){e.min=b1(e.min,t,n,a,s),e.max=b1(e.max,t,n,a,s)}function Zz(e,{x:t,y:n}){Np(e.x,t.translate,t.scale,t.originPoint),Np(e.y,n.translate,n.scale,n.originPoint)}const v1=.999999999999,k1=1.0000000000001;function mR(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&&Ps(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Zz(e,l)),a&&Ci(u.latestValues)&&Ps(e,u.latestValues))}t.x<k1&&t.x>v1&&(t.x=1),t.y<k1&&t.y>v1&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function w1(e,t,n,a,s=.5){const u=Ct(e.min,e.max,s);Np(e,t,n,u,a)}function Ps(e,t){w1(e.x,t.x,t.scaleX,t.scale,t.originX),w1(e.y,t.y,t.scaleY,t.scale,t.originY)}function Iz(e,t){return Vz(hR(e.getBoundingClientRect(),t))}function pR(e,t,n){const a=Iz(e,n),{scroll:s}=t;return s&&(Ls(a.x,s.offset.x),Ls(a.y,s.offset.y)),a}const gR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xR=io.length;function yR(e,t,n){let a="",s=!0;for(let u=0;u<xR;u++){const l=io[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=Ez(f,Mg[l]);if(!h){s=!1;const g=gR[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function Ug(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(so.has(h)){l=!0;continue}else if(rz(h)){s[h]=m;continue}else{const g=Ez(m,Mg[h]);h.startsWith("origin")?(f=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=yR(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 Hz(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 S1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ul={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const n=S1(e,t.target.x),a=S1(e,t.target.y);return`${n}% ${a}%`}},bR={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=Xa.parse(e);if(s.length>5)return a;const u=Xa.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=Ct(f,h,.5);return typeof s[2+l]=="number"&&(s[2+l]/=m),typeof s[3+l]=="number"&&(s[3+l]/=m),u(s)}},Cp={borderRadius:{...ul,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ul,borderTopRightRadius:ul,borderBottomLeftRadius:ul,borderBottomRightRadius:ul,boxShadow:bR};function Fz(e,{layout:t,layoutId:n}){return so.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cp[e]||e==="opacity")}function Vg(e,t,n){const a=e.style,s=t?.style,u={};if(!a)return u;for(const l in a)(bn(a[l])||s&&bn(s[l])||Fz(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(u[l]=a[l]);return u}function vR(e){return window.getComputedStyle(e)}class kR extends Uz{constructor(){super(...arguments),this.type="html",this.renderInstance=Hz}readValueFromInstance(t,n){if(so.has(n))return this.projection?.isProjecting?mp(n):J3(t,n);{const a=vR(t),s=(rz(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Iz(t,n)}build(t,n,a){Ug(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Vg(t,n,a)}}const wR={offset:"stroke-dashoffset",array:"stroke-dasharray"},SR={offset:"strokeDashoffset",array:"strokeDasharray"};function zR(e,t,n=1,a=0,s=!0){e.pathLength=1;const u=s?wR:SR;e[u.offset]=`${-a}`,e[u.array]=`${t} ${n}`}const _R=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qz(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:u=1,pathOffset:l=0,...f},h,m,g){if(Ug(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:b}=e;y.transform&&(b.transform=y.transform,delete y.transform),(b.transform||y.transformOrigin)&&(b.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),b.transform&&(b.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const v of _R)y[v]!==void 0&&(b[v]=y[v],delete y[v]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),s!==void 0&&zR(y,s,u,l,!1)}const Gz=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"]),Yz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function jR(e,t,n,a){Hz(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(Gz.has(s)?s:Rg(s),t.attrs[s])}function Kz(e,t,n){const a=Vg(e,t,n);for(const s in e)if(bn(e[s])||bn(t[s])){const u=io.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[u]=e[s]}return a}class NR extends Uz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=en}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(so.has(n)){const a=Cz(n);return a&&a.default||0}return n=Gz.has(n)?n:Rg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Kz(t,n,a)}build(t,n,a){qz(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){jR(t,n,a,s)}mount(t){this.isSVGTag=Yz(t.tagName),super.mount(t)}}const CR=Pg.length;function Xz(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Xz(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<CR;n++){const a=Pg[n],s=e.props[a];(Dl(s)||s===!1)&&(t[a]=s)}return t}function Jz(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 TR=[...Lg].reverse(),ER=Lg.length;function AR(e){return t=>Promise.all(t.map(({animation:n,options:a})=>VO(e,n,a)))}function OR(e){let t=AR(e),n=z1(),a=!0;const s=h=>(m,g)=>{const y=Hs(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:b,transitionEnd:v,...S}=y;m={...m,...S,...v}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Xz(e.parent)||{},y=[],b=new Set;let v={},S=1/0;for(let C=0;C<ER;C++){const E=TR[C],A=n[E],T=m[E]!==void 0?m[E]:g[E],L=Dl(T),U=E===h?A.isActive:null;U===!1&&(S=C);let D=T===g[E]&&T!==m[E]&&L;if(D&&a&&e.manuallyAnimateOnMount&&(D=!1),A.protectedKeys={...v},!A.isActive&&U===null||!T&&!A.prevProp||gd(T)||typeof T=="boolean")continue;const Z=RR(A.prevProp,T);let R=Z||E===h&&A.isActive&&!D&&L||C>S&&L,J=!1;const ue=Array.isArray(T)?T:[T];let le=ue.reduce(s(E),{});U===!1&&(le={});const{prevResolvedValues:re={}}=A,ae={...re,...le},te=Q=>{R=!0,b.has(Q)&&(J=!0,b.delete(Q)),A.needsAnimating[Q]=!0;const Y=e.getValue(Q);Y&&(Y.liveStyle=!1)};for(const Q in ae){const Y=le[Q],be=re[Q];if(v.hasOwnProperty(Q))continue;let O=!1;vp(Y)&&vp(be)?O=!Jz(Y,be):O=Y!==be,O?Y!=null?te(Q):b.add(Q):Y!==void 0&&b.has(Q)?te(Q):A.protectedKeys[Q]=!0}A.prevProp=T,A.prevResolvedValues=le,A.isActive&&(v={...v,...le}),a&&e.blockInitialAnimation&&(R=!1);const se=D&&Z;R&&(!se||J)&&y.push(...ue.map(Q=>{const Y={type:E};if(typeof Q=="string"&&a&&!se&&e.manuallyAnimateOnMount&&e.parent){const{parent:be}=e,O=Hs(be,Q);if(be.enteringChildren&&O){const{delayChildren:j}=O.transition||{};Y.delay=vz(be.enteringChildren,e,j)}}return{animation:Q,options:Y}}))}if(b.size){const C={};if(typeof m.initial!="boolean"){const E=Hs(e,Array.isArray(m.initial)?m.initial[0]:m.initial);E&&E.transition&&(C.transition=E.transition)}b.forEach(E=>{const A=e.getBaseTarget(E),T=e.getValue(E);T&&(T.liveStyle=!0),C[E]=A??null}),y.push({animation:C})}let N=!!y.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(N=!1),a=!1,N?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=z1()}}}function RR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Jz(t,e):!1}function _i(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function z1(){return{animate:_i(!0),whileInView:_i(),whileHover:_i(),whileTap:_i(),whileDrag:_i(),whileFocus:_i(),exit:_i()}}function _1(e,t){e.min=t.min,e.max=t.max}function zr(e,t){_1(e.x,t.x),_1(e.y,t.y)}function j1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Qz=1e-4,MR=1-Qz,DR=1+Qz,Wz=.01,$R=0-Wz,LR=0+Wz;function Cn(e){return e.max-e.min}function PR(e,t,n){return Math.abs(e-t)<=n}function N1(e,t,n,a=.5){e.origin=a,e.originPoint=Ct(t.min,t.max,e.origin),e.scale=Cn(n)/Cn(t),e.translate=Ct(n.min,n.max,e.origin)-e.originPoint,(e.scale>=MR&&e.scale<=DR||isNaN(e.scale))&&(e.scale=1),(e.translate>=$R&&e.translate<=LR||isNaN(e.translate))&&(e.translate=0)}function wl(e,t,n,a){N1(e.x,t.x,n.x,a?a.originX:void 0),N1(e.y,t.y,n.y,a?a.originY:void 0)}function C1(e,t,n){e.min=n.min+t.min,e.max=e.min+Cn(t)}function UR(e,t,n){C1(e.x,t.x,n.x),C1(e.y,t.y,n.y)}function T1(e,t,n){e.min=t.min-n.min,e.max=e.min+Cn(t)}function Qc(e,t,n){T1(e.x,t.x,n.x),T1(e.y,t.y,n.y)}function E1(e,t,n,a,s){return e-=t,e=Jc(e,1/n,a),s!==void 0&&(e=Jc(e,1/s,a)),e}function VR(e,t=0,n=1,a=.5,s,u=e,l=e){if(Lr.test(t)&&(t=parseFloat(t),t=Ct(l.min,l.max,t/100)-l.min),typeof t!="number")return;let f=Ct(u.min,u.max,a);e===u&&(f-=t),e.min=E1(e.min,t,n,f,s),e.max=E1(e.max,t,n,f,s)}function A1(e,t,[n,a,s],u,l){VR(e,t[n],t[a],t[s],t.scale,u,l)}const BR=["x","scaleX","originX"],ZR=["y","scaleY","originY"];function O1(e,t,n,a){A1(e.x,t,BR,n?n.x:void 0,a?a.x:void 0),A1(e.y,t,ZR,n?n.y:void 0,a?a.y:void 0)}function R1(e){return e.translate===0&&e.scale===1}function e_(e){return R1(e.x)&&R1(e.y)}function M1(e,t){return e.min===t.min&&e.max===t.max}function IR(e,t){return M1(e.x,t.x)&&M1(e.y,t.y)}function D1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function t_(e,t){return D1(e.x,t.x)&&D1(e.y,t.y)}function $1(e){return Cn(e.x)/Cn(e.y)}function L1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function cr(e){return[e("x"),e("y")]}function HR(e,t,n){let a="";const s=e.x.translate/t.x,u=e.y.translate/t.y,l=n?.z||0;if((s||u||l)&&(a=`translate3d(${s}px, ${u}px, ${l}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:y,rotateY:b,skewX:v,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),y&&(a+=`rotateX(${y}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),S&&(a+=`skewY(${S}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(a+=`scale(${f}, ${h})`),a||"none"}const n_=["TopLeft","TopRight","BottomLeft","BottomRight"],FR=n_.length,P1=e=>typeof e=="string"?parseFloat(e):e,U1=e=>typeof e=="number"||we.test(e);function qR(e,t,n,a,s,u){s?(e.opacity=Ct(0,n.opacity??1,GR(a)),e.opacityExit=Ct(t.opacity??1,0,YR(a))):u&&(e.opacity=Ct(t.opacity??1,n.opacity??1,a));for(let l=0;l<FR;l++){const f=`border${n_[l]}Radius`;let h=V1(t,f),m=V1(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||U1(h)===U1(m)?(e[f]=Math.max(Ct(P1(h),P1(m),a),0),(Lr.test(m)||Lr.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||n.rotate)&&(e.rotate=Ct(t.rotate||0,n.rotate||0,a))}function V1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const GR=r_(0,.5,JS),YR=r_(.5,.95,mr);function r_(e,t,n){return a=>a<e?0:a>t?1:n(Ol(e,t,a))}function KR(e,t,n){const a=bn(e)?e:Xs(e);return a.start(Ag("",a,t,n)),a.animation}function $l(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const XR=(e,t)=>e.depth-t.depth;class JR{constructor(){this.children=[],this.isDirty=!1}add(t){mg(this.children,t),this.isDirty=!0}remove(t){pg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(XR),this.isDirty=!1,this.children.forEach(t)}}function QR(e,t){const n=Nn.now(),a=({timestamp:s})=>{const u=s-n;u>=t&&(Ka(a),e(u-t))};return wt.setup(a,!0),()=>Ka(a)}function Vc(e){return bn(e)?e.get():e}class WR{constructor(){this.members=[]}add(t){mg(this.members,t),t.scheduleRender()}remove(t){if(pg(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 Bc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},mm=["","X","Y","Z"],eM=1e3;let tM=0;function pm(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function a_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=zz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(s||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&a_(a)}function i_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(l={},f=t?.()){this.id=tM++,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(aM),this.nodes.forEach(lM),this.nodes.forEach(uM),this.nodes.forEach(iM)},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 JR)}addEventListener(l,f){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new yg),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=Dz(l)&&!rR(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 b=()=>this.root.updateBlockedByResize=!1;wt.read(()=>{y=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==y&&(y=v,this.root.updateBlockedByResize=!0,g&&g(),g=QR(b,250),Bc.hasAnimatedSinceResize&&(Bc.hasAnimatedSinceResize=!1,this.nodes.forEach(I1)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||mM,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=m.getProps(),E=!this.targetLayout||!t_(this.targetLayout,v),A=!y&&b;if(this.options.layoutRoot||this.resumeFrom||A||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...Eg(S,"layout"),onPlay:N,onComplete:C};(m.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(g,A)}else y||I1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ka(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(cM),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&&a_(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(B1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Z1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(oM),this.nodes.forEach(nM),this.nodes.forEach(rM)):this.nodes.forEach(Z1),this.clearAllSnapshots();const f=Nn.now();dn.delta=Pr(0,1e3/60,f-dn.timestamp),dn.timestamp=f,dn.isProcessing=!0,sm.update.process(dn),sm.preRender.process(dn),sm.render.process(dn),dn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Dg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(sM),this.sharedNodes.forEach(dM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Cn(this.snapshot.measuredBox.x)&&!Cn(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=en(),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&&!e_(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(f||Ci(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)),pM(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return en();const f=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gM))){const{scroll:m}=this.root;m&&(Ls(f.x,m.offset.x),Ls(f.y,m.offset.y))}return f}removeElementScroll(l){const f=en();if(zr(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&&zr(f,l),Ls(f.x,g.offset.x),Ls(f.y,g.offset.y))}return f}applyTransform(l,f=!1){const h=en();zr(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&&Ps(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Ci(g.latestValues)&&Ps(h,g.latestValues)}return Ci(this.latestValues)&&Ps(h,this.latestValues),h}removeTransform(l){const f=en();zr(f,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!Ci(m.latestValues))continue;jp(m.latestValues)&&m.updateSnapshot();const g=en(),y=m.measurePageBox();zr(g,y),O1(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return Ci(this.latestValues)&&O1(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!==dn.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=dn.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=en(),this.targetWithTransforms=en()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),UR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):zr(this.target,this.layout.layoutBox),Zz(this.target,this.targetDelta)):zr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||jp(this.parent.latestValues)||Bz(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=en(),this.relativeTargetOrigin=en(),Qc(this.relativeTargetOrigin,f,h),zr(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===dn.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;zr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,b=this.treeScale.y;mR(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=en());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(j1(this.prevProjectionDelta.x,this.projectionDelta.x),j1(this.prevProjectionDelta.y,this.projectionDelta.y)),wl(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==b||!L1(this.projectionDelta.x,this.prevProjectionDelta.x)||!L1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=$s(),this.projectionDelta=$s(),this.projectionDeltaWithTransform=$s()}setAnimationOrigin(l,f=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},y=$s();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const b=en(),v=h?h.source:void 0,S=this.layout?this.layout.source:void 0,N=v!==S,C=this.getStack(),E=!C||C.members.length<=1,A=!!(N&&!E&&this.options.crossfade===!0&&!this.path.some(hM));this.animationProgress=0;let T;this.mixTargetDelta=L=>{const U=L/1e3;H1(y.x,l.x,U),H1(y.y,l.y,U),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qc(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),fM(this.relativeTarget,this.relativeTargetOrigin,b,U),T&&IR(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=en()),zr(T,this.relativeTarget)),N&&(this.animationValues=g,qR(g,m,this.latestValues,U,A,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ka(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{Bc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Xs(0)),this.currentAnimation=KR(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(eM),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&&s_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||en();const y=Cn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+y;const b=Cn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+b}zr(f,h),Ps(f,g),wl(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(l,f){this.sharedNodes.has(l)||this.sharedNodes.set(l,new WR),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&&pm("z",l,m,this.animationValues);for(let g=0;g<mm.length;g++)pm(`rotate${mm[g]}`,l,m,this.animationValues),pm(`skew${mm[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=Vc(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=Vc(f?.pointerEvents)||""),this.hasProjected&&!Ci(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let y=HR(this.projectionDeltaWithTransform,this.treeScale,g);h&&(y=h(g,y)),l.transform=y;const{x:b,y:v}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?l.opacity=m===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:l.opacity=m===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const S in Cp){if(g[S]===void 0)continue;const{correct:N,applyTo:C,isCSSVariable:E}=Cp[S],A=y==="none"?g[S]:N(g[S],m);if(C){const T=C.length;for(let L=0;L<T;L++)l[C[L]]=A}else E?this.options.visualElement.renderState.vars[S]=A:l[S]=A}this.options.layoutId&&(l.pointerEvents=m===this?Vc(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(B1),this.root.sharedNodes.clear()}}}function nM(e){e.updateLayout()}function rM(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"?cr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],b=Cn(y);y.min=n[g].min,y.max=y.min+b}):s_(s,t.layoutBox,n)&&cr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],b=Cn(n[g]);y.max=y.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+b)});const l=$s();wl(l,n,t.layoutBox);const f=$s();u?wl(f,e.applyTransform(a,!0),t.measuredBox):wl(f,n,t.layoutBox);const h=!e_(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:b}=g;if(y&&b){const v=en();Qc(v,t.layoutBox,y.layoutBox);const S=en();Qc(S,n,b.layoutBox),t_(v,S)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=v,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 aM(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 iM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function sM(e){e.clearSnapshot()}function B1(e){e.clearMeasurements()}function Z1(e){e.isLayoutDirty=!1}function oM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function I1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function lM(e){e.resolveTargetDelta()}function uM(e){e.calcProjection()}function cM(e){e.resetSkewAndRotation()}function dM(e){e.removeLeadSnapshot()}function H1(e,t,n){e.translate=Ct(t.translate,0,n),e.scale=Ct(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function F1(e,t,n,a){e.min=Ct(t.min,n.min,a),e.max=Ct(t.max,n.max,a)}function fM(e,t,n,a){F1(e.x,t.x,n.x,a),F1(e.y,t.y,n.y,a)}function hM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const mM={duration:.45,ease:[.4,0,.1,1]},q1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),G1=q1("applewebkit/")&&!q1("chrome/")?Math.round:mr;function Y1(e){e.min=G1(e.min),e.max=G1(e.max)}function pM(e){Y1(e.x),Y1(e.y)}function s_(e,t,n){return e==="position"||e==="preserve-aspect"&&!PR($1(t),$1(n),.2)}function gM(e){return e!==e.root&&e.scroll?.wasRoot}const xM=i_({attachResizeListener:(e,t)=>$l(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),gm={current:void 0},o_=i_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gm.current){const e=new xM({});e.mount(window),e.setOptions({layoutScroll:!0}),gm.current=e}return gm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Bg=z.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function K1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yM(...e){return t=>{let n=!1;const a=e.map(s=>{const u=K1(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():K1(e[s],null)}}}}function bM(...e){return z.useCallback(yM(...e),e)}class vM extends z.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=zp(a)&&a.offsetWidth||0,u=zp(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 kM({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(Bg),m=e.props?.ref??e?.ref,g=bM(l,m);return z.useInsertionEffect(()=>{const{width:y,height:b,top:v,left:S,right:N,bottom:C}=f.current;if(t||!l.current||!y||!b)return;const E=n==="left"?`left: ${S}`:`right: ${N}`,A=a==="bottom"?`bottom: ${C}`:`top: ${v}`;l.current.dataset.motionPopId=u;const T=document.createElement("style");h&&(T.nonce=h);const L=s??document.head;return L.appendChild(T),T.sheet&&T.sheet.insertRule(`
|
|
12
|
+
[data-motion-pop-id="${u}"] {
|
|
13
|
+
position: absolute !important;
|
|
14
|
+
width: ${y}px !important;
|
|
15
|
+
height: ${b}px !important;
|
|
16
|
+
${E}px !important;
|
|
17
|
+
${A}px !important;
|
|
18
|
+
}
|
|
19
|
+
`),()=>{L.contains(T)&&L.removeChild(T)}},[t]),d.jsx(vM,{isPresent:t,childRef:l,sizeRef:f,children:z.cloneElement(e,{ref:g})})}const wM=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:u,mode:l,anchorX:f,anchorY:h,root:m})=>{const g=hg(SM),y=z.useId();let b=!0,v=z.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:S=>{g.set(S,!0);for(const N of g.values())if(!N)return;a&&a()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[n,g,a]);return u&&b&&(v={...v}),z.useMemo(()=>{g.forEach((S,N)=>g.set(N,!1))},[n]),z.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=d.jsx(kM,{isPresent:n,anchorX:f,anchorY:h,root:m,children:e})),d.jsx(pd.Provider,{value:v,children:e})};function SM(){return new Map}function l_(e=!0){const t=z.useContext(pd);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 vc=e=>e.key||"";function X1(e){const t=[];return z.Children.forEach(e,n=>{z.isValidElement(n)&&t.push(n)}),t}const zM=({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]=l_(l),b=z.useMemo(()=>X1(e),[e]),v=l&&!g?[]:b.map(vc),S=z.useRef(!0),N=z.useRef(b),C=hg(()=>new Map),E=z.useRef(new Set),[A,T]=z.useState(b),[L,U]=z.useState(b);VS(()=>{S.current=!1,N.current=b;for(let R=0;R<L.length;R++){const J=vc(L[R]);v.includes(J)?(C.delete(J),E.current.delete(J)):C.get(J)!==!0&&C.set(J,!1)}},[L,v.length,v.join("-")]);const D=[];if(b!==A){let R=[...b];for(let J=0;J<L.length;J++){const ue=L[J],le=vc(ue);v.includes(le)||(R.splice(J,0,ue),D.push(ue))}return u==="wait"&&D.length&&(R=D),U(X1(R)),T(b),null}const{forceRender:Z}=z.useContext(fg);return d.jsx(d.Fragment,{children:L.map(R=>{const J=vc(R),ue=l&&!g?!1:b===L||v.includes(J),le=()=>{if(E.current.has(J))return;if(E.current.add(J),C.has(J))C.set(J,!0);else return;let re=!0;C.forEach(ae=>{ae||(re=!1)}),re&&(Z?.(),U(N.current),l&&y?.(),a&&a())};return d.jsx(wM,{isPresent:ue,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:u,root:m,onExitComplete:ue?void 0:le,anchorX:f,anchorY:h,children:R},J)})})},u_=z.createContext({strict:!1}),J1={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 Q1=!1;function _M(){if(Q1)return;const e={};for(const t in J1)e[t]={isEnabled:n=>J1[t].some(a=>!!n[a])};Pz(e),Q1=!0}function c_(){return _M(),cR()}function jM(e){const t=c_();for(const n in e)t[n]={...t[n],...e[n]};Pz(t)}const NM=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 Wc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||NM.has(e)}let d_=e=>!Wc(e);function CM(e){typeof e=="function"&&(d_=t=>t.startsWith("on")?!Wc(t):e(t))}try{CM(require("@emotion/is-prop-valid").default)}catch{}function TM(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(d_(s)||n===!0&&Wc(s)||!t&&!Wc(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const yd=z.createContext({});function EM(e,t){if(xd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Dl(n)?n:void 0,animate:Dl(a)?a:void 0}}return e.inherit!==!1?t:{}}function AM(e){const{initial:t,animate:n}=EM(e,z.useContext(yd));return z.useMemo(()=>({initial:t,animate:n}),[W1(t),W1(n)])}function W1(e){return Array.isArray(e)?e.join(" "):e}const Zg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function f_(e,t,n){for(const a in t)!bn(t[a])&&!Fz(a,n)&&(e[a]=t[a])}function OM({transformTemplate:e},t){return z.useMemo(()=>{const n=Zg();return Ug(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RM(e,t){const n=e.style||{},a={};return f_(a,n,e),Object.assign(a,OM(e,t)),a}function MM(e,t){const n={},a=RM(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 h_=()=>({...Zg(),attrs:{}});function DM(e,t,n,a){const s=z.useMemo(()=>{const u=h_();return qz(u,t,Yz(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};f_(u,e.style,e),s.style={...u,...s.style}}return s}const $M=["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 Ig(e){return typeof e!="string"||e.includes("-")?!1:!!($M.indexOf(e)>-1||/[A-Z]/u.test(e))}function LM(e,t,n,{latestValues:a},s,u=!1,l){const h=(l??Ig(e)?DM:MM)(t,a,s,e),m=TM(t,typeof e=="string",u),g=e!==z.Fragment?{...m,...h,ref:n}:{},{children:y}=t,b=z.useMemo(()=>bn(y)?y.get():y,[y]);return z.createElement(e,{...g,children:b})}function PM({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:UM(n,a,s,e),renderState:t()}}function UM(e,t,n,a){const s={},u=a(e,{});for(const b in u)s[b]=Vc(u[b]);let{initial:l,animate:f}=e;const h=xd(e),m=Lz(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"&&!gd(y)){const b=Array.isArray(y)?y:[y];for(let v=0;v<b.length;v++){const S=Og(e,b[v]);if(S){const{transitionEnd:N,transition:C,...E}=S;for(const A in E){let T=E[A];if(Array.isArray(T)){const L=g?T.length-1:0;T=T[L]}T!==null&&(s[A]=T)}for(const A in N)s[A]=N[A]}}}return s}const m_=e=>(t,n)=>{const a=z.useContext(yd),s=z.useContext(pd),u=()=>PM(e,t,a,s);return n?u():hg(u)},VM=m_({scrapeMotionValuesFromProps:Vg,createRenderState:Zg}),BM=m_({scrapeMotionValuesFromProps:Kz,createRenderState:h_}),ZM=Symbol.for("motionComponentSymbol");function IM(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 p_=z.createContext({});function xl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function HM(e,t,n,a,s,u){const{visualElement:l}=z.useContext(yd),f=z.useContext(u_),h=z.useContext(pd),m=z.useContext(Bg).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 b=g.current,v=z.useContext(p_);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&FM(g.current,n,s,v);const S=z.useRef(!1);z.useInsertionEffect(()=>{b&&S.current&&b.update(n,h)});const N=n[Sz],C=z.useRef(!!N&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return VS(()=>{y.current=!0,b&&(S.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),C.current&&b.animationState&&b.animationState.animateChanges())}),z.useEffect(()=>{b&&(!C.current&&b.animationState&&b.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),C.current=!1),b.enteringChildren=void 0)}),b}function FM(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:g_(e.parent)),e.projection.setOptions({layoutId:s,layout:u,alwaysMeasureLayout:!!l||f&&xl(f),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function g_(e){if(e)return e.options.allowProjection!==!1?e.projection:g_(e.parent)}function xm(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&jM(a);const u=n?n==="svg":Ig(e),l=u?BM:VM;function f(m,g){let y;const b={...z.useContext(Bg),...m,layoutId:qM(m)},{isStatic:v}=b,S=AM(m),N=l(m,v);if(!v&&US){GM();const C=YM(b);y=C.MeasureLayout,S.visualElement=HM(e,N,b,s,C.ProjectionNode,u)}return d.jsxs(yd.Provider,{value:S,children:[y&&S.visualElement?d.jsx(y,{visualElement:S.visualElement,...b}):null,LM(e,m,IM(N,S.visualElement,g),N,v,t,u)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=z.forwardRef(f);return h[ZM]=e,h}function qM({layoutId:e}){const t=z.useContext(fg).id;return t&&e!==void 0?t+"-"+e:e}function GM(e,t){z.useContext(u_).strict}function YM(e){const t=c_(),{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 KM(e,t){if(typeof Proxy>"u")return xm;const n=new Map,a=(u,l)=>xm(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,xm(l,void 0,e,t)),n.get(l))})}const XM=(e,t)=>t.isSVG??Ig(e)?new NR(t):new kR(t,{allowProjection:e!==z.Fragment});class JM extends ei{constructor(t){super(t),t.animationState||(t.animationState=OR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();gd(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 QM=0;class WM extends ei{constructor(){super(...arguments),this.id=QM++}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 eD={animation:{Feature:JM},exit:{Feature:WM}};function Kl(e){return{point:{x:e.pageX,y:e.pageY}}}const tD=e=>t=>$g(t)&&e(t,Kl(t));function Sl(e,t,n,a){return $l(e,t,tD(n),a)}const x_=({current:e})=>e?e.ownerDocument.defaultView:null,ek=(e,t)=>Math.abs(e-t);function nD(e,t){const n=ek(e.x,t.x),a=ek(e.y,t.y);return Math.sqrt(n**2+a**2)}const tk=new Set(["auto","scroll"]);class y_{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=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=bm(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,N=nD(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!N)return;const{point:C}=v,{timestamp:E}=dn;this.history.push({...C,timestamp:E});const{onStart:A,onMove:T}=this.handlers;S||(A&&A(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=ym(S,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:N,onSessionEnd:C,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=bm(v.type==="pointercancel"?this.lastMoveEventInfo:ym(S,this.transformPagePoint),this.history);this.startEvent&&N&&N(v,A),C&&C(v,A)},!$g(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=s||window;const h=Kl(t),m=ym(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=dn;this.history=[{...g,timestamp:y}];const{onSessionStart:b}=n;b&&b(t,bm(m,this.history)),this.removeListeners=ql(Sl(this.contextWindow,"pointermove",this.handlePointerMove),Sl(this.contextWindow,"pointerup",this.handlePointerUp),Sl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(tk.has(a.overflowX)||tk.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),wt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ka(this.updatePoint)}}function ym(e,t){return t?{point:t(e.point)}:e}function nk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bm({point:e},t){return{point:e,delta:nk(e,b_(t)),offset:nk(e,rD(t)),velocity:aD(t,.1)}}function rD(e){return e[0]}function b_(e){return e[e.length-1]}function aD(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=b_(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>ca(t)));)n--;if(!a)return{x:0,y:0};const u=hr(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 iD(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?Ct(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?Ct(n,e,a.max):Math.min(e,n)),e}function rk(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 sD(e,{top:t,left:n,bottom:a,right:s}){return{x:rk(e.x,n,s),y:rk(e.y,t,a)}}function ak(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 oD(e,t){return{x:ak(e.x,t.x),y:ak(e.y,t.y)}}function lD(e,t){let n=.5;const a=Cn(e),s=Cn(t);return s>a?n=Ol(t.min,t.max-a,e.min):a>s&&(n=Ol(e.min,e.max-s,t.min)),Pr(0,1,n)}function uD(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 Tp=.35;function cD(e=Tp){return e===!1?e=0:e===!0&&(e=Tp),{x:ik(e,"left","right"),y:ik(e,"top","bottom")}}function ik(e,t,n){return{min:sk(e,t),max:sk(e,n)}}function sk(e,t){return typeof e=="number"?e:e[t]||0}const dD=new WeakMap;class fD{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=en(),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(Kl(y).point)):this.pauseAnimation()},l=(y,b)=>{this.stopAnimation();const{drag:v,dragPropagation:S,onDragStart:N}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=QO(v),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cr(E=>{let A=this.getAxisMotionValue(E).get()||0;if(Lr.test(A)){const{projection:T}=this.visualElement;if(T&&T.layout){const L=T.layout.layoutBox[E];L&&(A=Cn(L)*(parseFloat(A)/100))}}this.originPoint[E]=A}),N&&wt.postRender(()=>N(y,b)),kp(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:N,onDrag:C}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:E}=b;if(S&&this.currentDirection===null){this.currentDirection=hD(E),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",b.point,E),this.updateAxis("y",b.point,E),this.visualElement.render(),C&&C(y,b)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>cr(y=>this.getAnimationState(y)==="paused"&&this.getAxisMotionValue(y).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new y_(t,{onSessionStart:u,onStart:l,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:x_(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&&wt.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||!kc(t,s,this.currentDirection))return;const u=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=iD(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&&xl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=sD(a.layoutBox,t):this.constraints=!1,this.elastic=cD(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&cr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=uD(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const u=pR(a,s.root,this.visualElement.getTransformPagePoint());let l=oD(s.layout.layoutBox,u);if(n){const f=n(fR(l));this.hasMutatedConstraints=!!f,f&&(l=Vz(f))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=cr(g=>{if(!kc(g,n,this.currentDirection))return;let y=h&&h[g]||{};l&&(y={min:0,max:0});const b=s?200:1e6,v=s?40:1e7,S={type:"inertia",velocity:a?t[g]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(f)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return kp(this.visualElement,t),a.start(Ag(t,a,0,n,this.visualElement,!1))}stopAnimation(){cr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){cr(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){cr(n=>{const{drag:a}=this.getProps();if(!kc(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]-Ct(l,f,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!xl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};cr(l=>{const f=this.getAxisMotionValue(l);if(f&&this.constraints!==!1){const h=f.get();s[l]=lD({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(),cr(l=>{if(!kc(l,t,null))return;const f=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];f.set(Ct(h,m,s[l]))})}addListeners(){if(!this.visualElement.current)return;dD.set(this.visualElement,this);const t=this.visualElement.current,n=Sl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),y=h.target,b=y!==t&&Mz(y);m&&g&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();xl(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()),wt.read(a);const l=$l(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(cr(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=Tp,dragMomentum:f=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:u,dragElastic:l,dragMomentum:f}}}function kc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hD(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mD extends ei{constructor(t){super(t),this.removeGroupControls=mr,this.removeListeners=mr,this.controls=new fD(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mr}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 ok=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class pD extends ei{constructor(){super(...arguments),this.removePointerDownListener=mr}onPointerDown(t){this.session=new y_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:x_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:ok(t),onStart:ok(n),onMove:a,onEnd:(u,l)=>{delete this.session,s&&wt.postRender(()=>s(u,l))}}}mount(){this.removePointerDownListener=Sl(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 vm=!1;class gD 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),vm&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Bc.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}),vm=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==u?l.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?l.promote():l.relegate()||wt.postRender(()=>{const f=l.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Dg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;vm=!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 v_(e){const[t,n]=l_(),a=z.useContext(fg);return d.jsx(gD,{...e,layoutGroup:a,switchLayoutGroup:z.useContext(p_),isPresent:t,safeToRemove:n})}const xD={pan:{Feature:pD},drag:{Feature:mD,ProjectionNode:o_,MeasureLayout:v_}};function lk(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&&wt.postRender(()=>u(t,Kl(t)))}class yD extends ei{mount(){const{current:t}=this.node;t&&(this.unmount=WO(t,(n,a)=>(lk(this.node,a,"Start"),s=>lk(this.node,s,"End"))))}unmount(){}}class bD extends ei{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=ql($l(this.node.current,"focus",()=>this.onFocus()),$l(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uk(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&&wt.postRender(()=>u(t,Kl(t)))}class vD extends ei{mount(){const{current:t}=this.node;t&&(this.unmount=nR(t,(n,a)=>(uk(this.node,a,"Start"),(s,{success:u})=>uk(this.node,s,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ep=new WeakMap,km=new WeakMap,kD=e=>{const t=Ep.get(e.target);t&&t(e)},wD=e=>{e.forEach(kD)};function SD({root:e,...t}){const n=e||document;km.has(n)||km.set(n,{});const a=km.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(wD,{root:e,...t})),a[s]}function zD(e,t,n){const a=SD(t);return Ep.set(e,n),a.observe(e),()=>{Ep.delete(e),a.unobserve(e)}}const _D={some:0,all:1};class jD extends ei{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:_D[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(),b=m?g:y;b&&b(h)};return zD(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(ND(t,n))&&this.startObserver()}unmount(){}}function ND({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const CD={inView:{Feature:jD},tap:{Feature:vD},focus:{Feature:bD},hover:{Feature:yD}},TD={layout:{ProjectionNode:o_,MeasureLayout:v_}},ED={...eD,...CD,...xD,...TD},Qe=KM(ED,XM),k_=()=>{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 AD({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(Rs,{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(jS,{className:"w-5 h-5"}):d.jsx(_S,{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(OA,{className:"w-6 h-6"})})]})]})}const Ia={list:()=>pe.get("/webhooks"),get:e=>pe.get(`/webhooks/${e}`),create:e=>pe.post("/webhooks",e),update:(e,t)=>pe.put(`/webhooks/${e}`,t),delete:e=>pe.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 pe.get(`/webhooks/notifications${n}`)},unreadCount:()=>pe.get("/webhooks/notifications/unread-count"),markRead:e=>pe.post("/webhooks/notifications/read",{ids:e})},pr=({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,Js=({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})}),gr=({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}),xr=({className:e,children:t})=>d.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),OD=({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}),fr=({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 RD({isOpen:e,onClose:t,onConfirm:n}){return d.jsx(pr,{open:e,onOpenChange:t,children:d.jsxs(Js,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(gr,{children:d.jsx(xr,{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(fr,{variant:"outline",onClick:t,children:"Cancel"}),d.jsx(fr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Os={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 pe.get(`/tasks${n}`)},get:e=>pe.get(`/tasks/${e}`),stats:()=>pe.get("/tasks/stats"),retry:e=>pe.post(`/tasks/${e}/retry`,{}),cancel:e=>pe.post(`/tasks/${e}/cancel`,{})};function MD({children:e}){const t=Tr(),[n,a]=z.useState(()=>{const C=localStorage.getItem("theme");return C?C==="dark":!0}),[s,u]=z.useState(!1),[l,f]=z.useState(!1),{logout:h}=k_(),{data:m}=xt("/webhooks/notifications/unread-count",()=>Ia.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:y}=xt("/tasks/stats",()=>Os.stats(),{refreshInterval:5e3}),b=(y?.pending??0)+(y?.running??0),v=async()=>{try{await pe.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(C){console.error("Failed to restart:",C),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:R0,label:"Dashboard",path:"/"},{icon:Tl,label:"Chat",path:"/chat"},{icon:P0,label:"Zaion",path:"/zaion"},{icon:$0,label:"MCP Servers",path:"/mcp-servers"},{icon:El,label:"Skills",path:"/skills"},{icon:Ym,label:"Usage Stats",path:"/stats"},{icon:qc,label:"Model Pricing",path:"/model-pricing"},{icon:Rs,label:"Sati Memories",path:"/sati-memories"},{icon:Wm,label:"Webhooks",path:"/webhooks"},{icon:Jm,label:"Tasks",path:"/tasks"},{icon:Zs,label:"Trinity DBs",path:"/trinity-databases"},{icon:Ga,label:"Chronos",path:"/chronos"},{icon:Qm,label:"Logs",path:"/logs"}],N=[{icon:R0,label:"Dashboard",path:"/"},{icon:Tl,label:"Chat",path:"/chat"},{icon:P0,label:"Zaion",path:"/zaion"},{icon:$0,label:"MCP Servers",path:"/mcp-servers"},{icon:El,label:"Skills",path:"/skills"},{icon:Ym,label:"Usage Stats",path:"/stats"},{icon:qc,label:"Model Pricing",path:"/model-pricing"},{icon:Rs,label:"Sati Memories",path:"/sati-memories"},{icon:Wm,label:"Webhooks",path:"/webhooks"},{icon:Jm,label:"Tasks",path:"/tasks"},{icon:Zs,label:"Trinity DBs",path:"/trinity-databases"},{icon:Ga,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(AD,{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(Rs,{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(jS,{className:"w-4 h-4"}):d.jsx(_S,{className:"w-4 h-4"})})]}),d.jsxs("nav",{className:"flex-1 p-2 space-y-0.5",children:[S.map(C=>{const E=t.pathname===C.path;return d.jsxs(Ha,{to:C.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(C.icon,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:C.label}),C.path==="/tasks"&&b>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:b>99?"99+":b})]},C.path)}),d.jsxs(Ha,{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(Cl,{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(L0,{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(M0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Logout"})]})})]}),d.jsx(zM,{children:s&&d.jsxs(Qe.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(Qe.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:C=>C.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(Rs,{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:[N.map(C=>{const E=t.pathname===C.path;return d.jsxs(Ha,{to:C.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(C.icon,{className:"w-5 h-5"}),d.jsx("span",{children:C.label}),C.path==="/tasks"&&b>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:b>99?"99+":b})]},C.path)}),d.jsxs(Ha,{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(Cl,{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(L0,{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(M0,{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(Y4,{}),d.jsx(RD,{isOpen:l,onClose:()=>f(!1),onConfirm:v})]})}const DD={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},Ti=({title:e,value:t,icon:n,subValue:a})=>d.jsxs(Qe.div,{variants:DD,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})]}),Ap={fetchUsageStats:async()=>pe.get("/stats/usage"),fetchGroupedUsageStats:async()=>pe.get("/stats/usage/grouped")};function $D(){const{data:e}=xt("/api/stats/usage",Ap.fetchUsageStats,{refreshInterval:5e3});return d.jsxs(d.Fragment,{children:[d.jsx(Ti,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:vS,subValue:"Tokens processed"}),d.jsx(Ti,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:kS,subValue:"Tokens generated"})]})}function LD(){const{data:e}=LS(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return d.jsxs(Qe.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[d.jsxs(Qe.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(Ti,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:Rs,subValue:e?`PID: ${e.pid}`:""}),d.jsx(Ti,{title:"Uptime",value:e?PS(e.uptimeSeconds):"-",icon:Ga,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),d.jsx(Ti,{title:"Version",value:e?.projectVersion||"-",icon:zS,subValue:`Node ${e?.nodeVersion||"-"}`}),d.jsx(Ti,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:IE,subValue:"LLM Inference Engine"}),d.jsx(Ti,{title:"Model",value:e?.llmModel||"-",icon:BE,subValue:"Active Model"}),d.jsx($D,{})]})]})}const PD=({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,b]=z.useState(""),v=z.useRef(null);z.useEffect(()=>{m&&v.current&&v.current.focus()},[m]);const S=(A,T)=>{A.stopPropagation(),g(T.id),b(T.title||"Untitled Session")},N=A=>{A?.stopPropagation(),m&&y.trim()&&(l(m,y.trim()),g(null))},C=A=>{A?.stopPropagation(),g(null)},E=A=>{A.key==="Enter"?N():A.key==="Escape"&&C()};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(Tl,{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(D0,{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(A=>d.jsxs("div",{onClick:()=>n(A.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===A.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===A.id?d.jsx("div",{className:"flex items-center gap-1 w-full",onClick:T=>T.stopPropagation(),children:d.jsx("input",{ref:v,type:"text",value:y,onChange:T=>b(T.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===A.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:A.title||"Untitled Session"}),d.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(A.started_at).toLocaleString()})]})}),d.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===A.id?d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:N,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(Km,{size:14})}),d.jsx("button",{onClick:C,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(lg,{size:14})})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:T=>S(T,A),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(ig,{size:14})}),d.jsx("button",{onClick:T=>{T.stopPropagation(),s(A.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(AE,{size:14})}),d.jsx("button",{onClick:T=>{T.stopPropagation(),u(A.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(Mi,{size:14})})]})})]},A.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(Tl,{})}),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(D0,{size:20})})]})};function UD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const VD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZD={};function ck(e,t){return(ZD.jsx?BD:VD).test(e)}const ID=/[ \t\n\f\r]/g;function HD(e){return typeof e=="object"?e.type==="text"?dk(e.value):!1:dk(e)}function dk(e){return e.replace(ID,"")===""}class Xl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Xl.prototype.normal={};Xl.prototype.property={};Xl.prototype.space=void 0;function w_(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Xl(n,a,t)}function Op(e){return e.toLowerCase()}class Bn{constructor(t,n){this.attribute=n,this.property=t}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let FD=0;const Ue=Li(),qt=Li(),Rp=Li(),de=Li(),gt=Li(),Fs=Li(),Jn=Li();function Li(){return 2**++FD}const Mp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:qt,commaOrSpaceSeparated:Jn,commaSeparated:Fs,number:de,overloadedBoolean:Rp,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),wm=Object.keys(Mp);class Hg extends Bn{constructor(t,n,a,s){let u=-1;if(super(t,n),fk(this,"space",s),typeof a=="number")for(;++u<wm.length;){const l=wm[u];fk(this,wm[u],(a&Mp[l])===Mp[l])}}}Hg.prototype.defined=!0;function fk(e,t,n){n&&(e[t]=n)}function oo(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const u=new Hg(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[Op(a)]=a,n[Op(u.attribute)]=a}return new Xl(t,n,e.space)}const S_=oo({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:gt,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:de,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:gt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:qt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function z_(e,t){return t in e?e[t]:t}function __(e,t){return z_(e,t.toLowerCase())}const qD=oo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fs,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:gt,autoFocus:Ue,autoPlay:Ue,blocking:gt,capture:null,charSet:null,checked:Ue,cite:null,className:gt,cols:de,colSpan:null,content:null,contentEditable:qt,controls:Ue,controlsList:gt,coords:de|Fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Rp,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:gt,height:de,hidden:Rp,high:de,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:gt,itemRef:gt,itemScope:Ue,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:de,pattern:null,ping:gt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:gt,required:Ue,reversed:Ue,rows:de,rowSpan:de,sandbox:gt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:qt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:__}),GD=oo({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:Jn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:gt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:Fs,g2:Fs,glyphName:Fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:z_}),j_=oo({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()}}),N_=oo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:__}),C_=oo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),YD={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"},KD=/[A-Z]/g,hk=/-[a-z]/g,XD=/^data[-\w.:]+$/i;function JD(e,t){const n=Op(t);let a=t,s=Bn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&XD.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(hk,WD);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!hk.test(u)){let l=u.replace(KD,QD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Hg}return new s(a,t)}function QD(e){return"-"+e.toLowerCase()}function WD(e){return e.charAt(1).toUpperCase()}const e5=w_([S_,qD,j_,N_,C_],"html"),Fg=w_([S_,GD,j_,N_,C_],"svg");function t5(e){return e.join(" ").trim()}var _s={},Sm,mk;function n5(){if(mk)return Sm;mk=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="",b="comment",v="declaration";function S(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var A=1,T=1;function L(te){var se=te.match(t);se&&(A+=se.length);var V=te.lastIndexOf(h);T=~V?te.length-V:T+te.length}function U(){var te={line:A,column:T};return function(se){return se.position=new D(te),J(),se}}function D(te){this.start=te,this.end={line:A,column:T},this.source=E.source}D.prototype.content=C;function Z(te){var se=new Error(E.source+":"+A+":"+T+": "+te);if(se.reason=te,se.filename=E.source,se.line=A,se.column=T,se.source=C,!E.silent)throw se}function R(te){var se=te.exec(C);if(se){var V=se[0];return L(V),C=C.slice(V.length),se}}function J(){R(n)}function ue(te){var se;for(te=te||[];se=le();)se!==!1&&te.push(se);return te}function le(){var te=U();if(!(m!=C.charAt(0)||g!=C.charAt(1))){for(var se=2;y!=C.charAt(se)&&(g!=C.charAt(se)||m!=C.charAt(se+1));)++se;if(se+=2,y===C.charAt(se-1))return Z("End of comment missing");var V=C.slice(2,se-2);return T+=2,L(V),C=C.slice(se),T+=2,te({type:b,comment:V})}}function re(){var te=U(),se=R(a);if(se){if(le(),!R(s))return Z("property missing ':'");var V=R(u),Q=te({type:v,property:N(se[0].replace(e,y)),value:V?N(V[0].replace(e,y)):y});return R(l),Q}}function ae(){var te=[];ue(te);for(var se;se=re();)se!==!1&&(te.push(se),ue(te));return te}return J(),ae()}function N(C){return C?C.replace(f,y):y}return Sm=S,Sm}var pk;function r5(){if(pk)return _s;pk=1;var e=_s&&_s.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(_s,"__esModule",{value:!0}),_s.default=n;const t=e(n5());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 _s}var cl={},gk;function a5(){if(gk)return cl;gk=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.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 cl.camelCase=h,cl}var dl,xk;function i5(){if(xk)return dl;xk=1;var e=dl&&dl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(r5()),n=a5();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,dl=a,dl}var s5=i5();const o5=Kp(s5),T_=E_("end"),qg=E_("start");function E_(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 l5(e){const t=qg(e),n=T_(e);if(t&&n)return{start:t,end:n}}function zl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yk(e.position):"start"in e||"end"in e?yk(e):"line"in e||"column"in e?Dp(e):""}function Dp(e){return bk(e&&e.line)+":"+bk(e&&e.column)}function yk(e){return Dp(e&&e.start)+"-"+Dp(e&&e.end)}function bk(e){return e&&typeof e=="number"?e:1}class vn 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=zl(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}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const Gg={}.hasOwnProperty,u5=new Map,c5=/[A-Z]/g,d5=new Set(["table","tbody","thead","tfoot","tr"]),f5=new Set(["td","th"]),A_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function h5(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=k5(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=v5(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"?Fg:e5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=O_(s,e,void 0);return u&&typeof u!="string"?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}function O_(e,t,n){if(t.type==="element")return m5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return p5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return x5(e,t,n);if(t.type==="mdxjsEsm")return g5(e,t);if(t.type==="root")return y5(e,t,n);if(t.type==="text")return b5(e,t)}function m5(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Fg,e.schema=s),e.ancestors.push(t);const u=M_(e,t.tagName,!1),l=w5(e,t);let f=Kg(e,t);return d5.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!HD(h):!0})),R_(e,l,u,t),Yg(l,f),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function p5(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)}Ll(e,t.position)}function g5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ll(e,t.position)}function x5(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Fg,e.schema=s),e.ancestors.push(t);const u=t.name===null?e.Fragment:M_(e,t.name,!0),l=S5(e,t),f=Kg(e,t);return R_(e,l,u,t),Yg(l,f),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function y5(e,t,n){const a={};return Yg(a,Kg(e,t)),e.create(t,e.Fragment,a,n)}function b5(e,t){return t.value}function R_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Yg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function v5(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 k5(e,t){return n;function n(a,s,u,l){const f=Array.isArray(u.children),h=qg(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 w5(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&Gg.call(t.properties,s)){const u=z5(e,s,t.properties[s]);if(u){const[l,f]=u;e.tableCellAlignToStyle&&l==="align"&&typeof f=="string"&&f5.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 S5(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 Ll(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 Ll(e,t.position);else u=a.value===null?!0:a.value;n[s]=u}return n}function Kg(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:u5;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=O_(e,u,l);f!==void 0&&n.push(f)}return n}function z5(e,t,n){const a=JD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?UD(n):t5(n)),a.property==="style"){let s=typeof n=="object"?n:_5(e,String(n));return e.stylePropertyNameCase==="css"&&(s=j5(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?YD[a.property]||a.property:a.attribute,n]}}function _5(e,t){try{return o5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new vn("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=A_+"#cannot-parse-style-attribute",s}}function M_(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=ck(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=ck(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Gg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Ll(e)}function Ll(e,t){const n=new vn("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=A_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function j5(e){const t={};let n;for(n in e)Gg.call(e,n)&&(t[N5(n)]=e[n]);return t}function N5(e){let t=e.replace(c5,C5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C5(e){return"-"+e.toLowerCase()}const zm={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"]},T5={};function E5(e,t){const n=T5,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return D_(e,a,s)}function D_(e,t,n){if(A5(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 vk(e.children,t,n)}return Array.isArray(e)?vk(e,t,n):""}function vk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=D_(e[s],t,n);return a.join("")}function A5(e){return!!(e&&typeof e=="object")}const kk=document.createElement("i");function Xg(e){const t="&"+e+";";kk.innerHTML=t;const n=kk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ur(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 dr(e,t){return e.length>0?(Ur(e,e.length,0,t),e):t}const wk={}.hasOwnProperty;function O5(e){const t={};let n=-1;for(;++n<e.length;)R5(t,e[n]);return t}function R5(e,t){let n;for(n in t){const s=(wk.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let l;if(u)for(l in u){wk.call(s,l)||(s[l]=[]);const f=u[l];M5(s[l],Array.isArray(f)?f:f?[f]:[])}}}function M5(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Ur(e,0,0,a)}function $_(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 qs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $r=ti(/[A-Za-z]/),Qn=ti(/[\dA-Za-z]/),D5=ti(/[#-'*+\--9=?A-Z^-~]/);function $p(e){return e!==null&&(e<32||e===127)}const Lp=ti(/\d/),$5=ti(/[\dA-Fa-f]/),L5=ti(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function Vn(e){return e!==null&&(e<0||e===32)}function nt(e){return e===-2||e===-1||e===32}const P5=ti(new RegExp("\\p{P}|\\p{S}","u")),U5=ti(/\s/);function ti(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const u=e.charCodeAt(n);let l="";if(u===37&&Qn(e.charCodeAt(n+1))&&Qn(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 yt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return nt(h)?(e.enter(n),f(h)):t(h)}function f(h){return nt(h)&&u++<s?(e.consume(h),f):(e.exit(n),t(h))}}const V5={tokenize:B5};function B5(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"),yt(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 Re(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),l)}}const Z5={tokenize:I5},Sk={tokenize:H5};function I5(e){const t=this,n=[];let a=0,s,u,l;return f;function f(T){if(a<n.length){const L=n[a];return t.containerState=L[1],e.attempt(L[0].continuation,h,m)(T)}return m(T)}function h(T){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const L=t.events.length;let U=L,D;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){D=t.events[U][1].end;break}E(a);let Z=L;for(;Z<t.events.length;)t.events[Z][1].end={...D},Z++;return Ur(t.events,U+1,0,t.events.slice(L)),t.events.length=Z,m(T)}return f(T)}function m(T){if(a===n.length){if(!s)return b(T);if(s.currentConstruct&&s.currentConstruct.concrete)return S(T);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sk,g,y)(T)}function g(T){return s&&A(),E(a),b(T)}function y(T){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(T)}function b(T){return t.containerState={},e.attempt(Sk,v,S)(T)}function v(T){return a++,n.push([t.currentConstruct,t.containerState]),b(T)}function S(T){if(T===null){s&&A(),E(0),e.consume(T);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),N(T)}function N(T){if(T===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(T);return}return Re(T)?(e.consume(T),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(T),N)}function C(T,L){const U=t.sliceStream(T);if(L&&U.push(null),T.previous=u,u&&(u.next=T),u=T,s.defineSkip(T.start),s.write(U),t.parser.lazy[T.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<l&&(!s.events[D][1].end||s.events[D][1].end.offset>l))return;const Z=t.events.length;let R=Z,J,ue;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(J){ue=t.events[R][1].end;break}J=!0}for(E(a),D=Z;D<t.events.length;)t.events[D][1].end={...ue},D++;Ur(t.events,R+1,0,t.events.slice(Z)),t.events.length=D}}function E(T){let L=n.length;for(;L-- >T;){const U=n[L];t.containerState=U[1],U[0].exit.call(t,e)}n.length=T}function A(){s.write([null]),u=void 0,s=void 0,t.containerState._closeFlow=void 0}}function H5(e,t,n){return yt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zk(e){if(e===null||Vn(e)||U5(e))return 1;if(P5(e))return 2}function Jg(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 Pp={name:"attention",resolveAll:F5,tokenize:q5};function F5(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},b={...e[n][1].start};_k(y,-h),_k(b,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:b},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...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=dr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=dr(m,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=dr(m,Jg(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=dr(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=dr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Ur(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 q5(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=zk(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=zk(h),y=!g||g===2&&s||n.includes(h),b=!s||s===2&&g||n.includes(a);return m._open=!!(u===42?y:y&&(s||!b)),m._close=!!(u===42?b:b&&(g||!y)),t(h)}}function _k(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G5={name:"autolink",tokenize:Y5};function Y5(e,t,n){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(v){return $r(v)?(e.consume(v),l):v===64?n(v):m(v)}function l(v){return v===43||v===45||v===46||Qn(v)?(a=1,f(v)):m(v)}function f(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||Qn(v))&&a++<32?(e.consume(v),f):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||$p(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),g):D5(v)?(e.consume(v),m):n(v)}function g(v){return Qn(v)?y(v):n(v)}function y(v){return v===46?(e.consume(v),a=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||Qn(v))&&a++<63){const S=v===45?b:y;return e.consume(v),S}return n(v)}}const bd={partial:!0,tokenize:K5};function K5(e,t,n){return a;function a(u){return nt(u)?yt(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||Re(u)?t(u):n(u)}}const L_={continuation:{tokenize:J5},exit:Q5,name:"blockQuote",tokenize:X5};function X5(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 nt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function J5(e,t,n){const a=this;return s;function s(l){return nt(l)?yt(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt(L_,t,n)(l)}}function Q5(e){e.exit("blockQuote")}const P_={name:"characterEscape",tokenize:W5};function W5(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 L5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const U_={name:"characterReference",tokenize:e$};function e$(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=Qn,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=$5,g):(e.enter("characterReferenceValue"),u=7,l=Lp,g(y))}function g(y){if(y===59&&s){const b=e.exit("characterReferenceValue");return l===Qn&&!Xg(a.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&s++<u?(e.consume(y),g):n(y)}}const jk={partial:!0,tokenize:n$},Nk={concrete:!0,name:"codeFenced",tokenize:t$};function t$(e,t,n){const a=this,s={partial:!0,tokenize:U};let u=0,l=0,f;return h;function h(D){return m(D)}function m(D){const Z=a.events[a.events.length-1];return u=Z&&Z[1].type==="linePrefix"?Z[2].sliceSerialize(Z[1],!0).length:0,f=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(D)}function g(D){return D===f?(l++,e.consume(D),g):l<3?n(D):(e.exit("codeFencedFenceSequence"),nt(D)?yt(e,y,"whitespace")(D):y(D))}function y(D){return D===null||Re(D)?(e.exit("codeFencedFence"),a.interrupt?t(D):e.check(jk,N,L)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Re(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(D)):nt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),yt(e,v,"whitespace")(D)):D===96&&D===f?n(D):(e.consume(D),b)}function v(D){return D===null||Re(D)?y(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Re(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(D)):D===96&&D===f?n(D):(e.consume(D),S)}function N(D){return e.attempt(s,L,C)(D)}function C(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),E}function E(D){return u>0&&nt(D)?yt(e,A,"linePrefix",u+1)(D):A(D)}function A(D){return D===null||Re(D)?e.check(jk,N,L)(D):(e.enter("codeFlowValue"),T(D))}function T(D){return D===null||Re(D)?(e.exit("codeFlowValue"),A(D)):(e.consume(D),T)}function L(D){return e.exit("codeFenced"),t(D)}function U(D,Z,R){let J=0;return ue;function ue(se){return D.enter("lineEnding"),D.consume(se),D.exit("lineEnding"),le}function le(se){return D.enter("codeFencedFence"),nt(se)?yt(D,re,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):re(se)}function re(se){return se===f?(D.enter("codeFencedFenceSequence"),ae(se)):R(se)}function ae(se){return se===f?(J++,D.consume(se),ae):J>=l?(D.exit("codeFencedFenceSequence"),nt(se)?yt(D,te,"whitespace")(se):te(se)):R(se)}function te(se){return se===null||Re(se)?(D.exit("codeFencedFence"),Z(se)):R(se)}}}function n$(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 _m={name:"codeIndented",tokenize:a$},r$={partial:!0,tokenize:i$};function a$(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),yt(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):Re(m)?e.attempt(r$,l,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Re(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function i$(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):Re(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):yt(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):Re(l)?s(l):n(l)}}const s$={name:"codeText",previous:l$,resolve:o$,tokenize:u$};function o$(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 l$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u$(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)):Re(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||Re(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 c${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&&fl(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),fl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fl(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);fl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fl(this.left,n.reverse())}}}function fl(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 V_(e){const t={};let n=-1,a,s,u,l,f,h,m;const g=new c$(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,d$(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 Ur(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function d$(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,b=-1,v=n,S=0,N=0;const C=[N];for(;v;){for(;e.get(++s)[1]!==v;);u.push(s),v._tokenizer||(g=a.sliceStream(v),v.next||g.push(null),y&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=v,v=v.next}for(v=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(N=b+1,C.push(N),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):C.pop(),b=C.length;b--;){const E=f.slice(C[b],C[b+1]),A=u.pop();h.push([A,A+E.length-1]),e.splice(A,2,E)}for(h.reverse(),b=-1;++b<h.length;)m[S+h[b][0]]=S+h[b][1],S+=h[b][1]-h[b][0]-1;return m}const f$={resolve:m$,tokenize:p$},h$={partial:!0,tokenize:g$};function m$(e){return V_(e),e}function p$(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):Re(f)?e.check(h$,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 g$(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),yt(e,u,"linePrefix")}function u(l){if(l===null||Re(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 B_(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),b):E===null||E===32||E===41||$p(E)?n(E):(e.enter(a),e.enter(l),e.enter(f),e.enter("chunkString",{contentType:"string"}),N(E))}function b(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"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(f),b(E)):E===null||E===60||Re(E)?n(E):(e.consume(E),E===92?S:v)}function S(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function N(E){return!g&&(E===null||E===41||Vn(E))?(e.exit("chunkString"),e.exit(f),e.exit(l),e.exit(a),t(E)):g<m&&E===40?(e.consume(E),g++,N):E===41?(e.consume(E),g--,N):E===null||E===32||E===40||$p(E)?n(E):(e.consume(E),E===92?C:N)}function C(E){return E===40||E===41||E===92?(e.consume(E),N):N(E)}}function Z_(e,t,n,a,s,u){const l=this;let f=0,h;return m;function m(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(u),g}function g(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(u),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):Re(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===null||v===91||v===93||Re(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!nt(v)),v===92?b:y)}function b(v){return v===91||v===92||v===93?(e.consume(v),f++,y):y(v)}}function I_(e,t,n,a,s,u){let l;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(s),e.consume(b),e.exit(s),l=b===40?41:b,h):n(b)}function h(b){return b===l?(e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):(e.enter(u),m(b))}function m(b){return b===l?(e.exit(u),h(l)):b===null?n(b):Re(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),yt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||Re(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?y:g)}function y(b){return b===l||b===92?(e.consume(b),g):g(b)}}function _l(e,t){let n;return a;function a(s){return Re(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):nt(s)?yt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const x$={name:"definition",tokenize:b$},y$={partial:!0,tokenize:v$};function b$(e,t,n){const a=this;let s;return u;function u(v){return e.enter("definition"),l(v)}function l(v){return Z_.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=qs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return Vn(v)?_l(e,m)(v):m(v)}function m(v){return B_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(y$,y,y)(v)}function y(v){return nt(v)?yt(e,b,"whitespace")(v):b(v)}function b(v){return v===null||Re(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function v$(e,t,n){return a;function a(f){return Vn(f)?_l(e,s)(f):n(f)}function s(f){return I_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return nt(f)?yt(e,l,"whitespace")(f):l(f)}function l(f){return f===null||Re(f)?t(f):n(f)}}const k$={name:"hardBreakEscape",tokenize:w$};function w$(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),s}function s(u){return Re(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const S$={name:"headingAtx",resolve:z$,tokenize:_$};function z$(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"},Ur(e,a,n-a+1,[["enter",s,t],["enter",u,t],["exit",u,t],["exit",s,t]])),e}function _$(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||Vn(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Re(g)?(e.exit("atxHeading"),t(g)):nt(g)?yt(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||Vn(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const j$=["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"],Ck=["pre","script","style","textarea"],N$={concrete:!0,name:"htmlFlow",resolveTo:E$,tokenize:A$},C$={partial:!0,tokenize:R$},T$={partial:!0,tokenize:O$};function E$(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 A$(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),b):w===47?(e.consume(w),u=!0,N):w===63?(e.consume(w),s=3,a.interrupt?t:O):$r(w)?(e.consume(w),l=String.fromCharCode(w),C):n(w)}function b(w){return w===45?(e.consume(w),s=2,v):w===91?(e.consume(w),s=5,f=0,S):$r(w)?(e.consume(w),s=4,a.interrupt?t:O):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:O):n(w)}function S(w){const G="CDATA[";return w===G.charCodeAt(f++)?(e.consume(w),f===G.length?a.interrupt?t:re:S):n(w)}function N(w){return $r(w)?(e.consume(w),l=String.fromCharCode(w),C):n(w)}function C(w){if(w===null||w===47||w===62||Vn(w)){const G=w===47,he=l.toLowerCase();return!G&&!u&&Ck.includes(he)?(s=1,a.interrupt?t(w):re(w)):j$.includes(l.toLowerCase())?(s=6,G?(e.consume(w),E):a.interrupt?t(w):re(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?A(w):T(w))}return w===45||Qn(w)?(e.consume(w),l+=String.fromCharCode(w),C):n(w)}function E(w){return w===62?(e.consume(w),a.interrupt?t:re):n(w)}function A(w){return nt(w)?(e.consume(w),A):ue(w)}function T(w){return w===47?(e.consume(w),ue):w===58||w===95||$r(w)?(e.consume(w),L):nt(w)?(e.consume(w),T):ue(w)}function L(w){return w===45||w===46||w===58||w===95||Qn(w)?(e.consume(w),L):U(w)}function U(w){return w===61?(e.consume(w),D):nt(w)?(e.consume(w),U):T(w)}function D(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,Z):nt(w)?(e.consume(w),D):R(w)}function Z(w){return w===h?(e.consume(w),h=null,J):w===null||Re(w)?n(w):(e.consume(w),Z)}function R(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Vn(w)?U(w):(e.consume(w),R)}function J(w){return w===47||w===62||nt(w)?T(w):n(w)}function ue(w){return w===62?(e.consume(w),le):n(w)}function le(w){return w===null||Re(w)?re(w):nt(w)?(e.consume(w),le):n(w)}function re(w){return w===45&&s===2?(e.consume(w),V):w===60&&s===1?(e.consume(w),Q):w===62&&s===4?(e.consume(w),j):w===63&&s===3?(e.consume(w),O):w===93&&s===5?(e.consume(w),be):Re(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(C$,F,ae)(w)):w===null||Re(w)?(e.exit("htmlFlowData"),ae(w)):(e.consume(w),re)}function ae(w){return e.check(T$,te,F)(w)}function te(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),se}function se(w){return w===null||Re(w)?ae(w):(e.enter("htmlFlowData"),re(w))}function V(w){return w===45?(e.consume(w),O):re(w)}function Q(w){return w===47?(e.consume(w),l="",Y):re(w)}function Y(w){if(w===62){const G=l.toLowerCase();return Ck.includes(G)?(e.consume(w),j):re(w)}return $r(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),Y):re(w)}function be(w){return w===93?(e.consume(w),O):re(w)}function O(w){return w===62?(e.consume(w),j):w===45&&s===2?(e.consume(w),O):re(w)}function j(w){return w===null||Re(w)?(e.exit("htmlFlowData"),F(w)):(e.consume(w),j)}function F(w){return e.exit("htmlFlow"),t(w)}}function O$(e,t,n){const a=this;return s;function s(l){return Re(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 R$(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(bd,t,n)}}const M$={name:"htmlText",tokenize:D$};function D$(e,t,n){const a=this;let s,u,l;return f;function f(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),U):O===63?(e.consume(O),T):$r(O)?(e.consume(O),R):n(O)}function m(O){return O===45?(e.consume(O),g):O===91?(e.consume(O),u=0,S):$r(O)?(e.consume(O),A):n(O)}function g(O){return O===45?(e.consume(O),v):n(O)}function y(O){return O===null?n(O):O===45?(e.consume(O),b):Re(O)?(l=y,Q(O)):(e.consume(O),y)}function b(O){return O===45?(e.consume(O),v):y(O)}function v(O){return O===62?V(O):O===45?b(O):y(O)}function S(O){const j="CDATA[";return O===j.charCodeAt(u++)?(e.consume(O),u===j.length?N:S):n(O)}function N(O){return O===null?n(O):O===93?(e.consume(O),C):Re(O)?(l=N,Q(O)):(e.consume(O),N)}function C(O){return O===93?(e.consume(O),E):N(O)}function E(O){return O===62?V(O):O===93?(e.consume(O),E):N(O)}function A(O){return O===null||O===62?V(O):Re(O)?(l=A,Q(O)):(e.consume(O),A)}function T(O){return O===null?n(O):O===63?(e.consume(O),L):Re(O)?(l=T,Q(O)):(e.consume(O),T)}function L(O){return O===62?V(O):T(O)}function U(O){return $r(O)?(e.consume(O),D):n(O)}function D(O){return O===45||Qn(O)?(e.consume(O),D):Z(O)}function Z(O){return Re(O)?(l=Z,Q(O)):nt(O)?(e.consume(O),Z):V(O)}function R(O){return O===45||Qn(O)?(e.consume(O),R):O===47||O===62||Vn(O)?J(O):n(O)}function J(O){return O===47?(e.consume(O),V):O===58||O===95||$r(O)?(e.consume(O),ue):Re(O)?(l=J,Q(O)):nt(O)?(e.consume(O),J):V(O)}function ue(O){return O===45||O===46||O===58||O===95||Qn(O)?(e.consume(O),ue):le(O)}function le(O){return O===61?(e.consume(O),re):Re(O)?(l=le,Q(O)):nt(O)?(e.consume(O),le):J(O)}function re(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,ae):Re(O)?(l=re,Q(O)):nt(O)?(e.consume(O),re):(e.consume(O),te)}function ae(O){return O===s?(e.consume(O),s=void 0,se):O===null?n(O):Re(O)?(l=ae,Q(O)):(e.consume(O),ae)}function te(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Vn(O)?J(O):(e.consume(O),te)}function se(O){return O===47||O===62||Vn(O)?J(O):n(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return nt(O)?yt(e,be,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):be(O)}function be(O){return e.enter("htmlTextData"),l(O)}}const Qg={name:"labelEnd",resolveAll:U$,resolveTo:V$,tokenize:B$},$$={tokenize:Z$},L$={tokenize:I$},P$={tokenize:H$};function U$(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&&Ur(e,0,e.length,n),e}function V$(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=dr(f,e.slice(u+1,u+a+3)),f=dr(f,[["enter",g,t]]),f=dr(f,Jg(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),f=dr(f,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),f=dr(f,e.slice(l+1)),f=dr(f,[["exit",h,t]]),Ur(e,u,e.length,f),e}function B$(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(b){return u?u._inactive?y(b):(l=a.parser.defined.includes(qs(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt($$,g,l?g:y)(b):b===91?e.attempt(L$,g,l?m:y)(b):l?g(b):y(b)}function m(b){return e.attempt(P$,g,y)(b)}function g(b){return t(b)}function y(b){return u._balanced=!0,n(b)}}function Z$(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 Vn(y)?_l(e,u)(y):u(y)}function u(y){return y===41?g(y):B_(e,l,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return Vn(y)?_l(e,h)(y):g(y)}function f(y){return n(y)}function h(y){return y===34||y===39||y===40?I_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function m(y){return Vn(y)?_l(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 I$(e,t,n){const a=this;return s;function s(f){return Z_.call(a,e,u,l,"reference","referenceMarker","referenceString")(f)}function u(f){return a.parser.defined.includes(qs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function l(f){return n(f)}}function H$(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 F$={name:"labelStartImage",resolveAll:Qg.resolveAll,tokenize:q$};function q$(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 G$={name:"labelStartLink",resolveAll:Qg.resolveAll,tokenize:Y$};function Y$(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 jm={name:"lineEnding",tokenize:K$};function K$(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),yt(e,t,"linePrefix")}}const Zc={name:"thematicBreak",tokenize:X$};function X$(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||Re(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),nt(m)?yt(e,f,"whitespace")(m):f(m))}}const Un={continuation:{tokenize:e6},exit:n6,name:"list",tokenize:W$},J$={partial:!0,tokenize:r6},Q$={partial:!0,tokenize:t6};function W$(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(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Lp(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Zc,n,m)(v):m(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return Lp(v)&&++l<10?(e.consume(v),h):(!a.interrupt||l<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(bd,a.interrupt?n:g,e.attempt(J$,b,y))}function g(v){return a.containerState.initialBlankLine=!0,u++,b(v)}function y(v){return nt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function e6(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(bd,s,u);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,yt(e,t,"listItemIndent",a.containerState.size+1)(f)}function u(f){return a.containerState.furtherBlankLines||!nt(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(Q$,t,l)(f))}function l(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,yt(e,e.attempt(Un,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function t6(e,t,n){const a=this;return yt(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 n6(e){e.exit(this.containerState.type)}function r6(e,t,n){const a=this;return yt(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!nt(u)&&l&&l[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const Tk={name:"setextUnderline",resolveTo:a6,tokenize:i6};function a6(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 i6(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"),nt(m)?yt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Re(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const s6={tokenize:o6};function o6(e){const t=this,n=e.attempt(bd,a,e.attempt(this.parser.constructs.flowInitial,s,yt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(f$,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 l6={resolveAll:F_()},u6=H_("string"),c6=H_("text");function H_(e){return{resolveAll:F_(e==="text"?d6: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 b=-1;if(y)for(;++b<y.length;){const v=y[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function F_(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 d6(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 f6={42:Un,43:Un,45:Un,48:Un,49:Un,50:Un,51:Un,52:Un,53:Un,54:Un,55:Un,56:Un,57:Un,62:L_},h6={91:x$},m6={[-2]:_m,[-1]:_m,32:_m},p6={35:S$,42:Zc,45:[Tk,Zc],60:N$,61:Tk,95:Zc,96:Nk,126:Nk},g6={38:U_,92:P_},x6={[-5]:jm,[-4]:jm,[-3]:jm,33:F$,38:U_,42:Pp,60:[G5,M$],91:G$,92:[k$,P_],93:Qg,95:Pp,96:s$},y6={null:[Pp,l6]},b6={null:[42,95]},v6={null:[]},k6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:b6,contentInitial:h6,disable:v6,document:f6,flow:p6,flowInitial:m6,insideSpan:y6,string:g6,text:x6},Symbol.toStringTag,{value:"Module"}));function w6(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:Z(U),check:Z(D),consume:A,enter:T,exit:L,interrupt:Z(D,{interrupt:!0})},m={code:null,containerState:{},defineSkip:N,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:y};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function y(le){return l=dr(l,le),C(),l[l.length-1]!==null?[]:(R(t,0),m.events=Jg(u,m.events,m),m.events)}function b(le,re){return z6(v(le),re)}function v(le){return S6(l,le)}function S(){const{_bufferIndex:le,_index:re,line:ae,column:te,offset:se}=a;return{_bufferIndex:le,_index:re,line:ae,column:te,offset:se}}function N(le){s[le.line]=le.column,ue()}function C(){let le;for(;a._index<l.length;){const re=l[a._index];if(typeof re=="string")for(le=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===le&&a._bufferIndex<re.length;)E(re.charCodeAt(a._bufferIndex));else E(re)}}function E(le){g=g(le)}function A(le){Re(le)?(a.line++,a.column=1,a.offset+=le===-3?2:1,ue()):le!==-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=le}function T(le,re){const ae=re||{};return ae.type=le,ae.start=S(),m.events.push(["enter",ae,m]),f.push(ae),ae}function L(le){const re=f.pop();return re.end=S(),m.events.push(["exit",re,m]),re}function U(le,re){R(le,re.from)}function D(le,re){re.restore()}function Z(le,re){return ae;function ae(te,se,V){let Q,Y,be,O;return Array.isArray(te)?F(te):"tokenize"in te?F([te]):j(te);function j(me){return fe;function fe(Ze){const Te=Ze!==null&&me[Ze],bt=Ze!==null&&me.null,Ae=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(bt)?bt:bt?[bt]:[]];return F(Ae)(Ze)}}function F(me){return Q=me,Y=0,me.length===0?V:w(me[Y])}function w(me){return fe;function fe(Ze){return O=J(),be=me,me.partial||(m.currentConstruct=me),me.name&&m.parser.constructs.disable.null.includes(me.name)?he():me.tokenize.call(re?Object.assign(Object.create(m),re):m,h,G,he)(Ze)}}function G(me){return le(be,O),se}function he(me){return O.restore(),++Y<Q.length?w(Q[Y]):V}}}function R(le,re){le.resolveAll&&!u.includes(le)&&u.push(le),le.resolve&&Ur(m.events,re,m.events.length-re,le.resolve(m.events.slice(re),m)),le.resolveTo&&(m.events=le.resolveTo(m.events,m))}function J(){const le=S(),re=m.previous,ae=m.currentConstruct,te=m.events.length,se=Array.from(f);return{from:te,restore:V};function V(){a=le,m.previous=re,m.currentConstruct=ae,m.events.length=te,f=se,ue()}}function ue(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function S6(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 z6(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 _6(e){const a={constructs:O5([k6,...(e||{}).extensions||[]]),content:s(V5),defined:[],document:s(Z5),flow:s(s6),lazy:{},string:s(u6),text:s(c6)};return a;function s(u){return l;function l(f){return w6(a,u,f)}}}function j6(e){for(;!V_(e););return e}const Ek=/[\0\t\n\r]/g;function N6(){let e=1,t="",n=!0,a;return s;function s(u,l,f){const h=[];let m,g,y,b,v;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(l||void 0).decode(u)),y=0,t="",n&&(u.charCodeAt(0)===65279&&y++,n=void 0);y<u.length;){if(Ek.lastIndex=y,m=Ek.exec(u),b=m&&m.index!==void 0?m.index:u.length,v=u.charCodeAt(b),!m){t=u.slice(y);break}if(v===10&&y===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<b&&(h.push(u.slice(y,b)),e+=b-y),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}y=b+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const C6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function T6(e){return e.replace(C6,E6)}function E6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),u=s===120||s===88;return $_(n.slice(u?2:1),u?16:10)}return Xg(n)||e}const q_={}.hasOwnProperty;function A6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),O6(n)(j6(_6(n).document().write(N6()(e,t,!0))))}function O6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(at),autolinkProtocol:J,autolinkEmail:J,atxHeading:u(Rt),blockQuote:u(bt),characterEscape:J,characterReference:J,codeFenced:u(Ae),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Ae,l),codeText:u(Oe,l),codeTextData:J,data:J,codeFlowValue:J,definition:u(Se),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(rt),hardBreakEscape:u($e),hardBreakTrailing:u($e),htmlFlow:u(Fe,l),htmlFlowData:J,htmlText:u(Fe,l),htmlTextData:J,image:u(ft),label:l,link:u(at),listItem:u(En),listItemValue:b,listOrdered:u(Bt,y),listUnordered:u(Bt),paragraph:u(Nt),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(Rt),strong:u(M),thematicBreak:u(Lt)},exit:{atxHeading:h(),atxHeadingSequence:U,autolink:h(),autolinkEmail:Te,autolinkProtocol:Ze,blockQuote:h(),characterEscapeValue:ue,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:me,characterReference:fe,codeFenced:h(C),codeFencedFence:N,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:ue,codeIndented:h(E),codeText:h(se),codeTextData:ue,data:ue,definition:h(),definitionDestinationString:L,definitionLabelString:A,definitionTitleString:T,emphasis:h(),hardBreakEscape:h(re),hardBreakTrailing:h(re),htmlFlow:h(ae),htmlFlowData:ue,htmlText:h(te),htmlTextData:ue,image:h(Q),label:be,labelText:Y,lineEnding:le,link:h(V),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:G,resourceDestinationString:O,resourceTitleString:j,resource:F,setextHeading:h(R),setextHeadingLineSequence:Z,setextHeadingText:D,strong:h(),thematicBreak:h()}};G_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(K){let ce={type:"root",children:[]};const ge={stack:[ce],tokenStack:[],config:t,enter:f,exit:m,buffer:l,resume:g,data:n},Ee=[];let qe=-1;for(;++qe<K.length;)if(K[qe][1].type==="listOrdered"||K[qe][1].type==="listUnordered")if(K[qe][0]==="enter")Ee.push(qe);else{const kn=Ee.pop();qe=s(K,kn,qe)}for(qe=-1;++qe<K.length;){const kn=t[K[qe][0]];q_.call(kn,K[qe][1].type)&&kn[K[qe][1].type].call(Object.assign({sliceSerialize:K[qe][2].sliceSerialize},ge),K[qe][1])}if(ge.tokenStack.length>0){const kn=ge.tokenStack[ge.tokenStack.length-1];(kn[1]||Ak).call(ge,void 0,kn[0])}for(ce.position={start:Pa(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Pa(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)ce=t.transforms[qe](ce)||ce;return ce}function s(K,ce,ge){let Ee=ce-1,qe=-1,kn=!1,In,wn,Jt,An;for(;++Ee<=ge;){const ht=K[Ee];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?qe++:qe--,An=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(In&&!An&&!qe&&!Jt&&(Jt=Ee),An=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:An=void 0}if(!qe&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||qe===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(In){let ha=Ee;for(wn=void 0;ha--;){const vr=K[ha];if(vr[1].type==="lineEnding"||vr[1].type==="lineEndingBlank"){if(vr[0]==="exit")continue;wn&&(K[wn][1].type="lineEndingBlank",kn=!0),vr[1].type="lineEnding",wn=ha}else if(!(vr[1].type==="linePrefix"||vr[1].type==="blockQuotePrefix"||vr[1].type==="blockQuotePrefixWhitespace"||vr[1].type==="blockQuoteMarker"||vr[1].type==="listItemIndent"))break}Jt&&(!wn||Jt<wn)&&(In._spread=!0),In.end=Object.assign({},wn?K[wn][1].start:ht[1].end),K.splice(wn||Ee,0,["exit",In,ht[2]]),Ee++,ge++}if(ht[1].type==="listItemPrefix"){const ha={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};In=ha,K.splice(Ee,0,["enter",ha,ht[2]]),Ee++,ge++,Jt=void 0,An=!0}}}return K[ce][1]._spread=kn,ge}function u(K,ce){return ge;function ge(Ee){f.call(this,K(Ee),Ee),ce&&ce.call(this,Ee)}}function l(){this.stack.push({type:"fragment",children:[]})}function f(K,ce,ge){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([ce,ge||void 0]),K.position={start:Pa(ce.start),end:void 0}}function h(K){return ce;function ce(ge){K&&K.call(this,ge),m.call(this,ge)}}function m(K,ce){const ge=this.stack.pop(),Ee=this.tokenStack.pop();if(Ee)Ee[0].type!==K.type&&(ce?ce.call(this,K,Ee[0]):(Ee[1]||Ak).call(this,K,Ee[0]));else throw new Error("Cannot close `"+K.type+"` ("+zl({start:K.start,end:K.end})+"): it’s not open");ge.position.end=Pa(K.end)}function g(){return E5(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(K){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function v(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=K}function S(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=K}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.value=K.replace(/(\r?\n|\r)$/g,"")}function A(K){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.label=ce,ge.identifier=qs(this.sliceSerialize(K)).toLowerCase()}function T(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.title=K}function L(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.url=K}function U(K){const ce=this.stack[this.stack.length-1];if(!ce.depth){const ge=this.sliceSerialize(K).length;ce.depth=ge}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function Z(K){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function J(K){const ge=this.stack[this.stack.length-1].children;let Ee=ge[ge.length-1];(!Ee||Ee.type!=="text")&&(Ee=_e(),Ee.position={start:Pa(K.start),end:void 0},ge.push(Ee)),this.stack.push(Ee)}function ue(K){const ce=this.stack.pop();ce.value+=this.sliceSerialize(K),ce.position.end=Pa(K.end)}function le(K){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ge=ce.children[ce.children.length-1];ge.position.end=Pa(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(J.call(this,K),ue.call(this,K))}function re(){this.data.atHardBreak=!0}function ae(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.value=K}function te(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.value=K}function se(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.value=K}function V(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ce,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function Q(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=ce,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function Y(K){const ce=this.sliceSerialize(K),ge=this.stack[this.stack.length-2];ge.label=T6(ce),ge.identifier=qs(ce).toLowerCase()}function be(){const K=this.stack[this.stack.length-1],ce=this.resume(),ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,ge.type==="link"){const Ee=K.children;ge.children=Ee}else ge.alt=ce}function O(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.url=K}function j(){const K=this.resume(),ce=this.stack[this.stack.length-1];ce.title=K}function F(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function G(K){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.label=ce,ge.identifier=qs(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function he(K){this.data.characterReferenceType=K.type}function me(K){const ce=this.sliceSerialize(K),ge=this.data.characterReferenceType;let Ee;ge?(Ee=$_(ce,ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ee=Xg(ce);const qe=this.stack[this.stack.length-1];qe.value+=Ee}function fe(K){const ce=this.stack.pop();ce.position.end=Pa(K.end)}function Ze(K){ue.call(this,K);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(K)}function Te(K){ue.call(this,K);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(K)}function bt(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function rt(){return{type:"emphasis",children:[]}}function Rt(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function at(){return{type:"link",title:null,url:"",children:[]}}function Bt(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function En(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Nt(){return{type:"paragraph",children:[]}}function M(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function Lt(){return{type:"thematicBreak"}}}function Pa(e){return{line:e.line,column:e.column,offset:e.offset}}function G_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?G_(e,a):R6(e,a)}}function R6(e,t){let n;for(n in t)if(q_.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 Ak(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zl({start:t.start,end:t.end})+") is still open")}function M6(e){const t=this;t.parser=n;function n(a){return A6(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function D6(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 $6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
23
|
+
`}]}function L6(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 P6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=lo(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 B6(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 Z6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Y_(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 I6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Y_(e,t);const s={src:lo(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 H6(e,t){const n={src:lo(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 F6(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 q6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Y_(e,t);const s={href:lo(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 G6(e,t){const n={href:lo(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 Y6(e,t,n){const a=e.all(t),s=n?K6(n):K_(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 K6(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=K_(n[a])}return t}function K_(e){const t=e.spread;return t??e.children.length>1}function X6(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 J6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function W6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eL(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=qg(t.children[1]),h=T_(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 tL(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],b={},v=l?l[h]:void 0;v&&(b.align=v);let S={type:"element",tagName:u,properties:b,children:[]};y&&(S.children=e.all(y),e.patch(y,S),S=e.applyData(y,S)),m.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function nL(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ok=9,Rk=32;function rL(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const u=[];for(;a;)u.push(Mk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return u.push(Mk(t.slice(s),s>0,!1)),u.join("")}function Mk(e,t,n){let a=0,s=e.length;if(t){let u=e.codePointAt(a);for(;u===Ok||u===Rk;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(s-1);for(;u===Ok||u===Rk;)s--,u=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function aL(e,t){const n={type:"text",value:rL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function iL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const sL={blockquote:D6,break:$6,code:L6,delete:P6,emphasis:U6,footnoteReference:V6,heading:B6,html:Z6,imageReference:I6,image:H6,inlineCode:F6,linkReference:q6,link:G6,listItem:Y6,list:X6,paragraph:J6,root:Q6,strong:W6,table:eL,tableCell:nL,tableRow:tL,text:aL,thematicBreak:iL,toml:wc,yaml:wc,definition:wc,footnoteDefinition:wc};function wc(){}const X_=-1,vd=0,jl=1,ed=2,Wg=3,ex=4,tx=5,nx=6,J_=7,Q_=8,Dk=typeof self=="object"?self:globalThis,oL=(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 vd:case X_:return n(l,s);case jl:{const f=n([],s);for(const h of l)f.push(a(h));return f}case ed:{const f=n({},s);for(const[h,m]of l)f[a(h)]=a(m);return f}case Wg:return n(new Date(l),s);case ex:{const{source:f,flags:h}=l;return n(new RegExp(f,h),s)}case tx:{const f=n(new Map,s);for(const[h,m]of l)f.set(a(h),a(m));return f}case nx:{const f=n(new Set,s);for(const h of l)f.add(a(h));return f}case J_:{const{name:f,message:h}=l;return n(new Dk[f](h),s)}case Q_: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 Dk[u](l),s)};return a},$k=e=>oL(new Map,e)(0),js="",{toString:lL}={},{keys:uL}=Object,hl=e=>{const t=typeof e;if(t!=="object"||!e)return[vd,t];const n=lL.call(e).slice(8,-1);switch(n){case"Array":return[jl,js];case"Object":return[ed,js];case"Date":return[Wg,js];case"RegExp":return[ex,js];case"Map":return[tx,js];case"Set":return[nx,js];case"DataView":return[jl,n]}return n.includes("Array")?[jl,n]:n.includes("Error")?[J_,n]:[ed,n]},Sc=([e,t])=>e===vd&&(t==="function"||t==="symbol"),cL=(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]=hl(l);switch(f){case vd:{let g=l;switch(h){case"bigint":f=Q_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([X_],l)}return s([f,g],l)}case jl:{if(h){let b=l;return h==="DataView"?b=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(l)),s([h,[...b]],l)}const g=[],y=s([f,g],l);for(const b of l)g.push(u(b));return y}case ed:{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 b of uL(l))(e||!Sc(hl(l[b])))&&g.push([u(b),u(l[b])]);return y}case Wg:return s([f,l.toISOString()],l);case ex:{const{source:g,flags:y}=l;return s([f,{source:g,flags:y}],l)}case tx:{const g=[],y=s([f,g],l);for(const[b,v]of l)(e||!(Sc(hl(b))||Sc(hl(v))))&&g.push([u(b),u(v)]);return y}case nx:{const g=[],y=s([f,g],l);for(const b of l)(e||!Sc(hl(b)))&&g.push(u(b));return y}}const{message:m}=l;return s([f,{name:h,message:m}],l)};return u},Lk=(e,{json:t,lossy:n}={})=>{const a=[];return cL(!(t||n),!!t,new Map,a)(e),a},td=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?$k(Lk(e,t)):structuredClone(e):(e,t)=>$k(Lk(e,t));function dL(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 fL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function hL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||dL,a=e.options.footnoteBackLabel||fL,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(),b=lo(y.toLowerCase());let v=0;const S=[],N=e.footnoteCounts.get(y);for(;N!==void 0&&++v<=N;){S.length>0&&S.push({type:"text",value:" "});let A=typeof n=="string"?n:n(h,v);typeof A=="string"&&(A={type:"text",value:A}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const C=g[g.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const A=C.children[C.children.length-1];A&&A.type==="text"?A.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else g.push(...S);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+b},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:{...td(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 W_=(function(e){if(e==null)return xL;if(typeof e=="function")return kd(e);if(typeof e=="object")return Array.isArray(e)?mL(e):pL(e);if(typeof e=="string")return gL(e);throw new Error("Expected function, string, or object as test")});function mL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=W_(e[n]);return kd(a);function a(...s){let u=-1;for(;++u<t.length;)if(t[u].apply(this,s))return!0;return!1}}function pL(e){const t=e;return kd(n);function n(a){const s=a;let u;for(u in e)if(s[u]!==t[u])return!1;return!0}}function gL(e){return kd(t);function t(n){return n&&n.type===e}}function kd(e){return t;function t(n,a,s){return!!(yL(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function xL(){return!0}function yL(e){return e!==null&&typeof e=="object"&&"type"in e}const ej=[],bL=!0,Pk=!1,vL="skip";function kL(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const u=W_(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 v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=ej,S,N,C;if((!t||u(h,m,g[g.length-1]||void 0))&&(v=wL(n(h,g)),v[0]===Pk))return v;if("children"in h&&h.children){const E=h;if(E.children&&v[0]!==vL)for(N=(a?E.children.length:-1)+l,C=g.concat(E);N>-1&&N<E.children.length;){const A=E.children[N];if(S=f(A,N,C)(),S[0]===Pk)return S;N=typeof S[1]=="number"?S[1]:N+l}}return v}}}function wL(e){return Array.isArray(e)?e:typeof e=="number"?[bL,e]:e==null?ej:[e]}function tj(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),kL(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 Up={}.hasOwnProperty,SL={};function zL(e,t){const n=t||SL,a=new Map,s=new Map,u=new Map,l={...sL,...n.handlers},f={all:m,applyData:jL,definitionById:a,footnoteById:s,footnoteCounts:u,footnoteOrder:[],handlers:l,one:h,options:n,patch:_L,wrap:CL};return tj(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:s,b=String(g.identifier).toUpperCase();y.has(b)||y.set(b,g)}}),f;function h(g,y){const b=g.type,v=f.handlers[b];if(Up.call(f.handlers,b)&&v)return v(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in g){const{children:N,...C}=g,E=td(C);return E.children=f.all(g),E}return td(g)}return(f.options.unknownHandler||NL)(f,g,y)}function m(g){const y=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const S=f.one(b[v],g);if(S){if(v&&b[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Uk(S.value)),!Array.isArray(S)&&S.type==="element")){const N=S.children[0];N&&N.type==="text"&&(N.value=Uk(N.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function _L(e,t){e.position&&(t.position=l5(e))}function jL(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,td(u)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function NL(e,t){const n=t.data||{},a="value"in t&&!(Up.call(n,"hProperties")||Up.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 CL(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 Uk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Vk(e,t){const n=zL(e,t),a=n.one(e,void 0),s=hL(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 TL(e,t){return e&&"run"in e?async function(n,a){const s=Vk(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Vk(n,{file:a,...e||t})}}function Bk(e){if(e)throw e}var Nm,Zk;function EL(){if(Zk)return Nm;Zk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},l=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},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 Nm=function h(){var m,g,y,b,v,S,N=arguments[0],C=1,E=arguments.length,A=!1;for(typeof N=="boolean"&&(A=N,N=arguments[1]||{},C=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});C<E;++C)if(m=arguments[C],m!=null)for(g in m)y=f(N,g),b=f(m,g),N!==b&&(A&&b&&(u(b)||(v=s(b)))?(v?(v=!1,S=y&&s(y)?y:[]):S=y&&u(y)?y:{},l(N,{name:g,newValue:h(A,S,b)})):typeof b<"u"&&l(N,{name:g,newValue:b}));return N},Nm}var AL=EL();const Cm=Kp(AL);function Vp(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 OL(){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?RL(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 RL(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 Mr={basename:ML,dirname:DL,extname:$L,join:LL,sep:"/"};function ML(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jl(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 DL(e){if(Jl(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 $L(e){Jl(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 LL(...e){let t=-1,n;for(;++t<e.length;)Jl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PL(n)}function PL(e){Jl(e);const t=e.codePointAt(0)===47;let n=UL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function UL(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 Jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VL={cwd:BL};function BL(){return"/"}function Bp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZL(e){if(typeof e=="string")e=new URL(e);else if(!Bp(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 IL(e)}function IL(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 Tm=["history","path","basename","stem","extname","dirname"];class nj{constructor(t){let n;t?Bp(t)?n={path:t}:typeof t=="string"||HL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":VL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Tm.length;){const u=Tm[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)Tm.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){Am(t,"basename"),Em(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){Ik(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(Em(t,"extname"),Ik(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=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bp(t)&&(t=ZL(t)),Am(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){Am(t,"stem"),Em(t,"stem"),this.path=Mr.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 vn(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 Em(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function Am(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ik(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function HL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FL=(function(e){const a=this.constructor.prototype,s=a[e],u=function(){return s.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),qL={}.hasOwnProperty;class rx extends FL{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=OL()}copy(){const t=new rx;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Cm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Mm("data",this.frozen),this.namespace[t]=n,this):qL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Mm("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=zc(t),a=this.parser||this.Parser;return Om("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Om("process",this.parser||this.Parser),Rm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(u,l){const f=zc(t),h=a.parse(f);a.run(h,f,function(g,y,b){if(g||!y||!b)return m(g);const v=y,S=a.stringify(v,b);KL(S)?b.value=S:b.result=S,m(g,b)});function m(g,y){g||!y?l(g):u?u(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),Om("processSync",this.parser||this.Parser),Rm("processSync",this.compiler||this.Compiler),this.process(t,s),Fk("processSync","process",n),a;function s(u,l){n=!0,Bk(u),a=l}}run(t,n,a){Hk(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=zc(n);s.run(t,h,m);function m(g,y,b){const v=y||t;g?f(g):l?l(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,s;return this.run(t,n,u),Fk("runSync","run",a),s;function u(l,f){Bk(l),s=f,a=!0}}stringify(t,n){this.freeze();const a=zc(n),s=this.compiler||this.Compiler;return Rm("stringify",s),Hk(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(Mm("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=Cm(!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,b=-1;for(;++y<a.length;)if(a[y][0]===m){b=y;break}if(b===-1)a.push([m,...g]);else if(g.length>0){let[v,...S]=g;const N=a[b][1];Vp(N)&&Vp(v)&&(v=Cm(!0,N,v)),a[b]=[m,v,...S]}}}}const GL=new rx().freeze();function Om(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Rm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mm(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 Hk(e){if(!Vp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zc(e){return YL(e)?e:new nj(e)}function YL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function KL(e){return typeof e=="string"||XL(e)}function XL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qk=[],Gk={allowDangerousHtml:!0},QL=/^(https?|ircs?|mailto|xmpp)$/i,WL=[{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 e9(e){const t=t9(e),n=n9(e);return r9(t.runSync(t.parse(n),n),e)}function t9(e){const t=e.rehypePlugins||qk,n=e.remarkPlugins||qk,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gk}:Gk;return GL().use(M6).use(n).use(TL,a).use(t)}function n9(e){const t=e.children||"",n=new nj;return typeof t=="string"&&(n.value=t),n}function r9(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,u=t.disallowedElements,l=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||a9;for(const g of WL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+JL+g.id,void 0);return tj(e,m),h5(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(g,y,b){if(g.type==="raw"&&b&&typeof y=="number")return l?b.children.splice(y,1):b.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let v;for(v in zm)if(Object.hasOwn(zm,v)&&Object.hasOwn(g.properties,v)){const S=g.properties[v],N=zm[v];(N===null||N.includes(g.tagName))&&(g.properties[v]=h(String(S||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!v&&a&&typeof y=="number"&&(v=!a(g,y,b)),v&&b&&typeof y=="number")return f&&g.children?b.children.splice(y,1,...g.children):b.children.splice(y,1),y}}}function a9(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||QL.test(e.slice(0,t))?e:""}const i9=({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(N=>String(N?.name||"").toLowerCase().includes("sati")):!1,g=S=>m(S)?"SATI Memory":"Tool Call",y=S=>{if(typeof S=="string")try{return JSON.stringify(JSON.parse(S),null,2)}catch{return S}try{return JSON.stringify(S,null,2)}catch{return String(S)}},b=S=>{const N=S.usage_metadata;if(!N||typeof N!="object")return null;const C=N.input_tokens??N.prompt_tokens??N.input??0,E=N.output_tokens??N.completion_tokens??N.output??0,A=Number(C),T=Number(E);if(!Number.isFinite(A)&&!Number.isFinite(T))return null;const L=Number.isFinite(A)?Math.max(0,Math.round(A)):0,U=Number.isFinite(T)?Math.max(0,Math.round(T)):0;return L===0&&U===0?null:{input:L,output:U}},v=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,N)=>{const C=b(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(zS,{size:16}):d.jsx(O0,{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(e9,{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}),C&&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(kS,{size:12}),d.jsx("span",{children:v(C.input)}),d.jsx("span",{className:"opacity-60",children:"/"}),d.jsx("span",{children:v(C.output)}),d.jsx(vS,{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(og,{size:18})})]},N)}),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(O0,{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(XA,{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(s9,{size:48,className:"mb-4 opacity-20"}),d.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},s9=({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"})}),Ua={getSessions:async()=>pe.get("/sessions"),createSession:async()=>pe.post("/sessions",{}),deleteSession:async e=>pe.delete(`/sessions/${e}`),renameSession:async(e,t)=>pe.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>pe.post(`/sessions/${e}/archive`,{}),getMessages:async e=>pe.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>pe.post("/chat",{sessionId:e,message:t})};function rj({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:u="Confirm",variant:l="default"}){return d.jsx(pr,{open:e,onOpenChange:t,children:d.jsxs(Js,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(gr,{children:d.jsx(xr,{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(OD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[d.jsx(fr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),d.jsx(fr,{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 o9=()=>{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 D=(await Ua.getMessages(n)).filter(Z=>Z.type!=="system");u(Z=>{if(D.length!==Z.length)return D;const R=D.at(-1)?.created_at??0,J=Z.at(-1)?.created_at??0;return R>J?D:Z})}catch{}},3e3);return()=>clearInterval(L)},[n]);const[y,b]=z.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const L=await Ua.getSessions();t(L)}catch(L){console.error("Failed to load sessions:",L)}};z.useEffect(()=>{v()},[]),z.useEffect(()=>{n?S(n):u([])},[n]);const S=async L=>{try{const U=await Ua.getMessages(L);u(U.filter(D=>D.type!=="system"))}catch(U){console.error("Failed to load messages:",U)}},N=async()=>{try{const L=await Ua.createSession();await v(),a(L.id)}catch(L){console.error("Failed to create session:",L)}},C=async L=>{if(!n)return;const U={type:"human",content:L};u(D=>[...D,U]),f(!0);try{await Ua.sendMessage(n,L),await S(n),await v()}catch(D){console.error("Failed to send message:",D)}finally{f(!1)}},E=L=>{b({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await Ua.archiveSession(L),n===L&&a(null),await v()}catch(U){console.error("Failed to archive session:",U)}}})},A=L=>{b({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await Ua.deleteSession(L),n===L&&a(null),await v()}catch(U){console.error("Failed to delete session:",U)}}})},T=async(L,U)=>{try{await Ua.renameSession(L,U),await v()}catch(D){console.error("Failed to rename session:",D)}};return d.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[d.jsx(PD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:N,onArchiveSession:E,onDeleteSession:A,onRenameSession:T,isOpen:h,toggleSidebar:()=>m(!h)}),d.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:d.jsx(i9,{messages:s,onSendMessage:C,isLoading:l,activeSessionId:n})}),d.jsx(rj,{isOpen:y.isOpen,onClose:()=>b(L=>({...L,isOpen:!1})),onConfirm:y.onConfirm,title:y.title,description:y.description,confirmJson:y.confirmJson,variant:y.variant})]})};function l9(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return xt(`/chronos${n}`,()=>pe.get(`/chronos${n}`))}function u9(e,t=50){return xt(e?`/chronos/${e}/executions?limit=${t}`:null,()=>pe.get(`/chronos/${e}/executions?limit=${t}`))}function aj(){return xt("/config/chronos",()=>pe.get("/config/chronos"))}const Ri={createJob:e=>pe.post("/chronos",e),updateJob:(e,t)=>pe.put(`/chronos/${e}`,t),deleteJob:e=>pe.delete(`/chronos/${e}`),enableJob:e=>pe.patch(`/chronos/${e}/enable`,{}),disableJob:e=>pe.patch(`/chronos/${e}/disable`,{}),getConfig:()=>pe.get("/config/chronos"),updateConfig:e=>pe.post("/config/chronos",e),preview:(e,t,n)=>pe.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function mn({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 c9=(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},d9=(e,t)=>({classGroupId:e,validator:t}),ij=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),nd="-",Yk=[],f9="arbitrary..",h9=e=>{const t=p9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return m9(l);const f=l.split(nd),h=f[0]===""&&f.length>1?1:0;return sj(f,h,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const h=a[l],m=n[l];return h?m?c9(m,h):h:m||Yk}return n[l]||Yk}}},sj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],u=n.nextPart.get(s);if(u){const m=sj(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const f=t===0?e.join(nd):e.slice(t).join(nd),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(f))return g.classGroupId}},m9=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?f9+a:void 0})(),p9=e=>{const{theme:t,classGroups:n}=e;return g9(n,t)},g9=(e,t)=>{const n=ij();for(const a in e){const s=e[a];ax(s,n,a,t)}return n},ax=(e,t,n,a)=>{const s=e.length;for(let u=0;u<s;u++){const l=e[u];x9(l,t,n,a)}},x9=(e,t,n,a)=>{if(typeof e=="string"){y9(e,t,n);return}if(typeof e=="function"){b9(e,t,n,a);return}v9(e,t,n,a)},y9=(e,t,n)=>{const a=e===""?t:oj(t,e);a.classGroupId=n},b9=(e,t,n,a)=>{if(k9(e)){ax(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(d9(n,e))},v9=(e,t,n,a)=>{const s=Object.entries(e),u=s.length;for(let l=0;l<u;l++){const[f,h]=s[l];ax(h,oj(t,f),n,a)}},oj=(e,t)=>{let n=e;const a=t.split(nd),s=a.length;for(let u=0;u<s;u++){const l=a[u];let f=n.nextPart.get(l);f||(f=ij(),n.nextPart.set(l,f)),n=f}return n},k9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,w9=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)}}},Zp="!",Kk=":",S9=[],Xk=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),z9=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 N=0;N<g;N++){const C=s[N];if(l===0&&f===0){if(C===Kk){u.push(s.slice(h,N)),h=N+1;continue}if(C==="/"){m=N;continue}}C==="["?l++:C==="]"?l--:C==="("?f++:C===")"&&f--}const y=u.length===0?s:s.slice(h);let b=y,v=!1;y.endsWith(Zp)?(b=y.slice(0,-1),v=!0):y.startsWith(Zp)&&(b=y.slice(1),v=!0);const S=m&&m>h?m-h:void 0;return Xk(u,v,b,S)};if(t){const s=t+Kk,u=a;a=l=>l.startsWith(s)?u(l.slice(s.length)):Xk(S9,!1,l,void 0,!0)}if(n){const s=a;a=u=>n({className:u,parseClassName:s})}return a},_9=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}},j9=e=>({cache:w9(e.cacheSize),parseClassName:z9(e),sortModifiers:_9(e),...h9(e)}),N9=/\s+/,C9=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:u}=t,l=[],f=e.trim().split(N9);let h="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{isExternal:y,modifiers:b,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:N}=n(g);if(y){h=g+(h.length>0?" "+h:h);continue}let C=!!N,E=a(C?S.substring(0,N):S);if(!E){if(!C){h=g+(h.length>0?" "+h:h);continue}if(E=a(S),!E){h=g+(h.length>0?" "+h:h);continue}C=!1}const A=b.length===0?"":b.length===1?b[0]:u(b).join(":"),T=v?A+Zp:A,L=T+E;if(l.indexOf(L)>-1)continue;l.push(L);const U=s(E,C);for(let D=0;D<U.length;++D){const Z=U[D];l.push(T+Z)}h=g+(h.length>0?" "+h:h)}return h},T9=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=lj(n))&&(s&&(s+=" "),s+=a);return s},lj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=lj(e[a]))&&(n&&(n+=" "),n+=t);return n},E9=(e,...t)=>{let n,a,s,u;const l=h=>{const m=t.reduce((g,y)=>y(g),e());return n=j9(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=C9(h,n);return s(h,g),g};return u=l,(...h)=>u(T9(...h))},A9=[],Wt=e=>{const t=n=>n[e]||A9;return t.isThemeGetter=!0,t},uj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,O9=/^\d+\/\d+$/,R9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,M9=/\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$/,D9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,L9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=e=>O9.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),Va=e=>!!e&&Number.isInteger(Number(e)),Dm=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),sa=e=>R9.test(e),P9=()=>!0,U9=e=>M9.test(e)&&!D9.test(e),dj=()=>!1,V9=e=>$9.test(e),B9=e=>L9.test(e),Z9=e=>!ve(e)&&!ke(e),I9=e=>uo(e,mj,dj),ve=e=>uj.test(e),ji=e=>uo(e,pj,U9),$m=e=>uo(e,Y9,Ve),Jk=e=>uo(e,fj,dj),H9=e=>uo(e,hj,B9),_c=e=>uo(e,gj,V9),ke=e=>cj.test(e),ml=e=>co(e,pj),F9=e=>co(e,K9),Qk=e=>co(e,fj),q9=e=>co(e,mj),G9=e=>co(e,hj),jc=e=>co(e,gj,!0),uo=(e,t,n)=>{const a=uj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},co=(e,t,n=!1)=>{const a=cj.exec(e);return a?a[1]?t(a[1]):n:!1},fj=e=>e==="position"||e==="percentage",hj=e=>e==="image"||e==="url",mj=e=>e==="length"||e==="size"||e==="bg-size",pj=e=>e==="length",Y9=e=>e==="number",K9=e=>e==="family-name",gj=e=>e==="shadow",X9=()=>{const e=Wt("color"),t=Wt("font"),n=Wt("text"),a=Wt("font-weight"),s=Wt("tracking"),u=Wt("leading"),l=Wt("breakpoint"),f=Wt("container"),h=Wt("spacing"),m=Wt("radius"),g=Wt("shadow"),y=Wt("inset-shadow"),b=Wt("text-shadow"),v=Wt("drop-shadow"),S=Wt("blur"),N=Wt("perspective"),C=Wt("aspect"),E=Wt("ease"),A=Wt("animate"),T=()=>["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"],U=()=>[...L(),ke,ve],D=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto","contain","none"],R=()=>[ke,ve,h],J=()=>[Ns,"full","auto",...R()],ue=()=>[Va,"none","subgrid",ke,ve],le=()=>["auto",{span:["full",Va,ke,ve]},Va,ke,ve],re=()=>[Va,"auto",ke,ve],ae=()=>["auto","min","max","fr",ke,ve],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...R()],Q=()=>[Ns,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],Y=()=>[e,ke,ve],be=()=>[...L(),Qk,Jk,{position:[ke,ve]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",q9,I9,{size:[ke,ve]}],F=()=>[Dm,ml,ji],w=()=>["","none","full",m,ke,ve],G=()=>["",Ve,ml,ji],he=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Ve,Dm,Qk,Jk],Ze=()=>["","none",S,ke,ve],Te=()=>["none",Ve,ke,ve],bt=()=>["none",Ve,ke,ve],Ae=()=>[Ve,ke,ve],Oe=()=>[Ns,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sa],breakpoint:[sa],color:[P9],container:[sa],"drop-shadow":[sa],ease:["in","out","in-out"],font:[Z9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sa],shadow:[sa],spacing:["px",Ve],text:[sa],"text-shadow":[sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ns,ve,ke,C]}],container:["container"],columns:[{columns:[Ve,ve,ke,f]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{start:J()}],end:[{end:J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[Va,"auto",ke,ve]}],basis:[{basis:[Ns,"full","auto",f,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,Ns,"auto","initial","none",ve]}],grow:[{grow:["",Ve,ke,ve]}],shrink:[{shrink:["",Ve,ke,ve]}],order:[{order:[Va,"first","last","none",ke,ve]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[f,"screen",...Q()]}],"min-w":[{"min-w":[f,"screen","none",...Q()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,ml,ji]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ke,$m]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dm,ve]}],"font-family":[{font:[F9,ve,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,ke,ve]}],"line-clamp":[{"line-clamp":[Ve,"none",ke,$m]}],leading:[{leading:[u,...R()]}],"list-image":[{"list-image":["none",ke,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",ke,ji]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Ve,"auto",ke,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,ve]}],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",ke,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:be()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Va,ke,ve],radial:["",ke,ve],conic:[Va,ke,ve]},G9,H9]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],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:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,ke,ve]}],"outline-w":[{outline:["",Ve,ml,ji]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",g,jc,_c]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",y,jc,_c]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Ve,ji]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",b,jc,_c]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Ve,ke,ve]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"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":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[ke,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:be()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,ve]}],filter:[{filter:["","none",ke,ve]}],blur:[{blur:Ze()}],brightness:[{brightness:[Ve,ke,ve]}],contrast:[{contrast:[Ve,ke,ve]}],"drop-shadow":[{"drop-shadow":["","none",v,jc,_c]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Ve,ke,ve]}],"hue-rotate":[{"hue-rotate":[Ve,ke,ve]}],invert:[{invert:["",Ve,ke,ve]}],saturate:[{saturate:[Ve,ke,ve]}],sepia:[{sepia:["",Ve,ke,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,ve]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,ke,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,ke,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,ke,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,ke,ve]}],"backdrop-invert":[{"backdrop-invert":["",Ve,ke,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,ke,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,ke,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,ke,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",ke,ve]}],ease:[{ease:["linear","initial",E,ke,ve]}],delay:[{delay:[Ve,ke,ve]}],animate:[{animate:["none",A,ke,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,ke,ve]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Te()}],"rotate-x":[{"rotate-x":Te()}],"rotate-y":[{"rotate-y":Te()}],"rotate-z":[{"rotate-z":Te()}],scale:[{scale:bt()}],"scale-x":[{"scale-x":bt()}],"scale-y":[{"scale-y":bt()}],"scale-z":[{"scale-z":bt()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[ke,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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",ke,ve]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",ke,ve]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Ve,ml,ji,$m]}],stroke:[{stroke:["none",...Y()]}],"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"]}},Gs=E9(X9);function Be({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:Gs("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 gn({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:Gs("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 Vt({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:Gs("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 _r({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:Gs("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:Gs("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:Gs("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const pn={fetchConfig:async()=>pe.get("/config"),updateConfig:async e=>pe.post("/config",e),getSatiConfig:async()=>pe.get("/config/sati"),updateSatiConfig:async e=>pe.post("/config/sati",e),deleteSatiConfig:async()=>pe.delete("/config/sati"),getApocConfig:async()=>pe.get("/config/apoc"),updateApocConfig:async e=>pe.post("/config/apoc",e),deleteApocConfig:async()=>pe.delete("/config/apoc"),getNeoConfig:async()=>pe.get("/config/neo"),updateNeoConfig:async e=>pe.post("/config/neo",e),deleteNeoConfig:async()=>pe.delete("/config/neo"),getTrinityConfig:async()=>pe.get("/config/trinity"),updateTrinityConfig:async e=>pe.post("/config/trinity",e),deleteTrinityConfig:async()=>pe.delete("/config/trinity"),getEncryptionStatus:async()=>pe.get("/config/encryption-status"),getEnvOverrides:async()=>pe.get("/config/env-overrides"),getSmithsConfig:async()=>await pe.get("/smiths/config"),updateSmithsConfig:async e=>pe.put("/smiths/config",e),getSmithsList:async()=>pe.get("/smiths"),pingSmith:async e=>pe.post(`/smiths/${e}/ping`,{}),removeSmith:async e=>pe.delete(`/smiths/${e}`)};function ee(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 b=g[y];b in f||(f[b]=m[b].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 Ys=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xj=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const yj={};function Ja(e){return yj}function bj(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 Ip(e,t){return typeof t=="bigint"?t.toString():t}function wd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ix(e){return e==null}function sx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function J9(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 Wk=Symbol("evaluating");function it(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Wk)return a===void 0&&(a=Wk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Pi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ni(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function ew(e){return JSON.stringify(e)}function Q9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const vj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const W9=wd(()=>{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(Pl(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Pl(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kj(e){return Qs(e)?{...e}:Array.isArray(e)?[...e]:e}const eP=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ri(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function je(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 tP(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const nP={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 rP(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=ni(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 Pi(this,"shape",l),l},checks:[]});return ri(e,u)}function aP(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=ni(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 Pi(this,"shape",l),l},checks:[]});return ri(e,u)}function iP(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=ni(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Pi(this,"shape",u),u}});return ri(e,s)}function sP(e,t){if(!Qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ni(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Pi(this,"shape",a),a}});return ri(e,n)}function oP(e,t){const n=ni(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Pi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ri(e,n)}function lP(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=ni(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 Pi(this,"shape",h),h},checks:[]});return ri(t,l)}function uP(e,t,n){const a=ni(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 Pi(this,"shape",u),u}});return ri(t,a)}function Us(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 Vs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Nc(e){return typeof e=="string"?e:e?.message}function Qa(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Nc(e.inst?._zod.def?.error?.(e))??Nc(t?.error?.(e))??Nc(n.customError?.(e))??Nc(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ox(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ul(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const wj=(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,Ip,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sj=ee("$ZodError",wj),zj=ee("$ZodError",wj,{Parent:Error});function cP(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 dP(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 lx=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 Ys;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Qa(h,u,Ja())));throw vj(f,s?.callee),f}return l.value},ux=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=>Qa(h,u,Ja())));throw vj(f,s?.callee),f}return l.value},Sd=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 Ys;return u.issues.length?{success:!1,error:new(e??Sj)(u.issues.map(l=>Qa(l,s,Ja())))}:{success:!0,data:u.value}},fP=Sd(zj),zd=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=>Qa(l,s,Ja())))}:{success:!0,data:u.value}},hP=zd(zj),mP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return lx(e)(t,n,s)},pP=e=>(t,n,a)=>lx(e)(t,n,a),gP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ux(e)(t,n,s)},xP=e=>async(t,n,a)=>ux(e)(t,n,a),yP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sd(e)(t,n,s)},bP=e=>(t,n,a)=>Sd(e)(t,n,a),vP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return zd(e)(t,n,s)},kP=e=>async(t,n,a)=>zd(e)(t,n,a),wP=/^[cC][^\s-]{8,}$/,SP=/^[0-9a-z]+$/,zP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_P=/^[0-9a-vA-V]{20}$/,jP=/^[A-Za-z0-9]{27}$/,NP=/^[a-zA-Z0-9_-]{21}$/,CP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,TP=/^([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})$/,tw=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)$/,EP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,AP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OP(){return new RegExp(AP,"u")}const RP=/^(?:(?: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])$/,MP=/^(([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}|:))$/,DP=/^((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])$/,$P=/^(([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])$/,LP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_j=/^[A-Za-z0-9_-]*$/,PP=/^\+[1-9]\d{6,14}$/,jj="(?:(?:\\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])))",UP=new RegExp(`^${jj}$`);function Nj(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 VP(e){return new RegExp(`^${Nj(e)}$`)}function BP(e){const t=Nj({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(`^${jj}T(?:${a})$`)}const ZP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},IP=/^-?\d+$/,Cj=/^-?\d+(?:\.\d+)?$/,HP=/^(?:true|false)$/i,FP=/^[^A-Z]*$/,qP=/^[^a-z]*$/,Zn=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tj={number:"number",bigint:"bigint",object:"date"},Ej=ee("$ZodCheckLessThan",(e,t)=>{Zn.init(e,t);const n=Tj[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})}}),Aj=ee("$ZodCheckGreaterThan",(e,t)=>{Zn.init(e,t);const n=Tj[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})}}),GP=ee("$ZodCheckMultipleOf",(e,t)=>{Zn.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):J9(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})}}),YP=ee("$ZodCheckNumberFormat",(e,t)=>{Zn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,u]=nP[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=IP)}),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})}}),KP=ee("$ZodCheckMaxLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ix(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=ox(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),XP=ee("$ZodCheckMinLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ix(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=ox(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),JP=ee("$ZodCheckLengthEquals",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ix(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=ox(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})}}),_d=ee("$ZodCheckStringFormat",(e,t)=>{var n,a;Zn.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=()=>{})}),QP=ee("$ZodCheckRegex",(e,t)=>{_d.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})}}),WP=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=FP),_d.init(e,t)}),eU=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qP),_d.init(e,t)}),tU=ee("$ZodCheckIncludes",(e,t)=>{Zn.init(e,t);const n=Ws(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})}}),nU=ee("$ZodCheckStartsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`^${Ws(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})}}),rU=ee("$ZodCheckEndsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`.*${Ws(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})}}),aU=ee("$ZodCheckOverwrite",(e,t)=>{Zn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let iU=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 sU={major:4,minor:3,patch:6},Tt=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sU;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=Us(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=y._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Ys;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Us(l,b)))});else{if(l.issues.length===b)continue;m||(m=Us(l,b))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Us(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Ys;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 Ys;return h.then(m=>s(m,a,f))}return s(h,a,f)}}it(e,"~standard",()=>({validate:s=>{try{const u=fP(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return hP(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),cx=ee("$ZodString",(e,t)=>{Tt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ZP(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}}),_t=ee("$ZodStringFormat",(e,t)=>{_d.init(e,t),cx.init(e,t)}),oU=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=TP),_t.init(e,t)}),lU=ee("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tw(a))}else t.pattern??(t.pattern=tw());_t.init(e,t)}),uU=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=EP),_t.init(e,t)}),cU=ee("$ZodURL",(e,t)=>{_t.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})}}}),dU=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=OP()),_t.init(e,t)}),fU=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=NP),_t.init(e,t)}),hU=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=wP),_t.init(e,t)}),mU=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=SP),_t.init(e,t)}),pU=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=zP),_t.init(e,t)}),gU=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_P),_t.init(e,t)}),xU=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jP),_t.init(e,t)}),yU=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=BP(t)),_t.init(e,t)}),bU=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=UP),_t.init(e,t)}),vU=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=VP(t)),_t.init(e,t)}),kU=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=CP),_t.init(e,t)}),wU=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=RP),_t.init(e,t),e._zod.bag.format="ipv4"}),SU=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=MP),_t.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})}}}),zU=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=DP),_t.init(e,t)}),_U=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=$P),_t.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 Oj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jU=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=LP),_t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Oj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function NU(e){if(!_j.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Oj(n)}const CU=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_j),_t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{NU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),TU=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=PP),_t.init(e,t)});function EU(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 AU=ee("$ZodJWT",(e,t)=>{_t.init(e,t),e._zod.check=n=>{EU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Rj=ee("$ZodNumber",(e,t)=>{Tt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Cj,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}}),OU=ee("$ZodNumberFormat",(e,t)=>{YP.init(e,t),Rj.init(e,t)}),RU=ee("$ZodBoolean",(e,t)=>{Tt.init(e,t),e._zod.pattern=HP,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}}),MU=ee("$ZodUnknown",(e,t)=>{Tt.init(e,t),e._zod.parse=n=>n}),DU=ee("$ZodNever",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nw(e,t,n){e.issues.length&&t.issues.push(...Vs(n,e.issues)),t.value[n]=e.value}const $U=ee("$ZodArray",(e,t)=>{Tt.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=>nw(m,n,l))):nw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function rd(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Vs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Mj(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=tP(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dj(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 b=h.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(v=>rd(v,n,y,t,g))):rd(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const LU=ee("$ZodObject",(e,t)=>{if(Tt.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=wd(()=>Mj(t));it(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=Pl,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 b of l.keys){const v=y[b],S=v._zod.optout==="optional",N=v._zod.run({value:m[b],issues:[]},h);N instanceof Promise?g.push(N.then(C=>rd(C,f,b,m,S))):rd(N,f,b,m,S)}return u?Dj(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),PU=ee("$ZodObjectJIT",(e,t)=>{LU.init(e,t);const n=e._zod.parse,a=wd(()=>Mj(t)),s=b=>{const v=new iU(["shape","payload","ctx"]),S=a.value,N=T=>{const L=ew(T);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};v.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const T of S.keys)C[T]=`key_${E++}`;v.write("const newResult = {};");for(const T of S.keys){const L=C[T],U=ew(T),Z=b[T]?._zod?.optout==="optional";v.write(`const ${L} = ${N(T)};`),Z?v.write(`
|
|
35
|
+
if (${L}.issues.length) {
|
|
36
|
+
if (${U} in input) {
|
|
37
|
+
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
38
|
+
...iss,
|
|
39
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (${L}.value === undefined) {
|
|
45
|
+
if (${U} in input) {
|
|
46
|
+
newResult[${U}] = undefined;
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
newResult[${U}] = ${L}.value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
`):v.write(`
|
|
53
|
+
if (${L}.issues.length) {
|
|
54
|
+
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
55
|
+
...iss,
|
|
56
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (${L}.value === undefined) {
|
|
61
|
+
if (${U} in input) {
|
|
62
|
+
newResult[${U}] = undefined;
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
newResult[${U}] = ${L}.value;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(T,L)=>A(b,T,L)};let u;const l=Pl,f=!yj.jitless,m=f&&W9.value,g=t.catchall;let y;e._zod.parse=(b,v)=>{y??(y=a.value);const S=b.value;return l(S)?f&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=s(t.shape)),b=u(b,v),g?Dj([],S,b,v,y,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function rw(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=>!Us(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=>Qa(l,a,Ja())))}),t)}const $j=ee("$ZodUnion",(e,t)=>{Tt.init(e,t),it(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),it(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),it(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),it(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=>sx(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=>rw(h,s,e,u)):rw(f,s,e,u)}}),UU=ee("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$j.init(e,t);const n=e._zod.parse;it(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=wd(()=>{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(!Pl(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)}}),VU=ee("$ZodIntersection",(e,t)=>{Tt.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])=>aw(n,h,m)):aw(n,u,l)}});function Hp(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=Hp(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=Hp(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 aw(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}),Us(e))return e;const l=Hp(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 BU=ee("$ZodRecord",(e,t)=>{Tt.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(...Vs(m,y.issues)),n.value[m]=y.value})):(g.issues.length&&n.issues.push(...Vs(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"&&Cj.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=>Qa(y,a,Ja())),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(...Vs(f,y.issues)),n.value[h.value]=y.value})):(g.issues.length&&n.issues.push(...Vs(f,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),ZU=ee("$ZodEnum",(e,t)=>{Tt.init(e,t);const n=bj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>eP.has(typeof s)).map(s=>typeof s=="string"?Ws(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}}),IU=ee("$ZodLiteral",(e,t)=>{if(Tt.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"?Ws(a):a?Ws(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}}),HU=ee("$ZodTransform",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new xj(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 Ys;return n.value=s,n}});function iw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Lj=ee("$ZodOptional",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),it(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(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=>iw(u,n.value)):iw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),FU=ee("$ZodExactOptional",(e,t)=>{Lj.init(e,t),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),qU=ee("$ZodNullable",(e,t)=>{Tt.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)}|null)$`):void 0}),it(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)}),GU=ee("$ZodDefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",it(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=>sw(u,t)):sw(s,t)}});function sw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const YU=ee("$ZodPrefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",it(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))}),KU=ee("$ZodNonOptional",(e,t)=>{Tt.init(e,t),it(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=>ow(u,e)):ow(s,e)}});function ow(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 XU=ee("$ZodCatch",(e,t)=>{Tt.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(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=>Qa(l,a,Ja()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Qa(u,a,Ja()))},input:n.value}),n.issues=[]),n)}}),JU=ee("$ZodPipe",(e,t)=>{Tt.init(e,t),it(e._zod,"values",()=>t.in._zod.values),it(e._zod,"optin",()=>t.in._zod.optin),it(e._zod,"optout",()=>t.out._zod.optout),it(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=>Cc(l,t.in,a)):Cc(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>Cc(u,t.out,a)):Cc(s,t.out,a)}});function Cc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const QU=ee("$ZodReadonly",(e,t)=>{Tt.init(e,t),it(e._zod,"propValues",()=>t.innerType._zod.propValues),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"optin",()=>t.innerType?._zod?.optin),it(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(lw):lw(s)}});function lw(e){return e.value=Object.freeze(e.value),e}const WU=ee("$ZodCustom",(e,t)=>{Zn.init(e,t),Tt.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=>uw(u,n,a,e));uw(s,n,a,e)}});function uw(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(Ul(s))}}var cw;let e8=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 t8(){return new e8}(cw=globalThis).__zod_globalRegistry??(cw.__zod_globalRegistry=t8());const yl=globalThis.__zod_globalRegistry;function n8(e,t){return new e({type:"string",...je(t)})}function r8(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...je(t)})}function dw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...je(t)})}function a8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...je(t)})}function i8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...je(t)})}function s8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...je(t)})}function o8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...je(t)})}function l8(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...je(t)})}function u8(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...je(t)})}function c8(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...je(t)})}function d8(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...je(t)})}function f8(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...je(t)})}function h8(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...je(t)})}function m8(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...je(t)})}function p8(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...je(t)})}function g8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...je(t)})}function x8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...je(t)})}function y8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...je(t)})}function b8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...je(t)})}function v8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...je(t)})}function k8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...je(t)})}function w8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...je(t)})}function S8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...je(t)})}function z8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...je(t)})}function _8(e,t){return new e({type:"string",format:"date",check:"string_format",...je(t)})}function j8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...je(t)})}function N8(e,t){return new e({type:"string",format:"duration",check:"string_format",...je(t)})}function C8(e,t){return new e({type:"number",checks:[],...je(t)})}function T8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...je(t)})}function E8(e,t){return new e({type:"boolean",...je(t)})}function A8(e){return new e({type:"unknown"})}function O8(e,t){return new e({type:"never",...je(t)})}function fw(e,t){return new Ej({check:"less_than",...je(t),value:e,inclusive:!1})}function Lm(e,t){return new Ej({check:"less_than",...je(t),value:e,inclusive:!0})}function hw(e,t){return new Aj({check:"greater_than",...je(t),value:e,inclusive:!1})}function Pm(e,t){return new Aj({check:"greater_than",...je(t),value:e,inclusive:!0})}function mw(e,t){return new GP({check:"multiple_of",...je(t),value:e})}function Pj(e,t){return new KP({check:"max_length",...je(t),maximum:e})}function ad(e,t){return new XP({check:"min_length",...je(t),minimum:e})}function Uj(e,t){return new JP({check:"length_equals",...je(t),length:e})}function R8(e,t){return new QP({check:"string_format",format:"regex",...je(t),pattern:e})}function M8(e){return new WP({check:"string_format",format:"lowercase",...je(e)})}function D8(e){return new eU({check:"string_format",format:"uppercase",...je(e)})}function $8(e,t){return new tU({check:"string_format",format:"includes",...je(t),includes:e})}function L8(e,t){return new nU({check:"string_format",format:"starts_with",...je(t),prefix:e})}function P8(e,t){return new rU({check:"string_format",format:"ends_with",...je(t),suffix:e})}function fo(e){return new aU({check:"overwrite",tx:e})}function U8(e){return fo(t=>t.normalize(e))}function V8(){return fo(e=>e.trim())}function B8(){return fo(e=>e.toLowerCase())}function Z8(){return fo(e=>e.toUpperCase())}function I8(){return fo(e=>Q9(e))}function H8(e,t,n){return new e({type:"array",element:t,...je(n)})}function F8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...je(n)})}function q8(e){const t=G8(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Ul(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(Ul(s))}},e(n.value,n)));return t}function G8(e,t){const n=new Zn({check:"custom",...je(t)});return n._zod.check=e,n}function Vj(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??yl,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 Yt(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 b=l.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),Yt(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"&&zn(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 Bj(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,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${f}/${v}`}}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 Zj(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 b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const N in h)N==="$ref"||N==="allOf"||N in m||delete h[N];if(v.$ref&&b.def)for(const N in h)N==="$ref"||N==="allOf"||N in b.def&&JSON.stringify(h[N])===JSON.stringify(b.def[N])&&delete h[N]}const y=l._zod.parent;if(y&&y!==g){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path: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:id(t,"input",e.processors),output:id(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function zn(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 zn(a.element,n);if(a.type==="set")return zn(a.valueType,n);if(a.type==="lazy")return zn(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 zn(a.innerType,n);if(a.type==="intersection")return zn(a.left,n)||zn(a.right,n);if(a.type==="record"||a.type==="map")return zn(a.keyType,n)||zn(a.valueType,n);if(a.type==="pipe")return zn(a.in,n)||zn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(zn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(zn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(zn(s,n))return!0;return!!(a.rest&&zn(a.rest,n))}return!1}const Y8=(e,t={})=>n=>{const a=Vj({...n,processors:t});return Yt(e,a),Bj(a,e),Zj(a,e)},id=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=Vj({...s??{},target:u,io:t,processors:n});return Yt(e,l),Bj(l,e),Zj(l,e)},K8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X8=(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=K8[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}))])}},J8=(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)},Q8=(e,t,n,a)=>{n.type="boolean"},W8=(e,t,n,a)=>{n.not={}},eV=(e,t,n,a)=>{},tV=(e,t,n,a)=>{const s=e._zod.def,u=bj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},nV=(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},rV=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},aV=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iV=(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=Yt(u.element,t,{...a,path:[...a.path,"items"]})},sV=(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]=Yt(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=Yt(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},oV=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((f,h)=>Yt(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},lV=(e,t,n,a)=>{const s=e._zod.def,u=Yt(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=Yt(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},uV=(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=Yt(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=Yt(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Yt(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)}},cV=(e,t,n,a)=>{const s=e._zod.def,u=Yt(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"}]},dV=(e,t,n,a)=>{const s=e._zod.def;Yt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},fV=(e,t,n,a)=>{const s=e._zod.def;Yt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},hV=(e,t,n,a)=>{const s=e._zod.def;Yt(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)))},mV=(e,t,n,a)=>{const s=e._zod.def;Yt(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},pV=(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;Yt(u,t,a);const l=t.seen.get(e);l.ref=u},gV=(e,t,n,a)=>{const s=e._zod.def;Yt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},Ij=(e,t,n,a)=>{const s=e._zod.def;Yt(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},xV=ee("ZodISODateTime",(e,t)=>{yU.init(e,t),At.init(e,t)});function yV(e){return z8(xV,e)}const bV=ee("ZodISODate",(e,t)=>{bU.init(e,t),At.init(e,t)});function vV(e){return _8(bV,e)}const kV=ee("ZodISOTime",(e,t)=>{vU.init(e,t),At.init(e,t)});function wV(e){return j8(kV,e)}const SV=ee("ZodISODuration",(e,t)=>{kU.init(e,t),At.init(e,t)});function zV(e){return N8(SV,e)}const _V=(e,t)=>{Sj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>dP(e,n)},flatten:{value:n=>cP(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ip,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ip,2)}},isEmpty:{get(){return e.issues.length===0}}})},yr=ee("ZodError",_V,{Parent:Error}),jV=lx(yr),NV=ux(yr),CV=Sd(yr),TV=zd(yr),EV=mP(yr),AV=pP(yr),OV=gP(yr),RV=xP(yr),MV=yP(yr),DV=bP(yr),$V=vP(yr),LV=kP(yr),Et=ee("ZodType",(e,t)=>(Tt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:id(e,"input"),output:id(e,"output")}}),e.toJSONSchema=Y8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ni(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)=>ri(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>jV(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>CV(e,n,a),e.parseAsync=async(n,a)=>NV(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>TV(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>EV(e,n,a),e.decode=(n,a)=>AV(e,n,a),e.encodeAsync=async(n,a)=>OV(e,n,a),e.decodeAsync=async(n,a)=>RV(e,n,a),e.safeEncode=(n,a)=>MV(e,n,a),e.safeDecode=(n,a)=>DV(e,n,a),e.safeEncodeAsync=async(n,a)=>$V(e,n,a),e.safeDecodeAsync=async(n,a)=>LV(e,n,a),e.refine=(n,a)=>e.check(AB(n,a)),e.superRefine=n=>e.check(OB(n)),e.overwrite=n=>e.check(fo(n)),e.optional=()=>bw(e),e.exactOptional=()=>yB(e),e.nullable=()=>vw(e),e.nullish=()=>bw(vw(e)),e.nonoptional=n=>zB(e,n),e.array=()=>Wa(e),e.or=n=>Gj([e,n]),e.and=n=>fB(e,n),e.transform=n=>kw(e,gB(n)),e.default=n=>kB(e,n),e.prefault=n=>SB(e,n),e.catch=n=>jB(e,n),e.pipe=n=>kw(e,n),e.readonly=()=>TB(e),e.describe=n=>{const a=e.clone();return yl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return yl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return yl.get(e);const a=e.clone();return yl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Hj=ee("_ZodString",(e,t)=>{cx.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,u)=>X8(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(R8(...a)),e.includes=(...a)=>e.check($8(...a)),e.startsWith=(...a)=>e.check(L8(...a)),e.endsWith=(...a)=>e.check(P8(...a)),e.min=(...a)=>e.check(ad(...a)),e.max=(...a)=>e.check(Pj(...a)),e.length=(...a)=>e.check(Uj(...a)),e.nonempty=(...a)=>e.check(ad(1,...a)),e.lowercase=a=>e.check(M8(a)),e.uppercase=a=>e.check(D8(a)),e.trim=()=>e.check(V8()),e.normalize=(...a)=>e.check(U8(...a)),e.toLowerCase=()=>e.check(B8()),e.toUpperCase=()=>e.check(Z8()),e.slugify=()=>e.check(I8())}),PV=ee("ZodString",(e,t)=>{cx.init(e,t),Hj.init(e,t),e.email=n=>e.check(r8(UV,n)),e.url=n=>e.check(l8(VV,n)),e.jwt=n=>e.check(S8(tB,n)),e.emoji=n=>e.check(u8(BV,n)),e.guid=n=>e.check(dw(pw,n)),e.uuid=n=>e.check(a8(Tc,n)),e.uuidv4=n=>e.check(i8(Tc,n)),e.uuidv6=n=>e.check(s8(Tc,n)),e.uuidv7=n=>e.check(o8(Tc,n)),e.nanoid=n=>e.check(c8(ZV,n)),e.guid=n=>e.check(dw(pw,n)),e.cuid=n=>e.check(d8(IV,n)),e.cuid2=n=>e.check(f8(HV,n)),e.ulid=n=>e.check(h8(FV,n)),e.base64=n=>e.check(v8(QV,n)),e.base64url=n=>e.check(k8(WV,n)),e.xid=n=>e.check(m8(qV,n)),e.ksuid=n=>e.check(p8(GV,n)),e.ipv4=n=>e.check(g8(YV,n)),e.ipv6=n=>e.check(x8(KV,n)),e.cidrv4=n=>e.check(y8(XV,n)),e.cidrv6=n=>e.check(b8(JV,n)),e.e164=n=>e.check(w8(eB,n)),e.datetime=n=>e.check(yV(n)),e.date=n=>e.check(vV(n)),e.time=n=>e.check(wV(n)),e.duration=n=>e.check(zV(n))});function Ke(e){return n8(PV,e)}const At=ee("ZodStringFormat",(e,t)=>{_t.init(e,t),Hj.init(e,t)}),UV=ee("ZodEmail",(e,t)=>{uU.init(e,t),At.init(e,t)}),pw=ee("ZodGUID",(e,t)=>{oU.init(e,t),At.init(e,t)}),Tc=ee("ZodUUID",(e,t)=>{lU.init(e,t),At.init(e,t)}),VV=ee("ZodURL",(e,t)=>{cU.init(e,t),At.init(e,t)}),BV=ee("ZodEmoji",(e,t)=>{dU.init(e,t),At.init(e,t)}),ZV=ee("ZodNanoID",(e,t)=>{fU.init(e,t),At.init(e,t)}),IV=ee("ZodCUID",(e,t)=>{hU.init(e,t),At.init(e,t)}),HV=ee("ZodCUID2",(e,t)=>{mU.init(e,t),At.init(e,t)}),FV=ee("ZodULID",(e,t)=>{pU.init(e,t),At.init(e,t)}),qV=ee("ZodXID",(e,t)=>{gU.init(e,t),At.init(e,t)}),GV=ee("ZodKSUID",(e,t)=>{xU.init(e,t),At.init(e,t)}),YV=ee("ZodIPv4",(e,t)=>{wU.init(e,t),At.init(e,t)}),KV=ee("ZodIPv6",(e,t)=>{SU.init(e,t),At.init(e,t)}),XV=ee("ZodCIDRv4",(e,t)=>{zU.init(e,t),At.init(e,t)}),JV=ee("ZodCIDRv6",(e,t)=>{_U.init(e,t),At.init(e,t)}),QV=ee("ZodBase64",(e,t)=>{jU.init(e,t),At.init(e,t)}),WV=ee("ZodBase64URL",(e,t)=>{CU.init(e,t),At.init(e,t)}),eB=ee("ZodE164",(e,t)=>{TU.init(e,t),At.init(e,t)}),tB=ee("ZodJWT",(e,t)=>{AU.init(e,t),At.init(e,t)}),Fj=ee("ZodNumber",(e,t)=>{Rj.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,u)=>J8(e,a,s),e.gt=(a,s)=>e.check(hw(a,s)),e.gte=(a,s)=>e.check(Pm(a,s)),e.min=(a,s)=>e.check(Pm(a,s)),e.lt=(a,s)=>e.check(fw(a,s)),e.lte=(a,s)=>e.check(Lm(a,s)),e.max=(a,s)=>e.check(Lm(a,s)),e.int=a=>e.check(gw(a)),e.safe=a=>e.check(gw(a)),e.positive=a=>e.check(hw(0,a)),e.nonnegative=a=>e.check(Pm(0,a)),e.negative=a=>e.check(fw(0,a)),e.nonpositive=a=>e.check(Lm(0,a)),e.multipleOf=(a,s)=>e.check(mw(a,s)),e.step=(a,s)=>e.check(mw(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 Tn(e){return C8(Fj,e)}const nB=ee("ZodNumberFormat",(e,t)=>{OU.init(e,t),Fj.init(e,t)});function gw(e){return T8(nB,e)}const rB=ee("ZodBoolean",(e,t)=>{RU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Q8(e,n,a)});function yn(e){return E8(rB,e)}const aB=ee("ZodUnknown",(e,t)=>{MU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eV()});function xw(){return A8(aB)}const iB=ee("ZodNever",(e,t)=>{DU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>W8(e,n,a)});function sB(e){return O8(iB,e)}const oB=ee("ZodArray",(e,t)=>{$U.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>iV(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(ad(n,a)),e.nonempty=n=>e.check(ad(1,n)),e.max=(n,a)=>e.check(Pj(n,a)),e.length=(n,a)=>e.check(Uj(n,a)),e.unwrap=()=>e.element});function Wa(e,t){return H8(oB,e,t)}const lB=ee("ZodObject",(e,t)=>{PU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sV(e,n,a,s),it(e,"shape",()=>t.shape),e.keyof=()=>ai(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xw()}),e.loose=()=>e.clone({...e._zod.def,catchall:xw()}),e.strict=()=>e.clone({...e._zod.def,catchall:sB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>iP(e,n),e.safeExtend=n=>sP(e,n),e.merge=n=>oP(e,n),e.pick=n=>rP(e,n),e.omit=n=>aP(e,n),e.partial=(...n)=>lP(Yj,e,n[0]),e.required=(...n)=>uP(Kj,e,n[0])});function tn(e,t){const n={type:"object",shape:e??{},...je(t)};return new lB(n)}const qj=ee("ZodUnion",(e,t)=>{$j.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oV(e,n,a,s),e.options=t.options});function Gj(e,t){return new qj({type:"union",options:e,...je(t)})}const uB=ee("ZodDiscriminatedUnion",(e,t)=>{qj.init(e,t),UU.init(e,t)});function cB(e,t,n){return new uB({type:"union",options:t,discriminator:e,...je(n)})}const dB=ee("ZodIntersection",(e,t)=>{VU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lV(e,n,a,s)});function fB(e,t){return new dB({type:"intersection",left:e,right:t})}const hB=ee("ZodRecord",(e,t)=>{BU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uV(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function Ic(e,t,n){return new hB({type:"record",keyType:e,valueType:t,...je(n)})}const Fp=ee("ZodEnum",(e,t)=>{ZU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,u)=>tV(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 Fp({...t,checks:[],...je(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 Fp({...t,checks:[],...je(s),entries:u})}});function ai(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Fp({type:"enum",entries:n,...je(t)})}const mB=ee("ZodLiteral",(e,t)=>{IU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nV(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 yw(e,t){return new mB({type:"literal",values:Array.isArray(e)?e:[e],...je(t)})}const pB=ee("ZodTransform",(e,t)=>{HU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>aV(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new xj(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Ul(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(Ul(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function gB(e){return new pB({type:"transform",transform:e})}const Yj=ee("ZodOptional",(e,t)=>{Lj.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Ij(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new Yj({type:"optional",innerType:e})}const xB=ee("ZodExactOptional",(e,t)=>{FU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Ij(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yB(e){return new xB({type:"optional",innerType:e})}const bB=ee("ZodNullable",(e,t)=>{qU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function vw(e){return new bB({type:"nullable",innerType:e})}const vB=ee("ZodDefault",(e,t)=>{GU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kB(e,t){return new vB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kj(t)}})}const wB=ee("ZodPrefault",(e,t)=>{YU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function SB(e,t){return new wB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kj(t)}})}const Kj=ee("ZodNonOptional",(e,t)=>{KU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function zB(e,t){return new Kj({type:"nonoptional",innerType:e,...je(t)})}const _B=ee("ZodCatch",(e,t)=>{XU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jB(e,t){return new _B({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const NB=ee("ZodPipe",(e,t)=>{JU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pV(e,n,a,s),e.in=t.in,e.out=t.out});function kw(e,t){return new NB({type:"pipe",in:e,out:t})}const CB=ee("ZodReadonly",(e,t)=>{QU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function TB(e){return new CB({type:"readonly",innerType:e})}const EB=ee("ZodCustom",(e,t)=>{WU.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rV(e,n)});function AB(e,t={}){return F8(EB,e,t)}function OB(e){return q8(e)}const pt={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}},RB=tn({provider:ai(["google","openai","openrouter","ollama"]).default(pt.audio.provider),model:Ke().min(1).default(pt.audio.model),enabled:yn().default(pt.audio.enabled),apiKey:Ke().optional(),base_url:Ke().optional(),maxDurationSeconds:Tn().default(pt.audio.maxDurationSeconds),supportedMimeTypes:Wa(Ke()).default(pt.audio.supportedMimeTypes)}),ho=tn({provider:ai(["openai","anthropic","openrouter","ollama","gemini"]).default(pt.llm.provider),model:Ke().min(1).default(pt.llm.model),temperature:Tn().min(0).max(1).default(pt.llm.temperature),max_tokens:Tn().int().positive().optional(),api_key:Ke().optional(),base_url:Ke().optional(),context_window:Tn().int().positive().optional()}),MB=ho.extend({memory_limit:Tn().int().positive().optional(),enabled_archived_sessions:yn().default(!0)}),DB=ho.extend({working_dir:Ke().optional(),timeout_ms:Tn().int().positive().optional(),execution_mode:ai(["sync","async"]).default("async")}),$B=ho.extend({execution_mode:ai(["sync","async"]).default("async")}),LB=ho.extend({execution_mode:ai(["sync","async"]).default("async")}),PB=ho.extend({skills_dir:Ke().optional()}),UB=tn({telegram_notify_all:yn().optional()}).optional(),VB=tn({timezone:Ke().default("UTC"),check_interval_ms:Tn().min(6e4).default(6e4),max_active_jobs:Tn().min(1).max(1e3).default(100)}),BB=tn({sandbox_dir:Ke().optional(),readonly_mode:yn().default(!1),allowed_shell_commands:Wa(Ke()).default([]),enable_filesystem:yn().default(!0),enable_shell:yn().default(!0),enable_git:yn().default(!0),enable_network:yn().default(!0),timeout_ms:Tn().int().positive().default(3e4)}),ZB=tn({name:Ke().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/,"Smith name must be lowercase alphanumeric with hyphens/underscores"),host:Ke().min(1),port:Tn().int().min(1).max(65535).default(7900),auth_token:Ke().min(1),tls:yn().default(!1)}),IB=tn({enabled:yn().default(!1),execution_mode:ai(["sync","async"]).default("async"),heartbeat_interval_ms:Tn().int().min(5e3).default(3e4),connection_timeout_ms:Tn().int().min(1e3).default(1e4),task_timeout_ms:Tn().int().min(1e3).default(6e4),entries:Wa(ZB).default([])}),HB=tn({agent:tn({name:Ke().default(pt.agent.name),personality:Ke().default(pt.agent.personality)}).default(pt.agent),llm:ho.default(pt.llm),sati:MB.optional(),neo:$B.optional(),apoc:DB.optional(),trinity:LB.optional(),keymaker:PB.optional(),webhooks:UB,audio:RB.default(pt.audio),memory:tn({limit:Tn().int().positive().optional()}).default(pt.memory),runtime:tn({async_tasks:tn({enabled:yn().default(pt.runtime?.async_tasks.enabled)}).default(pt.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:VB.optional(),devkit:BB.optional(),smiths:IB.optional(),verbose_mode:yn().default(!0),channels:tn({telegram:tn({enabled:yn().default(!1),token:Ke().optional(),allowedUsers:Wa(Ke()).default([])}).default(pt.channels.telegram),discord:tn({enabled:yn().default(!1),token:Ke().optional(),allowedUsers:Wa(Ke()).default([])}).default(pt.channels.discord)}).default(pt.channels),ui:tn({enabled:yn().default(pt.ui.enabled),port:Tn().default(pt.ui.port)}).default(pt.ui),logging:tn({enabled:yn().default(pt.logging.enabled),level:ai(["debug","info","warn","error"]).default(pt.logging.level),retention:Ke().default(pt.logging.retention)}).default(pt.logging)}),FB=cB("transport",[tn({transport:yw("stdio"),command:Ke().min(1,"Command is required for stdio transport"),args:Wa(Ke()).optional().default([]),env:Ic(Ke(),Ke()).optional().default({}),_comment:Ke().optional()}),tn({transport:yw("http"),url:Ke().url("Valid URL is required for http transport"),headers:Ic(Ke(),Ke()).optional().default({}),args:Wa(Ke()).optional().default([]),env:Ic(Ke(),Ke()).optional().default({}),_comment:Ke().optional()})]);Ic(Ke(),Gj([FB,Ke()]));function oe(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 b=g[y];b in f||(f[b]=m[b].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 Ks extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jj={};function Di(e){return Jj}function Qj(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 qp(e,t){return typeof t=="bigint"?t.toString():t}function dx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fx(e){return e==null}function hx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const ww=Symbol("evaluating");function lt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==ww)return a===void 0&&(a=ww,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ui(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ii(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Sw(e){return JSON.stringify(e)}function qB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GB=dx(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Vl(e){if(sd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(sd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function e2(e){return Vl(e)?{...e}:Array.isArray(e)?[...e]:e}const YB=new Set(["string","number","symbol"]);function eo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function si(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Me(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 KB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function XB(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=ii(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 Ui(this,"shape",l),l},checks:[]});return si(e,u)}function JB(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=ii(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 Ui(this,"shape",l),l},checks:[]});return si(e,u)}function QB(e,t){if(!Vl(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=ii(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Ui(this,"shape",u),u}});return si(e,s)}function WB(e,t){if(!Vl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ii(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ui(this,"shape",a),a}});return si(e,n)}function eZ(e,t){const n=ii(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ui(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return si(e,n)}function tZ(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=ii(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 Ui(this,"shape",h),h},checks:[]});return si(t,l)}function nZ(e,t,n){const a=ii(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 Ui(this,"shape",u),u}});return si(t,a)}function Bs(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 t2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Ec(e){return typeof e=="string"?e:e?.message}function $i(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Ec(e.inst?._zod.def?.error?.(e))??Ec(t?.error?.(e))??Ec(n.customError?.(e))??Ec(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function mx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Bl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const n2=(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,qp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},r2=oe("$ZodError",n2),a2=oe("$ZodError",n2,{Parent:Error});function rZ(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 aZ(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 px=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 Ks;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>$i(h,u,Di())));throw Wj(f,s?.callee),f}return l.value},gx=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=>$i(h,u,Di())));throw Wj(f,s?.callee),f}return l.value},jd=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 Ks;return u.issues.length?{success:!1,error:new(e??r2)(u.issues.map(l=>$i(l,s,Di())))}:{success:!0,data:u.value}},iZ=jd(a2),Nd=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=>$i(l,s,Di())))}:{success:!0,data:u.value}},sZ=Nd(a2),oZ=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return px(e)(t,n,s)},lZ=e=>(t,n,a)=>px(e)(t,n,a),uZ=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return gx(e)(t,n,s)},cZ=e=>async(t,n,a)=>gx(e)(t,n,a),dZ=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jd(e)(t,n,s)},fZ=e=>(t,n,a)=>jd(e)(t,n,a),hZ=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Nd(e)(t,n,s)},mZ=e=>async(t,n,a)=>Nd(e)(t,n,a),pZ=/^[cC][^\s-]{8,}$/,gZ=/^[0-9a-z]+$/,xZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yZ=/^[0-9a-vA-V]{20}$/,bZ=/^[A-Za-z0-9]{27}$/,vZ=/^[a-zA-Z0-9_-]{21}$/,kZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wZ=/^([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})$/,zw=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)$/,SZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _Z(){return new RegExp(zZ,"u")}const jZ=/^(?:(?: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])$/,NZ=/^(([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])$/,TZ=/^(([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])$/,EZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,i2=/^[A-Za-z0-9_-]*$/,AZ=/^\+[1-9]\d{6,14}$/,s2="(?:(?:\\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])))",OZ=new RegExp(`^${s2}$`);function o2(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 RZ(e){return new RegExp(`^${o2(e)}$`)}function MZ(e){const t=o2({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(`^${s2}T(?:${a})$`)}const DZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$Z=/^[^A-Z]*$/,LZ=/^[^a-z]*$/,Br=oe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),PZ=oe("$ZodCheckMaxLength",(e,t)=>{var n;Br.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!fx(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=mx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),UZ=oe("$ZodCheckMinLength",(e,t)=>{var n;Br.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!fx(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=mx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),VZ=oe("$ZodCheckLengthEquals",(e,t)=>{var n;Br.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!fx(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=mx(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})}}),Cd=oe("$ZodCheckStringFormat",(e,t)=>{var n,a;Br.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=()=>{})}),BZ=oe("$ZodCheckRegex",(e,t)=>{Cd.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=oe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$Z),Cd.init(e,t)}),IZ=oe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=LZ),Cd.init(e,t)}),HZ=oe("$ZodCheckIncludes",(e,t)=>{Br.init(e,t);const n=eo(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})}}),FZ=oe("$ZodCheckStartsWith",(e,t)=>{Br.init(e,t);const n=new RegExp(`^${eo(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})}}),qZ=oe("$ZodCheckEndsWith",(e,t)=>{Br.init(e,t);const n=new RegExp(`.*${eo(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})}}),GZ=oe("$ZodCheckOverwrite",(e,t)=>{Br.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class YZ{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 KZ={major:4,minor:3,patch:6},Kt=oe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=KZ;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=Bs(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=y._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Ks;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Bs(l,b)))});else{if(l.issues.length===b)continue;m||(m=Bs(l,b))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Bs(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Ks;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 Ks;return h.then(m=>s(m,a,f))}return s(h,a,f)}}lt(e,"~standard",()=>({validate:s=>{try{const u=iZ(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return sZ(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),xx=oe("$ZodString",(e,t)=>{Kt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??DZ(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}}),jt=oe("$ZodStringFormat",(e,t)=>{Cd.init(e,t),xx.init(e,t)}),XZ=oe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wZ),jt.init(e,t)}),JZ=oe("$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=zw(a))}else t.pattern??(t.pattern=zw());jt.init(e,t)}),QZ=oe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=SZ),jt.init(e,t)}),WZ=oe("$ZodURL",(e,t)=>{jt.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})}}}),e7=oe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_Z()),jt.init(e,t)}),t7=oe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=vZ),jt.init(e,t)}),n7=oe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pZ),jt.init(e,t)}),r7=oe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=gZ),jt.init(e,t)}),a7=oe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xZ),jt.init(e,t)}),i7=oe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=yZ),jt.init(e,t)}),s7=oe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=bZ),jt.init(e,t)}),o7=oe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=MZ(t)),jt.init(e,t)}),l7=oe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=OZ),jt.init(e,t)}),u7=oe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RZ(t)),jt.init(e,t)}),c7=oe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=kZ),jt.init(e,t)}),d7=oe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=jZ),jt.init(e,t),e._zod.bag.format="ipv4"}),f7=oe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=NZ),jt.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})}}}),h7=oe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=CZ),jt.init(e,t)}),m7=oe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=TZ),jt.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 l2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const p7=oe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=EZ),jt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{l2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function g7(e){if(!i2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return l2(n)}const x7=oe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=i2),jt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{g7(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),y7=oe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=AZ),jt.init(e,t)});function b7(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 v7=oe("$ZodJWT",(e,t)=>{jt.init(e,t),e._zod.check=n=>{b7(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),k7=oe("$ZodUnknown",(e,t)=>{Kt.init(e,t),e._zod.parse=n=>n}),w7=oe("$ZodNever",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _w(e,t,n){e.issues.length&&t.issues.push(...t2(n,e.issues)),t.value[n]=e.value}const S7=oe("$ZodArray",(e,t)=>{Kt.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=>_w(m,n,l))):_w(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function od(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...t2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function u2(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=KB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function c2(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 b=h.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(v=>od(v,n,y,t,g))):od(b,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const z7=oe("$ZodObject",(e,t)=>{if(Kt.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=dx(()=>u2(t));lt(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=sd,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 b of l.keys){const v=y[b],S=v._zod.optout==="optional",N=v._zod.run({value:m[b],issues:[]},h);N instanceof Promise?g.push(N.then(C=>od(C,f,b,m,S))):od(N,f,b,m,S)}return u?c2(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),_7=oe("$ZodObjectJIT",(e,t)=>{z7.init(e,t);const n=e._zod.parse,a=dx(()=>u2(t)),s=b=>{const v=new YZ(["shape","payload","ctx"]),S=a.value,N=T=>{const L=Sw(T);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};v.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const T of S.keys)C[T]=`key_${E++}`;v.write("const newResult = {};");for(const T of S.keys){const L=C[T],U=Sw(T),Z=b[T]?._zod?.optout==="optional";v.write(`const ${L} = ${N(T)};`),Z?v.write(`
|
|
73
|
+
if (${L}.issues.length) {
|
|
74
|
+
if (${U} in input) {
|
|
75
|
+
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
76
|
+
...iss,
|
|
77
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
78
|
+
})));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (${L}.value === undefined) {
|
|
83
|
+
if (${U} in input) {
|
|
84
|
+
newResult[${U}] = undefined;
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
newResult[${U}] = ${L}.value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
`):v.write(`
|
|
91
|
+
if (${L}.issues.length) {
|
|
92
|
+
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
93
|
+
...iss,
|
|
94
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
95
|
+
})));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (${L}.value === undefined) {
|
|
99
|
+
if (${U} in input) {
|
|
100
|
+
newResult[${U}] = undefined;
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
newResult[${U}] = ${L}.value;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(T,L)=>A(b,T,L)};let u;const l=sd,f=!Jj.jitless,m=f&&GB.value,g=t.catchall;let y;e._zod.parse=(b,v)=>{y??(y=a.value);const S=b.value;return l(S)?f&&m&&v?.async===!1&&v.jitless!==!0?(u||(u=s(t.shape)),b=u(b,v),g?c2([],S,b,v,y,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function jw(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=>!Bs(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=>$i(l,a,Di())))}),t)}const j7=oe("$ZodUnion",(e,t)=>{Kt.init(e,t),lt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),lt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),lt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),lt(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=>hx(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=>jw(h,s,e,u)):jw(f,s,e,u)}}),N7=oe("$ZodIntersection",(e,t)=>{Kt.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])=>Nw(n,h,m)):Nw(n,u,l)}});function Gp(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(Vl(e)&&Vl(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=Gp(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=Gp(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 Nw(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}),Bs(e))return e;const l=Gp(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=oe("$ZodEnum",(e,t)=>{Kt.init(e,t);const n=Qj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>YB.has(typeof s)).map(s=>typeof s=="string"?eo(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}}),T7=oe("$ZodLiteral",(e,t)=>{if(Kt.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"?eo(a):a?eo(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}}),E7=oe("$ZodTransform",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Xj(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 Ks;return n.value=s,n}});function Cw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const d2=oe("$ZodOptional",(e,t)=>{Kt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hx(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=>Cw(u,n.value)):Cw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),A7=oe("$ZodExactOptional",(e,t)=>{d2.init(e,t),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),O7=oe("$ZodNullable",(e,t)=>{Kt.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hx(n.source)}|null)$`):void 0}),lt(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)}),R7=oe("$ZodDefault",(e,t)=>{Kt.init(e,t),e._zod.optin="optional",lt(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=>Tw(u,t)):Tw(s,t)}});function Tw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const M7=oe("$ZodPrefault",(e,t)=>{Kt.init(e,t),e._zod.optin="optional",lt(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))}),D7=oe("$ZodNonOptional",(e,t)=>{Kt.init(e,t),lt(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=>Ew(u,e)):Ew(s,e)}});function Ew(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 $7=oe("$ZodCatch",(e,t)=>{Kt.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(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=>$i(l,a,Di()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>$i(u,a,Di()))},input:n.value}),n.issues=[]),n)}}),L7=oe("$ZodPipe",(e,t)=>{Kt.init(e,t),lt(e._zod,"values",()=>t.in._zod.values),lt(e._zod,"optin",()=>t.in._zod.optin),lt(e._zod,"optout",()=>t.out._zod.optout),lt(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=>Ac(l,t.in,a)):Ac(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>Ac(u,t.out,a)):Ac(s,t.out,a)}});function Ac(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const P7=oe("$ZodReadonly",(e,t)=>{Kt.init(e,t),lt(e._zod,"propValues",()=>t.innerType._zod.propValues),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"optin",()=>t.innerType?._zod?.optin),lt(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(Aw):Aw(s)}});function Aw(e){return e.value=Object.freeze(e.value),e}const U7=oe("$ZodCustom",(e,t)=>{Br.init(e,t),Kt.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=>Ow(u,n,a,e));Ow(s,n,a,e)}});function Ow(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(Bl(s))}}var Rw;class V7{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 B7(){return new V7}(Rw=globalThis).__zod_globalRegistry??(Rw.__zod_globalRegistry=B7());const bl=globalThis.__zod_globalRegistry;function Z7(e,t){return new e({type:"string",...Me(t)})}function I7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Me(t)})}function Mw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Me(t)})}function H7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Me(t)})}function F7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Me(t)})}function q7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Me(t)})}function G7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Me(t)})}function Y7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Me(t)})}function K7(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Me(t)})}function X7(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Me(t)})}function J7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Me(t)})}function Q7(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Me(t)})}function W7(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Me(t)})}function eI(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Me(t)})}function tI(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Me(t)})}function nI(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Me(t)})}function rI(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Me(t)})}function aI(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Me(t)})}function iI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Me(t)})}function sI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Me(t)})}function oI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Me(t)})}function lI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Me(t)})}function uI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Me(t)})}function cI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Me(t)})}function dI(e,t){return new e({type:"string",format:"date",check:"string_format",...Me(t)})}function fI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Me(t)})}function hI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Me(t)})}function mI(e){return new e({type:"unknown"})}function pI(e,t){return new e({type:"never",...Me(t)})}function f2(e,t){return new PZ({check:"max_length",...Me(t),maximum:e})}function ld(e,t){return new UZ({check:"min_length",...Me(t),minimum:e})}function h2(e,t){return new VZ({check:"length_equals",...Me(t),length:e})}function gI(e,t){return new BZ({check:"string_format",format:"regex",...Me(t),pattern:e})}function xI(e){return new ZZ({check:"string_format",format:"lowercase",...Me(e)})}function yI(e){return new IZ({check:"string_format",format:"uppercase",...Me(e)})}function bI(e,t){return new HZ({check:"string_format",format:"includes",...Me(t),includes:e})}function vI(e,t){return new FZ({check:"string_format",format:"starts_with",...Me(t),prefix:e})}function kI(e,t){return new qZ({check:"string_format",format:"ends_with",...Me(t),suffix:e})}function mo(e){return new GZ({check:"overwrite",tx:e})}function wI(e){return mo(t=>t.normalize(e))}function SI(){return mo(e=>e.trim())}function zI(){return mo(e=>e.toLowerCase())}function _I(){return mo(e=>e.toUpperCase())}function jI(){return mo(e=>qB(e))}function NI(e,t,n){return new e({type:"array",element:t,...Me(n)})}function CI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Me(n)})}function TI(e){const t=EI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Bl(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(Bl(s))}},e(n.value,n)));return t}function EI(e,t){const n=new Br({check:"custom",...Me(t)});return n._zod.check=e,n}function m2(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??bl,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 fn(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 b=l.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),fn(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"&&_n(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 p2(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,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${b("__shared")}#/${f}/${v}`}}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 g2(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 b=e.seen.get(g),v=b.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(v)):Object.assign(h,v),Object.assign(h,m),l._zod.parent===g)for(const N in h)N==="$ref"||N==="allOf"||N in m||delete h[N];if(v.$ref&&b.def)for(const N in h)N==="$ref"||N==="allOf"||N in b.def&&JSON.stringify(h[N])===JSON.stringify(b.def[N])&&delete h[N]}const y=l._zod.parent;if(y&&y!==g){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const v in h)v==="$ref"||v==="allOf"||v in b.def&&JSON.stringify(h[v])===JSON.stringify(b.def[v])&&delete h[v]}e.override({zodSchema:l,jsonSchema:h,path: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:ud(t,"input",e.processors),output:ud(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function _n(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 _n(a.element,n);if(a.type==="set")return _n(a.valueType,n);if(a.type==="lazy")return _n(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 _n(a.innerType,n);if(a.type==="intersection")return _n(a.left,n)||_n(a.right,n);if(a.type==="record"||a.type==="map")return _n(a.keyType,n)||_n(a.valueType,n);if(a.type==="pipe")return _n(a.in,n)||_n(a.out,n);if(a.type==="object"){for(const s in a.shape)if(_n(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(_n(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(_n(s,n))return!0;return!!(a.rest&&_n(a.rest,n))}return!1}const AI=(e,t={})=>n=>{const a=m2({...n,processors:t});return fn(e,a),p2(a,e),g2(a,e)},ud=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=m2({...s??{},target:u,io:t,processors:n});return fn(e,l),p2(l,e),g2(l,e)},OI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},RI=(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=OI[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}))])}},MI=(e,t,n,a)=>{n.not={}},DI=(e,t,n,a)=>{},$I=(e,t,n,a)=>{const s=e._zod.def,u=Qj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},LI=(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},PI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},VI=(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=fn(u.element,t,{...a,path:[...a.path,"items"]})},BI=(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]=fn(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=fn(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)=>fn(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},II=(e,t,n,a)=>{const s=e._zod.def,u=fn(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=fn(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},HI=(e,t,n,a)=>{const s=e._zod.def,u=fn(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"}]},FI=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},qI=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},GI=(e,t,n,a)=>{const s=e._zod.def;fn(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)))},YI=(e,t,n,a)=>{const s=e._zod.def;fn(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},KI=(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;fn(u,t,a);const l=t.seen.get(e);l.ref=u},XI=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},x2=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},JI=oe("ZodISODateTime",(e,t)=>{o7.init(e,t),Ot.init(e,t)});function QI(e){return cI(JI,e)}const WI=oe("ZodISODate",(e,t)=>{l7.init(e,t),Ot.init(e,t)});function eH(e){return dI(WI,e)}const tH=oe("ZodISOTime",(e,t)=>{u7.init(e,t),Ot.init(e,t)});function nH(e){return fI(tH,e)}const rH=oe("ZodISODuration",(e,t)=>{c7.init(e,t),Ot.init(e,t)});function aH(e){return hI(rH,e)}const y2=(e,t)=>{r2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>aZ(e,n)},flatten:{value:n=>rZ(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,qp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,qp,2)}},isEmpty:{get(){return e.issues.length===0}}})},iH=oe("ZodError",y2),br=oe("ZodError",y2,{Parent:Error}),sH=px(br),oH=gx(br),lH=jd(br),uH=Nd(br),cH=oZ(br),dH=lZ(br),fH=uZ(br),hH=cZ(br),mH=dZ(br),pH=fZ(br),gH=hZ(br),xH=mZ(br),Xt=oe("ZodType",(e,t)=>(Kt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ud(e,"input"),output:ud(e,"output")}}),e.toJSONSchema=AI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ii(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)=>si(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>sH(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>lH(e,n,a),e.parseAsync=async(n,a)=>oH(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>uH(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>cH(e,n,a),e.decode=(n,a)=>dH(e,n,a),e.encodeAsync=async(n,a)=>fH(e,n,a),e.decodeAsync=async(n,a)=>hH(e,n,a),e.safeEncode=(n,a)=>mH(e,n,a),e.safeDecode=(n,a)=>pH(e,n,a),e.safeEncodeAsync=async(n,a)=>gH(e,n,a),e.safeDecodeAsync=async(n,a)=>xH(e,n,a),e.refine=(n,a)=>e.check(cF(n,a)),e.superRefine=n=>e.check(dF(n)),e.overwrite=n=>e.check(mo(n)),e.optional=()=>Pw(e),e.exactOptional=()=>JH(e),e.nullable=()=>Uw(e),e.nullish=()=>Pw(Uw(e)),e.nonoptional=n=>rF(e,n),e.array=()=>VH(e),e.or=n=>v2([e,n]),e.and=n=>FH(e,n),e.transform=n=>Vw(e,KH(n)),e.default=n=>eF(e,n),e.prefault=n=>nF(e,n),e.catch=n=>iF(e,n),e.pipe=n=>Vw(e,n),e.readonly=()=>lF(e),e.describe=n=>{const a=e.clone();return bl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return bl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return bl.get(e);const a=e.clone();return bl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),b2=oe("_ZodString",(e,t)=>{xx.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>RI(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(gI(...a)),e.includes=(...a)=>e.check(bI(...a)),e.startsWith=(...a)=>e.check(vI(...a)),e.endsWith=(...a)=>e.check(kI(...a)),e.min=(...a)=>e.check(ld(...a)),e.max=(...a)=>e.check(f2(...a)),e.length=(...a)=>e.check(h2(...a)),e.nonempty=(...a)=>e.check(ld(1,...a)),e.lowercase=a=>e.check(xI(a)),e.uppercase=a=>e.check(yI(a)),e.trim=()=>e.check(SI()),e.normalize=(...a)=>e.check(wI(...a)),e.toLowerCase=()=>e.check(zI()),e.toUpperCase=()=>e.check(_I()),e.slugify=()=>e.check(jI())}),yH=oe("ZodString",(e,t)=>{xx.init(e,t),b2.init(e,t),e.email=n=>e.check(I7(bH,n)),e.url=n=>e.check(Y7(vH,n)),e.jwt=n=>e.check(uI(DH,n)),e.emoji=n=>e.check(K7(kH,n)),e.guid=n=>e.check(Mw(Dw,n)),e.uuid=n=>e.check(H7(Oc,n)),e.uuidv4=n=>e.check(F7(Oc,n)),e.uuidv6=n=>e.check(q7(Oc,n)),e.uuidv7=n=>e.check(G7(Oc,n)),e.nanoid=n=>e.check(X7(wH,n)),e.guid=n=>e.check(Mw(Dw,n)),e.cuid=n=>e.check(J7(SH,n)),e.cuid2=n=>e.check(Q7(zH,n)),e.ulid=n=>e.check(W7(_H,n)),e.base64=n=>e.check(sI(OH,n)),e.base64url=n=>e.check(oI(RH,n)),e.xid=n=>e.check(eI(jH,n)),e.ksuid=n=>e.check(tI(NH,n)),e.ipv4=n=>e.check(nI(CH,n)),e.ipv6=n=>e.check(rI(TH,n)),e.cidrv4=n=>e.check(aI(EH,n)),e.cidrv6=n=>e.check(iI(AH,n)),e.e164=n=>e.check(lI(MH,n)),e.datetime=n=>e.check(QI(n)),e.date=n=>e.check(eH(n)),e.time=n=>e.check(nH(n)),e.duration=n=>e.check(aH(n))});function Um(e){return Z7(yH,e)}const Ot=oe("ZodStringFormat",(e,t)=>{jt.init(e,t),b2.init(e,t)}),bH=oe("ZodEmail",(e,t)=>{QZ.init(e,t),Ot.init(e,t)}),Dw=oe("ZodGUID",(e,t)=>{XZ.init(e,t),Ot.init(e,t)}),Oc=oe("ZodUUID",(e,t)=>{JZ.init(e,t),Ot.init(e,t)}),vH=oe("ZodURL",(e,t)=>{WZ.init(e,t),Ot.init(e,t)}),kH=oe("ZodEmoji",(e,t)=>{e7.init(e,t),Ot.init(e,t)}),wH=oe("ZodNanoID",(e,t)=>{t7.init(e,t),Ot.init(e,t)}),SH=oe("ZodCUID",(e,t)=>{n7.init(e,t),Ot.init(e,t)}),zH=oe("ZodCUID2",(e,t)=>{r7.init(e,t),Ot.init(e,t)}),_H=oe("ZodULID",(e,t)=>{a7.init(e,t),Ot.init(e,t)}),jH=oe("ZodXID",(e,t)=>{i7.init(e,t),Ot.init(e,t)}),NH=oe("ZodKSUID",(e,t)=>{s7.init(e,t),Ot.init(e,t)}),CH=oe("ZodIPv4",(e,t)=>{d7.init(e,t),Ot.init(e,t)}),TH=oe("ZodIPv6",(e,t)=>{f7.init(e,t),Ot.init(e,t)}),EH=oe("ZodCIDRv4",(e,t)=>{h7.init(e,t),Ot.init(e,t)}),AH=oe("ZodCIDRv6",(e,t)=>{m7.init(e,t),Ot.init(e,t)}),OH=oe("ZodBase64",(e,t)=>{p7.init(e,t),Ot.init(e,t)}),RH=oe("ZodBase64URL",(e,t)=>{x7.init(e,t),Ot.init(e,t)}),MH=oe("ZodE164",(e,t)=>{y7.init(e,t),Ot.init(e,t)}),DH=oe("ZodJWT",(e,t)=>{v7.init(e,t),Ot.init(e,t)}),$H=oe("ZodUnknown",(e,t)=>{k7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>DI()});function $w(){return mI($H)}const LH=oe("ZodNever",(e,t)=>{w7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>MI(e,n,a)});function PH(e){return pI(LH,e)}const UH=oe("ZodArray",(e,t)=>{S7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>VI(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(ld(n,a)),e.nonempty=n=>e.check(ld(1,n)),e.max=(n,a)=>e.check(f2(n,a)),e.length=(n,a)=>e.check(h2(n,a)),e.unwrap=()=>e.element});function VH(e,t){return NI(UH,e,t)}const BH=oe("ZodObject",(e,t)=>{_7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>BI(e,n,a,s),lt(e,"shape",()=>t.shape),e.keyof=()=>qH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$w()}),e.loose=()=>e.clone({...e._zod.def,catchall:$w()}),e.strict=()=>e.clone({...e._zod.def,catchall:PH()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>QB(e,n),e.safeExtend=n=>WB(e,n),e.merge=n=>eZ(e,n),e.pick=n=>XB(e,n),e.omit=n=>JB(e,n),e.partial=(...n)=>tZ(k2,e,n[0]),e.required=(...n)=>nZ(w2,e,n[0])});function ZH(e,t){const n={type:"object",shape:e??{},...Me(t)};return new BH(n)}const IH=oe("ZodUnion",(e,t)=>{j7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>ZI(e,n,a,s),e.options=t.options});function v2(e,t){return new IH({type:"union",options:e,...Me(t)})}const HH=oe("ZodIntersection",(e,t)=>{N7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>II(e,n,a,s)});function FH(e,t){return new HH({type:"intersection",left:e,right:t})}const Yp=oe("ZodEnum",(e,t)=>{C7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>$I(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 Yp({...t,checks:[],...Me(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 Yp({...t,checks:[],...Me(s),entries:u})}});function qH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Yp({type:"enum",entries:n,...Me(t)})}const GH=oe("ZodLiteral",(e,t)=>{T7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>LI(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 Lw(e,t){return new GH({type:"literal",values:Array.isArray(e)?e:[e],...Me(t)})}const YH=oe("ZodTransform",(e,t)=>{E7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>UI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Xj(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Bl(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(Bl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function KH(e){return new YH({type:"transform",transform:e})}const k2=oe("ZodOptional",(e,t)=>{d2.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>x2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Pw(e){return new k2({type:"optional",innerType:e})}const XH=oe("ZodExactOptional",(e,t)=>{A7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>x2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function JH(e){return new XH({type:"optional",innerType:e})}const QH=oe("ZodNullable",(e,t)=>{O7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>HI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Uw(e){return new QH({type:"nullable",innerType:e})}const WH=oe("ZodDefault",(e,t)=>{R7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>qI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eF(e,t){return new WH({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():e2(t)}})}const tF=oe("ZodPrefault",(e,t)=>{M7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>GI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function nF(e,t){return new tF({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():e2(t)}})}const w2=oe("ZodNonOptional",(e,t)=>{D7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>FI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function rF(e,t){return new w2({type:"nonoptional",innerType:e,...Me(t)})}const aF=oe("ZodCatch",(e,t)=>{$7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>YI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function iF(e,t){return new aF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const sF=oe("ZodPipe",(e,t)=>{L7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>KI(e,n,a,s),e.in=t.in,e.out=t.out});function Vw(e,t){return new sF({type:"pipe",in:e,out:t})}const oF=oe("ZodReadonly",(e,t)=>{P7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>XI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function lF(e){return new oF({type:"readonly",innerType:e})}const uF=oe("ZodCustom",(e,t)=>{U7.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>PI(e,n)});function cF(e,t={}){return CI(uF,e,t)}function dF(e){return TI(e)}const fF=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"devkit",label:"DevKit"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"ui",label:"Interface"},{id:"logging",label:"Logging"},{id:"chronos",label:"Chronos"},{id:"smiths",label:"Smiths"}],hF=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],pl=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function mF(){const{data:e,error:t}=xt("/api/config",pn.fetchConfig),{data:n}=xt("/api/config/sati",pn.getSatiConfig),{data:a}=xt("/api/config/apoc",pn.getApocConfig),{data:s}=xt("/api/config/neo",pn.getNeoConfig),{data:u}=xt("/api/config/trinity",pn.getTrinityConfig),{data:l}=xt("/api/config/encryption-status",()=>pn.getEncryptionStatus()),{data:f}=xt("/api/config/env-overrides",()=>pn.getEnvOverrides()),{data:h}=aj(),[m,g]=z.useState(null),[y,b]=z.useState(!1),{data:v}=xt("/api/smiths/config",pn.getSmithsConfig),{data:S,mutate:N}=xt("/api/smiths",pn.getSmithsList),[C,E]=z.useState(null),[A,T]=z.useState(!1),[L,U]=z.useState(null),[D,Z]=z.useState({name:"",host:"",port:7900,auth_token:""}),[R,J]=z.useState(null),[ue,le]=z.useState(null),[re,ae]=z.useState(null),[te,se]=z.useState(null),[V,Q]=z.useState(null),[Y,be]=z.useState("general"),[O,j]=z.useState("oracle"),[F,w]=z.useState(!1),[G,he]=z.useState({}),[me,fe]=z.useState(null);z.useEffect(()=>{e&&!R&&J(e)},[e]),z.useEffect(()=>{n&&!ue&&le(n)},[n]),z.useEffect(()=>{a&&!te?se(a):!a&&!te&&R&&se({...R.apoc??R.llm,temperature:R.apoc?.temperature??.2,timeout_ms:R.apoc?.timeout_ms??3e4})},[a,R]),z.useEffect(()=>{s&&!re?ae(s):!s&&!re&&R&&ae({...R.neo??R.llm,temperature:R.neo?.temperature??.2})},[s,R]),z.useEffect(()=>{u&&!V?Q(u):!u&&!V&&R&&Q({...R.trinity??R.llm,temperature:R.trinity?.temperature??.2})},[u,R]),z.useEffect(()=>{h&&!m&&g(h)},[h]),z.useEffect(()=>{v&&!C&&E(v)},[v]);const Ze=JSON.stringify(e)!==JSON.stringify(R)||JSON.stringify(n)!==JSON.stringify(ue)||JSON.stringify(s)!==JSON.stringify(re)||JSON.stringify(a)!==JSON.stringify(te)||JSON.stringify(u)!==JSON.stringify(V),Te=(M,_e)=>{if(!l?.apiKeysEncrypted)return null;const{morpheusSecretSet:Lt,apiKeysEncrypted:K}=l,ce=K[M];return!_e?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[bt(M)]?null:Lt?ce?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"})},bt=M=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[M],Ae=M=>!f||!f[M]?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"}),Oe=M=>!!(f&&f[M]),Se=(M,_e)=>{if(!R)return;const Lt=JSON.parse(JSON.stringify(R));let K=Lt;for(let ce=0;ce<M.length-1;ce++)(K[M[ce]]===void 0||K[M[ce]]===null)&&(K[M[ce]]={}),K=K[M[ce]];K[M[M.length-1]]=_e,J(Lt);try{HB.parse(Lt),he({})}catch(ce){if(ce instanceof iH){const ge={};ce.errors.forEach(Ee=>{const qe=Ee.path.join(".");ge[qe]=Ee.message}),he(ge)}}},rt=(M,_e)=>{ue&&le({...ue,[M]:_e})},Rt=(M,_e)=>{te&&se({...te,[M]:_e})},$e=(M,_e)=>{re&&ae({...re,[M]:_e})},Fe=(M,_e)=>{V&&Q({...V,[M]:_e})},ft=()=>{!R||!V||Q({...V,provider:R.llm.provider,model:R.llm.model,api_key:R.llm.api_key})},at=()=>{!R||!ue||le({...ue,provider:R.llm.provider,model:R.llm.model,api_key:R.llm.api_key})},Bt=()=>{!R||!te||se({...te,provider:R.llm.provider,model:R.llm.model,api_key:R.llm.api_key})},En=()=>{!R||!re||ae({...re,provider:R.llm.provider,model:R.llm.model,api_key:R.llm.api_key})},Nt=async()=>{if(R){w(!0),fe(null);try{const M=await pn.updateConfig(R);ue&&await pn.updateSatiConfig(ue),re&&await pn.updateNeoConfig(re),te&&await pn.updateApocConfig(te),V&&await pn.updateTrinityConfig(V),jn("/api/config"),jn("/api/config/sati"),jn("/api/config/neo"),jn("/api/config/apoc"),jn("/api/config/trinity");const _e=M._restartRequired||[];_e.length>0?fe({type:"success",message:`Settings saved and applied. Some changes require restart: ${_e.join(", ")}`}):fe({type:"success",message:"Settings saved and applied successfully."})}catch(M){if(fe({type:"error",message:M.message}),M.details&&Array.isArray(M.details)){const _e={};M.details.forEach(Lt=>{const K=Lt.path.join(".");_e[K]=Lt.message}),he(_e)}}finally{w(!1)}}};return t?d.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):R?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:Nt,disabled:!Ze||Object.keys(G).length>0||F,className:`px-4 py-2 rounded font-medium transition-colors ${Ze&&Object.keys(G).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:F?"Saving...":"Save Changes"})]}),me&&d.jsx("div",{className:`p-4 rounded border ${me.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:me.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:fF.map(M=>d.jsx("button",{onClick:()=>be(M.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${Y===M.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:M.label},M.id))})}),d.jsxs("div",{className:"space-y-6",children:[Y==="general"&&d.jsxs(mn,{title:"Agent Identity",children:[d.jsx(Be,{label:"Agent Name",value:R.agent.name,onChange:M=>Se(["agent","name"],M.target.value),error:G["agent.name"]}),d.jsx(Be,{label:"Personality",value:R.agent.personality,onChange:M=>Se(["agent","personality"],M.target.value),error:G["agent.personality"]}),d.jsx(gn,{label:"Verbose Mode",value:R.verbose_mode!==!1?"true":"false",onChange:M=>Se(["verbose_mode"],M.target.value==="true"),options:[{value:"true",label:"Enabled (notify tool execution on channels)"},{value:"false",label:"Disabled"}],helperText:"When enabled, channels like Telegram/Discord show which tools are being executed in real-time."})]}),Y==="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:hF.map(M=>d.jsx("button",{onClick:()=>j(M.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${O===M.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:M.label},M.id))}),O==="oracle"&&d.jsxs(mn,{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"}),Ae("llm.provider")]}),d.jsx(gn,{label:"",value:R.llm.provider,onChange:M=>Se(["llm","provider"],M.target.value),options:pl,error:G["llm.provider"],disabled:Oe("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"}),Ae("llm.model")]}),d.jsx(Be,{label:"",value:R.llm.model,onChange:M=>Se(["llm","model"],M.target.value),disabled:Oe("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"}),Ae("llm.temperature")]}),d.jsx(Vt,{label:"",value:R.llm.temperature,onChange:M=>Se(["llm","temperature"],parseFloat(M.target.value)),step:.1,min:0,max:1,error:G["llm.temperature"],disabled:Oe("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"}),Ae("llm.max_tokens")]}),d.jsx(Vt,{label:"",value:R.llm.max_tokens??"",onChange:M=>Se(["llm","max_tokens"],M.target.value?parseInt(M.target.value):void 0),min:1,error:G["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:Oe("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)"}),Ae("llm.context_window")]}),d.jsx(Vt,{label:"",value:R.llm.context_window??100,onChange:M=>Se(["llm","context_window"],parseInt(M.target.value)),min:1,step:1,error:G["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:Oe("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:[Ae("llm.api_key"),Te("oracle",R.llm.api_key)]})]}),d.jsx(Be,{label:"",type:"password",value:R.llm.api_key||"",onChange:M=>Se(["llm","api_key"],M.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:Oe("llm.api_key")}),R.llm.provider==="openrouter"&&d.jsx(Be,{label:"Base URL",value:R.llm.base_url||"https://openrouter.ai/api/v1",onChange:M=>Se(["llm","base_url"],M.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),O==="sati"&&d.jsxs(mn,{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:at,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"})]}),ue&&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"}),Ae("sati.provider")]}),d.jsx(gn,{label:"",value:ue.provider,onChange:M=>rt("provider",M.target.value),options:pl,disabled:Oe("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"}),Ae("sati.model")]}),d.jsx(Be,{label:"",value:ue.model,onChange:M=>rt("model",M.target.value),disabled:Oe("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:[Ae("sati.api_key"),Te("sati",ue.api_key)]})]}),d.jsx(Be,{label:"",type:"password",value:ue.api_key||"",onChange:M=>rt("api_key",M.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:Oe("sati.api_key")}),ue.provider==="openrouter"&&d.jsx(Be,{label:"Base URL",value:ue.base_url||"https://openrouter.ai/api/v1",onChange:M=>rt("base_url",M.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(Vt,{label:"Memory Limit",value:ue.memory_limit??10,onChange:M=>rt("memory_limit",parseInt(M.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),d.jsx(_r,{label:"Enable Archived Sessions in Memory Retrieval",checked:ue.enabled_archived_sessions??!0,onChange:M=>rt("enabled_archived_sessions",M)})]})]}),O==="neo"&&d.jsxs(mn,{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:En,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"})]}),re&&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"}),Ae("neo.provider")]}),d.jsx(gn,{label:"",value:re.provider,onChange:M=>$e("provider",M.target.value),options:pl,disabled:Oe("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"}),Ae("neo.model")]}),d.jsx(Be,{label:"",value:re.model,onChange:M=>$e("model",M.target.value),disabled:Oe("neo.model")}),d.jsx(Be,{label:"Personality",value:re.personality||"analytical_engineer",onChange:M=>$e("personality",M.target.value),placeholder:"analytical_engineer",helperText:"e.g., analytical_engineer, meticulous_auditor, systems_thinker"}),d.jsx(gn,{label:"Execution Mode",value:re.execution_mode||"async",onChange:M=>$e("execution_mode",M.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),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"}),Ae("neo.temperature")]}),d.jsx(Vt,{label:"",value:re.temperature,onChange:M=>$e("temperature",parseFloat(M.target.value)),step:.1,min:0,max:1,disabled:Oe("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"}),Ae("neo.max_tokens")]}),d.jsx(Vt,{label:"",value:re.max_tokens??"",onChange:M=>$e("max_tokens",M.target.value?parseInt(M.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:Oe("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)"}),Ae("neo.context_window")]}),d.jsx(Vt,{label:"",value:re.context_window??100,onChange:M=>$e("context_window",parseInt(M.target.value)),min:1,step:1,disabled:Oe("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:[Ae("neo.api_key"),Te("neo",re.api_key)]})]}),d.jsx(Be,{label:"",type:"password",value:re.api_key||"",onChange:M=>$e("api_key",M.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:Oe("neo.api_key")}),re.provider==="openrouter"&&d.jsx(Be,{label:"Base URL",value:re.base_url||"https://openrouter.ai/api/v1",onChange:M=>$e("base_url",M.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),O==="trinity"&&d.jsxs(mn,{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:ft,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"})]}),V&&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"}),Ae("trinity.provider")]}),d.jsx(gn,{label:"",value:V.provider,onChange:M=>Fe("provider",M.target.value),options:pl,disabled:Oe("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"}),Ae("trinity.model")]}),d.jsx(Be,{label:"",value:V.model,onChange:M=>Fe("model",M.target.value),disabled:Oe("trinity.model")}),d.jsx(Be,{label:"Personality",value:V.personality||"data_specialist",onChange:M=>Fe("personality",M.target.value),placeholder:"data_specialist",helperText:"e.g., data_specialist, query_optimizer, db_architect"}),d.jsx(gn,{label:"Execution Mode",value:V.execution_mode||"async",onChange:M=>Fe("execution_mode",M.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),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"}),Ae("trinity.temperature")]}),d.jsx(Vt,{label:"",value:V.temperature,onChange:M=>Fe("temperature",parseFloat(M.target.value)),step:.1,min:0,max:1,disabled:Oe("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"}),Ae("trinity.max_tokens")]}),d.jsx(Vt,{label:"",value:V.max_tokens??"",onChange:M=>Fe("max_tokens",M.target.value?parseInt(M.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:Oe("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:[Ae("trinity.api_key"),Te("trinity",V.api_key)]})]}),d.jsx(Be,{label:"",type:"password",value:V.api_key||"",onChange:M=>Fe("api_key",M.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:Oe("trinity.api_key")}),V.provider==="openrouter"&&d.jsx(Be,{label:"Base URL",value:V.base_url||"https://openrouter.ai/api/v1",onChange:M=>Fe("base_url",M.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),O==="apoc"&&d.jsxs(mn,{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:Bt,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"})]}),te&&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"}),Ae("apoc.provider")]}),d.jsx(gn,{label:"",value:te.provider,onChange:M=>Rt("provider",M.target.value),options:pl,disabled:Oe("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"}),Ae("apoc.model")]}),d.jsx(Be,{label:"",value:te.model,onChange:M=>Rt("model",M.target.value),disabled:Oe("apoc.model")}),d.jsx(Be,{label:"Personality",value:te.personality||"pragmatic_dev",onChange:M=>Rt("personality",M.target.value),placeholder:"pragmatic_dev",helperText:"e.g., pragmatic_dev, cautious_admin, automation_specialist"}),d.jsx(gn,{label:"Execution Mode",value:te.execution_mode||"async",onChange:M=>Rt("execution_mode",M.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),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"}),Ae("apoc.temperature")]}),d.jsx(Vt,{label:"",value:te.temperature,onChange:M=>Rt("temperature",parseFloat(M.target.value)),step:.1,min:0,max:1,disabled:Oe("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:[Ae("apoc.api_key"),Te("apoc",te.api_key)]})]}),d.jsx(Be,{label:"",type:"password",value:te.api_key||"",onChange:M=>Rt("api_key",M.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:Oe("apoc.api_key")}),te.provider==="openrouter"&&d.jsx(Be,{label:"Base URL",value:te.base_url||"https://openrouter.ai/api/v1",onChange:M=>Rt("base_url",M.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(Be,{label:"Working Directory",value:te.working_dir||"",onChange:M=>Rt("working_dir",M.target.value),placeholder:"(deprecated — use DevKit tab)",helperText:"Deprecated: Use the DevKit tab's Sandbox Directory instead.",disabled:!0}),d.jsx(Vt,{label:"Timeout (ms)",value:te.timeout_ms??3e4,onChange:M=>Rt("timeout_ms",parseInt(M.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),Y==="devkit"&&d.jsxs(d.Fragment,{children:[d.jsxs(mn,{title:"DevKit Security",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Shared security configuration for DevKit tools used by Apoc and Keymaker. Controls path sandboxing, shell command restrictions, and tool category access."}),d.jsx(Be,{label:"Sandbox Directory",value:R.devkit?.sandbox_dir||"",onChange:M=>Se(["devkit","sandbox_dir"],M.target.value),placeholder:typeof window<"u"?"(defaults to process.cwd())":"",helperText:"Root directory for all DevKit operations. All file, shell, and git paths are confined here.",disabled:Oe("devkit.sandbox_dir")}),d.jsx(gn,{label:"Read-Only Mode",value:R.devkit?.readonly_mode?"true":"false",onChange:M=>Se(["devkit","readonly_mode"],M.target.value==="true"),options:[{value:"false",label:"Disabled (read + write)"},{value:"true",label:"Enabled (read-only, blocks writes/deletes)"}],helperText:"When enabled, blocks all write, delete, and create operations on the filesystem.",disabled:Oe("devkit.readonly_mode")}),d.jsx(Vt,{label:"Timeout (ms)",value:R.devkit?.timeout_ms??3e4,onChange:M=>Se(["devkit","timeout_ms"],parseInt(M.target.value)),min:1e3,step:1e3,helperText:"Default timeout for shell and system operations in milliseconds.",disabled:Oe("devkit.timeout_ms")})]}),d.jsxs(mn,{title:"Tool Categories",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Enable or disable entire categories of DevKit tools."}),d.jsx(_r,{label:"Filesystem (read, write, list, copy, move, delete files)",checked:R.devkit?.enable_filesystem!==!1,onChange:M=>Se(["devkit","enable_filesystem"],M)}),d.jsx(_r,{label:"Shell (run_command, run_script, which)",checked:R.devkit?.enable_shell!==!1,onChange:M=>Se(["devkit","enable_shell"],M)}),d.jsx(_r,{label:"Git (status, diff, commit, push, pull, clone, branch)",checked:R.devkit?.enable_git!==!1,onChange:M=>Se(["devkit","enable_git"],M)}),d.jsx(_r,{label:"Network (http_request, ping, dns_lookup, download_file)",checked:R.devkit?.enable_network!==!1,onChange:M=>Se(["devkit","enable_network"],M)})]}),d.jsxs(mn,{title:"Shell Command Allowlist",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Restrict which shell commands Apoc and Keymaker can execute. Leave empty to allow all commands (default)."}),d.jsx(Be,{label:"Allowed Commands",value:(R.devkit?.allowed_shell_commands||[]).join(", "),onChange:M=>Se(["devkit","allowed_shell_commands"],M.target.value.split(",").map(_e=>_e.trim()).filter(Boolean)),placeholder:"e.g. node, npm, git, python, cargo",helperText:"Comma-separated list of allowed binary names. Empty = all commands allowed.",disabled:Oe("devkit.allowed_shell_commands")})]})]}),Y==="audio"&&d.jsxs(mn,{title:"Audio Transcription",children:[d.jsx(_r,{label:"Enable Audio",checked:R.audio.enabled,onChange:M=>Se(["audio","enabled"],M)}),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"}),Ae("audio.provider")]}),d.jsx(gn,{label:"",value:R.audio.provider||"google",onChange:M=>Se(["audio","provider"],M.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:G["audio.provider"],disabled:Oe("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"}),Ae("audio.model")]}),d.jsx(Be,{label:"",value:R.audio.model,onChange:M=>Se(["audio","model"],M.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:G["audio.model"],disabled:Oe("audio.model")}),R.audio.provider==="ollama"&&d.jsx(Be,{label:"Base URL",value:R.audio.base_url||"",onChange:M=>Se(["audio","base_url"],M.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:[Ae("audio.apiKey"),Te("audio",R.audio.apiKey)]})]}),d.jsx(Be,{label:"",type:"password",value:R.audio.apiKey||"",onChange:M=>Se(["audio","apiKey"],M.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:Oe("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)"}),Ae("audio.maxDurationSeconds")]}),d.jsx(Vt,{label:"",value:R.audio.maxDurationSeconds,onChange:M=>Se(["audio","maxDurationSeconds"],parseInt(M.target.value)),min:1,disabled:Oe("audio.maxDurationSeconds")}),d.jsx(Be,{label:"Supported Mime Types",value:R.audio.supportedMimeTypes.join(", "),onChange:M=>Se(["audio","supportedMimeTypes"],M.target.value.split(",").map(_e=>_e.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),Y==="channels"&&d.jsxs(d.Fragment,{children:[d.jsxs(mn,{title:"Telegram",children:[d.jsx(_r,{label:"Enable Telegram",checked:R.channels.telegram.enabled,onChange:M=>Se(["channels","telegram","enabled"],M)}),R.channels.telegram.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(Be,{label:"Bot Token",type:"password",value:R.channels.telegram.token||"",onChange:M=>Se(["channels","telegram","token"],M.target.value)}),d.jsx(Be,{label:"Allowed Users (comma separated)",value:R.channels.telegram.allowedUsers.join(", "),onChange:M=>Se(["channels","telegram","allowedUsers"],M.target.value.split(",").map(_e=>_e.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),d.jsxs(mn,{title:"Discord",children:[d.jsx(_r,{label:"Enable Discord",checked:R.channels.discord.enabled,onChange:M=>Se(["channels","discord","enabled"],M)}),R.channels.discord.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(Be,{label:"Bot Token",type:"password",value:R.channels.discord.token||"",onChange:M=>Se(["channels","discord","token"],M.target.value)}),d.jsx(Be,{label:"Allowed Users (comma separated)",value:(R.channels.discord.allowedUsers??[]).join(", "),onChange:M=>Se(["channels","discord","allowedUsers"],M.target.value.split(",").map(_e=>_e.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),Y==="ui"&&d.jsxs(mn,{title:"Dashboard",children:[d.jsx(_r,{label:"Enable Web UI",checked:R.ui.enabled,onChange:M=>Se(["ui","enabled"],M)}),d.jsx(Vt,{label:"Port",value:R.ui.port,onChange:M=>Se(["ui","port"],parseInt(M.target.value)),disabled:!0,helperText:"Port changes require daemon restart."})]}),Y==="logging"&&d.jsxs(mn,{title:"Logging",children:[d.jsx(_r,{label:"Enable Logging",checked:R.logging.enabled,onChange:M=>Se(["logging","enabled"],M)}),d.jsx(gn,{label:"Log Level",value:R.logging.level,onChange:M=>Se(["logging","level"],M.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),Y==="chronos"&&m&&d.jsxs(mn,{title:"Chronos — Temporal Intent Engine",children:[d.jsx(gn,{label:"Timezone",value:m.timezone,onChange:M=>g({...m,timezone:M.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(Vt,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:M=>g({...m,check_interval_ms:Number(M.target.value)*1e3}),min:60}),d.jsx(Vt,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:M=>g({...m,max_active_jobs:Number(M.target.value)}),min:1,max:1e3}),d.jsx("div",{className:"flex justify-end pt-2",children:d.jsx("button",{onClick:async()=>{b(!0),fe(null);try{await Ri.updateConfig(m),jn("/api/config/chronos"),fe({type:"success",message:"Chronos settings saved."})}catch(M){fe({type:"error",message:M.message})}finally{b(!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"})})]}),Y==="smiths"&&C&&d.jsxs(mn,{title:"Smiths — Remote Agents",children:[d.jsx(_r,{label:"Enable Smiths",checked:C.enabled,onChange:M=>E({...C,enabled:M}),helperText:"Master switch for the Smiths subsystem."}),d.jsx(gn,{label:"Execution Mode",value:C.execution_mode,onChange:M=>E({...C,execution_mode:M.target.value}),options:[{label:"Sync (inline result)",value:"sync"},{label:"Async (background task)",value:"async"}]}),d.jsx(Vt,{label:"Heartbeat Interval (seconds)",value:Math.round(C.heartbeat_interval_ms/1e3),onChange:M=>E({...C,heartbeat_interval_ms:Number(M.target.value)*1e3}),min:5}),d.jsx(Vt,{label:"Connection Timeout (seconds)",value:Math.round(C.connection_timeout_ms/1e3),onChange:M=>E({...C,connection_timeout_ms:Number(M.target.value)*1e3}),min:1}),d.jsx(Vt,{label:"Task Timeout (seconds)",value:Math.round(C.task_timeout_ms/1e3),onChange:M=>E({...C,task_timeout_ms:Number(M.target.value)*1e3}),min:5}),d.jsxs("div",{className:"mt-6",children:[d.jsx("h3",{className:"text-sm font-semibold text-azure-text dark:text-matrix-highlight mb-3",children:"Configured Smiths"}),C.entries.length===0?d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary italic",children:"No Smiths configured. Add one below."}):d.jsx("div",{className:"space-y-2",children:C.entries.map((M,_e)=>{const Lt=S?.smiths?.find(K=>K.name===M.name);return d.jsxs("div",{className:"flex items-center justify-between p-3 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface/50 dark:bg-zinc-900",children:[d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${Lt?.state==="online"?"bg-emerald-500":Lt?.state==="connecting"?"bg-amber-500 animate-pulse":"bg-red-500"}`,title:Lt?.state??"unknown"}),d.jsxs("div",{children:[d.jsx("span",{className:"font-medium text-azure-text dark:text-matrix-secondary",children:M.name}),d.jsxs("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary ml-2",children:[M.host,":",M.port]})]})]}),d.jsxs("div",{className:"flex items-center space-x-2",children:[Lt?.lastSeen&&d.jsxs("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:["Last seen: ",new Date(Lt.lastSeen).toLocaleTimeString()]}),d.jsx("button",{onClick:async()=>{try{const K=await pn.pingSmith(M.name);fe({type:"success",message:`Ping to ${M.name}: ${K.latency_ms}ms`})}catch(K){fe({type:"error",message:`Ping failed: ${K.message}`})}},className:"px-2 py-1 text-xs rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Ping",children:"📡"}),d.jsx("button",{onClick:()=>U({...M,auth_token:""}),className:"px-2 py-1 text-xs rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:"✏️"}),d.jsx("button",{onClick:()=>{const K=C.entries.filter((ce,ge)=>ge!==_e);E({...C,entries:K})},className:"px-2 py-1 text-xs rounded border border-red-300 dark:border-red-700 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/30 transition-colors",title:"Remove",children:"🗑️"})]})]},M.name)})})]}),L&&d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center",children:d.jsxs("div",{className:"bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl p-6 w-full max-w-md",children:[d.jsx("h3",{className:"text-lg font-semibold text-azure-text dark:text-matrix-highlight mb-4",children:"Edit Smith"}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Be,{label:"Name",value:L.name,onChange:M=>U({...L,name:M.target.value}),disabled:!0}),d.jsx(Be,{label:"Host",value:L.host,onChange:M=>U({...L,host:M.target.value})}),d.jsx(Vt,{label:"Port",value:L.port,onChange:M=>U({...L,port:Number(M.target.value)}),min:1,max:65535}),d.jsx(Be,{label:"Auth Token",value:L.auth_token,placeholder:"Leave blank to keep existing token",onChange:M=>U({...L,auth_token:M.target.value})}),d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[d.jsx("input",{type:"checkbox",id:"edit-smith-tls",checked:L.tls??!1,onChange:M=>U({...L,tls:M.target.checked}),className:"w-4 h-4 accent-azure-primary dark:accent-matrix-highlight"}),d.jsxs("label",{htmlFor:"edit-smith-tls",className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Use TLS (",d.jsx("code",{className:"text-xs",children:"wss://"}),")"]})]})]}),d.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[d.jsx("button",{onClick:()=>U(null),className:"px-4 py-2 rounded text-sm text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight transition-colors",children:"Cancel"}),d.jsx("button",{onClick:()=>{const M=C.entries.map(_e=>_e.name===L.name?L:_e);E({...C,entries:M}),U(null)},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 transition-colors",children:"Save"})]})]})}),d.jsxs("div",{className:"mt-4 p-4 rounded border border-dashed border-azure-border dark:border-matrix-primary",children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text dark:text-matrix-secondary mb-3",children:"Add New Smith"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx(Be,{label:"Name",value:D.name,onChange:M=>Z({...D,name:M.target.value})}),d.jsx(Be,{label:"Host",value:D.host,onChange:M=>Z({...D,host:M.target.value})}),d.jsx(Vt,{label:"Port",value:D.port,onChange:M=>Z({...D,port:Number(M.target.value)}),min:1,max:65535}),d.jsx(Be,{label:"Auth Token",value:D.auth_token,onChange:M=>Z({...D,auth_token:M.target.value})})]}),d.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[d.jsx("input",{type:"checkbox",id:"new-smith-tls",checked:D.tls??!1,onChange:M=>Z({...D,tls:M.target.checked}),className:"w-4 h-4 accent-azure-primary dark:accent-matrix-highlight"}),d.jsxs("label",{htmlFor:"new-smith-tls",className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Use TLS (",d.jsx("code",{className:"text-xs",children:"wss://"}),")"]})]}),d.jsx("div",{className:"flex justify-end mt-3",children:d.jsx("button",{onClick:()=>{if(!D.name||!D.host||!D.auth_token){fe({type:"error",message:"Name, host, and auth token are required."});return}if(C.entries.some(M=>M.name===D.name)){fe({type:"error",message:`Smith '${D.name}' already exists.`});return}E({...C,entries:[...C.entries,{...D}]}),Z({name:"",host:"",port:7900,auth_token:""})},className:"px-4 py-2 rounded text-sm font-medium border border-azure-primary text-azure-primary hover:bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:hover:bg-matrix-highlight/10 transition-colors",children:"+ Add Smith"})})]}),d.jsx("div",{className:"flex justify-end pt-2",children:d.jsx("button",{onClick:async()=>{T(!0),fe(null);try{await pn.updateSmithsConfig(C),jn("/api/smiths/config"),N(),fe({type:"success",message:"Smiths settings saved."})}catch(M){fe({type:"error",message:M.message})}finally{T(!1)}},disabled:A,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:A?"Saving…":"Save Smiths Settings"})})]})]})]}):d.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function pF(){const{data:e}=q4(),[t,n]=z.useState(null),{data:a,mutate:s}=G4(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(Qe.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(pA,{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(Ms,{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 gF(){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,b]=await Promise.all([Ap.fetchUsageStats(),Ap.fetchGroupedUsageStats()]);t(y),a(b)}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(Qe.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(Ym,{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(Qe.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(Tl,{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(Qe.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(Zs,{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(Qe.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(qc,{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(Qe.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 xF=()=>{const[e,t]=z.useState(""),[n,a]=z.useState(""),s=eg(),u=Tr(),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."})]})})},yF=({children:e})=>{const{isAuthenticated:t}=k_(),n=Tr();return t?d.jsx(d.Fragment,{children:e}):d.jsx(mS,{to:"/login",state:{from:n},replace:!0})},bF=({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})}),vF=({...e})=>d.jsx("thead",{...e}),kF=({...e})=>d.jsx("tbody",{...e}),Vm=({...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}),Cs=({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}),Ni=({className:e,...t})=>d.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),Bw=({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})},cd=({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})},Bm=({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}),Zw=({className:e,...t})=>d.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),wF=({className:e,...t})=>d.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),Zm=({className:e,...t})=>d.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),SF=({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})},zF=({className:e,...t})=>d.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),S2=({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})]})]})},_F=({isOpen:e,onClose:t,memory:n})=>n?d.jsx(S2,{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(sg,{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(cd,{variant:"outline",children:n.category})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(s4,{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(cd,{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(wS,{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(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:"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(Hl,{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(kA,{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(_A,{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(fr,{onClick:t,children:"Close"})})]})}):null,z2=({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(S2,{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(fr,{variant:"outline",onClick:t,children:l}),d.jsx(fr,{variant:"destructive",onClick:()=>{n(),t()},children:u})]})]})}),jF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=z.useCallback(h=>(t(!0),a(null),pe.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),pe.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),pe.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),pe.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}},NF=()=>{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"),[b,v]=z.useState(null),[S,N]=z.useState(!1),[C,E]=z.useState(null),[A,T]=z.useState(!1),[L,U]=z.useState(null),[D,Z]=z.useState(!1),{get:R,del:J,post:ue}=jF();z.useEffect(()=>{le()},[]);const le=async()=>{try{a(!0);const j=await R("/sati/memories");t(j),v(null)}catch(j){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",j)}finally{a(!1)}},re=()=>{s.length===Y.length?u([]):u(Y.map(j=>j.id))},ae=j=>{s.includes(j)?u(s.filter(F=>F!==j)):u([...s,j])},te=async()=>{if(s.length!==0)try{await ue("/sati/memories/bulk-delete",{ids:s}),await le(),u([]),N(!1)}catch(j){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",j)}},se=j=>{U(j),Z(!0)},V=async()=>{if(L)try{await J(`/sati/memories/${L}`),await le()}catch(j){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",j)}finally{U(null),Z(!1)}},Q=j=>{E(j),T(!0)},Y=e.filter(j=>{const F=j.summary.toLowerCase().includes(l.toLowerCase())||j.details?.toLowerCase().includes(l.toLowerCase())||j.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||j.category===h,G=g==="all"||j.importance===g;return F&&w&&G&&!j.archived}),be=Array.from(new Set(e.map(j=>j.category))),O=Array.from(new Set(e.map(j=>j.importance)));return n?d.jsx(Bm,{className:"w-full",children:d.jsx(Zm,{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(fr,{variant:"destructive",size:"sm",onClick:()=>N(!0),disabled:s.length===0,children:[d.jsx(Mi,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&d.jsx(SF,{variant:"destructive",children:d.jsx(zF,{children:b})}),d.jsxs(Bm,{children:[d.jsx(Zw,{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(YA,{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:j=>f(j.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:j=>m(j.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"}),be.map(j=>d.jsx("option",{value:j,children:j},j))]}),d.jsxs("select",{value:g,onChange:j=>y(j.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"}),O.map(j=>d.jsx("option",{value:j,children:j},j))]})]})]})}),d.jsx(Zm,{className:"p-0",children:d.jsxs(bF,{children:[d.jsx(vF,{children:d.jsxs(Vm,{className:"hover:bg-transparent",children:[d.jsx(Cs,{className:"w-12",children:d.jsx(Bw,{checked:Y.length>0&&s.length===Y.length,onCheckedChange:re})}),d.jsx(Cs,{children:"Summary"}),d.jsx(Cs,{children:"Category"}),d.jsx(Cs,{children:"Importance"}),d.jsx(Cs,{children:"Created"}),d.jsx(Cs,{className:"w-32",children:"Actions"})]})}),d.jsx(kF,{children:Y.length===0?d.jsx(Vm,{children:d.jsx(Ni,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):Y.map(j=>d.jsxs(Vm,{children:[d.jsx(Ni,{children:d.jsx(Bw,{checked:s.includes(j.id),onCheckedChange:()=>ae(j.id)})}),d.jsx(Ni,{className:"font-medium max-w-xs truncate",children:j.summary}),d.jsx(Ni,{children:d.jsx(cd,{variant:"outline",children:j.category})}),d.jsx(Ni,{children:d.jsx(cd,{variant:j.importance==="critical"?"destructive":j.importance==="high"?"default":j.importance==="medium"?"secondary":"outline",children:j.importance})}),d.jsx(Ni,{children:d.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(wS,{className:"w-4 h-4"}),new Date(j.created_at).toLocaleDateString()]})}),d.jsx(Ni,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(fr,{variant:"ghost",size:"sm",onClick:()=>Q(j),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.jsx(Hl,{className:"w-4 h-4"})}),d.jsx(fr,{variant:"ghost",size:"sm",onClick:()=>se(j.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:d.jsx(Mi,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),S&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs(Bm,{className:"w-full max-w-md mx-4",children:[d.jsx(Zw,{children:d.jsx(wF,{children:"Delete Memories"})}),d.jsxs(Zm,{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(fr,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),d.jsx(fr,{variant:"destructive",onClick:te,children:"Delete"})]})]})]})}),d.jsx(_F,{isOpen:A,onClose:()=>T(!1),memory:C}),d.jsx(z2,{isOpen:D,onClose:()=>Z(!1),onConfirm:V,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},Ba=Fa.getInstance(),jr={fetchServers:async()=>Ba.get("/mcp/servers"),addServer:async(e,t)=>Ba.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>Ba.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>Ba.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>Ba.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>Ba.post("/mcp/reload",{}),fetchStatus:async()=>Ba.get("/mcp/status"),fetchStats:async()=>Ba.get("/mcp/stats")},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"})]})},Iw=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const u=z.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,y)=>{const b=[...u];b[m]={...b[m],[g]:y},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},f=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((y,b)=>b!==m);n(g.filter(y=>y.key.trim().length>0||y.value.trim().length>0))};return 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"})]})},TF=({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(Iw,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&d.jsx(Iw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),EF=ZH({name:Um().min(1,"Name is required"),transport:v2([Lw("stdio"),Lw("http")]),command:Um().optional(),url:Um().optional()}),Rc=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Im=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),AF=({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,b]=z.useState(n?.config.transport==="http"?n.config.url:""),[v,S]=z.useState(n?.config.args??[]),[N,C]=z.useState(Rc(n?.config.env)),[E,A]=z.useState(n?.config.transport==="http"?Rc(n.config.headers):[]),[T,L]=z.useState(null);z.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),b(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),C(Rc(n?.config.env)),A(n?.config.transport==="http"?Rc(n.config.headers):[]),L(null))},[e,n]);const U=t==="create",D=async()=>{const R=EF.safeParse({name:u,transport:f,command:m,url:y});if(!R.success){L(R.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 J=f==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:N.length>0?Im(N):void 0}:{transport:"http",url:y.trim(),headers:E.length>0?Im(E):void 0,env:N.length>0?Im(N):void 0};L(null),await s(u.trim(),J)},Z=z.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return d.jsx(pr,{open:e,onOpenChange:a,children:d.jsxs(Js,{children:[d.jsx(gr,{children:d.jsx(xr,{children:Z})}),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:R=>l(R.target.value),placeholder:"coolify",disabled:!U})]}),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:R=>h(R.target.value),children:[d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),d.jsx(TF,{transport:f,command:m,url:y,args:v,env:N,headers:E,onCommandChange:g,onUrlChange:b,onArgsChange:S,onEnvChange:C,onHeadersChange:A}),T&&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:T}),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:D,children:"Save"})]})]})]})})},OF=({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"})]})]}),RF=()=>{const{data:e,error:t,mutate:n,isLoading:a}=xt("/api/mcp/servers",()=>jr.fetchServers()),[s,u]=z.useState(""),[l,f]=z.useState("all"),[h,m]=z.useState(!1),[g,y]=z.useState(null),[b,v]=z.useState(!1),[S,N]=z.useState(null),[C,E]=z.useState(null),[A,T]=z.useState({}),[L,U]=z.useState(!1),[D,Z]=z.useState(!1),[R,J]=z.useState(null),ue=e?.servers??[];z.useEffect(()=>{jr.fetchStats().then(j=>{J(j);const F={};for(const w of j.servers)F[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};T(F)}).catch(()=>{})},[]);const le=z.useMemo(()=>ue.filter(j=>{const F=j.name.toLowerCase().includes(s.toLowerCase()),w=l==="all"||j.config.transport===l;return F&&w}),[ue,s,l]),re=()=>{y(null),m(!0)},ae=j=>{y(j),m(!0)},te=async()=>{const j=await jr.fetchStats();J(j);const F={};for(const w of j.servers)F[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};return T(F),j},se=async(j,F)=>{try{g?await jr.updateServer(g.name,F):await jr.addServer(j,F),m(!1),y(null),await n(),await jr.reloadTools();const w=await te();E({type:"success",message:`MCP server saved. Tools reloaded: ${w.totalTools} total.`})}catch(w){E({type:"error",message:w.message||"Failed to save MCP server."})}},V=async j=>{N(j),v(!0)},Q=async()=>{if(S)try{await jr.deleteServer(S.name),await n(),v(!1),N(null),await jr.reloadTools();const j=await te();E({type:"success",message:`MCP server deleted. Tools reloaded: ${j.totalTools} total.`})}catch(j){E({type:"error",message:j.message||"Failed to delete MCP server."})}},Y=async()=>{U(!0);try{const j=await te();E({type:"success",message:`Status checked: ${j.totalTools} tools from ${j.servers.length} servers.`})}catch(j){E({type:"error",message:j.message||"Failed to check MCP status."})}finally{U(!1)}},be=async()=>{Z(!0);try{await jr.reloadTools();const j=await te();E({type:"success",message:`MCP tools reloaded: ${j.totalTools} tools from ${j.servers.length} servers.`})}catch(j){E({type:"error",message:j.message||"Failed to reload MCP tools."})}finally{Z(!1)}},O=async(j,F)=>{try{await jr.toggleServer(j.name,F),await n(),await jr.reloadTools();const w=await te();E({type:"success",message:`MCP server ${F?"enabled":"disabled"}. Tools reloaded: ${w.totalTools} total.`})}catch(w){E({type:"error",message:w.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.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),R&&R.totalTools>0&&d.jsxs("span",{className:"rounded-full bg-azure-primary/10 px-3 py-1 text-sm font-semibold text-azure-primary dark:bg-matrix-highlight/20 dark:text-matrix-highlight",children:[R.totalTools," tools cached"]})]}),d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Manage MCP servers stored in mcps.json."," ",R?.lastLoadedAt&&d.jsxs("span",{className:"text-azure-text-muted dark:text-matrix-tertiary",children:["Last loaded: ",new Date(R.lastLoadedAt).toLocaleTimeString()]})]})]}),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:Y,children:L?"Checking…":"Check Status"}),d.jsx("button",{type:"button",disabled:D,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:be,children:D?"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:re,children:"Add Server"})]})]}),C&&d.jsx("div",{className:`p-4 rounded border ${C.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:C.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:j=>u(j.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:j=>f(j.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&&le.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:le.map(j=>d.jsx(OF,{server:j,probeResult:A[j.name],onEdit:ae,onDelete:V,onToggle:O},`${j.name}-${j.enabled?"on":"off"}`))}),d.jsx(AF,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:se}),d.jsx(pr,{open:b,onOpenChange:v,children:d.jsxs(Js,{children:[d.jsx(gr,{children:d.jsx(xr,{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:()=>v(!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:Q,children:"Delete"})]})]})]})})]})},Hm={list:()=>pe.get("/model-pricing"),upsert:e=>pe.post("/model-pricing",e),update:(e,t,n)=>pe.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>pe.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},MF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Hw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},DF=["anthropic","openai","google","openrouter","ollama","other"],Fw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),$F=()=>{const{data:e=[],mutate:t}=xt("/api/model-pricing",()=>Hm.list()),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Fw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[b,v]=z.useState(!1),S=(T,L)=>{y({type:T,message:L}),setTimeout(()=>y(null),3e3)},N=()=>{u(null),f(Fw()),a(!0)},C=T=>{u(T),f({...T}),a(!0)},E=async()=>{if(!(!l.provider.trim()||!l.model.trim())){v(!0);try{await Hm.upsert(l),await t(),a(!1),S("success",s?"Pricing updated.":"Pricing created.")}catch{S("error","Failed to save pricing entry.")}finally{v(!1)}}},A=async()=>{if(h)try{await Hm.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(Qe.div,{variants:MF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Qe.div,{variants:Hw,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(qc,{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: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(md,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&d.jsx(Qe.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(Qe.div,{variants:Hw,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(T=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:T},T))})}),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(T=>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:T.provider}),d.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:T.model}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",T.input_price_per_1m.toFixed(4)]}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",T.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:()=>C(T),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(ig,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(T),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(Mi,{className:"w-4 h-4"})})]})})]},`${T.provider}/${T.model}`))})]})}),d.jsx(pr,{open:n,onOpenChange:a,children:d.jsxs(Js,{children:[d.jsx(gr,{children:d.jsx(xr,{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:T=>f({...l,provider:T.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..."}),DF.map(T=>d.jsx("option",{value:T,children:T},T))]})]}),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:T=>f({...l,model:T.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:T=>f({...l,input_price_per_1m:parseFloat(T.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:T=>f({...l,output_price_per_1m:parseFloat(T.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:b||!l.provider.trim()||!l.model.trim(),className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving...":"Save"})]})]})]})}),d.jsx(pr,{open:!!h,onOpenChange:T=>!T&&m(null),children:d.jsxs(Js,{children:[d.jsx(gr,{children:d.jsx(xr,{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:A,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},LF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},qw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},PF=["ui","telegram","discord"],Gw=()=>({name:"",prompt:"",notification_channels:["ui"]}),UF=()=>{const{data:e=[],mutate:t}=xt("/webhooks",()=>Ia.list(),{refreshInterval:1e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Gw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[b,v]=z.useState(!1),[S,N]=z.useState(null),[C,E]=z.useState(null),A=(ae,te)=>{y({type:ae,message:te}),setTimeout(()=>y(null),3500)},T=()=>{u(null),f(Gw()),E(null),a(!0)},L=ae=>{u(ae),f({name:ae.name,prompt:ae.prompt,notification_channels:ae.notification_channels}),E(null),a(!0)},U=ae=>/^[a-z0-9-_]+$/.test(ae),D=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!U(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),v(!0);try{s?(await Ia.update(s.id,l),A("success","Webhook updated.")):(await Ia.create(l),A("success","Webhook created.")),await t(),a(!1)}catch(ae){const te=ae?.message||"Failed to save webhook.";E(te)}finally{v(!1)}}},Z=async ae=>{try{await Ia.update(ae.id,{enabled:!ae.enabled}),await t()}catch{A("error","Failed to toggle webhook.")}},R=async()=>{if(h)try{await Ia.delete(h.id),await t(),m(null),A("success","Webhook deleted.")}catch{A("error","Failed to delete webhook.")}},J=ae=>`${window.location.origin}/api/webhooks/trigger/${ae}`,ue=ae=>`curl -X POST ${J(ae.name)} \\
|
|
109
|
+
-H "x-api-key: ${ae.api_key}" \\
|
|
110
|
+
-H "Content-Type: application/json" \\
|
|
111
|
+
-d '{"event":"your_payload"}'`,le=async(ae,te)=>{await navigator.clipboard.writeText(ae),N(te),setTimeout(()=>N(null),2e3)},re=ae=>{const te=l.notification_channels.includes(ae);f({...l,notification_channels:te?l.notification_channels.filter(se=>se!==ae):[...l.notification_channels,ae]})};return d.jsxs(Qe.div,{variants:LF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Qe.div,{variants:qw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Wm,{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(Ha,{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(Cl,{className:"w-4 h-4"}),"Notifications"]}),d.jsxs("button",{onClick:T,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(md,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&d.jsx(Qe.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(Qe.div,{variants:qw,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(ae=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ae},ae))})}),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:T,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ae=>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:ae.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:[ae.api_key.slice(0,16),"…"]}),d.jsx("button",{onClick:()=>le(ue(ae),`curl-${ae.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-${ae.id}`?d.jsx(Km,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(Qm,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:()=>le(ae.api_key,`key-${ae.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-${ae.id}`?d.jsx(Km,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(uA,{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:ae.notification_channels.map(te=>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:te},te))})}),d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ae.trigger_count}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("button",{onClick:()=>Z(ae),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ae.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:ae.enabled?d.jsxs(d.Fragment,{children:[d.jsx(CS,{className:"w-3.5 h-3.5"})," Enabled"]}):d.jsxs(d.Fragment,{children:[d.jsx(NS,{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(ae),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(ig,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(ae),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(Mi,{className:"w-4 h-4"})})]})})]},ae.id))})]})})}),d.jsxs(pr,{open:n,onOpenChange:a,children:[d.jsx(gr,{children:d.jsx(xr,{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:ae=>{f({...l,name:ae.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:ae=>f({...l,prompt:ae.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:PF.map(ae=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(ae),onChange:()=>re(ae),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:ae})]},ae))})]}),C&&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:C}),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:D,disabled:b||!l.name.trim()||!l.prompt.trim()||l.notification_channels.length===0,className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Saving…":s?"Update":"Create"})]})]})]}),d.jsxs(pr,{open:!!h,onOpenChange:ae=>!ae&&m(null),children:[d.jsx(gr,{children:d.jsx(xr,{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:R,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},VF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Yw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},Kw=({status:e})=>e==="completed"?d.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[d.jsx(SS,{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(Xm,{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(Ga,{className:"w-4 h-4 animate-pulse"}),d.jsx("span",{className:"text-xs",children:"Pending"})]}),Mc=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),BF=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}=xt(["/webhooks/notifications",e],()=>Ia.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=s.filter(g=>!g.read).length,f=async g=>{g.length!==0&&(await Ia.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(Qe.div,{variants:VF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Qe.div,{variants:Yw,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(Cl,{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(Ha,{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(ME,{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(bA,{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(GE,{className:"w-4 h-4"}),"Mark all read"]})]})]}),d.jsx(Qe.div,{variants:Yw,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(Kw,{status:g.status})}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:Mc(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?Mc(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(Hl,{className:"w-4 h-4"})})})]},g.id))})]})})}),d.jsxs(pr,{open:!!n,onOpenChange:g=>!g&&a(null),children:[d.jsx(gr,{children:d.jsxs(xr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cl,{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(Kw,{status:n.status}),d.jsx("span",{children:Mc(n.created_at)}),n.completed_at&&d.jsxs("span",{children:["→ ",Mc(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:BF(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"})})]})]})]})},IF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Dc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},HF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function FF({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(SS,{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(Xm,{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(TA,{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(Xm,{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(Ga,{className:"w-4 h-4"}),"Pending"]})}const Xw=e=>e?new Date(e).toLocaleString():"—";function qF(){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}=xt("/tasks/stats",()=>Os.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=xt(["/tasks",g],()=>Os.list(g),{refreshInterval:3e3});return d.jsxs(Qe.div,{variants:IF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Qe.div,{variants:Dc,className:"flex items-center gap-3",children:[d.jsx(Jm,{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(Qe.div,{variants:Dc,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[d.jsx(Ts,{label:"Pending",value:y?.pending??0}),d.jsx(Ts,{label:"Running",value:y?.running??0}),d.jsx(Ts,{label:"Completed",value:y?.completed??0}),d.jsx(Ts,{label:"Failed",value:y?.failed??0}),d.jsx(Ts,{label:"Cancelled",value:y?.cancelled??0}),d.jsx(Ts,{label:"Total",value:y?.total??0})]}),d.jsxs(Qe.div,{variants:Dc,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(HF).map(([S,N])=>d.jsx("option",{value:S,children:N},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(Qe.div,{variants:Dc,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:b.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."})}):b.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(FF,{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:Xw(S.created_at)}),d.jsx("td",{className:"px-4 py-3",children:Xw(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(Hl,{className:"w-4 h-4"})}),(S.status==="pending"||S.status==="running")&&d.jsx("button",{onClick:async()=>{await Os.cancel(S.id),await v()},title:"Cancel task",className:"p-1.5 rounded hover:bg-red-100 dark:hover:bg-red-900/30 text-red-500 dark:text-red-400",children:d.jsx(LE,{className:"w-4 h-4"})})]})]},S.id))})]})}),d.jsxs(pr,{open:!!h,onOpenChange:S=>!S&&m(null),children:[d.jsx(gr,{children:d.jsx(xr,{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 Os.cancel(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg border border-red-400 dark:border-red-500 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 text-sm",children:"Cancel Task"}),h.status==="failed"&&d.jsx("button",{onClick:async()=>{await Os.retry(h.id),m(null),await v()},className:"px-4 py-2 rounded-lg bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black text-sm",children:"Retry Task"})]})]})]})]})}function Ts({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 Fm={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},Jw={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},GF={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 YF(){return pe.get("/trinity/databases")}function KF(){const{data:e,error:t}=xt("/trinity/databases",YF,{refreshInterval:3e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Jw),[h,m]=z.useState(!1),[g,y]=z.useState(null),[b,v]=z.useState({}),[S,N]=z.useState(null),[C,E]=z.useState({}),[A,T]=z.useState(null),[L,U]=z.useState(null),[D,Z]=z.useState(null),[R,J]=z.useState(!1),ue=()=>{u(null),f(Jw),J(!1),y(null),a(!0)},le=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}),J(!!w.connection_string),y(null),a(!0)},re=async()=>{if(m(!0),y(null),!R&&!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};R?(!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 pe.put(`/trinity/databases/${s.id}`,w):await pe.post("/trinity/databases",w),await jn("/trinity/databases"),a(!1)}catch(w){y(w.message||"Failed to save database")}finally{m(!1)}},ae=w=>{Z(w)},te=async()=>{if(!D)return;const w=D.id;U(w);try{await pe.delete(`/trinity/databases/${w}`),await jn("/trinity/databases")}catch(G){alert(`Delete failed: ${G.message}`)}finally{U(null),Z(null)}},se=async w=>{N(w);try{const G=await pe.post(`/trinity/databases/${w}/test`,{});E(he=>({...he,[w]:G.success}))}catch{E(G=>({...G,[w]:!1}))}finally{N(null)}},V=async w=>{T(w);try{await pe.post(`/trinity/databases/${w}/refresh-schema`,{}),await jn("/trinity/databases")}catch(G){alert(`Schema refresh failed: ${G.message}`)}finally{T(null)}},Q=w=>{v(G=>({...G,[w]:!G[w]}))},Y=w=>{w!=="mongodb"&&J(!1),f(G=>({...G,type:w,port:Fm[w]?String(Fm[w]):""}))},be=w=>{f(G=>({...G,[w]:!G[w]}))};if(t)return d.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const O="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",j="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",F=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(he=>w[he.key]).map(he=>he.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(Zs,{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:ue,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(md,{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(Zs,{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 G=w.schema_json?JSON.parse(w.schema_json):null,he=!!G?.databases,me=he?G.databases.reduce((Se,rt)=>Se+rt.tables.length,0):G?.tables?.length??0,fe=he?G.databases.length:0,Ze=w.type==="mongodb"?"collection":"table",Te=w.type==="mongodb"?"collections":"tables",bt=C[w.id],Ae=b[w.id],Oe=F(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(Zs,{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}),bt===!0&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[d.jsx(Jh,{className:"w-3 h-3"})," Connected"]}),bt===!1&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[d.jsx(f4,{className:"w-3 h-3"})," Failed"]}),Oe.length>0&&d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(U0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),Oe.map(Se=>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:Se},Se))]})]}),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",he&&fe>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",fe," database",fe!==1?"s":""," · ",me," ",me!==1?Te:Ze]}),!he&&me>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",me," ",me!==1?Te:Ze]}),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:()=>se(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(Jh,{className:"w-4 h-4 animate-pulse"}):d.jsx(Jh,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>V(w.id),disabled:A===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(Ms,{className:`w-4 h-4 ${A===w.id?"animate-spin":""}`})}),d.jsx("button",{onClick:()=>le(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:()=>ae(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(Mi,{className:"w-4 h-4"})}),G&&d.jsx("button",{onClick:()=>Q(w.id),title:Ae?"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:Ae?d.jsx(XE,{className:"w-4 h-4"}):d.jsx(QE,{className:"w-4 h-4"})})]})]}),Ae&&G&&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:he?`${fe} database${fe!==1?"s":""} — ${me} ${me!==1?Te:Ze} total`:`Schema — ${me} ${me!==1?Te:Ze}`}),d.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:he?G.databases?.map(Se=>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:Se.name}),d.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",Se.tables.length," ",Se.tables.length!==1?Te:Ze,")"]})]}),d.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[Se.tables.map(rt=>d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:rt.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:rt.columns?.map(Rt=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{children:Rt.name}),d.jsx("span",{className:"opacity-50 ml-2",children:Rt.type}),Rt.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},Rt.name))})]},rt.name)),Se.tables.length===0&&d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Te]})]})]},Se.name)):G.tables?.map(Se=>d.jsxs("div",{className:"text-xs",children:[d.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:Se.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:Se.columns?.map(rt=>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:rt.name}),d.jsx("span",{className:"opacity-50 ml-2",children:rt.type}),rt.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},rt.name))})]},Se.name))})]})]},w.id)})}):d.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),d.jsx(rj,{isOpen:!!D,onClose:()=>Z(null),onConfirm:te,title:"Delete database",description:`Remove "${D?.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(lg,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:j,children:"Name *"}),d.jsx("input",{className:O,value:l.name,onChange:w=>f(G=>({...G,name:w.target.value})),placeholder:"My Production DB"})]}),d.jsxs("div",{children:[d.jsx("label",{className:j,children:"Type *"}),d.jsxs("select",{className:O,value:l.type,onChange:w=>Y(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:()=>J(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${R?"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:()=>J(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${R?"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"&&R?d.jsxs("div",{children:[d.jsxs("label",{className:j,children:["Connection String ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:O,type:"password",value:l.connection_string,onChange:w=>f(G=>({...G,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:j,children:"Host"}),d.jsx("input",{className:O,value:l.host,onChange:w=>f(G=>({...G,host:w.target.value})),placeholder:"localhost"})]}),d.jsxs("div",{children:[d.jsx("label",{className:j,children:"Port"}),d.jsx("input",{className:O,type:"number",value:l.port,onChange:w=>f(G=>({...G,port:w.target.value})),placeholder:String(Fm[l.type]||"")})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:j,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(G=>({...G,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:j,children:"Username"}),d.jsx("input",{className:O,value:l.username,onChange:w=>f(G=>({...G,username:w.target.value})),placeholder:"postgres"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:j,children:["Password ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:O,type:"password",value:l.password,onChange:w=>f(G=>({...G,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(U0,{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:GF[l.type]?.map(({key:w,label:G,description:he})=>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:()=>be(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:G}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:he})]})]},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:re,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 XF={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 JF({jobId:e}){const{data:t,isLoading:n}=u9(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 ${XF[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 QF({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 Qw(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Ww(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function WF({onEdit:e}){const{data:t,isLoading:n}=l9(),[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 Ri.disableJob(y.id):await Ri.enableJob(y.id),await jn(b=>typeof b=="string"&&b.startsWith("/chronos"))}finally{l(null)}},g=async()=>{if(f){l(f.id);try{await Ri.deleteJob(f.id),await jn(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:Qw(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:Ww(y.next_run_at)}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Ww(y.last_run_at)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(QF,{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(eA,{className:"w-4 h-4"}):d.jsx(SA,{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(UA,{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(LA,{className:"w-4 h-4"}):d.jsx(ZA,{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(Mi,{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(JF,{jobId:y.id})]})},`${y.id}-history`)]}))})]}),d.jsx(z2,{isOpen:!!f,onClose:()=>h(null),onConfirm:g,title:"Delete Chronos Job",message:f?`Delete job "${Qw(f.prompt,60)}"? This action cannot be undone.`:""})]})}function eq({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=z.useState(null),[u,l]=z.useState(null),f=z.useRef(null);if(z.useEffect(()=>{if(!e.trim()){s(null),l(null);return}return f.current&&clearTimeout(f.current),f.current=setTimeout(async()=>{try{const m=await Ri.preview(e,t,n);s(m),l(null)}catch(m){l(m.message??"Invalid expression"),s(null)}},500),()=>{f.current&&clearTimeout(f.current)}},[e,t,n]),!e.trim())return null;const h=(m,g)=>{try{return new Date(m).toLocaleString("pt-BR",{timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return new Date(m).toLocaleString()}};return 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(Ga,{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:h(a.next_run_at,n||"UTC")})]}),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((m,g)=>d.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",g+2,": ",m]},g))})]}):d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})})}const tq=["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"],nq=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],rq=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],aq={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 iq({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:u}=aj(),[l,f]=z.useState(""),[h,m]=z.useState("once"),[g,y]=z.useState(""),[b,v]=z.useState("UTC"),[S,N]=z.useState([]),[C,E]=z.useState(null),[A,T]=z.useState(!1),L=D=>{N(Z=>Z.includes(D)?Z.filter(R=>R!==D):[...Z,D])};z.useEffect(()=>{a?(f(a.prompt),m(a.schedule_type),y(a.schedule_expression),v(a.timezone),N(a.notify_channels??[])):(f(""),m("once"),y(""),v(u?.timezone??"UTC"),N([])),E(null)},[a,e,u?.timezone]);const U=async()=>{if(E(null),!l.trim()){E("Prompt is required");return}if(!g.trim()){E("Schedule expression is required");return}T(!0);try{if(s&&a){const D={prompt:l,schedule_expression:g,timezone:b,notify_channels:S};await Ri.updateJob(a.id,D)}else{const D={prompt:l,schedule_type:h,schedule_expression:g,timezone:b,notify_channels:S};await Ri.createJob(D)}await jn(D=>typeof D=="string"&&D.startsWith("/chronos")),n(),t()}catch(D){E(D.message??"Failed to save job")}finally{T(!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(lg,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx(Be,{label:"Prompt",value:l,onChange:D=>f(D.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&d.jsx(gn,{label:"Schedule Type",value:h,onChange:D=>m(D.target.value),options:rq}),d.jsxs("div",{children:[d.jsx(Be,{label:"Schedule Expression",value:g,onChange:D=>y(D.target.value),placeholder:aq[h]}),d.jsx(eq,{scheduleExpression:g,scheduleType:h,timezone:b})]}),d.jsx(gn,{label:"Timezone",value:b,onChange:D=>v(D.target.value),options:tq.map(D=>({value:D,label:D}))}),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:nq.map(({value:D,label:Z})=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:S.includes(D),onChange:()=>L(D),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:Z})]},D))})]}),C&&d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:C})]}),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:U,disabled:A,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:A?"Saving…":s?"Update":"Create"})]})]})]}):null}function sq(){const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=f=>{a(f),t(!0)},u=()=>{t(!1),a(null)},l=()=>{jn(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(Ga,{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(md,{className:"w-4 h-4"}),"New Job"]})]}),d.jsx(WF,{onEdit:s}),d.jsx(iq,{isOpen:e,onClose:u,onCreated:l,editJob:n})]})}const Es=Fa.getInstance(),As={fetchSkills:async()=>Es.get("/skills"),fetchSkill:async e=>Es.get(`/skills/${encodeURIComponent(e)}`),reloadSkills:async()=>Es.post("/skills/reload",{}),enableSkill:async e=>Es.post(`/skills/${encodeURIComponent(e)}/enable`,{}),disableSkill:async e=>Es.post(`/skills/${encodeURIComponent(e)}/disable`,{}),uploadSkill:async e=>Es.uploadFile("/skills/upload",e)},eS={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Hc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function oq({skill:e,onToggle:t,onView:n}){return d.jsxs(Qe.div,{variants:Hc,className:`rounded-lg border p-4 transition-all ${e.enabled?"border-azure-primary dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950":"border-azure-border dark:border-zinc-700 bg-azure-surface/50 dark:bg-zinc-900/50 opacity-60"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h3",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight truncate",children:e.name}),e.version&&d.jsxs("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:["v",e.version]})]}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1 line-clamp-2",children:e.description}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full bg-azure-primary/10 dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-primary",children:[d.jsx(sg,{className:"w-3 h-3"}),a]},a))})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:n,className:"p-2 rounded-lg hover:bg-azure-hover dark:hover:bg-zinc-800 text-azure-text-secondary dark:text-matrix-tertiary",title:"View details",children:d.jsx(Hl,{className:"w-4 h-4"})}),d.jsx("button",{onClick:t,className:`p-2 rounded-lg transition-colors ${e.enabled?"text-green-600 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/20":"text-zinc-400 dark:text-zinc-600 hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,title:e.enabled?"Disable skill":"Enable skill",children:e.enabled?d.jsx(CS,{className:"w-5 h-5"}):d.jsx(NS,{className:"w-5 h-5"})})]})]}),e.author&&d.jsxs("div",{className:"flex items-center gap-1 mt-2 text-xs text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(og,{className:"w-3 h-3"}),e.author]})]})}function lq({skill:e,open:t,onOpenChange:n}){return e?d.jsxs(pr,{open:t,onOpenChange:n,children:[d.jsx(gr,{children:d.jsx(xr,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(El,{className:"w-5 h-5"}),e.name,e.version&&d.jsxs("span",{className:"text-sm font-normal text-azure-text-secondary dark:text-matrix-dim",children:["v",e.version]})]})})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{children:d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:e.description})}),e.author&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(og,{className:"w-4 h-4"}),"Author: ",e.author]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(xA,{className:"w-4 h-4"}),"Path: ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:e.path})]}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-azure-primary/10 dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-primary",children:[d.jsx(sg,{className:"w-3 h-3"}),a]},a))}),e.examples&&e.examples.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"Examples"}),d.jsx("ul",{className:"list-disc list-inside text-sm text-azure-text-secondary dark:text-matrix-secondary space-y-1",children:e.examples.map((a,s)=>d.jsx("li",{children:a},s))})]}),e.content&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"SKILL.md Content"}),d.jsx("pre",{className:"p-3 rounded-lg bg-azure-hover dark:bg-zinc-900 text-xs overflow-auto max-h-64 text-azure-text-secondary dark:text-matrix-secondary whitespace-pre-wrap",children:e.content})]})]})]}):null}function uq(){const[e,t]=z.useState(null),[n,a]=z.useState(!1),[s,u]=z.useState(!1),[l,f]=z.useState(!1),[h,m]=z.useState(null),[g,y]=z.useState(null),b=z.useRef(null),{data:v,mutate:S,isLoading:N}=xt("/skills",()=>As.fetchSkills(),{refreshInterval:1e4}),C=v?.skills??[],E=v?.enabled??0,A=async()=>{await As.reloadSkills(),S()},T=async Z=>{Z.enabled?await As.disableSkill(Z.name):await As.enableSkill(Z.name),S()},L=async Z=>{a(!0);try{const R=await As.fetchSkill(Z.name);t(R)}finally{a(!1)}},U=async Z=>{const R=Z.target.files?.[0];if(R){m(null),y(null),f(!0);try{const J=await As.uploadSkill(R);y(`Skill "${J.skill.name}" uploaded successfully!`),S(),b.current&&(b.current.value="")}catch(J){m({error:J.message||"Upload failed",details:J.details})}finally{f(!1)}}},D=()=>{m(null),y(null),u(!0)};return d.jsxs(Qe.div,{variants:eS,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(Qe.div,{variants:Hc,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(El,{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:"Skills"}),d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:[C.length," skill",C.length!==1?"s":"",", ",E," enabled"]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:D,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-primary dark:border-matrix-primary text-azure-primary dark:text-matrix-primary font-medium hover:bg-azure-primary/10 dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsx(pc,{className:"w-4 h-4"}),"Upload"]}),d.jsxs("button",{onClick:A,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[d.jsx(Ms,{className:"w-4 h-4"}),"Reload"]})]})]}),N?d.jsxs(Qe.div,{variants:Hc,className:"text-center py-12",children:[d.jsx(Ms,{className:"w-8 h-8 animate-spin mx-auto text-azure-text-secondary dark:text-matrix-dim"}),d.jsx("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-dim",children:"Loading skills..."})]}):C.length===0?d.jsxs(Qe.div,{variants:Hc,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[d.jsx(El,{className:"w-12 h-12 mx-auto text-azure-text-tertiary dark:text-matrix-dim"}),d.jsx("h3",{className:"mt-4 text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:"No skills found"}),d.jsxs("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-secondary max-w-md mx-auto",children:["Upload a skill ZIP or add skills manually to"," ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"~/.morpheus/skills/"}),". Each skill folder must contain a"," ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file with frontmatter."]}),d.jsxs("button",{onClick:D,className:"mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[d.jsx(pc,{className:"w-4 h-4"}),"Upload Skill"]})]}):d.jsx(Qe.div,{variants:eS,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:C.map(Z=>d.jsx(oq,{skill:Z,onToggle:()=>T(Z),onView:()=>L(Z)},Z.name))}),d.jsx(lq,{skill:e,open:!!e,onOpenChange:Z=>!Z&&t(null)}),d.jsxs(pr,{open:s,onOpenChange:u,children:[d.jsx(gr,{children:d.jsx(xr,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(pc,{className:"w-5 h-5"}),"Upload Skill"]})})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm",children:["Upload a ZIP file containing your skill folder. The ZIP must have exactly one folder at root level with a valid ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file."]}),d.jsxs("div",{className:"border-2 border-dashed border-azure-border dark:border-matrix-primary rounded-lg p-6",children:[d.jsx("input",{ref:b,type:"file",accept:".zip,application/zip,application/x-zip-compressed",onChange:U,disabled:l,className:"hidden",id:"skill-upload-input"}),d.jsxs("label",{htmlFor:"skill-upload-input",className:`flex flex-col items-center gap-2 cursor-pointer ${l?"opacity-50 cursor-not-allowed":""}`,children:[l?d.jsx(Ms,{className:"w-8 h-8 animate-spin text-azure-primary dark:text-matrix-primary"}):d.jsx(pc,{className:"w-8 h-8 text-azure-text-tertiary dark:text-matrix-dim"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:l?"Uploading...":"Click to select ZIP file"})]})]}),h&&d.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:[d.jsx(nA,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:h.error}),h.details&&d.jsx("p",{className:"text-xs text-red-600 dark:text-red-300 mt-1",children:h.details})]})]}),g&&d.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800",children:[d.jsx(aA,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),d.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:g})]}),d.jsxs("div",{className:"rounded-lg bg-azure-hover dark:bg-zinc-900 p-3",children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"ZIP Structure Example"}),d.jsx("pre",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:`my-skill.zip
|
|
112
|
+
└── my-skill/
|
|
113
|
+
├── SKILL.md (required)
|
|
114
|
+
├── scripts/ (optional)
|
|
115
|
+
│ └── script.js
|
|
116
|
+
└── examples/ (optional)
|
|
117
|
+
└── output.txt`})]})]})]}),n&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsx(Ms,{className:"w-8 h-8 animate-spin text-white"})})]})}function cq(){return d.jsx(mE,{children:d.jsxs(T0,{children:[d.jsx(an,{path:"/login",element:d.jsx(xF,{})}),d.jsx(an,{path:"/*",element:d.jsx(yF,{children:d.jsx(MD,{children:d.jsxs(T0,{children:[d.jsx(an,{path:"/",element:d.jsx(LD,{})}),d.jsx(an,{path:"/chat",element:d.jsx(o9,{})}),d.jsx(an,{path:"/zaion",element:d.jsx(mF,{})}),d.jsx(an,{path:"/logs",element:d.jsx(pF,{})}),d.jsx(an,{path:"/stats",element:d.jsx(gF,{})}),d.jsx(an,{path:"/sati-memories",element:d.jsx(NF,{})}),d.jsx(an,{path:"/mcp-servers",element:d.jsx(RF,{})}),d.jsx(an,{path:"/model-pricing",element:d.jsx($F,{})}),d.jsx(an,{path:"/webhooks",element:d.jsx(UF,{})}),d.jsx(an,{path:"/notifications",element:d.jsx(ZF,{})}),d.jsx(an,{path:"/tasks",element:d.jsx(qF,{})}),d.jsx(an,{path:"/trinity-databases",element:d.jsx(KF,{})}),d.jsx(an,{path:"/chronos",element:d.jsx(sq,{})}),d.jsx(an,{path:"/skills",element:d.jsx(uq,{})}),d.jsx(an,{path:"*",element:d.jsx(mS,{to:"/",replace:!0})})]})})})})]})})}YC.createRoot(document.getElementById("root")).render(d.jsx(z.StrictMode,{children:d.jsx(cq,{})}));
|