morpheus-cli 0.8.2 → 0.8.3
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/dist/devkit/registry.js +46 -1
- package/dist/http/api.js +31 -0
- package/dist/runtime/apoc.js +28 -11
- package/dist/runtime/audit/repository.js +132 -0
- package/dist/runtime/audit/types.js +1 -0
- package/dist/runtime/chronos/worker.js +20 -0
- package/dist/runtime/keymaker.js +22 -10
- package/dist/runtime/memory/sati/repository.js +1 -1
- package/dist/runtime/memory/sati/service.js +21 -0
- package/dist/runtime/memory/sqlite.js +73 -7
- package/dist/runtime/neo.js +27 -11
- package/dist/runtime/oracle.js +28 -1
- package/dist/runtime/smiths/delegator.js +30 -14
- package/dist/runtime/tasks/repository.js +15 -3
- package/dist/runtime/tasks/worker.js +79 -8
- package/dist/runtime/tools/apoc-tool.js +16 -1
- package/dist/runtime/tools/factory.js +42 -2
- package/dist/runtime/tools/neo-tool.js +16 -1
- package/dist/runtime/tools/smith-tool.js +17 -1
- package/dist/runtime/tools/trinity-tool.js +16 -1
- package/dist/runtime/trinity.js +25 -10
- package/dist/ui/assets/index-CZS235KG.js +177 -0
- package/dist/ui/assets/index-QQyZIsmH.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/sw.js +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/index-C8uUR62u.css +0 -1
- package/dist/ui/assets/index-mIH_kbig.js +0 -117
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(s){if(s.ep)return;s.ep=!0;const c=n(s);fetch(s.href,c)}})();function og(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var em={exports:{}},dl={};var Tv;function nT(){if(Tv)return dl;Tv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,c){var l=null;if(c!==void 0&&(l=""+c),s.key!==void 0&&(l=""+s.key),"key"in s){c={};for(var f in s)f!=="key"&&(c[f]=s[f])}else c=s;return s=c.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:c}}return dl.Fragment=t,dl.jsx=n,dl.jsxs=n,dl}var Ev;function rT(){return Ev||(Ev=1,em.exports=nT()),em.exports}var u=rT(),tm={exports:{}},Ae={};var Av;function aT(){if(Av)return Ae;Av=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"),c=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"),x=Symbol.for("react.activity"),b=Symbol.iterator;function v(_){return _===null||typeof _!="object"?null:(_=b&&_[b]||_["@@iterator"],typeof _=="function"?_:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,O={};function T(_,H,w){this.props=_,this.context=H,this.refs=O,this.updater=w||j}T.prototype.isReactComponent={},T.prototype.setState=function(_,H){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,H,"setState")},T.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function E(){}E.prototype=T.prototype;function C(_,H,w){this.props=_,this.context=H,this.refs=O,this.updater=w||j}var $=C.prototype=new E;$.constructor=C,S($,T.prototype),$.isPureReactComponent=!0;var D=Array.isArray;function M(){}var Z={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function K(_,H,w){var J=w.ref;return{$$typeof:e,type:_,key:H,ref:J!==void 0?J:null,props:w}}function de(_,H){return K(_.type,H,_.props)}function ae(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function le(_){var H={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(w){return H[w]})}var ne=/\/+/g;function oe(_,H){return typeof _=="object"&&_!==null&&_.key!=null?le(""+_.key):H.toString(36)}function ie(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(M,M):(_.status="pending",_.then(function(H){_.status==="pending"&&(_.status="fulfilled",_.value=H)},function(H){_.status==="pending"&&(_.status="rejected",_.reason=H)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function B(_,H,w,J,he){var pe=typeof _;(pe==="undefined"||pe==="boolean")&&(_=null);var xe=!1;if(_===null)xe=!0;else switch(pe){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(_.$$typeof){case e:case t:xe=!0;break;case g:return xe=_._init,B(xe(_._payload),H,w,J,he)}}if(xe)return he=he(_),xe=J===""?"."+oe(_,0):J,D(he)?(w="",xe!=null&&(w=xe.replace(ne,"$&/")+"/"),B(he,H,w,"",function(xt){return xt})):he!=null&&(ae(he)&&(he=de(he,w+(he.key==null||_&&_.key===he.key?"":(""+he.key).replace(ne,"$&/")+"/")+xe)),H.push(he)),1;xe=0;var Pe=J===""?".":J+":";if(D(_))for(var Ee=0;Ee<_.length;Ee++)J=_[Ee],pe=Pe+oe(J,Ee),xe+=B(J,H,w,pe,he);else if(Ee=v(_),typeof Ee=="function")for(_=Ee.call(_),Ee=0;!(J=_.next()).done;)J=J.value,pe=Pe+oe(J,Ee++),xe+=B(J,H,w,pe,he);else if(pe==="object"){if(typeof _.then=="function")return B(ie(_),H,w,J,he);throw H=String(_),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return xe}function V(_,H,w){if(_==null)return _;var J=[],he=0;return B(_,J,"","",function(pe){return H.call(w,pe,he++)}),J}function G(_){if(_._status===-1){var H=_._result;H=H(),H.then(function(w){(_._status===0||_._status===-1)&&(_._status=1,_._result=w)},function(w){(_._status===0||_._status===-1)&&(_._status=2,_._result=w)}),_._status===-1&&(_._status=0,_._result=H)}if(_._status===1)return _._result.default;throw _._result}var ce=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},A={map:V,forEach:function(_,H,w){V(_,function(){H.apply(this,arguments)},w)},count:function(_){var H=0;return V(_,function(){H++}),H},toArray:function(_){return V(_,function(H){return H})||[]},only:function(_){if(!ae(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Ae.Activity=x,Ae.Children=A,Ae.Component=T,Ae.Fragment=n,Ae.Profiler=s,Ae.PureComponent=C,Ae.StrictMode=a,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(_){return Z.H.useMemoCache(_)}},Ae.cache=function(_){return function(){return _.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(_,H,w){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var J=S({},_.props),he=_.key;if(H!=null)for(pe in H.key!==void 0&&(he=""+H.key),H)!U.call(H,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&H.ref===void 0||(J[pe]=H[pe]);var pe=arguments.length-2;if(pe===1)J.children=w;else if(1<pe){for(var xe=Array(pe),Pe=0;Pe<pe;Pe++)xe[Pe]=arguments[Pe+2];J.children=xe}return K(_.type,he,J)},Ae.createContext=function(_){return _={$$typeof:l,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:c,_context:_},_},Ae.createElement=function(_,H,w){var J,he={},pe=null;if(H!=null)for(J in H.key!==void 0&&(pe=""+H.key),H)U.call(H,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(he[J]=H[J]);var xe=arguments.length-2;if(xe===1)he.children=w;else if(1<xe){for(var Pe=Array(xe),Ee=0;Ee<xe;Ee++)Pe[Ee]=arguments[Ee+2];he.children=Pe}if(_&&_.defaultProps)for(J in xe=_.defaultProps,xe)he[J]===void 0&&(he[J]=xe[J]);return K(_,pe,he)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(_){return{$$typeof:f,render:_}},Ae.isValidElement=ae,Ae.lazy=function(_){return{$$typeof:g,_payload:{_status:-1,_result:_},_init:G}},Ae.memo=function(_,H){return{$$typeof:m,type:_,compare:H===void 0?null:H}},Ae.startTransition=function(_){var H=Z.T,w={};Z.T=w;try{var J=_(),he=Z.S;he!==null&&he(w,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(M,ce)}catch(pe){ce(pe)}finally{H!==null&&w.types!==null&&(H.types=w.types),Z.T=H}},Ae.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Ae.use=function(_){return Z.H.use(_)},Ae.useActionState=function(_,H,w){return Z.H.useActionState(_,H,w)},Ae.useCallback=function(_,H){return Z.H.useCallback(_,H)},Ae.useContext=function(_){return Z.H.useContext(_)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(_,H){return Z.H.useDeferredValue(_,H)},Ae.useEffect=function(_,H){return Z.H.useEffect(_,H)},Ae.useEffectEvent=function(_){return Z.H.useEffectEvent(_)},Ae.useId=function(){return Z.H.useId()},Ae.useImperativeHandle=function(_,H,w){return Z.H.useImperativeHandle(_,H,w)},Ae.useInsertionEffect=function(_,H){return Z.H.useInsertionEffect(_,H)},Ae.useLayoutEffect=function(_,H){return Z.H.useLayoutEffect(_,H)},Ae.useMemo=function(_,H){return Z.H.useMemo(_,H)},Ae.useOptimistic=function(_,H){return Z.H.useOptimistic(_,H)},Ae.useReducer=function(_,H,w){return Z.H.useReducer(_,H,w)},Ae.useRef=function(_){return Z.H.useRef(_)},Ae.useState=function(_){return Z.H.useState(_)},Ae.useSyncExternalStore=function(_,H,w){return Z.H.useSyncExternalStore(_,H,w)},Ae.useTransition=function(){return Z.H.useTransition()},Ae.version="19.2.4",Ae}var Ov;function zd(){return Ov||(Ov=1,tm.exports=aT()),tm.exports}var z=zd();const lg=og(z);var nm={exports:{}},fl={},rm={exports:{}},am={};var Mv;function iT(){return Mv||(Mv=1,(function(e){function t(B,V){var G=B.length;B.push(V);e:for(;0<G;){var ce=G-1>>>1,A=B[ce];if(0<s(A,V))B[ce]=V,B[G]=A,G=ce;else break e}}function n(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var V=B[0],G=B.pop();if(G!==V){B[0]=G;e:for(var ce=0,A=B.length,_=A>>>1;ce<_;){var H=2*(ce+1)-1,w=B[H],J=H+1,he=B[J];if(0>s(w,G))J<A&&0>s(he,w)?(B[ce]=he,B[J]=G,ce=J):(B[ce]=w,B[H]=G,ce=H);else if(J<A&&0>s(he,G))B[ce]=he,B[J]=G,ce=J;else break e}}return V}function s(B,V){var G=B.sortIndex-V.sortIndex;return G!==0?G:B.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var h=[],m=[],g=1,x=null,b=3,v=!1,j=!1,S=!1,O=!1,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function $(B){for(var V=n(m);V!==null;){if(V.callback===null)a(m);else if(V.startTime<=B)a(m),V.sortIndex=V.expirationTime,t(h,V);else break;V=n(m)}}function D(B){if(S=!1,$(B),!j)if(n(h)!==null)j=!0,M||(M=!0,le());else{var V=n(m);V!==null&&ie(D,V.startTime-B)}}var M=!1,Z=-1,U=5,K=-1;function de(){return O?!0:!(e.unstable_now()-K<U)}function ae(){if(O=!1,M){var B=e.unstable_now();K=B;var V=!0;try{e:{j=!1,S&&(S=!1,E(Z),Z=-1),v=!0;var G=b;try{t:{for($(B),x=n(h);x!==null&&!(x.expirationTime>B&&de());){var ce=x.callback;if(typeof ce=="function"){x.callback=null,b=x.priorityLevel;var A=ce(x.expirationTime<=B);if(B=e.unstable_now(),typeof A=="function"){x.callback=A,$(B),V=!0;break t}x===n(h)&&a(h),$(B)}else a(h);x=n(h)}if(x!==null)V=!0;else{var _=n(m);_!==null&&ie(D,_.startTime-B),V=!1}}break e}finally{x=null,b=G,v=!1}V=void 0}}finally{V?le():M=!1}}}var le;if(typeof C=="function")le=function(){C(ae)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,oe=ne.port2;ne.port1.onmessage=ae,le=function(){oe.postMessage(null)}}else le=function(){T(ae,0)};function ie(B,V){Z=T(function(){B(e.unstable_now())},V)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(B){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var G=b;b=V;try{return B()}finally{b=G}},e.unstable_requestPaint=function(){O=!0},e.unstable_runWithPriority=function(B,V){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var G=b;b=B;try{return V()}finally{b=G}},e.unstable_scheduleCallback=function(B,V,G){var ce=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?ce+G:ce):G=ce,B){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=G+A,B={id:g++,callback:V,priorityLevel:B,startTime:G,expirationTime:A,sortIndex:-1},G>ce?(B.sortIndex=G,t(m,B),n(h)===null&&B===n(m)&&(S?(E(Z),Z=-1):S=!0,ie(D,G-ce))):(B.sortIndex=A,t(h,B),j||v||(j=!0,M||(M=!0,le()))),B},e.unstable_shouldYield=de,e.unstable_wrapCallback=function(B){var V=b;return function(){var G=b;b=V;try{return B.apply(this,arguments)}finally{b=G}}}})(am)),am}var Rv;function sT(){return Rv||(Rv=1,rm.exports=iT()),rm.exports}var im={exports:{}},hn={};var Dv;function oT(){if(Dv)return hn;Dv=1;var e=zd();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 c(h,m,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:x==null?null:""+x,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 c(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,x=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:x,integrity:b,fetchPriority:v}):g==="script"&&a.d.X(h,{crossOrigin:x,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,x=f(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:x,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 $v;function lT(){if($v)return im.exports;$v=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(),im.exports=oT(),im.exports}var Lv;function cT(){if(Lv)return fl;Lv=1;var e=sT(),t=zd(),n=lT();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 c(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(c(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=c(r),i===null)throw Error(a(188));return i!==r?null:r}for(var o=r,d=i;;){var p=o.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){o=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===o)return h(p),r;if(y===d)return h(p),i;y=y.sibling}throw Error(a(188))}if(o.return!==d.return)o=p,d=y;else{for(var k=!1,N=p.child;N;){if(N===o){k=!0,o=p,d=y;break}if(N===d){k=!0,d=p,o=y;break}N=N.sibling}if(!k){for(N=y.child;N;){if(N===o){k=!0,o=y,d=p;break}if(N===d){k=!0,d=y,o=p;break}N=N.sibling}if(!k)throw Error(a(189))}}if(o.alternate!==d)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 x=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=ae&&r[ae]||r["@@iterator"],typeof r=="function"?r:null)}var ne=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ne?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case T:return"Profiler";case O:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case j:return"Portal";case C:return r.displayName||"Context";case E:return(r._context.displayName||"Context")+".Consumer";case $: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:oe(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ie=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},ce=[],A=-1;function _(r){return{current:r}}function H(r){0>A||(r.current=ce[A],ce[A]=null,A--)}function w(r,i){A++,ce[A]=r.current,r.current=i}var J=_(null),he=_(null),pe=_(null),xe=_(null);function Pe(r,i){switch(w(pe,i),w(he,r),w(J,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Q0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Q0(i),r=W0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(J),w(J,r)}function Ee(){H(J),H(he),H(pe)}function xt(r){r.memoizedState!==null&&w(xe,r);var i=J.current,o=W0(i,r.type);i!==o&&(w(he,r),w(J,o))}function L(r){he.current===r&&(H(J),H(he)),xe.current===r&&(H(xe),ol._currentValue=G)}var Oe,Ue;function Ye(r){if(Oe===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);Oe=i&&i[1]||"",Ue=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Oe+r+Ue}var wt=!1;function Ie(r,i){if(!r||wt)return"";wt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(X){var Y=X}Reflect.construct(r,[],re)}else{try{re.call()}catch(X){Y=X}r.call(re.prototype)}}else{try{throw Error()}catch(X){Y=X}(re=r())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(X){if(X&&Y&&typeof X.stack=="string")return[X.stack,Y.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),k=y[0],N=y[1];if(k&&N){var R=k.split(`
|
|
4
|
-
`),q=N.split(`
|
|
5
|
-
`);for(p=d=0;d<R.length&&!R[d].includes("DetermineComponentFrameRoot");)d++;for(;p<q.length&&!q[p].includes("DetermineComponentFrameRoot");)p++;if(d===R.length||p===q.length)for(d=R.length-1,p=q.length-1;1<=d&&0<=p&&R[d]!==q[p];)p--;for(;1<=d&&0<=p;d--,p--)if(R[d]!==q[p]){if(d!==1||p!==1)do if(d--,p--,0>p||R[d]!==q[p]){var Q=`
|
|
6
|
-
`+R[d].replace(" at new "," at ");return r.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",r.displayName)),Q}while(1<=d&&0<=p);break}}}finally{wt=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?Ye(o):""}function nt(r,i){switch(r.tag){case 26:case 27:case 5:return Ye(r.type);case 16:return Ye("Lazy");case 13:return r.child!==i&&i!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return Ie(r.type,!1);case 11:return Ie(r.type.render,!1);case 1:return Ie(r.type,!0);case 31:return Ye("Activity");default:return""}}function dt(r){try{var i="",o=null;do i+=nt(r,o),o=r,r=r.return;while(r);return i}catch(d){return`
|
|
7
|
-
Error generating stack: `+d.message+`
|
|
8
|
-
`+d.stack}}var ot=Object.prototype.hasOwnProperty,nn=e.unstable_scheduleCallback,Wn=e.unstable_cancelCallback,Dt=e.unstable_shouldYield,Yt=e.unstable_requestPaint,yt=e.unstable_now,Fi=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ne=e.unstable_LowPriority,Je=e.unstable_IdlePriority,bn=e.log,In=e.unstable_setDisableYieldValue,vn=null,Jt=null;function Cn(r){if(typeof bn=="function"&&In(r),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(vn,r)}catch{}}var ft=Math.clz32?Math.clz32:I2,pa=Math.log,yr=Math.LN2;function I2(r){return r>>>=0,r===0?32:31-(pa(r)/yr|0)|0}var cc=256,uc=262144,dc=4194304;function ui(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 fc(r,i,o){var d=r.pendingLanes;if(d===0)return 0;var p=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~y,d!==0?p=ui(d):(k&=N,k!==0?p=ui(k):o||(o=N&~r,o!==0&&(p=ui(o))))):(N=d&~y,N!==0?p=ui(N):k!==0?p=ui(k):o||(o=d&~r,o!==0&&(p=ui(o)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,o=i&-i,y>=o||y===32&&(o&4194048)!==0)?i:p}function vo(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Z2(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 Mx(){var r=dc;return dc<<=1,(dc&62914560)===0&&(dc=4194304),r}function Bd(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function ko(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function H2(r,i,o,d,p,y){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 N=r.entanglements,R=r.expirationTimes,q=r.hiddenUpdates;for(o=k&~o;0<o;){var Q=31-ft(o),re=1<<Q;N[Q]=0,R[Q]=-1;var Y=q[Q];if(Y!==null)for(q[Q]=null,Q=0;Q<Y.length;Q++){var X=Y[Q];X!==null&&(X.lane&=-536870913)}o&=~re}d!==0&&Rx(r,d,0),y!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function Rx(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ft(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|o&261930}function Dx(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var d=31-ft(o),p=1<<d;p&i|r[d]&i&&(r[d]|=i),o&=~p}}function $x(r,i){var o=i&-i;return o=(o&42)!==0?1:Id(o),(o&(r.suspendedLanes|i))!==0?0:o}function Id(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 Zd(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Lx(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:wv(r.type))}function Px(r,i){var o=V.p;try{return V.p=r,i()}finally{V.p=o}}var ga=Math.random().toString(36).slice(2),sn="__reactFiber$"+ga,Tn="__reactProps$"+ga,qi="__reactContainer$"+ga,Hd="__reactEvents$"+ga,F2="__reactListeners$"+ga,q2="__reactHandles$"+ga,Ux="__reactResources$"+ga,wo="__reactMarker$"+ga;function Fd(r){delete r[sn],delete r[Tn],delete r[Hd],delete r[F2],delete r[q2]}function Gi(r){var i=r[sn];if(i)return i;for(var o=r.parentNode;o;){if(i=o[qi]||o[sn]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=sv(r);r!==null;){if(o=r[sn])return o;r=sv(r)}return i}r=o,o=r.parentNode}return null}function Yi(r){if(r=r[sn]||r[qi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function So(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Ji(r){var i=r[Ux];return i||(i=r[Ux]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function rn(r){r[wo]=!0}var Vx=new Set,Bx={};function di(r,i){Ki(r,i),Ki(r+"Capture",i)}function Ki(r,i){for(Bx[r]=i,r=0;r<i.length;r++)Vx.add(i[r])}var G2=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]*$"),Ix={},Zx={};function Y2(r){return ot.call(Zx,r)?!0:ot.call(Ix,r)?!1:G2.test(r)?Zx[r]=!0:(Ix[r]=!0,!1)}function hc(r,i,o){if(Y2(i))if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+o)}}function mc(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,d){if(d===null)r.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(i,o,""+d)}}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 Hx(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function J2(r,i,o){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,y=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(k){o=""+k,y.call(this,k)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return o},setValue:function(k){o=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function qd(r){if(!r._valueTracker){var i=Hx(r)?"checked":"value";r._valueTracker=J2(r,i,""+r[i])}}function Fx(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),d="";return r&&(d=Hx(r)?r.checked?"true":"false":r.value),r=d,r!==o?(i.setValue(r),!0):!1}function pc(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 K2=/[\n"\\]/g;function tr(r){return r.replace(K2,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Gd(r,i,o,d,p,y,k,N){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?Yd(r,k,er(i)):o!=null?Yd(r,k,er(o)):d!=null&&r.removeAttribute("value"),p==null&&y!=null&&(r.defaultChecked=!!y),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+er(N):r.removeAttribute("name")}function qx(r,i,o,d,p,y,k,N){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){qd(r);return}o=o!=null?""+er(o):"",i=i!=null?""+er(i):o,N||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=N?r.checked:!!d,r.defaultChecked=!!d,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),qd(r)}function Yd(r,i,o){i==="number"&&pc(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Xi(r,i,o,d){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&&d&&(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,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Gx(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 Yx(r,i,o,d){if(i==null){if(d!=null){if(o!=null)throw Error(a(92));if(ie(d)){if(1<d.length)throw Error(a(93));d=d[0]}o=d}o==null&&(o=""),i=o}o=er(i),r.defaultValue=o,d=r.textContent,d===o&&d!==""&&d!==null&&(r.value=d),qd(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 X2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jx(r,i,o){var d=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,o):typeof o!="number"||o===0||X2.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Kx(r,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,o!=null){for(var d in o)!o.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&o[p]!==d&&Jx(r,p,d)}else for(var y in i)i.hasOwnProperty(y)&&Jx(r,y,i[y])}function Jd(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 Q2=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"]]),W2=/^[\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 gc(r){return W2.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Hr(){}var Kd=null;function Xd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Wi=null,es=null;function Xx(r){var i=Yi(r);if(i&&(r=i.stateNode)){var o=r[Tn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Gd(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 d=o[i];if(d!==r&&d.form===r.form){var p=d[Tn]||null;if(!p)throw Error(a(90));Gd(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<o.length;i++)d=o[i],d.form===r.form&&Fx(d)}break e;case"textarea":Gx(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Xi(r,!!o.multiple,i,!1)}}}var Qd=!1;function Qx(r,i,o){if(Qd)return r(i,o);Qd=!0;try{var d=r(i);return d}finally{if(Qd=!1,(Wi!==null||es!==null)&&(ru(),Wi&&(i=Wi,r=es,es=Wi=null,Xx(i),r)))for(i=0;i<r.length;i++)Xx(r[i])}}function zo(r,i){var o=r.stateNode;if(o===null)return null;var d=o[Tn]||null;if(d===null)return null;o=d[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":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wd=!1;if(Fr)try{var jo={};Object.defineProperty(jo,"passive",{get:function(){Wd=!0}}),window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{Wd=!1}var xa=null,ef=null,xc=null;function Wx(){if(xc)return xc;var r,i=ef,o=i.length,d,p="value"in xa?xa.value:xa.textContent,y=p.length;for(r=0;r<o&&i[r]===p[r];r++);var k=o-r;for(d=1;d<=k&&i[o-d]===p[y-d];d++);return xc=p.slice(r,1<d?1-d:void 0)}function yc(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 bc(){return!0}function ey(){return!1}function En(r){function i(o,d,p,y,k){this._reactName=o,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(o=r[N],this[N]=o?o(y):y[N]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?bc:ey,this.isPropagationStopped=ey,this}return x(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=bc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=bc)},persist:function(){},isPersistent:bc}),i}var fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vc=En(fi),_o=x({},fi,{view:0,detail:0}),eN=En(_o),tf,nf,No,kc=x({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,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!==No&&(No&&r.type==="mousemove"?(tf=r.screenX-No.screenX,nf=r.screenY-No.screenY):nf=tf=0,No=r),tf)},movementY:function(r){return"movementY"in r?r.movementY:nf}}),ty=En(kc),tN=x({},kc,{dataTransfer:0}),nN=En(tN),rN=x({},_o,{relatedTarget:0}),rf=En(rN),aN=x({},fi,{animationName:0,elapsedTime:0,pseudoElement:0}),iN=En(aN),sN=x({},fi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),oN=En(sN),lN=x({},fi,{data:0}),ny=En(lN),cN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uN={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"},dN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=dN[r])?!!i[r]:!1}function af(){return fN}var hN=x({},_o,{key:function(r){if(r.key){var i=cN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=yc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?uN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(r){return r.type==="keypress"?yc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?yc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),mN=En(hN),pN=x({},kc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ry=En(pN),gN=x({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),xN=En(gN),yN=x({},fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),bN=En(yN),vN=x({},kc,{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}),kN=En(vN),wN=x({},fi,{newState:0,oldState:0}),SN=En(wN),zN=[9,13,27,32],sf=Fr&&"CompositionEvent"in window,Co=null;Fr&&"documentMode"in document&&(Co=document.documentMode);var jN=Fr&&"TextEvent"in window&&!Co,ay=Fr&&(!sf||Co&&8<Co&&11>=Co),iy=" ",sy=!1;function oy(r,i){switch(r){case"keyup":return zN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ly(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ts=!1;function _N(r,i){switch(r){case"compositionend":return ly(i);case"keypress":return i.which!==32?null:(sy=!0,iy);case"textInput":return r=i.data,r===iy&&sy?null:r;default:return null}}function NN(r,i){if(ts)return r==="compositionend"||!sf&&oy(r,i)?(r=Wx(),xc=ef=xa=null,ts=!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 ay&&i.locale!=="ko"?null:i.data;default:return null}}var CN={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 cy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!CN[r.type]:i==="textarea"}function uy(r,i,o,d){Wi?es?es.push(d):es=[d]:Wi=d,i=uu(i,"onChange"),0<i.length&&(o=new vc("onChange","change",null,o,d),r.push({event:o,listeners:i}))}var To=null,Eo=null;function TN(r){q0(r,0)}function wc(r){var i=So(r);if(Fx(i))return r}function dy(r,i){if(r==="change")return i}var fy=!1;if(Fr){var of;if(Fr){var lf="oninput"in document;if(!lf){var hy=document.createElement("div");hy.setAttribute("oninput","return;"),lf=typeof hy.oninput=="function"}of=lf}else of=!1;fy=of&&(!document.documentMode||9<document.documentMode)}function my(){To&&(To.detachEvent("onpropertychange",py),Eo=To=null)}function py(r){if(r.propertyName==="value"&&wc(Eo)){var i=[];uy(i,Eo,r,Xd(r)),Qx(TN,i)}}function EN(r,i,o){r==="focusin"?(my(),To=i,Eo=o,To.attachEvent("onpropertychange",py)):r==="focusout"&&my()}function AN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return wc(Eo)}function ON(r,i){if(r==="click")return wc(i)}function MN(r,i){if(r==="input"||r==="change")return wc(i)}function RN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Zn=typeof Object.is=="function"?Object.is:RN;function Ao(r,i){if(Zn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var o=Object.keys(r),d=Object.keys(i);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var p=o[d];if(!ot.call(i,p)||!Zn(r[p],i[p]))return!1}return!0}function gy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function xy(r,i){var o=gy(r);r=0;for(var d;o;){if(o.nodeType===3){if(d=r+o.textContent.length,r<=i&&d>=i)return{node:o,offset:i-r};r=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=gy(o)}}function yy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?yy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function by(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=pc(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=pc(r.document)}return i}function cf(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 DN=Fr&&"documentMode"in document&&11>=document.documentMode,ns=null,uf=null,Oo=null,df=!1;function vy(r,i,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;df||ns==null||ns!==pc(d)||(d=ns,"selectionStart"in d&&cf(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Oo&&Ao(Oo,d)||(Oo=d,d=uu(uf,"onSelect"),0<d.length&&(i=new vc("onSelect","select",null,i,o),r.push({event:i,listeners:d}),i.target=ns)))}function hi(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var rs={animationend:hi("Animation","AnimationEnd"),animationiteration:hi("Animation","AnimationIteration"),animationstart:hi("Animation","AnimationStart"),transitionrun:hi("Transition","TransitionRun"),transitionstart:hi("Transition","TransitionStart"),transitioncancel:hi("Transition","TransitionCancel"),transitionend:hi("Transition","TransitionEnd")},ff={},ky={};Fr&&(ky=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function mi(r){if(ff[r])return ff[r];if(!rs[r])return r;var i=rs[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in ky)return ff[r]=i[o];return r}var wy=mi("animationend"),Sy=mi("animationiteration"),zy=mi("animationstart"),$N=mi("transitionrun"),LN=mi("transitionstart"),PN=mi("transitioncancel"),jy=mi("transitionend"),_y=new Map,hf="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(" ");hf.push("scrollEnd");function br(r,i){_y.set(r,i),di(i,[r])}var Sc=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=[],as=0,mf=0;function zc(){for(var r=as,i=mf=as=0;i<r;){var o=nr[i];nr[i++]=null;var d=nr[i];nr[i++]=null;var p=nr[i];nr[i++]=null;var y=nr[i];if(nr[i++]=null,d!==null&&p!==null){var k=d.pending;k===null?p.next=p:(p.next=k.next,k.next=p),d.pending=p}y!==0&&Ny(o,p,y)}}function jc(r,i,o,d){nr[as++]=r,nr[as++]=i,nr[as++]=o,nr[as++]=d,mf|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function pf(r,i,o,d){return jc(r,i,o,d),_c(r)}function pi(r,i){return jc(r,null,null,i),_c(r)}function Ny(r,i,o){r.lanes|=o;var d=r.alternate;d!==null&&(d.lanes|=o);for(var p=!1,y=r.return;y!==null;)y.childLanes|=o,d=y.alternate,d!==null&&(d.childLanes|=o),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(p=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,p&&i!==null&&(p=31-ft(o),r=y.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=o|536870912),y):null}function _c(r){if(50<el)throw el=0,zh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var is={};function UN(r,i,o,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(r,i,o,d){return new UN(r,i,o,d)}function gf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function qr(r,i){var o=r.alternate;return o===null?(o=Hn(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 Cy(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 Nc(r,i,o,d,p,y){var k=0;if(d=r,typeof r=="function")gf(r)&&(k=1);else if(typeof r=="string")k=HC(r,o,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case K:return r=Hn(31,o,i,p),r.elementType=K,r.lanes=y,r;case S:return gi(o.children,p,y,i);case O:k=8,p|=24;break;case T:return r=Hn(12,o,i,p|2),r.elementType=T,r.lanes=y,r;case D:return r=Hn(13,o,i,p),r.elementType=D,r.lanes=y,r;case M:return r=Hn(19,o,i,p),r.elementType=M,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:k=10;break e;case E:k=9;break e;case $:k=11;break e;case Z:k=14;break e;case U:k=16,d=null;break e}k=29,o=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Hn(k,o,i,p),i.elementType=r,i.type=d,i.lanes=y,i}function gi(r,i,o,d){return r=Hn(7,r,d,i),r.lanes=o,r}function xf(r,i,o){return r=Hn(6,r,null,i),r.lanes=o,r}function Ty(r){var i=Hn(18,null,null,0);return i.stateNode=r,i}function yf(r,i,o){return i=Hn(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Ey=new WeakMap;function rr(r,i){if(typeof r=="object"&&r!==null){var o=Ey.get(r);return o!==void 0?o:(i={value:r,source:i,stack:dt(i)},Ey.set(r,i),i)}return{value:r,source:i,stack:dt(i)}}var ss=[],os=0,Cc=null,Mo=0,ar=[],ir=0,ya=null,Cr=1,Tr="";function Gr(r,i){ss[os++]=Mo,ss[os++]=Cc,Cc=r,Mo=i}function Ay(r,i,o){ar[ir++]=Cr,ar[ir++]=Tr,ar[ir++]=ya,ya=r;var d=Cr;r=Tr;var p=32-ft(d)-1;d&=~(1<<p),o+=1;var y=32-ft(i)+p;if(30<y){var k=p-p%5;y=(d&(1<<k)-1).toString(32),d>>=k,p-=k,Cr=1<<32-ft(i)+p|o<<p|d,Tr=y+r}else Cr=1<<y|o<<p|d,Tr=r}function bf(r){r.return!==null&&(Gr(r,1),Ay(r,1,0))}function vf(r){for(;r===Cc;)Cc=ss[--os],ss[os]=null,Mo=ss[--os],ss[os]=null;for(;r===ya;)ya=ar[--ir],ar[ir]=null,Tr=ar[--ir],ar[ir]=null,Cr=ar[--ir],ar[ir]=null}function Oy(r,i){ar[ir++]=Cr,ar[ir++]=Tr,ar[ir++]=ya,Cr=i.id,Tr=i.overflow,ya=r}var on=null,bt=null,qe=!1,ba=null,sr=!1,kf=Error(a(519));function va(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ro(rr(i,r)),kf}function My(r){var i=r.stateNode,o=r.type,d=r.memoizedProps;switch(i[sn]=r,i[Tn]=d,o){case"dialog":Be("cancel",i),Be("close",i);break;case"iframe":case"object":case"embed":Be("load",i);break;case"video":case"audio":for(o=0;o<nl.length;o++)Be(nl[o],i);break;case"source":Be("error",i);break;case"img":case"image":case"link":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"input":Be("invalid",i),qx(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Be("invalid",i);break;case"textarea":Be("invalid",i),Yx(i,d.value,d.defaultValue,d.children)}o=d.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||d.suppressHydrationWarning===!0||K0(i.textContent,o)?(d.popover!=null&&(Be("beforetoggle",i),Be("toggle",i)),d.onScroll!=null&&Be("scroll",i),d.onScrollEnd!=null&&Be("scrollend",i),d.onClick!=null&&(i.onclick=Hr),i=!0):i=!1,i||va(r,!0)}function Ry(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 ls(r){if(r!==on)return!1;if(!qe)return Ry(r),qe=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||Uh(r.type,r.memoizedProps)),o=!o),o&&bt&&va(r),Ry(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));bt=iv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));bt=iv(r)}else i===27?(i=bt,Ra(r.type)?(r=Hh,Hh=null,bt=r):bt=i):bt=on?lr(r.stateNode.nextSibling):null;return!0}function xi(){bt=on=null,qe=!1}function wf(){var r=ba;return r!==null&&(Rn===null?Rn=r:Rn.push.apply(Rn,r),ba=null),r}function Ro(r){ba===null?ba=[r]:ba.push(r)}var Sf=_(null),yi=null,Yr=null;function ka(r,i,o){w(Sf,i._currentValue),i._currentValue=o}function Jr(r){r._currentValue=Sf.current,H(Sf)}function zf(r,i,o){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===o)break;r=r.return}}function jf(r,i,o,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var y=p.dependencies;if(y!==null){var k=p.child;y=y.firstContext;e:for(;y!==null;){var N=y;y=p;for(var R=0;R<i.length;R++)if(N.context===i[R]){y.lanes|=o,N=y.alternate,N!==null&&(N.lanes|=o),zf(y.return,o,r),d||(k=null);break e}y=N.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(a(341));k.lanes|=o,y=k.alternate,y!==null&&(y.lanes|=o),zf(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 cs(r,i,o,d){r=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!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 N=p.type;Zn(p.pendingProps.value,k.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(ol):r=[ol])}p=p.return}r!==null&&jf(i,r,o,d),i.flags|=262144}function Tc(r){for(r=r.firstContext;r!==null;){if(!Zn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function bi(r){yi=r,Yr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function ln(r){return Dy(yi,r)}function Ec(r,i){return yi===null&&bi(r),Dy(r,i)}function Dy(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Yr===null){if(r===null)throw Error(a(308));Yr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Yr=Yr.next=i;return o}var VN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(o,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(o){return o()})}},BN=e.unstable_scheduleCallback,IN=e.unstable_NormalPriority,Pt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _f(){return{controller:new VN,data:new Map,refCount:0}}function Do(r){r.refCount--,r.refCount===0&&BN(IN,function(){r.controller.abort()})}var $o=null,Nf=0,us=0,ds=null;function ZN(r,i){if($o===null){var o=$o=[];Nf=0,us=Eh(),ds={status:"pending",value:void 0,then:function(d){o.push(d)}}}return Nf++,i.then($y,$y),i}function $y(){if(--Nf===0&&$o!==null){ds!==null&&(ds.status="fulfilled");var r=$o;$o=null,us=0,ds=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function HN(r,i){var o=[],d={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<o.length;p++)(0,o[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),d}var Ly=B.S;B.S=function(r,i){v0=yt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&ZN(r,i),Ly!==null&&Ly(r,i)};var vi=_(null);function Cf(){var r=vi.current;return r!==null?r:ht.pooledCache}function Ac(r,i){i===null?w(vi,vi.current):w(vi,i.pool)}function Py(){var r=Cf();return r===null?null:{parent:Pt._currentValue,pool:r}}var fs=Error(a(460)),Tf=Error(a(474)),Oc=Error(a(542)),Mc={then:function(){}};function Uy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Vy(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(Hr,Hr),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Iy(r),r;default:if(typeof i.status=="string")i.then(Hr,Hr);else{if(r=ht,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Iy(r),r}throw wi=i,fs}}function ki(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(wi=o,fs):o}}var wi=null;function By(){if(wi===null)throw Error(a(459));var r=wi;return wi=null,r}function Iy(r){if(r===fs||r===Oc)throw Error(a(483))}var hs=null,Lo=0;function Rc(r){var i=Lo;return Lo+=1,hs===null&&(hs=[]),Vy(hs,r,i)}function Po(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Dc(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 Zy(r){function i(I,P){if(r){var F=I.deletions;F===null?(I.deletions=[P],I.flags|=16):F.push(P)}}function o(I,P){if(!r)return null;for(;P!==null;)i(I,P),P=P.sibling;return null}function d(I){for(var P=new Map;I!==null;)I.key!==null?P.set(I.key,I):P.set(I.index,I),I=I.sibling;return P}function p(I,P){return I=qr(I,P),I.index=0,I.sibling=null,I}function y(I,P,F){return I.index=F,r?(F=I.alternate,F!==null?(F=F.index,F<P?(I.flags|=67108866,P):F):(I.flags|=67108866,P)):(I.flags|=1048576,P)}function k(I){return r&&I.alternate===null&&(I.flags|=67108866),I}function N(I,P,F,te){return P===null||P.tag!==6?(P=xf(F,I.mode,te),P.return=I,P):(P=p(P,F),P.return=I,P)}function R(I,P,F,te){var je=F.type;return je===S?Q(I,P,F.props.children,te,F.key):P!==null&&(P.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===U&&ki(je)===P.type)?(P=p(P,F.props),Po(P,F),P.return=I,P):(P=Nc(F.type,F.key,F.props,null,I.mode,te),Po(P,F),P.return=I,P)}function q(I,P,F,te){return P===null||P.tag!==4||P.stateNode.containerInfo!==F.containerInfo||P.stateNode.implementation!==F.implementation?(P=yf(F,I.mode,te),P.return=I,P):(P=p(P,F.children||[]),P.return=I,P)}function Q(I,P,F,te,je){return P===null||P.tag!==7?(P=gi(F,I.mode,te,je),P.return=I,P):(P=p(P,F),P.return=I,P)}function re(I,P,F){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=xf(""+P,I.mode,F),P.return=I,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case v:return F=Nc(P.type,P.key,P.props,null,I.mode,F),Po(F,P),F.return=I,F;case j:return P=yf(P,I.mode,F),P.return=I,P;case U:return P=ki(P),re(I,P,F)}if(ie(P)||le(P))return P=gi(P,I.mode,F,null),P.return=I,P;if(typeof P.then=="function")return re(I,Rc(P),F);if(P.$$typeof===C)return re(I,Ec(I,P),F);Dc(I,P)}return null}function Y(I,P,F,te){var je=P!==null?P.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return je!==null?null:N(I,P,""+F,te);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return F.key===je?R(I,P,F,te):null;case j:return F.key===je?q(I,P,F,te):null;case U:return F=ki(F),Y(I,P,F,te)}if(ie(F)||le(F))return je!==null?null:Q(I,P,F,te,null);if(typeof F.then=="function")return Y(I,P,Rc(F),te);if(F.$$typeof===C)return Y(I,P,Ec(I,F),te);Dc(I,F)}return null}function X(I,P,F,te,je){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return I=I.get(F)||null,N(P,I,""+te,je);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return I=I.get(te.key===null?F:te.key)||null,R(P,I,te,je);case j:return I=I.get(te.key===null?F:te.key)||null,q(P,I,te,je);case U:return te=ki(te),X(I,P,F,te,je)}if(ie(te)||le(te))return I=I.get(F)||null,Q(P,I,te,je,null);if(typeof te.then=="function")return X(I,P,F,Rc(te),je);if(te.$$typeof===C)return X(I,P,F,Ec(P,te),je);Dc(P,te)}return null}function ye(I,P,F,te){for(var je=null,Xe=null,Se=P,Re=P=0,He=null;Se!==null&&Re<F.length;Re++){Se.index>Re?(He=Se,Se=null):He=Se.sibling;var Qe=Y(I,Se,F[Re],te);if(Qe===null){Se===null&&(Se=He);break}r&&Se&&Qe.alternate===null&&i(I,Se),P=y(Qe,P,Re),Xe===null?je=Qe:Xe.sibling=Qe,Xe=Qe,Se=He}if(Re===F.length)return o(I,Se),qe&&Gr(I,Re),je;if(Se===null){for(;Re<F.length;Re++)Se=re(I,F[Re],te),Se!==null&&(P=y(Se,P,Re),Xe===null?je=Se:Xe.sibling=Se,Xe=Se);return qe&&Gr(I,Re),je}for(Se=d(Se);Re<F.length;Re++)He=X(Se,I,Re,F[Re],te),He!==null&&(r&&He.alternate!==null&&Se.delete(He.key===null?Re:He.key),P=y(He,P,Re),Xe===null?je=He:Xe.sibling=He,Xe=He);return r&&Se.forEach(function(Ua){return i(I,Ua)}),qe&&Gr(I,Re),je}function _e(I,P,F,te){if(F==null)throw Error(a(151));for(var je=null,Xe=null,Se=P,Re=P=0,He=null,Qe=F.next();Se!==null&&!Qe.done;Re++,Qe=F.next()){Se.index>Re?(He=Se,Se=null):He=Se.sibling;var Ua=Y(I,Se,Qe.value,te);if(Ua===null){Se===null&&(Se=He);break}r&&Se&&Ua.alternate===null&&i(I,Se),P=y(Ua,P,Re),Xe===null?je=Ua:Xe.sibling=Ua,Xe=Ua,Se=He}if(Qe.done)return o(I,Se),qe&&Gr(I,Re),je;if(Se===null){for(;!Qe.done;Re++,Qe=F.next())Qe=re(I,Qe.value,te),Qe!==null&&(P=y(Qe,P,Re),Xe===null?je=Qe:Xe.sibling=Qe,Xe=Qe);return qe&&Gr(I,Re),je}for(Se=d(Se);!Qe.done;Re++,Qe=F.next())Qe=X(Se,I,Re,Qe.value,te),Qe!==null&&(r&&Qe.alternate!==null&&Se.delete(Qe.key===null?Re:Qe.key),P=y(Qe,P,Re),Xe===null?je=Qe:Xe.sibling=Qe,Xe=Qe);return r&&Se.forEach(function(tT){return i(I,tT)}),qe&&Gr(I,Re),je}function ut(I,P,F,te){if(typeof F=="object"&&F!==null&&F.type===S&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case v:e:{for(var je=F.key;P!==null;){if(P.key===je){if(je=F.type,je===S){if(P.tag===7){o(I,P.sibling),te=p(P,F.props.children),te.return=I,I=te;break e}}else if(P.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===U&&ki(je)===P.type){o(I,P.sibling),te=p(P,F.props),Po(te,F),te.return=I,I=te;break e}o(I,P);break}else i(I,P);P=P.sibling}F.type===S?(te=gi(F.props.children,I.mode,te,F.key),te.return=I,I=te):(te=Nc(F.type,F.key,F.props,null,I.mode,te),Po(te,F),te.return=I,I=te)}return k(I);case j:e:{for(je=F.key;P!==null;){if(P.key===je)if(P.tag===4&&P.stateNode.containerInfo===F.containerInfo&&P.stateNode.implementation===F.implementation){o(I,P.sibling),te=p(P,F.children||[]),te.return=I,I=te;break e}else{o(I,P);break}else i(I,P);P=P.sibling}te=yf(F,I.mode,te),te.return=I,I=te}return k(I);case U:return F=ki(F),ut(I,P,F,te)}if(ie(F))return ye(I,P,F,te);if(le(F)){if(je=le(F),typeof je!="function")throw Error(a(150));return F=je.call(F),_e(I,P,F,te)}if(typeof F.then=="function")return ut(I,P,Rc(F),te);if(F.$$typeof===C)return ut(I,P,Ec(I,F),te);Dc(I,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,P!==null&&P.tag===6?(o(I,P.sibling),te=p(P,F),te.return=I,I=te):(o(I,P),te=xf(F,I.mode,te),te.return=I,I=te),k(I)):o(I,P)}return function(I,P,F,te){try{Lo=0;var je=ut(I,P,F,te);return hs=null,je}catch(Se){if(Se===fs||Se===Oc)throw Se;var Xe=Hn(29,Se,null,I.mode);return Xe.lanes=te,Xe.return=I,Xe}}}var Si=Zy(!0),Hy=Zy(!1),wa=!1;function Ef(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Af(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 Sa(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function za(r,i,o){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(et&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=_c(r),Ny(r,null,o),i}return jc(r,d,i,o),_c(r)}function Uo(r,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,o|=d,i.lanes=o,Dx(r,o)}}function Of(r,i){var o=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var p=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var k={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?p=y=k:y=y.next=k,o=o.next}while(o!==null);y===null?p=y=i:y=y.next=i}else p=y=i;o={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=i:r.next=i,o.lastBaseUpdate=i}var Mf=!1;function Vo(){if(Mf){var r=ds;if(r!==null)throw r}}function Bo(r,i,o,d){Mf=!1;var p=r.updateQueue;wa=!1;var y=p.firstBaseUpdate,k=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var R=N,q=R.next;R.next=null,k===null?y=q:k.next=q,k=R;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,N=Q.lastBaseUpdate,N!==k&&(N===null?Q.firstBaseUpdate=q:N.next=q,Q.lastBaseUpdate=R))}if(y!==null){var re=p.baseState;k=0,Q=q=R=null,N=y;do{var Y=N.lane&-536870913,X=Y!==N.lane;if(X?(Ze&Y)===Y:(d&Y)===Y){Y!==0&&Y===us&&(Mf=!0),Q!==null&&(Q=Q.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ye=r,_e=N;Y=i;var ut=o;switch(_e.tag){case 1:if(ye=_e.payload,typeof ye=="function"){re=ye.call(ut,re,Y);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=_e.payload,Y=typeof ye=="function"?ye.call(ut,re,Y):ye,Y==null)break e;re=x({},re,Y);break e;case 2:wa=!0}}Y=N.callback,Y!==null&&(r.flags|=64,X&&(r.flags|=8192),X=p.callbacks,X===null?p.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Q===null?(q=Q=X,R=re):Q=Q.next=X,k|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;X=N,N=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);Q===null&&(R=re),p.baseState=R,p.firstBaseUpdate=q,p.lastBaseUpdate=Q,y===null&&(p.shared.lanes=0),Ta|=k,r.lanes=k,r.memoizedState=re}}function Fy(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function qy(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)Fy(o[r],i)}var ms=_(null),$c=_(0);function Gy(r,i){r=aa,w($c,r),w(ms,i),aa=r|i.baseLanes}function Rf(){w($c,aa),w(ms,ms.current)}function Df(){aa=$c.current,H(ms),H($c)}var Fn=_(null),or=null;function ja(r){var i=r.alternate;w($t,$t.current&1),w(Fn,r),or===null&&(i===null||ms.current!==null||i.memoizedState!==null)&&(or=r)}function $f(r){w($t,$t.current),w(Fn,r),or===null&&(or=r)}function Yy(r){r.tag===22?(w($t,$t.current),w(Fn,r),or===null&&(or=r)):_a()}function _a(){w($t,$t.current),w(Fn,Fn.current)}function qn(r){H(Fn),or===r&&(or=null),H($t)}var $t=_(0);function Lc(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Ih(o)||Zh(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,Me=null,lt=null,Ut=null,Pc=!1,ps=!1,zi=!1,Uc=0,Io=0,gs=null,FN=0;function Ot(){throw Error(a(321))}function Lf(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!Zn(r[o],i[o]))return!1;return!0}function Pf(r,i,o,d,p,y){return Kr=y,Me=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=r===null||r.memoizedState===null?Ab:Wf,zi=!1,y=o(d,p),zi=!1,ps&&(y=Ky(i,o,d,p)),Jy(r),y}function Jy(r){B.H=Fo;var i=lt!==null&<.next!==null;if(Kr=0,Ut=lt=Me=null,Pc=!1,Io=0,gs=null,i)throw Error(a(300));r===null||Vt||(r=r.dependencies,r!==null&&Tc(r)&&(Vt=!0))}function Ky(r,i,o,d){Me=r;var p=0;do{if(ps&&(gs=null),Io=0,ps=!1,25<=p)throw Error(a(301));if(p+=1,Ut=lt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}B.H=Ob,y=i(o,d)}while(ps);return y}function qN(){var r=B.H,i=r.useState()[0];return i=typeof i.then=="function"?Zo(i):i,r=r.useState()[0],(lt!==null?lt.memoizedState:null)!==r&&(Me.flags|=1024),i}function Uf(){var r=Uc!==0;return Uc=0,r}function Vf(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function Bf(r){if(Pc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Pc=!1}Kr=0,Ut=lt=Me=null,ps=!1,Io=Uc=0,gs=null}function kn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Me.memoizedState=Ut=r:Ut=Ut.next=r,Ut}function Lt(){if(lt===null){var r=Me.alternate;r=r!==null?r.memoizedState:null}else r=lt.next;var i=Ut===null?Me.memoizedState:Ut.next;if(i!==null)Ut=i,lt=r;else{if(r===null)throw Me.alternate===null?Error(a(467)):Error(a(310));lt=r,r={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Ut===null?Me.memoizedState=Ut=r:Ut=Ut.next=r}return Ut}function Vc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zo(r){var i=Io;return Io+=1,gs===null&&(gs=[]),r=Vy(gs,r,i),i=Me,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Ab:Wf),r}function Bc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Zo(r);if(r.$$typeof===C)return ln(r)}throw Error(a(438,String(r)))}function If(r){var i=null,o=Me.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var d=Me.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Vc(),Me.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(r),d=0;d<r;d++)o[d]=de;return i.index++,o}function Xr(r,i){return typeof i=="function"?i(r):i}function Ic(r){var i=Lt();return Zf(i,lt,r)}function Zf(r,i,o){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=o;var p=r.baseQueue,y=d.pending;if(y!==null){if(p!==null){var k=p.next;p.next=y.next,y.next=k}i.baseQueue=p=y,d.pending=null}if(y=r.baseState,p===null)r.memoizedState=y;else{i=p.next;var N=k=null,R=null,q=i,Q=!1;do{var re=q.lane&-536870913;if(re!==q.lane?(Ze&re)===re:(Kr&re)===re){var Y=q.revertLane;if(Y===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),re===us&&(Q=!0);else if((Kr&Y)===Y){q=q.next,Y===us&&(Q=!0);continue}else re={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},R===null?(N=R=re,k=y):R=R.next=re,Me.lanes|=Y,Ta|=Y;re=q.action,zi&&o(y,re),y=q.hasEagerState?q.eagerState:o(y,re)}else Y={lane:re,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},R===null?(N=R=Y,k=y):R=R.next=Y,Me.lanes|=re,Ta|=re;q=q.next}while(q!==null&&q!==i);if(R===null?k=y:R.next=N,!Zn(y,r.memoizedState)&&(Vt=!0,Q&&(o=ds,o!==null)))throw o;r.memoizedState=y,r.baseState=k,r.baseQueue=R,d.lastRenderedState=y}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Hf(r){var i=Lt(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=r;var d=o.dispatch,p=o.pending,y=i.memoizedState;if(p!==null){o.pending=null;var k=p=p.next;do y=r(y,k.action),k=k.next;while(k!==p);Zn(y,i.memoizedState)||(Vt=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),o.lastRenderedState=y}return[y,d]}function Xy(r,i,o){var d=Me,p=Lt(),y=qe;if(y){if(o===void 0)throw Error(a(407));o=o()}else o=i();var k=!Zn((lt||p).memoizedState,o);if(k&&(p.memoizedState=o,Vt=!0),p=p.queue,Gf(eb.bind(null,d,p,r),[r]),p.getSnapshot!==i||k||Ut!==null&&Ut.memoizedState.tag&1){if(d.flags|=2048,xs(9,{destroy:void 0},Wy.bind(null,d,p,o,i),null),ht===null)throw Error(a(349));y||(Kr&127)!==0||Qy(d,i,o)}return o}function Qy(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=Me.updateQueue,i===null?(i=Vc(),Me.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function Wy(r,i,o,d){i.value=o,i.getSnapshot=d,tb(i)&&nb(r)}function eb(r,i,o){return o(function(){tb(i)&&nb(r)})}function tb(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!Zn(r,o)}catch{return!0}}function nb(r){var i=pi(r,2);i!==null&&Dn(i,r,2)}function Ff(r){var i=kn();if(typeof r=="function"){var o=r;if(r=o(),zi){Cn(!0);try{o()}finally{Cn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:r},i}function rb(r,i,o,d){return r.baseState=o,Zf(r,lt,typeof d=="function"?d:Xr)}function GN(r,i,o,d,p){if(Fc(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};B.T!==null?o(!0):y.isTransition=!1,d(y),o=i.pending,o===null?(y.next=i.pending=y,ab(i,y)):(y.next=o.next,i.pending=o.next=y)}}function ab(r,i){var o=i.action,d=i.payload,p=r.state;if(i.isTransition){var y=B.T,k={};B.T=k;try{var N=o(p,d),R=B.S;R!==null&&R(k,N),ib(r,i,N)}catch(q){qf(r,i,q)}finally{y!==null&&k.types!==null&&(y.types=k.types),B.T=y}}else try{y=o(p,d),ib(r,i,y)}catch(q){qf(r,i,q)}}function ib(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(d){sb(r,i,d)},function(d){return qf(r,i,d)}):sb(r,i,o)}function sb(r,i,o){i.status="fulfilled",i.value=o,ob(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,ab(r,o)))}function qf(r,i,o){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=o,ob(i),i=i.next;while(i!==d)}r.action=null}function ob(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function lb(r,i){return i}function cb(r,i){if(qe){var o=ht.formState;if(o!==null){e:{var d=Me;if(qe){if(bt){t:{for(var p=bt,y=sr;p.nodeType!==8;){if(!y){p=null;break t}if(p=lr(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){bt=lr(p.nextSibling),d=p.data==="F!";break e}}va(d)}d=!1}d&&(i=o[0])}}return o=kn(),o.memoizedState=o.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lb,lastRenderedState:i},o.queue=d,o=Cb.bind(null,Me,d),d.dispatch=o,d=Ff(!1),y=Qf.bind(null,Me,!1,d.queue),d=kn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,o=GN.bind(null,Me,p,y,o),p.dispatch=o,d.memoizedState=r,[i,o,!1]}function ub(r){var i=Lt();return db(i,lt,r)}function db(r,i,o){if(i=Zf(r,i,lb)[0],r=Ic(Xr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Zo(i)}catch(k){throw k===fs?Oc:k}else d=i;i=Lt();var p=i.queue,y=p.dispatch;return o!==i.memoizedState&&(Me.flags|=2048,xs(9,{destroy:void 0},YN.bind(null,p,o),null)),[d,y,r]}function YN(r,i){r.action=i}function fb(r){var i=Lt(),o=lt;if(o!==null)return db(i,o,r);Lt(),i=i.memoizedState,o=Lt();var d=o.queue.dispatch;return o.memoizedState=r,[i,d,!1]}function xs(r,i,o,d){return r={tag:r,create:o,deps:d,inst:i,next:null},i=Me.updateQueue,i===null&&(i=Vc(),Me.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=r.next=r:(d=o.next,o.next=r,r.next=d,i.lastEffect=r),r}function hb(){return Lt().memoizedState}function Zc(r,i,o,d){var p=kn();Me.flags|=r,p.memoizedState=xs(1|i,{destroy:void 0},o,d===void 0?null:d)}function Hc(r,i,o,d){var p=Lt();d=d===void 0?null:d;var y=p.memoizedState.inst;lt!==null&&d!==null&&Lf(d,lt.memoizedState.deps)?p.memoizedState=xs(i,y,o,d):(Me.flags|=r,p.memoizedState=xs(1|i,y,o,d))}function mb(r,i){Zc(8390656,8,r,i)}function Gf(r,i){Hc(2048,8,r,i)}function JN(r){Me.flags|=4;var i=Me.updateQueue;if(i===null)i=Vc(),Me.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function pb(r){var i=Lt().memoizedState;return JN({ref:i,nextImpl:r}),function(){if((et&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function gb(r,i){return Hc(4,2,r,i)}function xb(r,i){return Hc(4,4,r,i)}function yb(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 bb(r,i,o){o=o!=null?o.concat([r]):null,Hc(4,4,yb.bind(null,i,r),o)}function Yf(){}function vb(r,i){var o=Lt();i=i===void 0?null:i;var d=o.memoizedState;return i!==null&&Lf(i,d[1])?d[0]:(o.memoizedState=[r,i],r)}function kb(r,i){var o=Lt();i=i===void 0?null:i;var d=o.memoizedState;if(i!==null&&Lf(i,d[1]))return d[0];if(d=r(),zi){Cn(!0);try{r()}finally{Cn(!1)}}return o.memoizedState=[d,i],d}function Jf(r,i,o){return o===void 0||(Kr&1073741824)!==0&&(Ze&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=w0(),Me.lanes|=r,Ta|=r,o)}function wb(r,i,o,d){return Zn(o,i)?o:ms.current!==null?(r=Jf(r,o,d),Zn(r,i)||(Vt=!0),r):(Kr&42)===0||(Kr&1073741824)!==0&&(Ze&261930)===0?(Vt=!0,r.memoizedState=o):(r=w0(),Me.lanes|=r,Ta|=r,i)}function Sb(r,i,o,d,p){var y=V.p;V.p=y!==0&&8>y?y:8;var k=B.T,N={};B.T=N,Qf(r,!1,i,o);try{var R=p(),q=B.S;if(q!==null&&q(N,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=HN(R,d);Ho(r,i,Q,Jn(r))}else Ho(r,i,d,Jn(r))}catch(re){Ho(r,i,{then:function(){},status:"rejected",reason:re},Jn())}finally{V.p=y,k!==null&&N.types!==null&&(k.types=N.types),B.T=k}}function KN(){}function Kf(r,i,o,d){if(r.tag!==5)throw Error(a(476));var p=zb(r).queue;Sb(r,p,i,G,o===null?KN:function(){return jb(r),o(d)})}function zb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:G},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 jb(r){var i=zb(r);i.next===null&&(i=r.alternate.memoizedState),Ho(r,i.next.queue,{},Jn())}function Xf(){return ln(ol)}function _b(){return Lt().memoizedState}function Nb(){return Lt().memoizedState}function XN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=Jn();r=Sa(o);var d=za(i,r,o);d!==null&&(Dn(d,i,o),Uo(d,i,o)),i={cache:_f()},r.payload=i;return}i=i.return}}function QN(r,i,o){var d=Jn();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Fc(r)?Tb(i,o):(o=pf(r,i,o,d),o!==null&&(Dn(o,r,d),Eb(o,i,d)))}function Cb(r,i,o){var d=Jn();Ho(r,i,o,d)}function Ho(r,i,o,d){var p={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Fc(r))Tb(i,p);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var k=i.lastRenderedState,N=y(k,o);if(p.hasEagerState=!0,p.eagerState=N,Zn(N,k))return jc(r,i,p,0),ht===null&&zc(),!1}catch{}if(o=pf(r,i,p,d),o!==null)return Dn(o,r,d),Eb(o,i,d),!0}return!1}function Qf(r,i,o,d){if(d={lane:2,revertLane:Eh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Fc(r)){if(i)throw Error(a(479))}else i=pf(r,o,d,2),i!==null&&Dn(i,r,2)}function Fc(r){var i=r.alternate;return r===Me||i!==null&&i===Me}function Tb(r,i){ps=Pc=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function Eb(r,i,o){if((o&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,o|=d,i.lanes=o,Dx(r,o)}}var Fo={readContext:ln,use:Bc,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Fo.useEffectEvent=Ot;var Ab={readContext:ln,use:Bc,useCallback:function(r,i){return kn().memoizedState=[r,i===void 0?null:i],r},useContext:ln,useEffect:mb,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,Zc(4194308,4,yb.bind(null,i,r),o)},useLayoutEffect:function(r,i){return Zc(4194308,4,r,i)},useInsertionEffect:function(r,i){Zc(4,2,r,i)},useMemo:function(r,i){var o=kn();i=i===void 0?null:i;var d=r();if(zi){Cn(!0);try{r()}finally{Cn(!1)}}return o.memoizedState=[d,i],d},useReducer:function(r,i,o){var d=kn();if(o!==void 0){var p=o(i);if(zi){Cn(!0);try{o(i)}finally{Cn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=QN.bind(null,Me,r),[d.memoizedState,r]},useRef:function(r){var i=kn();return r={current:r},i.memoizedState=r},useState:function(r){r=Ff(r);var i=r.queue,o=Cb.bind(null,Me,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:Yf,useDeferredValue:function(r,i){var o=kn();return Jf(o,r,i)},useTransition:function(){var r=Ff(!1);return r=Sb.bind(null,Me,r.queue,!0,!1),kn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var d=Me,p=kn();if(qe){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),ht===null)throw Error(a(349));(Ze&127)!==0||Qy(d,i,o)}p.memoizedState=o;var y={value:o,getSnapshot:i};return p.queue=y,mb(eb.bind(null,d,y,r),[r]),d.flags|=2048,xs(9,{destroy:void 0},Wy.bind(null,d,y,o,i),null),o},useId:function(){var r=kn(),i=ht.identifierPrefix;if(qe){var o=Tr,d=Cr;o=(d&~(1<<32-ft(d)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Uc++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=FN++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Xf,useFormState:cb,useActionState:cb,useOptimistic:function(r){var i=kn();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=Qf.bind(null,Me,!0,o),o.dispatch=i,[r,i]},useMemoCache:If,useCacheRefresh:function(){return kn().memoizedState=XN.bind(null,Me)},useEffectEvent:function(r){var i=kn(),o={impl:r};return i.memoizedState=o,function(){if((et&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Wf={readContext:ln,use:Bc,useCallback:vb,useContext:ln,useEffect:Gf,useImperativeHandle:bb,useInsertionEffect:gb,useLayoutEffect:xb,useMemo:kb,useReducer:Ic,useRef:hb,useState:function(){return Ic(Xr)},useDebugValue:Yf,useDeferredValue:function(r,i){var o=Lt();return wb(o,lt.memoizedState,r,i)},useTransition:function(){var r=Ic(Xr)[0],i=Lt().memoizedState;return[typeof r=="boolean"?r:Zo(r),i]},useSyncExternalStore:Xy,useId:_b,useHostTransitionStatus:Xf,useFormState:ub,useActionState:ub,useOptimistic:function(r,i){var o=Lt();return rb(o,lt,r,i)},useMemoCache:If,useCacheRefresh:Nb};Wf.useEffectEvent=pb;var Ob={readContext:ln,use:Bc,useCallback:vb,useContext:ln,useEffect:Gf,useImperativeHandle:bb,useInsertionEffect:gb,useLayoutEffect:xb,useMemo:kb,useReducer:Hf,useRef:hb,useState:function(){return Hf(Xr)},useDebugValue:Yf,useDeferredValue:function(r,i){var o=Lt();return lt===null?Jf(o,r,i):wb(o,lt.memoizedState,r,i)},useTransition:function(){var r=Hf(Xr)[0],i=Lt().memoizedState;return[typeof r=="boolean"?r:Zo(r),i]},useSyncExternalStore:Xy,useId:_b,useHostTransitionStatus:Xf,useFormState:fb,useActionState:fb,useOptimistic:function(r,i){var o=Lt();return lt!==null?rb(o,lt,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:If,useCacheRefresh:Nb};Ob.useEffectEvent=pb;function eh(r,i,o,d){i=r.memoizedState,o=o(d,i),o=o==null?i:x({},i,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var th={enqueueSetState:function(r,i,o){r=r._reactInternals;var d=Jn(),p=Sa(d);p.payload=i,o!=null&&(p.callback=o),i=za(r,p,d),i!==null&&(Dn(i,r,d),Uo(i,r,d))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var d=Jn(),p=Sa(d);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=za(r,p,d),i!==null&&(Dn(i,r,d),Uo(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=Jn(),d=Sa(o);d.tag=2,i!=null&&(d.callback=i),i=za(r,d,o),i!==null&&(Dn(i,r,o),Uo(i,r,o))}};function Mb(r,i,o,d,p,y,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,y,k):i.prototype&&i.prototype.isPureReactComponent?!Ao(o,d)||!Ao(p,y):!0}function Rb(r,i,o,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,d),i.state!==r&&th.enqueueReplaceState(i,i.state,null)}function ji(r,i){var o=i;if("ref"in i){o={};for(var d in i)d!=="ref"&&(o[d]=i[d])}if(r=r.defaultProps){o===i&&(o=x({},o));for(var p in r)o[p]===void 0&&(o[p]=r[p])}return o}function Db(r){Sc(r)}function $b(r){console.error(r)}function Lb(r){Sc(r)}function qc(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function Pb(r,i,o){try{var d=r.onCaughtError;d(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function nh(r,i,o){return o=Sa(o),o.tag=3,o.payload={element:null},o.callback=function(){qc(r,i)},o}function Ub(r){return r=Sa(r),r.tag=3,r}function Vb(r,i,o,d){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;r.payload=function(){return p(y)},r.callback=function(){Pb(i,o,d)}}var k=o.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){Pb(i,o,d),typeof p!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function WN(r,i,o,d,p){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=o.alternate,i!==null&&cs(i,o,p,!0),o=Fn.current,o!==null){switch(o.tag){case 31:case 13:return or===null?au():o.alternate===null&&Mt===0&&(Mt=3),o.flags&=-257,o.flags|=65536,o.lanes=p,d===Mc?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([d]):i.add(d),Nh(r,d,p)),!1;case 22:return o.flags|=65536,d===Mc?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([d]):o.add(d)),Nh(r,d,p)),!1}throw Error(a(435,o.tag))}return Nh(r,d,p),au(),!1}if(qe)return i=Fn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==kf&&(r=Error(a(422),{cause:d}),Ro(rr(r,o)))):(d!==kf&&(i=Error(a(423),{cause:d}),Ro(rr(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=rr(d,o),p=nh(r.stateNode,d,p),Of(r,p),Mt!==4&&(Mt=2)),!1;var y=Error(a(520),{cause:d});if(y=rr(y,o),Wo===null?Wo=[y]:Wo.push(y),Mt!==4&&(Mt=2),i===null)return!0;d=rr(d,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=p&-p,o.lanes|=r,r=nh(o.stateNode,d,r),Of(o,r),!1;case 1:if(i=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ea===null||!Ea.has(y))))return o.flags|=65536,p&=-p,o.lanes|=p,p=Ub(p),Vb(p,r,o,d),Of(o,p),!1}o=o.return}while(o!==null);return!1}var rh=Error(a(461)),Vt=!1;function cn(r,i,o,d){i.child=r===null?Hy(i,null,o,d):Si(i,r.child,o,d)}function Bb(r,i,o,d,p){o=o.render;var y=i.ref;if("ref"in d){var k={};for(var N in d)N!=="ref"&&(k[N]=d[N])}else k=d;return bi(i),d=Pf(r,i,o,k,y,p),N=Uf(),r!==null&&!Vt?(Vf(r,i,p),Qr(r,i,p)):(qe&&N&&bf(i),i.flags|=1,cn(r,i,d,p),i.child)}function Ib(r,i,o,d,p){if(r===null){var y=o.type;return typeof y=="function"&&!gf(y)&&y.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=y,Zb(r,i,y,d,p)):(r=Nc(o.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!dh(r,p)){var k=y.memoizedProps;if(o=o.compare,o=o!==null?o:Ao,o(k,d)&&r.ref===i.ref)return Qr(r,i,p)}return i.flags|=1,r=qr(y,d),r.ref=i.ref,r.return=i,i.child=r}function Zb(r,i,o,d,p){if(r!==null){var y=r.memoizedProps;if(Ao(y,d)&&r.ref===i.ref)if(Vt=!1,i.pendingProps=d=y,dh(r,p))(r.flags&131072)!==0&&(Vt=!0);else return i.lanes=r.lanes,Qr(r,i,p)}return ah(r,i,o,d,p)}function Hb(r,i,o,d){var p=d.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~y}else d=0,i.child=null;return Fb(r,i,y,o,d)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Ac(i,y!==null?y.cachePool:null),y!==null?Gy(i,y):Rf(),Yy(i);else return d=i.lanes=536870912,Fb(r,i,y!==null?y.baseLanes|o:o,o,d)}else y!==null?(Ac(i,y.cachePool),Gy(i,y),_a(),i.memoizedState=null):(r!==null&&Ac(i,null),Rf(),_a());return cn(r,i,p,o),i.child}function qo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Fb(r,i,o,d,p){var y=Cf();return y=y===null?null:{parent:Pt._currentValue,pool:y},i.memoizedState={baseLanes:o,cachePool:y},r!==null&&Ac(i,null),Rf(),Yy(i),r!==null&&cs(r,i,d,!0),i.childLanes=p,null}function Gc(r,i){return i=Jc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function qb(r,i,o){return Si(i,r.child,null,o),r=Gc(i,i.pendingProps),r.flags|=2,qn(i),i.memoizedState=null,r}function eC(r,i,o){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(qe){if(d.mode==="hidden")return r=Gc(i,d),i.lanes=536870912,qo(null,r);if($f(i),(r=bt)?(r=av(r,sr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ya!==null?{id:Cr,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},o=Ty(r),o.return=i,i.child=o,on=i,bt=null)):r=null,r===null)throw va(i);return i.lanes=536870912,null}return Gc(i,d)}var y=r.memoizedState;if(y!==null){var k=y.dehydrated;if($f(i),p)if(i.flags&256)i.flags&=-257,i=qb(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Vt||cs(r,i,o,!1),p=(o&r.childLanes)!==0,Vt||p){if(d=ht,d!==null&&(k=$x(d,o),k!==0&&k!==y.retryLane))throw y.retryLane=k,pi(r,k),Dn(d,r,k),rh;au(),i=qb(r,i,o)}else r=y.treeContext,bt=lr(k.nextSibling),on=i,qe=!0,ba=null,sr=!1,r!==null&&Oy(i,r),i=Gc(i,d),i.flags|=4096;return i}return r=qr(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Yc(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 ah(r,i,o,d,p){return bi(i),o=Pf(r,i,o,d,void 0,p),d=Uf(),r!==null&&!Vt?(Vf(r,i,p),Qr(r,i,p)):(qe&&d&&bf(i),i.flags|=1,cn(r,i,o,p),i.child)}function Gb(r,i,o,d,p,y){return bi(i),i.updateQueue=null,o=Ky(i,d,o,p),Jy(r),d=Uf(),r!==null&&!Vt?(Vf(r,i,y),Qr(r,i,y)):(qe&&d&&bf(i),i.flags|=1,cn(r,i,o,y),i.child)}function Yb(r,i,o,d,p){if(bi(i),i.stateNode===null){var y=is,k=o.contextType;typeof k=="object"&&k!==null&&(y=ln(k)),y=new o(d,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=th,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=d,y.state=i.memoizedState,y.refs={},Ef(i),k=o.contextType,y.context=typeof k=="object"&&k!==null?ln(k):is,y.state=i.memoizedState,k=o.getDerivedStateFromProps,typeof k=="function"&&(eh(i,o,k,d),y.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&th.enqueueReplaceState(y,y.state,null),Bo(i,d,y,p),Vo(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){y=i.stateNode;var N=i.memoizedProps,R=ji(o,N);y.props=R;var q=y.context,Q=o.contextType;k=is,typeof Q=="object"&&Q!==null&&(k=ln(Q));var re=o.getDerivedStateFromProps;Q=typeof re=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,Q||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||q!==k)&&Rb(i,y,d,k),wa=!1;var Y=i.memoizedState;y.state=Y,Bo(i,d,y,p),Vo(),q=i.memoizedState,N||Y!==q||wa?(typeof re=="function"&&(eh(i,o,re,d),q=i.memoizedState),(R=wa||Mb(i,o,R,d,Y,q,k))?(Q||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=q),y.props=d,y.state=q,y.context=k,d=R):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{y=i.stateNode,Af(r,i),k=i.memoizedProps,Q=ji(o,k),y.props=Q,re=i.pendingProps,Y=y.context,q=o.contextType,R=is,typeof q=="object"&&q!==null&&(R=ln(q)),N=o.getDerivedStateFromProps,(q=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==re||Y!==R)&&Rb(i,y,d,R),wa=!1,Y=i.memoizedState,y.state=Y,Bo(i,d,y,p),Vo();var X=i.memoizedState;k!==re||Y!==X||wa||r!==null&&r.dependencies!==null&&Tc(r.dependencies)?(typeof N=="function"&&(eh(i,o,N,d),X=i.memoizedState),(Q=wa||Mb(i,o,Q,d,Y,X,R)||r!==null&&r.dependencies!==null&&Tc(r.dependencies))?(q||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,X,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,X,R)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=X),y.props=d,y.state=X,y.context=R,d=Q):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),d=!1)}return y=d,Yc(r,i),d=(i.flags&128)!==0,y||d?(y=i.stateNode,o=d&&typeof o.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&d?(i.child=Si(i,r.child,null,p),i.child=Si(i,null,o,p)):cn(r,i,o,p),i.memoizedState=y.state,r=i.child):r=Qr(r,i,p),r}function Jb(r,i,o,d){return xi(),i.flags|=256,cn(r,i,o,d),i.child}var ih={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sh(r){return{baseLanes:r,cachePool:Py()}}function oh(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Yn),r}function Kb(r,i,o){var d=i.pendingProps,p=!1,y=(i.flags&128)!==0,k;if((k=y)||(k=r!==null&&r.memoizedState===null?!1:($t.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(qe){if(p?ja(i):_a(),(r=bt)?(r=av(r,sr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ya!==null?{id:Cr,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},o=Ty(r),o.return=i,i.child=o,on=i,bt=null)):r=null,r===null)throw va(i);return Zh(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(_a(),p=i.mode,N=Jc({mode:"hidden",children:N},p),d=gi(d,p,o,null),N.return=i,d.return=i,N.sibling=d,i.child=N,d=i.child,d.memoizedState=sh(o),d.childLanes=oh(r,k,o),i.memoizedState=ih,qo(null,d)):(ja(i),lh(i,N))}var R=r.memoizedState;if(R!==null&&(N=R.dehydrated,N!==null)){if(y)i.flags&256?(ja(i),i.flags&=-257,i=ch(r,i,o)):i.memoizedState!==null?(_a(),i.child=r.child,i.flags|=128,i=null):(_a(),N=d.fallback,p=i.mode,d=Jc({mode:"visible",children:d.children},p),N=gi(N,p,o,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Si(i,r.child,null,o),d=i.child,d.memoizedState=sh(o),d.childLanes=oh(r,k,o),i.memoizedState=ih,i=qo(null,d));else if(ja(i),Zh(N)){if(k=N.nextSibling&&N.nextSibling.dataset,k)var q=k.dgst;k=q,d=Error(a(419)),d.stack="",d.digest=k,Ro({value:d,source:null,stack:null}),i=ch(r,i,o)}else if(Vt||cs(r,i,o,!1),k=(o&r.childLanes)!==0,Vt||k){if(k=ht,k!==null&&(d=$x(k,o),d!==0&&d!==R.retryLane))throw R.retryLane=d,pi(r,d),Dn(k,r,d),rh;Ih(N)||au(),i=ch(r,i,o)}else Ih(N)?(i.flags|=192,i.child=r.child,i=null):(r=R.treeContext,bt=lr(N.nextSibling),on=i,qe=!0,ba=null,sr=!1,r!==null&&Oy(i,r),i=lh(i,d.children),i.flags|=4096);return i}return p?(_a(),N=d.fallback,p=i.mode,R=r.child,q=R.sibling,d=qr(R,{mode:"hidden",children:d.children}),d.subtreeFlags=R.subtreeFlags&65011712,q!==null?N=qr(q,N):(N=gi(N,p,o,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,qo(null,d),d=i.child,N=r.child.memoizedState,N===null?N=sh(o):(p=N.cachePool,p!==null?(R=Pt._currentValue,p=p.parent!==R?{parent:R,pool:R}:p):p=Py(),N={baseLanes:N.baseLanes|o,cachePool:p}),d.memoizedState=N,d.childLanes=oh(r,k,o),i.memoizedState=ih,qo(r.child,d)):(ja(i),o=r.child,r=o.sibling,o=qr(o,{mode:"visible",children:d.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 lh(r,i){return i=Jc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Jc(r,i){return r=Hn(22,r,null,i),r.lanes=0,r}function ch(r,i,o){return Si(i,r.child,null,o),r=lh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Xb(r,i,o){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),zf(r.return,i,o)}function uh(r,i,o,d,p,y){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:p,treeForkCount:y}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=d,k.tail=o,k.tailMode=p,k.treeForkCount=y)}function Qb(r,i,o){var d=i.pendingProps,p=d.revealOrder,y=d.tail;d=d.children;var k=$t.current,N=(k&2)!==0;if(N?(k=k&1|2,i.flags|=128):k&=1,w($t,k),cn(r,i,d,o),d=qe?Mo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Xb(r,o,i);else if(r.tag===19)Xb(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&&Lc(r)===null&&(p=o),o=o.sibling;o=p,o===null?(p=i.child,i.child=null):(p=o.sibling,o.sibling=null),uh(i,!1,p,o,y,d);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Lc(r)===null){i.child=p;break}r=p.sibling,p.sibling=o,o=p,p=r}uh(i,!0,o,null,y,d);break;case"together":uh(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Qr(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),Ta|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(cs(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=qr(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=qr(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function dh(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Tc(r)))}function tC(r,i,o){switch(i.tag){case 3:Pe(i,i.stateNode.containerInfo),ka(i,Pt,r.memoizedState.cache),xi();break;case 27:case 5:xt(i);break;case 4:Pe(i,i.stateNode.containerInfo);break;case 10:ka(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,$f(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(ja(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Kb(r,i,o):(ja(i),r=Qr(r,i,o),r!==null?r.sibling:null);ja(i);break;case 19:var p=(r.flags&128)!==0;if(d=(o&i.childLanes)!==0,d||(cs(r,i,o,!1),d=(o&i.childLanes)!==0),p){if(d)return Qb(r,i,o);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w($t,$t.current),d)break;return null;case 22:return i.lanes=0,Hb(r,i,o,i.pendingProps);case 24:ka(i,Pt,r.memoizedState.cache)}return Qr(r,i,o)}function Wb(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Vt=!0;else{if(!dh(r,o)&&(i.flags&128)===0)return Vt=!1,tC(r,i,o);Vt=(r.flags&131072)!==0}else Vt=!1,qe&&(i.flags&1048576)!==0&&Ay(i,Mo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=ki(i.elementType),i.type=r,typeof r=="function")gf(r)?(d=ji(r,d),i.tag=1,i=Yb(null,i,r,d,o)):(i.tag=0,i=ah(null,i,r,d,o));else{if(r!=null){var p=r.$$typeof;if(p===$){i.tag=11,i=Bb(null,i,r,d,o);break e}else if(p===Z){i.tag=14,i=Ib(null,i,r,d,o);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return ah(r,i,i.type,i.pendingProps,o);case 1:return d=i.type,p=ji(d,i.pendingProps),Yb(r,i,d,p,o);case 3:e:{if(Pe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var y=i.memoizedState;p=y.element,Af(r,i),Bo(i,d,null,o);var k=i.memoizedState;if(d=k.cache,ka(i,Pt,d),d!==y.cache&&jf(i,[Pt],o,!0),Vo(),d=k.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=Jb(r,i,d,o);break e}else if(d!==p){p=rr(Error(a(424)),i),Ro(p),i=Jb(r,i,d,o);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,bt=lr(r.firstChild),on=i,qe=!0,ba=null,sr=!0,o=Hy(i,null,d,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(xi(),d===p){i=Qr(r,i,o);break e}cn(r,i,d,o)}i=i.child}return i;case 26:return Yc(r,i),r===null?(o=uv(i.type,null,i.pendingProps,null))?i.memoizedState=o:qe||(o=i.type,r=i.pendingProps,d=du(pe.current).createElement(o),d[sn]=i,d[Tn]=r,un(d,o,r),rn(d),i.stateNode=d):i.memoizedState=uv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return xt(i),r===null&&qe&&(d=i.stateNode=ov(i.type,i.pendingProps,pe.current),on=i,sr=!0,p=bt,Ra(i.type)?(Hh=p,bt=lr(d.firstChild)):bt=p),cn(r,i,i.pendingProps.children,o),Yc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&qe&&((p=d=bt)&&(d=AC(d,i.type,i.pendingProps,sr),d!==null?(i.stateNode=d,on=i,bt=lr(d.firstChild),sr=!1,p=!0):p=!1),p||va(i)),xt(i),p=i.type,y=i.pendingProps,k=r!==null?r.memoizedProps:null,d=y.children,Uh(p,y)?d=null:k!==null&&Uh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=Pf(r,i,qN,null,null,o),ol._currentValue=p),Yc(r,i),cn(r,i,d,o),i.child;case 6:return r===null&&qe&&((r=o=bt)&&(o=OC(o,i.pendingProps,sr),o!==null?(i.stateNode=o,on=i,bt=null,r=!0):r=!1),r||va(i)),null;case 13:return Kb(r,i,o);case 4:return Pe(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Si(i,null,d,o):cn(r,i,d,o),i.child;case 11:return Bb(r,i,i.type,i.pendingProps,o);case 7:return cn(r,i,i.pendingProps,o),i.child;case 8:return cn(r,i,i.pendingProps.children,o),i.child;case 12:return cn(r,i,i.pendingProps.children,o),i.child;case 10:return d=i.pendingProps,ka(i,i.type,d.value),cn(r,i,d.children,o),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,bi(i),p=ln(p),d=d(p),i.flags|=1,cn(r,i,d,o),i.child;case 14:return Ib(r,i,i.type,i.pendingProps,o);case 15:return Zb(r,i,i.type,i.pendingProps,o);case 19:return Qb(r,i,o);case 31:return eC(r,i,o);case 22:return Hb(r,i,o,i.pendingProps);case 24:return bi(i),d=ln(Pt),r===null?(p=Cf(),p===null&&(p=ht,y=_f(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=o),p=y),i.memoizedState={parent:d,cache:p},Ef(i),ka(i,Pt,p)):((r.lanes&o)!==0&&(Af(r,i),Bo(i,null,null,o),Vo()),p=r.memoizedState,y=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),ka(i,Pt,d)):(d=y.cache,ka(i,Pt,d),d!==p.cache&&jf(i,[Pt],o,!0))),cn(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Wr(r){r.flags|=4}function fh(r,i,o,d,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(_0())r.flags|=8192;else throw wi=Mc,Tf}else r.flags&=-16777217}function e0(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!pv(i))if(_0())r.flags|=8192;else throw wi=Mc,Tf}function Kc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Mx():536870912,r.lanes|=i,ks|=i)}function Go(r,i){if(!qe)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 d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function vt(r){var i=r.alternate!==null&&r.alternate.child===r.child,o=0,d=0;if(i)for(var p=r.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=o,i}function nC(r,i,o){var d=i.pendingProps;switch(vf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(i),null;case 1:return vt(i),null;case 3:return o=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Jr(Pt),Ee(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(ls(i)?Wr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,wf())),vt(i),null;case 26:var p=i.type,y=i.memoizedState;return r===null?(Wr(i),y!==null?(vt(i),e0(i,y)):(vt(i),fh(i,p,null,d,o))):y?y!==r.memoizedState?(Wr(i),vt(i),e0(i,y)):(vt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&Wr(i),vt(i),fh(i,p,r,d,o)),null;case 27:if(L(i),o=pe.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Wr(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}r=J.current,ls(i)?My(i):(r=ov(p,d,o),i.stateNode=r,Wr(i))}return vt(i),null;case 5:if(L(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Wr(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}if(y=J.current,ls(i))My(i);else{var k=du(pe.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?k.createElement("select",{is:d.is}):k.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?k.createElement(p,{is:d.is}):k.createElement(p)}}y[sn]=i,y[Tn]=d;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)y.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=y;e:switch(un(y,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Wr(i)}}return vt(i),fh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&Wr(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=pe.current,ls(i)){if(r=i.stateNode,o=i.memoizedProps,d=null,p=on,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[sn]=i,r=!!(r.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||K0(r.nodeValue,o)),r||va(i,!0)}else r=du(r).createTextNode(d),r[sn]=i,i.stateNode=r}return vt(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(d=ls(i),o!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[sn]=i}else xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),r=!1}else o=wf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(qn(i),i):(qn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return vt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=ls(i),d!==null&&d.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 xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),p=!1}else p=wf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(qn(i),i):(qn(i),null)}return qn(i),(i.flags&128)!==0?(i.lanes=o,i):(o=d!==null,r=r!==null&&r.memoizedState!==null,o&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)),o!==r&&o&&(i.child.flags|=8192),Kc(i,i.updateQueue),vt(i),null);case 4:return Ee(),r===null&&Rh(i.stateNode.containerInfo),vt(i),null;case 10:return Jr(i.type),vt(i),null;case 19:if(H($t),d=i.memoizedState,d===null)return vt(i),null;if(p=(i.flags&128)!==0,y=d.rendering,y===null)if(p)Go(d,!1);else{if(Mt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=Lc(r),y!==null){for(i.flags|=128,Go(d,!1),r=y.updateQueue,i.updateQueue=r,Kc(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)Cy(o,r),o=o.sibling;return w($t,$t.current&1|2),qe&&Gr(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&yt()>tu&&(i.flags|=128,p=!0,Go(d,!1),i.lanes=4194304)}else{if(!p)if(r=Lc(y),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Kc(i,r),Go(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!qe)return vt(i),null}else 2*yt()-d.renderingStartTime>tu&&o!==536870912&&(i.flags|=128,p=!0,Go(d,!1),i.lanes=4194304);d.isBackwards?(y.sibling=i.child,i.child=y):(r=d.last,r!==null?r.sibling=y:i.child=y,d.last=y)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=yt(),r.sibling=null,o=$t.current,w($t,p?o&1|2:o&1),qe&&Gr(i,d.treeForkCount),r):(vt(i),null);case 22:case 23:return qn(i),Df(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(o&536870912)!==0&&(i.flags&128)===0&&(vt(i),i.subtreeFlags&6&&(i.flags|=8192)):vt(i),o=i.updateQueue,o!==null&&Kc(i,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==o&&(i.flags|=2048),r!==null&&H(vi),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Jr(Pt),vt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function rC(r,i){switch(vf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Jr(Pt),Ee(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return L(i),null;case 31:if(i.memoizedState!==null){if(qn(i),i.alternate===null)throw Error(a(340));xi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(qn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));xi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return H($t),null;case 4:return Ee(),null;case 10:return Jr(i.type),null;case 22:case 23:return qn(i),Df(),r!==null&&H(vi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Jr(Pt),null;case 25:return null;default:return null}}function t0(r,i){switch(vf(i),i.tag){case 3:Jr(Pt),Ee();break;case 26:case 27:case 5:L(i);break;case 4:Ee();break;case 31:i.memoizedState!==null&&qn(i);break;case 13:qn(i);break;case 19:H($t);break;case 10:Jr(i.type);break;case 22:case 23:qn(i),Df(),r!==null&&H(vi);break;case 24:Jr(Pt)}}function Yo(r,i){try{var o=i.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var p=d.next;o=p;do{if((o.tag&r)===r){d=void 0;var y=o.create,k=o.inst;d=y(),k.destroy=d}o=o.next}while(o!==p)}}catch(N){it(i,i.return,N)}}function Na(r,i,o){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&r)===r){var k=d.inst,N=k.destroy;if(N!==void 0){k.destroy=void 0,p=i;var R=o,q=N;try{q()}catch(Q){it(p,R,Q)}}}d=d.next}while(d!==y)}}catch(Q){it(i,i.return,Q)}}function n0(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{qy(i,o)}catch(d){it(r,r.return,d)}}}function r0(r,i,o){o.props=ji(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(d){it(r,i,d)}}function Jo(r,i){try{var o=r.ref;if(o!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof o=="function"?r.refCleanup=o(d):o.current=d}}catch(p){it(r,i,p)}}function Er(r,i){var o=r.ref,d=r.refCleanup;if(o!==null)if(typeof d=="function")try{d()}catch(p){it(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){it(r,i,p)}else o.current=null}function a0(r){var i=r.type,o=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(p){it(r,r.return,p)}}function hh(r,i,o){try{var d=r.stateNode;jC(d,r.type,o,i),d[Tn]=i}catch(p){it(r,r.return,p)}}function i0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ra(r.type)||r.tag===4}function mh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||i0(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&&Ra(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 ph(r,i,o){var d=r.tag;if(d===5||d===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=Hr));else if(d!==4&&(d===27&&Ra(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(ph(r,i,o),r=r.sibling;r!==null;)ph(r,i,o),r=r.sibling}function Xc(r,i,o){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?o.insertBefore(r,i):o.appendChild(r);else if(d!==4&&(d===27&&Ra(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Xc(r,i,o),r=r.sibling;r!==null;)Xc(r,i,o),r=r.sibling}function s0(r){var i=r.stateNode,o=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);un(i,d,o),i[sn]=r,i[Tn]=o}catch(y){it(r,r.return,y)}}var ea=!1,Bt=!1,gh=!1,o0=typeof WeakSet=="function"?WeakSet:Set,an=null;function aC(r,i){if(r=r.containerInfo,Lh=yu,r=by(r),cf(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var k=0,N=-1,R=-1,q=0,Q=0,re=r,Y=null;t:for(;;){for(var X;re!==o||p!==0&&re.nodeType!==3||(N=k+p),re!==y||d!==0&&re.nodeType!==3||(R=k+d),re.nodeType===3&&(k+=re.nodeValue.length),(X=re.firstChild)!==null;)Y=re,re=X;for(;;){if(re===r)break t;if(Y===o&&++q===p&&(N=k),Y===y&&++Q===d&&(R=k),(X=re.nextSibling)!==null)break;re=Y,Y=re.parentNode}re=X}o=N===-1||R===-1?null:{start:N,end:R}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ph={focusedElem:r,selectionRange:o},yu=!1,an=i;an!==null;)if(i=an,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,an=r;else for(;an!==null;){switch(i=an,y=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&&y!==null){r=void 0,o=i,p=y.memoizedProps,y=y.memoizedState,d=o.stateNode;try{var ye=ji(o.type,p);r=d.getSnapshotBeforeUpdate(ye,y),d.__reactInternalSnapshotBeforeUpdate=r}catch(_e){it(o,o.return,_e)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)Bh(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Bh(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,an=r;break}an=i.return}}function l0(r,i,o){var d=o.flags;switch(o.tag){case 0:case 11:case 15:na(r,o),d&4&&Yo(5,o);break;case 1:if(na(r,o),d&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(k){it(o,o.return,k)}else{var p=ji(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){it(o,o.return,k)}}d&64&&n0(o),d&512&&Jo(o,o.return);break;case 3:if(na(r,o),d&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{qy(r,i)}catch(k){it(o,o.return,k)}}break;case 27:i===null&&d&4&&s0(o);case 26:case 5:na(r,o),i===null&&d&4&&a0(o),d&512&&Jo(o,o.return);break;case 12:na(r,o);break;case 31:na(r,o),d&4&&d0(r,o);break;case 13:na(r,o),d&4&&f0(r,o),d&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=hC.bind(null,o),MC(r,o))));break;case 22:if(d=o.memoizedState!==null||ea,!d){i=i!==null&&i.memoizedState!==null||Bt,p=ea;var y=Bt;ea=d,(Bt=i)&&!y?ra(r,o,(o.subtreeFlags&8772)!==0):na(r,o),ea=p,Bt=y}break;case 30:break;default:na(r,o)}}function c0(r){var i=r.alternate;i!==null&&(r.alternate=null,c0(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Fd(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,An=!1;function ta(r,i,o){for(o=o.child;o!==null;)u0(r,i,o),o=o.sibling}function u0(r,i,o){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(vn,o)}catch{}switch(o.tag){case 26:Bt||Er(o,i),ta(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Bt||Er(o,i);var d=St,p=An;Ra(o.type)&&(St=o.stateNode,An=!1),ta(r,i,o),al(o.stateNode),St=d,An=p;break;case 5:Bt||Er(o,i);case 6:if(d=St,p=An,St=null,ta(r,i,o),St=d,An=p,St!==null)if(An)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(o.stateNode)}catch(y){it(o,i,y)}else try{St.removeChild(o.stateNode)}catch(y){it(o,i,y)}break;case 18:St!==null&&(An?(r=St,nv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),Ts(r)):nv(St,o.stateNode));break;case 4:d=St,p=An,St=o.stateNode.containerInfo,An=!0,ta(r,i,o),St=d,An=p;break;case 0:case 11:case 14:case 15:Na(2,o,i),Bt||Na(4,o,i),ta(r,i,o);break;case 1:Bt||(Er(o,i),d=o.stateNode,typeof d.componentWillUnmount=="function"&&r0(o,i,d)),ta(r,i,o);break;case 21:ta(r,i,o);break;case 22:Bt=(d=Bt)||o.memoizedState!==null,ta(r,i,o),Bt=d;break;default:ta(r,i,o)}}function d0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Ts(r)}catch(o){it(i,i.return,o)}}}function f0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Ts(r)}catch(o){it(i,i.return,o)}}function iC(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new o0),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new o0),i;default:throw Error(a(435,r.tag))}}function Qc(r,i){var o=iC(r);i.forEach(function(d){if(!o.has(d)){o.add(d);var p=mC.bind(null,r,d);d.then(p,p)}})}function On(r,i){var o=i.deletions;if(o!==null)for(var d=0;d<o.length;d++){var p=o[d],y=r,k=i,N=k;e:for(;N!==null;){switch(N.tag){case 27:if(Ra(N.type)){St=N.stateNode,An=!1;break e}break;case 5:St=N.stateNode,An=!1;break e;case 3:case 4:St=N.stateNode.containerInfo,An=!0;break e}N=N.return}if(St===null)throw Error(a(160));u0(y,k,p),St=null,An=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)h0(i,r),i=i.sibling}var vr=null;function h0(r,i){var o=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:On(i,r),Mn(r),d&4&&(Na(3,r,r.return),Yo(3,r),Na(5,r,r.return));break;case 1:On(i,r),Mn(r),d&512&&(Bt||o===null||Er(o,o.return)),d&64&&ea&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?d:o.concat(d))));break;case 26:var p=vr;if(On(i,r),Mn(r),d&512&&(Bt||o===null||Er(o,o.return)),d&4){var y=o!==null?o.memoizedState:null;if(d=r.memoizedState,o===null)if(d===null)if(r.stateNode===null){e:{d=r.type,o=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[wo]||y[sn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),un(y,d,o),y[sn]=r,rn(y),d=y;break e;case"link":var k=hv("link","href",p).get(d+(o.href||""));if(k){for(var N=0;N<k.length;N++)if(y=k[N],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(N,1);break t}}y=p.createElement(d),un(y,d,o),p.head.appendChild(y);break;case"meta":if(k=hv("meta","content",p).get(d+(o.content||""))){for(N=0;N<k.length;N++)if(y=k[N],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(N,1);break t}}y=p.createElement(d),un(y,d,o),p.head.appendChild(y);break;default:throw Error(a(468,d))}y[sn]=r,rn(y),d=y}r.stateNode=d}else mv(p,r.type,r.stateNode);else r.stateNode=fv(p,d,r.memoizedProps);else y!==d?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,d===null?mv(p,r.type,r.stateNode):fv(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&hh(r,r.memoizedProps,o.memoizedProps)}break;case 27:On(i,r),Mn(r),d&512&&(Bt||o===null||Er(o,o.return)),o!==null&&d&4&&hh(r,r.memoizedProps,o.memoizedProps);break;case 5:if(On(i,r),Mn(r),d&512&&(Bt||o===null||Er(o,o.return)),r.flags&32){p=r.stateNode;try{Qi(p,"")}catch(ye){it(r,r.return,ye)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,hh(r,p,o!==null?o.memoizedProps:p)),d&1024&&(gh=!0);break;case 6:if(On(i,r),Mn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,o=r.stateNode;try{o.nodeValue=d}catch(ye){it(r,r.return,ye)}}break;case 3:if(mu=null,p=vr,vr=fu(i.containerInfo),On(i,r),vr=p,Mn(r),d&4&&o!==null&&o.memoizedState.isDehydrated)try{Ts(i.containerInfo)}catch(ye){it(r,r.return,ye)}gh&&(gh=!1,m0(r));break;case 4:d=vr,vr=fu(r.stateNode.containerInfo),On(i,r),Mn(r),vr=d;break;case 12:On(i,r),Mn(r);break;case 31:On(i,r),Mn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Qc(r,d)));break;case 13:On(i,r),Mn(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(eu=yt()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Qc(r,d)));break;case 22:p=r.memoizedState!==null;var R=o!==null&&o.memoizedState!==null,q=ea,Q=Bt;if(ea=q||p,Bt=Q||R,On(i,r),Bt=Q,ea=q,Mn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||R||ea||Bt||_i(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){R=o=i;try{if(y=R.stateNode,p)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{N=R.stateNode;var re=R.memoizedProps.style,Y=re!=null&&re.hasOwnProperty("display")?re.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ye){it(R,R.return,ye)}}}else if(i.tag===6){if(o===null){R=i;try{R.stateNode.nodeValue=p?"":R.memoizedProps}catch(ye){it(R,R.return,ye)}}}else if(i.tag===18){if(o===null){R=i;try{var X=R.stateNode;p?rv(X,!0):rv(R.stateNode,!1)}catch(ye){it(R,R.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}d&4&&(d=r.updateQueue,d!==null&&(o=d.retryQueue,o!==null&&(d.retryQueue=null,Qc(r,o))));break;case 19:On(i,r),Mn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Qc(r,d)));break;case 30:break;case 21:break;default:On(i,r),Mn(r)}}function Mn(r){var i=r.flags;if(i&2){try{for(var o,d=r.return;d!==null;){if(i0(d)){o=d;break}d=d.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,y=mh(r);Xc(r,y,p);break;case 5:var k=o.stateNode;o.flags&32&&(Qi(k,""),o.flags&=-33);var N=mh(r);Xc(r,N,k);break;case 3:case 4:var R=o.stateNode.containerInfo,q=mh(r);ph(r,q,R);break;default:throw Error(a(161))}}catch(Q){it(r,r.return,Q)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function m0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;m0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function na(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)l0(r,i.alternate,i),i=i.sibling}function _i(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Na(4,i,i.return),_i(i);break;case 1:Er(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&r0(i,i.return,o),_i(i);break;case 27:al(i.stateNode);case 26:case 5:Er(i,i.return),_i(i);break;case 22:i.memoizedState===null&&_i(i);break;case 30:_i(i);break;default:_i(i)}r=r.sibling}}function ra(r,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,y=i,k=y.flags;switch(y.tag){case 0:case 11:case 15:ra(p,y,o),Yo(4,y);break;case 1:if(ra(p,y,o),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(q){it(d,d.return,q)}if(d=y,p=d.updateQueue,p!==null){var N=d.stateNode;try{var R=p.shared.hiddenCallbacks;if(R!==null)for(p.shared.hiddenCallbacks=null,p=0;p<R.length;p++)Fy(R[p],N)}catch(q){it(d,d.return,q)}}o&&k&64&&n0(y),Jo(y,y.return);break;case 27:s0(y);case 26:case 5:ra(p,y,o),o&&d===null&&k&4&&a0(y),Jo(y,y.return);break;case 12:ra(p,y,o);break;case 31:ra(p,y,o),o&&k&4&&d0(p,y);break;case 13:ra(p,y,o),o&&k&4&&f0(p,y);break;case 22:y.memoizedState===null&&ra(p,y,o),Jo(y,y.return);break;case 30:break;default:ra(p,y,o)}i=i.sibling}}function xh(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&&Do(o))}function yh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Do(r))}function kr(r,i,o,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)p0(r,i,o,d),i=i.sibling}function p0(r,i,o,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:kr(r,i,o,d),p&2048&&Yo(9,i);break;case 1:kr(r,i,o,d);break;case 3:kr(r,i,o,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Do(r)));break;case 12:if(p&2048){kr(r,i,o,d),r=i.stateNode;try{var y=i.memoizedProps,k=y.id,N=y.onPostCommit;typeof N=="function"&&N(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){it(i,i.return,R)}}else kr(r,i,o,d);break;case 31:kr(r,i,o,d);break;case 13:kr(r,i,o,d);break;case 23:break;case 22:y=i.stateNode,k=i.alternate,i.memoizedState!==null?y._visibility&2?kr(r,i,o,d):Ko(r,i):y._visibility&2?kr(r,i,o,d):(y._visibility|=2,ys(r,i,o,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&xh(k,i);break;case 24:kr(r,i,o,d),p&2048&&yh(i.alternate,i);break;default:kr(r,i,o,d)}}function ys(r,i,o,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,k=i,N=o,R=d,q=k.flags;switch(k.tag){case 0:case 11:case 15:ys(y,k,N,R,p),Yo(8,k);break;case 23:break;case 22:var Q=k.stateNode;k.memoizedState!==null?Q._visibility&2?ys(y,k,N,R,p):Ko(y,k):(Q._visibility|=2,ys(y,k,N,R,p)),p&&q&2048&&xh(k.alternate,k);break;case 24:ys(y,k,N,R,p),p&&q&2048&&yh(k.alternate,k);break;default:ys(y,k,N,R,p)}i=i.sibling}}function Ko(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=r,d=i,p=d.flags;switch(d.tag){case 22:Ko(o,d),p&2048&&xh(d.alternate,d);break;case 24:Ko(o,d),p&2048&&yh(d.alternate,d);break;default:Ko(o,d)}i=i.sibling}}var Xo=8192;function bs(r,i,o){if(r.subtreeFlags&Xo)for(r=r.child;r!==null;)g0(r,i,o),r=r.sibling}function g0(r,i,o){switch(r.tag){case 26:bs(r,i,o),r.flags&Xo&&r.memoizedState!==null&&FC(o,vr,r.memoizedState,r.memoizedProps);break;case 5:bs(r,i,o);break;case 3:case 4:var d=vr;vr=fu(r.stateNode.containerInfo),bs(r,i,o),vr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Xo,Xo=16777216,bs(r,i,o),Xo=d):bs(r,i,o));break;default:bs(r,i,o)}}function x0(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 Qo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var d=i[o];an=d,b0(d,r)}x0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)y0(r),r=r.sibling}function y0(r){switch(r.tag){case 0:case 11:case 15:Qo(r),r.flags&2048&&Na(9,r,r.return);break;case 3:Qo(r);break;case 12:Qo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Wc(r)):Qo(r);break;default:Qo(r)}}function Wc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var d=i[o];an=d,b0(d,r)}x0(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Na(8,i,i.return),Wc(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,Wc(i));break;default:Wc(i)}r=r.sibling}}function b0(r,i){for(;an!==null;){var o=an;switch(o.tag){case 0:case 11:case 15:Na(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var d=o.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Do(o.memoizedState.cache)}if(d=o.child,d!==null)d.return=o,an=d;else e:for(o=r;an!==null;){d=an;var p=d.sibling,y=d.return;if(c0(d),d===o){an=null;break e}if(p!==null){p.return=y,an=p;break e}an=y}}}var sC={getCacheForType:function(r){var i=ln(Pt),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return ln(Pt).controller.signal}},oC=typeof WeakMap=="function"?WeakMap:Map,et=0,ht=null,Ve=null,Ze=0,at=0,Gn=null,Ca=!1,vs=!1,bh=!1,aa=0,Mt=0,Ta=0,Ni=0,vh=0,Yn=0,ks=0,Wo=null,Rn=null,kh=!1,eu=0,v0=0,tu=1/0,nu=null,Ea=null,Kt=0,Aa=null,ws=null,ia=0,wh=0,Sh=null,k0=null,el=0,zh=null;function Jn(){return(et&2)!==0&&Ze!==0?Ze&-Ze:B.T!==null?Eh():Lx()}function w0(){if(Yn===0)if((Ze&536870912)===0||qe){var r=uc;uc<<=1,(uc&3932160)===0&&(uc=262144),Yn=r}else Yn=536870912;return r=Fn.current,r!==null&&(r.flags|=32),Yn}function Dn(r,i,o){(r===ht&&(at===2||at===9)||r.cancelPendingCommit!==null)&&(Ss(r,0),Oa(r,Ze,Yn,!1)),ko(r,o),((et&2)===0||r!==ht)&&(r===ht&&((et&2)===0&&(Ni|=o),Mt===4&&Oa(r,Ze,Yn,!1)),Ar(r))}function S0(r,i,o){if((et&6)!==0)throw Error(a(327));var d=!o&&(i&127)===0&&(i&r.expiredLanes)===0||vo(r,i),p=d?uC(r,i):_h(r,i,!0),y=d;do{if(p===0){vs&&!d&&Oa(r,i,0,!1);break}else{if(o=r.current.alternate,y&&!lC(o)){p=_h(r,i,!1),y=!1;continue}if(p===2){if(y=i,r.errorRecoveryDisabledLanes&y)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var N=r;p=Wo;var R=N.current.memoizedState.isDehydrated;if(R&&(Ss(N,k).flags|=256),k=_h(N,k,!1),k!==2){if(bh&&!R){N.errorRecoveryDisabledLanes|=y,Ni|=y,p=4;break e}y=Rn,Rn=p,y!==null&&(Rn===null?Rn=y:Rn.push.apply(Rn,y))}p=k}if(y=!1,p!==2)continue}}if(p===1){Ss(r,0),Oa(r,i,0,!0);break}e:{switch(d=r,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Oa(d,i,Yn,!Ca);break e;case 2:Rn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=eu+300-yt(),10<p)){if(Oa(d,i,Yn,!Ca),fc(d,0,!0)!==0)break e;ia=i,d.timeoutHandle=ev(z0.bind(null,d,o,Rn,nu,kh,i,Yn,Ni,ks,Ca,y,"Throttled",-0,0),p);break e}z0(d,o,Rn,nu,kh,i,Yn,Ni,ks,Ca,y,null,-0,0)}}break}while(!0);Ar(r)}function z0(r,i,o,d,p,y,k,N,R,q,Q,re,Y,X){if(r.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hr},g0(i,y,re);var ye=(y&62914560)===y?eu-yt():(y&4194048)===y?v0-yt():0;if(ye=qC(re,ye),ye!==null){ia=y,r.cancelPendingCommit=ye(O0.bind(null,r,i,y,o,d,p,k,N,R,Q,re,null,Y,X)),Oa(r,y,k,!q);return}}O0(r,i,y,o,d,p,k,N,R)}function lC(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 d=0;d<o.length;d++){var p=o[d],y=p.getSnapshot;p=p.value;try{if(!Zn(y(),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 Oa(r,i,o,d){i&=~vh,i&=~Ni,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var y=31-ft(p),k=1<<y;d[y]=-1,p&=~k}o!==0&&Rx(r,o,i)}function ru(){return(et&6)===0?(tl(0),!1):!0}function jh(){if(Ve!==null){if(at===0)var r=Ve.return;else r=Ve,Yr=yi=null,Bf(r),hs=null,Lo=0,r=Ve;for(;r!==null;)t0(r.alternate,r),r=r.return;Ve=null}}function Ss(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,CC(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),ia=0,jh(),ht=r,Ve=o=qr(r.current,null),Ze=i,at=0,Gn=null,Ca=!1,vs=vo(r,i),bh=!1,ks=Yn=vh=Ni=Ta=Mt=0,Rn=Wo=null,kh=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-ft(d),y=1<<p;i|=r[p],d&=~y}return aa=i,zc(),o}function j0(r,i){Me=null,B.H=Fo,i===fs||i===Oc?(i=By(),at=3):i===Tf?(i=By(),at=4):at=i===rh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Gn=i,Ve===null&&(Mt=1,qc(r,rr(i,r.current)))}function _0(){var r=Fn.current;return r===null?!0:(Ze&4194048)===Ze?or===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?r===or:!1}function N0(){var r=B.H;return B.H=Fo,r===null?Fo:r}function C0(){var r=B.A;return B.A=sC,r}function au(){Mt=4,Ca||(Ze&4194048)!==Ze&&Fn.current!==null||(vs=!0),(Ta&134217727)===0&&(Ni&134217727)===0||ht===null||Oa(ht,Ze,Yn,!1)}function _h(r,i,o){var d=et;et|=2;var p=N0(),y=C0();(ht!==r||Ze!==i)&&(nu=null,Ss(r,i)),i=!1;var k=Mt;e:do try{if(at!==0&&Ve!==null){var N=Ve,R=Gn;switch(at){case 8:jh(),k=6;break e;case 3:case 2:case 9:case 6:Fn.current===null&&(i=!0);var q=at;if(at=0,Gn=null,zs(r,N,R,q),o&&vs){k=0;break e}break;default:q=at,at=0,Gn=null,zs(r,N,R,q)}}cC(),k=Mt;break}catch(Q){j0(r,Q)}while(!0);return i&&r.shellSuspendCounter++,Yr=yi=null,et=d,B.H=p,B.A=y,Ve===null&&(ht=null,Ze=0,zc()),k}function cC(){for(;Ve!==null;)T0(Ve)}function uC(r,i){var o=et;et|=2;var d=N0(),p=C0();ht!==r||Ze!==i?(nu=null,tu=yt()+500,Ss(r,i)):vs=vo(r,i);e:do try{if(at!==0&&Ve!==null){i=Ve;var y=Gn;t:switch(at){case 1:at=0,Gn=null,zs(r,i,y,1);break;case 2:case 9:if(Uy(y)){at=0,Gn=null,E0(i);break}i=function(){at!==2&&at!==9||ht!==r||(at=7),Ar(r)},y.then(i,i);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:Uy(y)?(at=0,Gn=null,E0(i)):(at=0,Gn=null,zs(r,i,y,7));break;case 5:var k=null;switch(Ve.tag){case 26:k=Ve.memoizedState;case 5:case 27:var N=Ve;if(k?pv(k):N.stateNode.complete){at=0,Gn=null;var R=N.sibling;if(R!==null)Ve=R;else{var q=N.return;q!==null?(Ve=q,iu(q)):Ve=null}break t}}at=0,Gn=null,zs(r,i,y,5);break;case 6:at=0,Gn=null,zs(r,i,y,6);break;case 8:jh(),Mt=6;break e;default:throw Error(a(462))}}dC();break}catch(Q){j0(r,Q)}while(!0);return Yr=yi=null,B.H=d,B.A=p,et=o,Ve!==null?0:(ht=null,Ze=0,zc(),Mt)}function dC(){for(;Ve!==null&&!Dt();)T0(Ve)}function T0(r){var i=Wb(r.alternate,r,aa);r.memoizedProps=r.pendingProps,i===null?iu(r):Ve=i}function E0(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=Gb(o,i,i.pendingProps,i.type,void 0,Ze);break;case 11:i=Gb(o,i,i.pendingProps,i.type.render,i.ref,Ze);break;case 5:Bf(i);default:t0(o,i),i=Ve=Cy(i,aa),i=Wb(o,i,aa)}r.memoizedProps=r.pendingProps,i===null?iu(r):Ve=i}function zs(r,i,o,d){Yr=yi=null,Bf(i),hs=null,Lo=0;var p=i.return;try{if(WN(r,p,i,o,Ze)){Mt=1,qc(r,rr(o,r.current)),Ve=null;return}}catch(y){if(p!==null)throw Ve=p,y;Mt=1,qc(r,rr(o,r.current)),Ve=null;return}i.flags&32768?(qe||d===1?r=!0:vs||(Ze&536870912)!==0?r=!1:(Ca=r=!0,(d===2||d===9||d===3||d===6)&&(d=Fn.current,d!==null&&d.tag===13&&(d.flags|=16384))),A0(i,r)):iu(i)}function iu(r){var i=r;do{if((i.flags&32768)!==0){A0(i,Ca);return}r=i.return;var o=nC(i.alternate,i,aa);if(o!==null){Ve=o;return}if(i=i.sibling,i!==null){Ve=i;return}Ve=i=r}while(i!==null);Mt===0&&(Mt=5)}function A0(r,i){do{var o=rC(r.alternate,r);if(o!==null){o.flags&=32767,Ve=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Ve=r;return}Ve=r=o}while(r!==null);Mt=6,Ve=null}function O0(r,i,o,d,p,y,k,N,R){r.cancelPendingCommit=null;do su();while(Kt!==0);if((et&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=mf,H2(r,o,y,k,N,R),r===ht&&(Ve=ht=null,Ze=0),ws=i,Aa=r,ia=o,wh=y,Sh=p,k0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,pC(we,function(){return L0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=B.T,B.T=null,p=V.p,V.p=2,k=et,et|=4;try{aC(r,i,o)}finally{et=k,V.p=p,B.T=d}}Kt=1,M0(),R0(),D0()}}function M0(){if(Kt===1){Kt=0;var r=Aa,i=ws,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=B.T,B.T=null;var d=V.p;V.p=2;var p=et;et|=4;try{h0(i,r);var y=Ph,k=by(r.containerInfo),N=y.focusedElem,R=y.selectionRange;if(k!==N&&N&&N.ownerDocument&&yy(N.ownerDocument.documentElement,N)){if(R!==null&&cf(N)){var q=R.start,Q=R.end;if(Q===void 0&&(Q=q),"selectionStart"in N)N.selectionStart=q,N.selectionEnd=Math.min(Q,N.value.length);else{var re=N.ownerDocument||document,Y=re&&re.defaultView||window;if(Y.getSelection){var X=Y.getSelection(),ye=N.textContent.length,_e=Math.min(R.start,ye),ut=R.end===void 0?_e:Math.min(R.end,ye);!X.extend&&_e>ut&&(k=ut,ut=_e,_e=k);var I=xy(N,_e),P=xy(N,ut);if(I&&P&&(X.rangeCount!==1||X.anchorNode!==I.node||X.anchorOffset!==I.offset||X.focusNode!==P.node||X.focusOffset!==P.offset)){var F=re.createRange();F.setStart(I.node,I.offset),X.removeAllRanges(),_e>ut?(X.addRange(F),X.extend(P.node,P.offset)):(F.setEnd(P.node,P.offset),X.addRange(F))}}}}for(re=[],X=N;X=X.parentNode;)X.nodeType===1&&re.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<re.length;N++){var te=re[N];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}yu=!!Lh,Ph=Lh=null}finally{et=p,V.p=d,B.T=o}}r.current=i,Kt=2}}function R0(){if(Kt===2){Kt=0;var r=Aa,i=ws,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=B.T,B.T=null;var d=V.p;V.p=2;var p=et;et|=4;try{l0(r,i.alternate,i)}finally{et=p,V.p=d,B.T=o}}Kt=3}}function D0(){if(Kt===4||Kt===3){Kt=0,Yt();var r=Aa,i=ws,o=ia,d=k0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,ws=Aa=null,$0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ea=null),Zd(o),i=i.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(vn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=B.T,p=V.p,V.p=2,B.T=null;try{for(var y=r.onRecoverableError,k=0;k<d.length;k++){var N=d[k];y(N.value,{componentStack:N.stack})}}finally{B.T=i,V.p=p}}(ia&3)!==0&&su(),Ar(r),p=r.pendingLanes,(o&261930)!==0&&(p&42)!==0?r===zh?el++:(el=0,zh=r):el=0,tl(0)}}function $0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Do(i)))}function su(){return M0(),R0(),D0(),L0()}function L0(){if(Kt!==5)return!1;var r=Aa,i=wh;wh=0;var o=Zd(ia),d=B.T,p=V.p;try{V.p=32>o?32:o,B.T=null,o=Sh,Sh=null;var y=Aa,k=ia;if(Kt=0,ws=Aa=null,ia=0,(et&6)!==0)throw Error(a(331));var N=et;if(et|=4,y0(y.current),p0(y,y.current,k,o),et=N,tl(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(vn,y)}catch{}return!0}finally{V.p=p,B.T=d,$0(r,i)}}function P0(r,i,o){i=rr(o,i),i=nh(r.stateNode,i,2),r=za(r,i,2),r!==null&&(ko(r,2),Ar(r))}function it(r,i,o){if(r.tag===3)P0(r,r,o);else for(;i!==null;){if(i.tag===3){P0(i,r,o);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ea===null||!Ea.has(d))){r=rr(o,r),o=Ub(2),d=za(i,o,2),d!==null&&(Vb(o,d,i,r),ko(d,2),Ar(d));break}}i=i.return}}function Nh(r,i,o){var d=r.pingCache;if(d===null){d=r.pingCache=new oC;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(o)||(bh=!0,p.add(o),r=fC.bind(null,r,i,o),i.then(r,r))}function fC(r,i,o){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,ht===r&&(Ze&o)===o&&(Mt===4||Mt===3&&(Ze&62914560)===Ze&&300>yt()-eu?(et&2)===0&&Ss(r,0):vh|=o,ks===Ze&&(ks=0)),Ar(r)}function U0(r,i){i===0&&(i=Mx()),r=pi(r,i),r!==null&&(ko(r,i),Ar(r))}function hC(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),U0(r,o)}function mC(r,i){var o=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(o=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),U0(r,o)}function pC(r,i){return nn(r,i)}var ou=null,js=null,Ch=!1,lu=!1,Th=!1,Ma=0;function Ar(r){r!==js&&r.next===null&&(js===null?ou=js=r:js=js.next=r),lu=!0,Ch||(Ch=!0,xC())}function tl(r,i){if(!Th&&lu){Th=!0;do for(var o=!1,d=ou;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var k=d.suspendedLanes,N=d.pingedLanes;y=(1<<31-ft(42|r)+1)-1,y&=p&~(k&~N),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,Z0(d,y))}else y=Ze,y=fc(d,d===ht?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||vo(d,y)||(o=!0,Z0(d,y));d=d.next}while(o);Th=!1}}function gC(){V0()}function V0(){lu=Ch=!1;var r=0;Ma!==0&&NC()&&(r=Ma);for(var i=yt(),o=null,d=ou;d!==null;){var p=d.next,y=B0(d,i);y===0?(d.next=null,o===null?ou=p:o.next=p,p===null&&(js=o)):(o=d,(r!==0||(y&3)!==0)&&(lu=!0)),d=p}Kt!==0&&Kt!==5||tl(r),Ma!==0&&(Ma=0)}function B0(r,i){for(var o=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var k=31-ft(y),N=1<<k,R=p[k];R===-1?((N&o)===0||(N&d)!==0)&&(p[k]=Z2(N,i)):R<=i&&(r.expiredLanes|=N),y&=~N}if(i=ht,o=Ze,o=fc(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,o===0||r===i&&(at===2||at===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Wn(d),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||vo(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(d!==null&&Wn(d),Zd(o)){case 2:case 8:o=fe;break;case 32:o=we;break;case 268435456:o=Je;break;default:o=we}return d=I0.bind(null,r),o=nn(o,d),r.callbackPriority=i,r.callbackNode=o,i}return d!==null&&d!==null&&Wn(d),r.callbackPriority=2,r.callbackNode=null,2}function I0(r,i){if(Kt!==0&&Kt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(su()&&r.callbackNode!==o)return null;var d=Ze;return d=fc(r,r===ht?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(S0(r,d,i),B0(r,yt()),r.callbackNode!=null&&r.callbackNode===o?I0.bind(null,r):null)}function Z0(r,i){if(su())return null;S0(r,i,!0)}function xC(){TC(function(){(et&6)!==0?nn(W,gC):V0()})}function Eh(){if(Ma===0){var r=us;r===0&&(r=cc,cc<<=1,(cc&261888)===0&&(cc=256)),Ma=r}return Ma}function H0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:gc(""+r)}function F0(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 yC(r,i,o,d,p){if(i==="submit"&&o&&o.stateNode===p){var y=H0((p[Tn]||null).action),k=d.submitter;k&&(i=(i=k[Tn]||null)?H0(i.formAction):k.getAttribute("formAction"),i!==null&&(y=i,k=null));var N=new vc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ma!==0){var R=k?F0(p,k):new FormData(p);Kf(o,{pending:!0,data:R,method:p.method,action:y},null,R)}}else typeof y=="function"&&(N.preventDefault(),R=k?F0(p,k):new FormData(p),Kf(o,{pending:!0,data:R,method:p.method,action:y},y,R))},currentTarget:p}]})}}for(var Ah=0;Ah<hf.length;Ah++){var Oh=hf[Ah],bC=Oh.toLowerCase(),vC=Oh[0].toUpperCase()+Oh.slice(1);br(bC,"on"+vC)}br(wy,"onAnimationEnd"),br(Sy,"onAnimationIteration"),br(zy,"onAnimationStart"),br("dblclick","onDoubleClick"),br("focusin","onFocus"),br("focusout","onBlur"),br($N,"onTransitionRun"),br(LN,"onTransitionStart"),br(PN,"onTransitionCancel"),br(jy,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),di("onBeforeInput",["compositionend","keypress","textInput","paste"]),di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nl="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(" "),kC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nl));function q0(r,i){i=(i&4)!==0;for(var o=0;o<r.length;o++){var d=r[o],p=d.event;d=d.listeners;e:{var y=void 0;if(i)for(var k=d.length-1;0<=k;k--){var N=d[k],R=N.instance,q=N.currentTarget;if(N=N.listener,R!==y&&p.isPropagationStopped())break e;y=N,p.currentTarget=q;try{y(p)}catch(Q){Sc(Q)}p.currentTarget=null,y=R}else for(k=0;k<d.length;k++){if(N=d[k],R=N.instance,q=N.currentTarget,N=N.listener,R!==y&&p.isPropagationStopped())break e;y=N,p.currentTarget=q;try{y(p)}catch(Q){Sc(Q)}p.currentTarget=null,y=R}}}}function Be(r,i){var o=i[Hd];o===void 0&&(o=i[Hd]=new Set);var d=r+"__bubble";o.has(d)||(G0(i,r,2,!1),o.add(d))}function Mh(r,i,o){var d=0;i&&(d|=4),G0(o,r,d,i)}var cu="_reactListening"+Math.random().toString(36).slice(2);function Rh(r){if(!r[cu]){r[cu]=!0,Vx.forEach(function(o){o!=="selectionchange"&&(kC.has(o)||Mh(o,!1,r),Mh(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[cu]||(i[cu]=!0,Mh("selectionchange",!1,i))}}function G0(r,i,o,d){switch(wv(i)){case 2:var p=JC;break;case 8:p=KC;break;default:p=Jh}o=p.bind(null,i,o,r),p=void 0,!Wd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?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 Dh(r,i,o,d,p){var y=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var k=d.tag;if(k===3||k===4){var N=d.stateNode.containerInfo;if(N===p)break;if(k===4)for(k=d.return;k!==null;){var R=k.tag;if((R===3||R===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;N!==null;){if(k=Gi(N),k===null)return;if(R=k.tag,R===5||R===6||R===26||R===27){d=y=k;continue e}N=N.parentNode}}d=d.return}Qx(function(){var q=y,Q=Xd(o),re=[];e:{var Y=_y.get(r);if(Y!==void 0){var X=vc,ye=r;switch(r){case"keypress":if(yc(o)===0)break e;case"keydown":case"keyup":X=mN;break;case"focusin":ye="focus",X=rf;break;case"focusout":ye="blur",X=rf;break;case"beforeblur":case"afterblur":X=rf;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=ty;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=nN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=xN;break;case wy:case Sy:case zy:X=iN;break;case jy:X=bN;break;case"scroll":case"scrollend":X=eN;break;case"wheel":X=kN;break;case"copy":case"cut":case"paste":X=oN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=ry;break;case"toggle":case"beforetoggle":X=SN}var _e=(i&4)!==0,ut=!_e&&(r==="scroll"||r==="scrollend"),I=_e?Y!==null?Y+"Capture":null:Y;_e=[];for(var P=q,F;P!==null;){var te=P;if(F=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||F===null||I===null||(te=zo(P,I),te!=null&&_e.push(rl(P,te,F))),ut)break;P=P.return}0<_e.length&&(Y=new X(Y,ye,null,o,Q),re.push({event:Y,listeners:_e}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",X=r==="mouseout"||r==="pointerout",Y&&o!==Kd&&(ye=o.relatedTarget||o.fromElement)&&(Gi(ye)||ye[qi]))break e;if((X||Y)&&(Y=Q.window===Q?Q:(Y=Q.ownerDocument)?Y.defaultView||Y.parentWindow:window,X?(ye=o.relatedTarget||o.toElement,X=q,ye=ye?Gi(ye):null,ye!==null&&(ut=c(ye),_e=ye.tag,ye!==ut||_e!==5&&_e!==27&&_e!==6)&&(ye=null)):(X=null,ye=q),X!==ye)){if(_e=ty,te="onMouseLeave",I="onMouseEnter",P="mouse",(r==="pointerout"||r==="pointerover")&&(_e=ry,te="onPointerLeave",I="onPointerEnter",P="pointer"),ut=X==null?Y:So(X),F=ye==null?Y:So(ye),Y=new _e(te,P+"leave",X,o,Q),Y.target=ut,Y.relatedTarget=F,te=null,Gi(Q)===q&&(_e=new _e(I,P+"enter",ye,o,Q),_e.target=F,_e.relatedTarget=ut,te=_e),ut=te,X&&ye)t:{for(_e=wC,I=X,P=ye,F=0,te=I;te;te=_e(te))F++;te=0;for(var je=P;je;je=_e(je))te++;for(;0<F-te;)I=_e(I),F--;for(;0<te-F;)P=_e(P),te--;for(;F--;){if(I===P||P!==null&&I===P.alternate){_e=I;break t}I=_e(I),P=_e(P)}_e=null}else _e=null;X!==null&&Y0(re,Y,X,_e,!1),ye!==null&&ut!==null&&Y0(re,ut,ye,_e,!0)}}e:{if(Y=q?So(q):window,X=Y.nodeName&&Y.nodeName.toLowerCase(),X==="select"||X==="input"&&Y.type==="file")var Xe=dy;else if(cy(Y))if(fy)Xe=MN;else{Xe=AN;var Se=EN}else X=Y.nodeName,!X||X.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?q&&Jd(q.elementType)&&(Xe=dy):Xe=ON;if(Xe&&(Xe=Xe(r,q))){uy(re,Xe,o,Q);break e}Se&&Se(r,Y,q),r==="focusout"&&q&&Y.type==="number"&&q.memoizedProps.value!=null&&Yd(Y,"number",Y.value)}switch(Se=q?So(q):window,r){case"focusin":(cy(Se)||Se.contentEditable==="true")&&(ns=Se,uf=q,Oo=null);break;case"focusout":Oo=uf=ns=null;break;case"mousedown":df=!0;break;case"contextmenu":case"mouseup":case"dragend":df=!1,vy(re,o,Q);break;case"selectionchange":if(DN)break;case"keydown":case"keyup":vy(re,o,Q)}var Re;if(sf)e:{switch(r){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else ts?oy(r,o)&&(He="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(He="onCompositionStart");He&&(ay&&o.locale!=="ko"&&(ts||He!=="onCompositionStart"?He==="onCompositionEnd"&&ts&&(Re=Wx()):(xa=Q,ef="value"in xa?xa.value:xa.textContent,ts=!0)),Se=uu(q,He),0<Se.length&&(He=new ny(He,r,null,o,Q),re.push({event:He,listeners:Se}),Re?He.data=Re:(Re=ly(o),Re!==null&&(He.data=Re)))),(Re=jN?_N(r,o):NN(r,o))&&(He=uu(q,"onBeforeInput"),0<He.length&&(Se=new ny("onBeforeInput","beforeinput",null,o,Q),re.push({event:Se,listeners:He}),Se.data=Re)),yC(re,r,q,o,Q)}q0(re,i)})}function rl(r,i,o){return{instance:r,listener:i,currentTarget:o}}function uu(r,i){for(var o=i+"Capture",d=[];r!==null;){var p=r,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=zo(r,o),p!=null&&d.unshift(rl(r,p,y)),p=zo(r,i),p!=null&&d.push(rl(r,p,y))),r.tag===3)return d;r=r.return}return[]}function wC(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Y0(r,i,o,d,p){for(var y=i._reactName,k=[];o!==null&&o!==d;){var N=o,R=N.alternate,q=N.stateNode;if(N=N.tag,R!==null&&R===d)break;N!==5&&N!==26&&N!==27||q===null||(R=q,p?(q=zo(o,y),q!=null&&k.unshift(rl(o,q,R))):p||(q=zo(o,y),q!=null&&k.push(rl(o,q,R)))),o=o.return}k.length!==0&&r.push({event:i,listeners:k})}var SC=/\r\n?/g,zC=/\u0000|\uFFFD/g;function J0(r){return(typeof r=="string"?r:""+r).replace(SC,`
|
|
9
|
-
`).replace(zC,"")}function K0(r,i){return i=J0(i),J0(r)===i}function ct(r,i,o,d,p,y){switch(o){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Qi(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Qi(r,""+d);break;case"className":mc(r,"class",d);break;case"tabIndex":mc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":mc(r,o,d);break;case"style":Kx(r,d,y);break;case"data":if(i!=="object"){mc(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||o!=="href")){r.removeAttribute(o);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(o);break}d=gc(""+d),r.setAttribute(o,d);break;case"action":case"formAction":if(typeof d=="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 y=="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(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(o);break}d=gc(""+d),r.setAttribute(o,d);break;case"onClick":d!=null&&(r.onclick=Hr);break;case"onScroll":d!=null&&Be("scroll",r);break;case"onScrollEnd":d!=null&&Be("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}o=gc(""+d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(o,""+d):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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(o,""):r.removeAttribute(o);break;case"capture":case"download":d===!0?r.setAttribute(o,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(o,d):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(o,d):r.removeAttribute(o);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(o):r.setAttribute(o,d);break;case"popover":Be("beforetoggle",r),Be("toggle",r),hc(r,"popover",d);break;case"xlinkActuate":Zr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Zr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Zr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Zr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Zr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Zr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Zr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Zr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Zr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":hc(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Q2.get(o)||o,hc(r,o,d))}}function $h(r,i,o,d,p,y){switch(o){case"style":Kx(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"children":typeof d=="string"?Qi(r,d):(typeof d=="number"||typeof d=="bigint")&&Qi(r,""+d);break;case"onScroll":d!=null&&Be("scroll",r);break;case"onScrollEnd":d!=null&&Be("scrollend",r);break;case"onClick":d!=null&&(r.onclick=Hr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bx.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),i=o.slice(2,p?o.length-7:void 0),y=r[Tn]||null,y=y!=null?y[o]:null,typeof y=="function"&&r.removeEventListener(i,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(i,d,p);break e}o in r?r[o]=d:d===!0?r.setAttribute(o,""):hc(r,o,d)}}}function un(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",r),Be("load",r);var d=!1,p=!1,y;for(y in o)if(o.hasOwnProperty(y)){var k=o[y];if(k!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ct(r,i,y,k,o,null)}}p&&ct(r,i,"srcSet",o.srcSet,o,null),d&&ct(r,i,"src",o.src,o,null);return;case"input":Be("invalid",r);var N=y=k=p=null,R=null,q=null;for(d in o)if(o.hasOwnProperty(d)){var Q=o[d];if(Q!=null)switch(d){case"name":p=Q;break;case"type":k=Q;break;case"checked":R=Q;break;case"defaultChecked":q=Q;break;case"value":y=Q;break;case"defaultValue":N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:ct(r,i,d,Q,o,null)}}qx(r,y,N,R,q,k,p,!1);return;case"select":Be("invalid",r),d=k=y=null;for(p in o)if(o.hasOwnProperty(p)&&(N=o[p],N!=null))switch(p){case"value":y=N;break;case"defaultValue":k=N;break;case"multiple":d=N;default:ct(r,i,p,N,o,null)}i=y,o=k,r.multiple=!!d,i!=null?Xi(r,!!d,i,!1):o!=null&&Xi(r,!!d,o,!0);return;case"textarea":Be("invalid",r),y=p=d=null;for(k in o)if(o.hasOwnProperty(k)&&(N=o[k],N!=null))switch(k){case"value":d=N;break;case"defaultValue":p=N;break;case"children":y=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:ct(r,i,k,N,o,null)}Yx(r,d,p,y);return;case"option":for(R in o)o.hasOwnProperty(R)&&(d=o[R],d!=null)&&(R==="selected"?r.selected=d&&typeof d!="function"&&typeof d!="symbol":ct(r,i,R,d,o,null));return;case"dialog":Be("beforetoggle",r),Be("toggle",r),Be("cancel",r),Be("close",r);break;case"iframe":case"object":Be("load",r);break;case"video":case"audio":for(d=0;d<nl.length;d++)Be(nl[d],r);break;case"image":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"embed":case"source":case"link":Be("error",r),Be("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(q in o)if(o.hasOwnProperty(q)&&(d=o[q],d!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ct(r,i,q,d,o,null)}return;default:if(Jd(i)){for(Q in o)o.hasOwnProperty(Q)&&(d=o[Q],d!==void 0&&$h(r,i,Q,d,o,void 0));return}}for(N in o)o.hasOwnProperty(N)&&(d=o[N],d!=null&&ct(r,i,N,d,o,null))}function jC(r,i,o,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,k=null,N=null,R=null,q=null,Q=null;for(X in o){var re=o[X];if(o.hasOwnProperty(X)&&re!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":R=re;default:d.hasOwnProperty(X)||ct(r,i,X,null,d,re)}}for(var Y in d){var X=d[Y];if(re=o[Y],d.hasOwnProperty(Y)&&(X!=null||re!=null))switch(Y){case"type":y=X;break;case"name":p=X;break;case"checked":q=X;break;case"defaultChecked":Q=X;break;case"value":k=X;break;case"defaultValue":N=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:X!==re&&ct(r,i,Y,X,d,re)}}Gd(r,k,N,R,q,Q,y,p);return;case"select":X=k=N=Y=null;for(y in o)if(R=o[y],o.hasOwnProperty(y)&&R!=null)switch(y){case"value":break;case"multiple":X=R;default:d.hasOwnProperty(y)||ct(r,i,y,null,d,R)}for(p in d)if(y=d[p],R=o[p],d.hasOwnProperty(p)&&(y!=null||R!=null))switch(p){case"value":Y=y;break;case"defaultValue":N=y;break;case"multiple":k=y;default:y!==R&&ct(r,i,p,y,d,R)}i=N,o=k,d=X,Y!=null?Xi(r,!!o,Y,!1):!!d!=!!o&&(i!=null?Xi(r,!!o,i,!0):Xi(r,!!o,o?[]:"",!1));return;case"textarea":X=Y=null;for(N in o)if(p=o[N],o.hasOwnProperty(N)&&p!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:ct(r,i,N,null,d,p)}for(k in d)if(p=d[k],y=o[k],d.hasOwnProperty(k)&&(p!=null||y!=null))switch(k){case"value":Y=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&ct(r,i,k,p,d,y)}Gx(r,Y,X);return;case"option":for(var ye in o)Y=o[ye],o.hasOwnProperty(ye)&&Y!=null&&!d.hasOwnProperty(ye)&&(ye==="selected"?r.selected=!1:ct(r,i,ye,null,d,Y));for(R in d)Y=d[R],X=o[R],d.hasOwnProperty(R)&&Y!==X&&(Y!=null||X!=null)&&(R==="selected"?r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol":ct(r,i,R,Y,d,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 _e in o)Y=o[_e],o.hasOwnProperty(_e)&&Y!=null&&!d.hasOwnProperty(_e)&&ct(r,i,_e,null,d,Y);for(q in d)if(Y=d[q],X=o[q],d.hasOwnProperty(q)&&Y!==X&&(Y!=null||X!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:ct(r,i,q,Y,d,X)}return;default:if(Jd(i)){for(var ut in o)Y=o[ut],o.hasOwnProperty(ut)&&Y!==void 0&&!d.hasOwnProperty(ut)&&$h(r,i,ut,void 0,d,Y);for(Q in d)Y=d[Q],X=o[Q],!d.hasOwnProperty(Q)||Y===X||Y===void 0&&X===void 0||$h(r,i,Q,Y,d,X);return}}for(var I in o)Y=o[I],o.hasOwnProperty(I)&&Y!=null&&!d.hasOwnProperty(I)&&ct(r,i,I,null,d,Y);for(re in d)Y=d[re],X=o[re],!d.hasOwnProperty(re)||Y===X||Y==null&&X==null||ct(r,i,re,Y,d,X)}function X0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _C(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,o=performance.getEntriesByType("resource"),d=0;d<o.length;d++){var p=o[d],y=p.transferSize,k=p.initiatorType,N=p.duration;if(y&&N&&X0(k)){for(k=0,N=p.responseEnd,d+=1;d<o.length;d++){var R=o[d],q=R.startTime;if(q>N)break;var Q=R.transferSize,re=R.initiatorType;Q&&X0(re)&&(R=R.responseEnd,k+=Q*(R<N?1:(N-q)/(R-q)))}if(--d,i+=8*(y+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 Lh=null,Ph=null;function du(r){return r.nodeType===9?r:r.ownerDocument}function Q0(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 W0(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 Uh(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 Vh=null;function NC(){var r=window.event;return r&&r.type==="popstate"?r===Vh?!1:(Vh=r,!0):(Vh=null,!1)}var ev=typeof setTimeout=="function"?setTimeout:void 0,CC=typeof clearTimeout=="function"?clearTimeout:void 0,tv=typeof Promise=="function"?Promise:void 0,TC=typeof queueMicrotask=="function"?queueMicrotask:typeof tv<"u"?function(r){return tv.resolve(null).then(r).catch(EC)}:ev;function EC(r){setTimeout(function(){throw r})}function Ra(r){return r==="head"}function nv(r,i){var o=i,d=0;do{var p=o.nextSibling;if(r.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(d===0){r.removeChild(p),Ts(i);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")al(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,al(o);for(var y=o.firstChild;y;){var k=y.nextSibling,N=y.nodeName;y[wo]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=k}}else o==="body"&&al(r.ownerDocument.body);o=p}while(o);Ts(i)}function rv(r,i){var o=r;r=0;do{var d=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||""),d&&d.nodeType===8)if(o=d.data,o==="/$"){if(r===0)break;r--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||r++;o=d}while(o)}function Bh(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":Bh(o),Fd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function AC(r,i,o,d){for(;r.nodeType===1;){var p=o;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[wo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==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(y=r.getAttribute("src"),(y!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=lr(r.nextSibling),r===null)break}return null}function OC(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 av(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 Ih(r){return r.data==="$?"||r.data==="$~"}function Zh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function MC(r,i){var o=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||o.readyState!=="loading")i();else{var d=function(){i(),o.removeEventListener("DOMContentLoaded",d)};o.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}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 Hh=null;function iv(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 sv(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 ov(r,i,o){switch(i=du(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 al(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Fd(r)}var cr=new Map,lv=new Set;function fu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var sa=V.d;V.d={f:RC,r:DC,D:$C,C:LC,L:PC,m:UC,X:BC,S:VC,M:IC};function RC(){var r=sa.f(),i=ru();return r||i}function DC(r){var i=Yi(r);i!==null&&i.tag===5&&i.type==="form"?jb(i):sa.r(r)}var _s=typeof document>"u"?null:document;function cv(r,i,o){var d=_s;if(d&&typeof i=="string"&&i){var p=tr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),lv.has(p)||(lv.add(p),r={rel:r,crossOrigin:o,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),un(i,"link",r),rn(i),d.head.appendChild(i)))}}function $C(r){sa.D(r),cv("dns-prefetch",r,null)}function LC(r,i){sa.C(r,i),cv("preconnect",r,i)}function PC(r,i,o){sa.L(r,i,o);var d=_s;if(d&&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 y=p;switch(i){case"style":y=Ns(r);break;case"script":y=Cs(r)}cr.has(y)||(r=x({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),cr.set(y,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(il(y))||i==="script"&&d.querySelector(sl(y))||(i=d.createElement("link"),un(i,"link",r),rn(i),d.head.appendChild(i)))}}function UC(r,i){sa.m(r,i);var o=_s;if(o&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+tr(d)+'"][href="'+tr(r)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Cs(r)}if(!cr.has(y)&&(r=x({rel:"modulepreload",href:r},i),cr.set(y,r),o.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(sl(y)))return}d=o.createElement("link"),un(d,"link",r),rn(d),o.head.appendChild(d)}}}function VC(r,i,o){sa.S(r,i,o);var d=_s;if(d&&r){var p=Ji(d).hoistableStyles,y=Ns(r);i=i||"default";var k=p.get(y);if(!k){var N={loading:0,preload:null};if(k=d.querySelector(il(y)))N.loading=5;else{r=x({rel:"stylesheet",href:r,"data-precedence":i},o),(o=cr.get(y))&&Fh(r,o);var R=k=d.createElement("link");rn(R),un(R,"link",r),R._p=new Promise(function(q,Q){R.onload=q,R.onerror=Q}),R.addEventListener("load",function(){N.loading|=1}),R.addEventListener("error",function(){N.loading|=2}),N.loading|=4,hu(k,i,d)}k={type:"stylesheet",instance:k,count:1,state:N},p.set(y,k)}}}function BC(r,i){sa.X(r,i);var o=_s;if(o&&r){var d=Ji(o).hoistableScripts,p=Cs(r),y=d.get(p);y||(y=o.querySelector(sl(p)),y||(r=x({src:r,async:!0},i),(i=cr.get(p))&&qh(r,i),y=o.createElement("script"),rn(y),un(y,"link",r),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function IC(r,i){sa.M(r,i);var o=_s;if(o&&r){var d=Ji(o).hoistableScripts,p=Cs(r),y=d.get(p);y||(y=o.querySelector(sl(p)),y||(r=x({src:r,async:!0,type:"module"},i),(i=cr.get(p))&&qh(r,i),y=o.createElement("script"),rn(y),un(y,"link",r),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function uv(r,i,o,d){var p=(p=pe.current)?fu(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=Ns(o.href),o=Ji(p).hoistableStyles,d=o.get(i),d||(d={type:"style",instance:null,count:0,state:null},o.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=Ns(o.href);var y=Ji(p).hoistableStyles,k=y.get(r);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,k),(y=p.querySelector(il(r)))&&!y._p&&(k.instance=y,k.state.loading=5),cr.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},cr.set(r,o),y||ZC(p,r,o,k.state))),i&&d===null)throw Error(a(528,""));return k}if(i&&d!==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=Cs(o),o=Ji(p).hoistableScripts,d=o.get(i),d||(d={type:"script",instance:null,count:0,state:null},o.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Ns(r){return'href="'+tr(r)+'"'}function il(r){return'link[rel="stylesheet"]['+r+"]"}function dv(r){return x({},r,{"data-precedence":r.precedence,precedence:null})}function ZC(r,i,o,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),un(i,"link",o),rn(i),r.head.appendChild(i))}function Cs(r){return'[src="'+tr(r)+'"]'}function sl(r){return"script[async]"+r}function fv(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+tr(o.href)+'"]');if(d)return i.instance=d,rn(d),d;var p=x({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),rn(d),un(d,"style",p),hu(d,o.precedence,r),i.instance=d;case"stylesheet":p=Ns(o.href);var y=r.querySelector(il(p));if(y)return i.state.loading|=4,i.instance=y,rn(y),y;d=dv(o),(p=cr.get(p))&&Fh(d,p),y=(r.ownerDocument||r).createElement("link"),rn(y);var k=y;return k._p=new Promise(function(N,R){k.onload=N,k.onerror=R}),un(y,"link",d),i.state.loading|=4,hu(y,o.precedence,r),i.instance=y;case"script":return y=Cs(o.src),(p=r.querySelector(sl(y)))?(i.instance=p,rn(p),p):(d=o,(p=cr.get(y))&&(d=x({},o),qh(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),rn(p),un(p,"link",d),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&&(d=i.instance,i.state.loading|=4,hu(d,o.precedence,r));return i.instance}function hu(r,i,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,k=0;k<d.length;k++){var N=d[k];if(N.dataset.precedence===i)y=N;else if(y!==p)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(r,i.firstChild))}function Fh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function qh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var mu=null;function hv(r,i,o){if(mu===null){var d=new Map,p=mu=new Map;p.set(o,d)}else p=mu,d=p.get(o),d||(d=new Map,p.set(o,d));if(d.has(r))return d;for(d.set(r,null),o=o.getElementsByTagName(r),p=0;p<o.length;p++){var y=o[p];if(!(y[wo]||y[sn]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(i)||"";k=r+k;var N=d.get(k);N?N.push(y):d.set(k,[y])}}return d}function mv(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function HC(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 pv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function FC(r,i,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Ns(d.href),y=i.querySelector(il(p));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=pu.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=y,rn(y);return}y=i.ownerDocument||i,d=dv(d),(p=cr.get(p))&&Fh(d,p),y=y.createElement("link"),rn(y);var k=y;k._p=new Promise(function(N,R){k.onload=N,k.onerror=R}),un(y,"link",d),o.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=pu.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var Gh=0;function qC(r,i){return r.stylesheets&&r.count===0&&xu(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var d=setTimeout(function(){if(r.stylesheets&&xu(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&Gh===0&&(Gh=62500*_C());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&xu(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>Gh?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var gu=null;function xu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,gu=new Map,i.forEach(GC,r),gu=null,pu.call(r))}function GC(r,i){if(!(i.state.loading&4)){var o=gu.get(r);if(o)var d=o.get(null);else{o=new Map,gu.set(r,o);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var k=p[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(o.set(k.dataset.precedence,k),d=k)}d&&o.set(null,d)}p=i.instance,k=p.getAttribute("data-precedence"),y=o.get(k)||d,y===d&&o.set(null,p),o.set(k,p),this.count++,d=pu.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var ol={$$typeof:C,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function YC(r,i,o,d,p,y,k,N,R){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=Bd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bd(0),this.hiddenUpdates=Bd(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function gv(r,i,o,d,p,y,k,N,R,q,Q,re){return r=new YC(r,i,o,k,R,q,Q,re,N),i=1,y===!0&&(i|=24),y=Hn(3,null,null,i),r.current=y,y.stateNode=r,i=_f(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:d,isDehydrated:o,cache:i},Ef(y),r}function xv(r){return r?(r=is,r):is}function yv(r,i,o,d,p,y){p=xv(p),d.context===null?d.context=p:d.pendingContext=p,d=Sa(i),d.payload={element:o},y=y===void 0?null:y,y!==null&&(d.callback=y),o=za(r,d,i),o!==null&&(Dn(o,r,i),Uo(o,r,i))}function bv(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function Yh(r,i){bv(r,i),(r=r.alternate)&&bv(r,i)}function vv(r){if(r.tag===13||r.tag===31){var i=pi(r,67108864);i!==null&&Dn(i,r,67108864),Yh(r,67108864)}}function kv(r){if(r.tag===13||r.tag===31){var i=Jn();i=Id(i);var o=pi(r,i);o!==null&&Dn(o,r,i),Yh(r,i)}}var yu=!0;function JC(r,i,o,d){var p=B.T;B.T=null;var y=V.p;try{V.p=2,Jh(r,i,o,d)}finally{V.p=y,B.T=p}}function KC(r,i,o,d){var p=B.T;B.T=null;var y=V.p;try{V.p=8,Jh(r,i,o,d)}finally{V.p=y,B.T=p}}function Jh(r,i,o,d){if(yu){var p=Kh(d);if(p===null)Dh(r,i,d,bu,o),Sv(r,d);else if(QC(p,r,i,o,d))d.stopPropagation();else if(Sv(r,d),i&4&&-1<XC.indexOf(r)){for(;p!==null;){var y=Yi(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=ui(y.pendingLanes);if(k!==0){var N=y;for(N.pendingLanes|=2,N.entangledLanes|=2;k;){var R=1<<31-ft(k);N.entanglements[1]|=R,k&=~R}Ar(y),(et&6)===0&&(tu=yt()+500,tl(0))}}break;case 31:case 13:N=pi(y,2),N!==null&&Dn(N,y,2),ru(),Yh(y,2)}if(y=Kh(d),y===null&&Dh(r,i,d,bu,o),y===p)break;p=y}p!==null&&d.stopPropagation()}else Dh(r,i,d,null,o)}}function Kh(r){return r=Xd(r),Xh(r)}var bu=null;function Xh(r){if(bu=null,r=Gi(r),r!==null){var i=c(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 bu=r,null}function wv(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fi()){case W:return 2;case fe:return 8;case we:case Ne:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Qh=!1,Da=null,$a=null,La=null,ll=new Map,cl=new Map,Pa=[],XC="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 Sv(r,i){switch(r){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":La=null;break;case"pointerover":case"pointerout":ll.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":cl.delete(i.pointerId)}}function ul(r,i,o,d,p,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:o,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},i!==null&&(i=Yi(i),i!==null&&vv(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function QC(r,i,o,d,p){switch(i){case"focusin":return Da=ul(Da,r,i,o,d,p),!0;case"dragenter":return $a=ul($a,r,i,o,d,p),!0;case"mouseover":return La=ul(La,r,i,o,d,p),!0;case"pointerover":var y=p.pointerId;return ll.set(y,ul(ll.get(y)||null,r,i,o,d,p)),!0;case"gotpointercapture":return y=p.pointerId,cl.set(y,ul(cl.get(y)||null,r,i,o,d,p)),!0}return!1}function zv(r){var i=Gi(r.target);if(i!==null){var o=c(i);if(o!==null){if(i=o.tag,i===13){if(i=l(o),i!==null){r.blockedOn=i,Px(r.priority,function(){kv(o)});return}}else if(i===31){if(i=f(o),i!==null){r.blockedOn=i,Px(r.priority,function(){kv(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 vu(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=Kh(r.nativeEvent);if(o===null){o=r.nativeEvent;var d=new o.constructor(o.type,o);Kd=d,o.target.dispatchEvent(d),Kd=null}else return i=Yi(o),i!==null&&vv(i),r.blockedOn=o,!1;i.shift()}return!0}function jv(r,i,o){vu(r)&&o.delete(i)}function WC(){Qh=!1,Da!==null&&vu(Da)&&(Da=null),$a!==null&&vu($a)&&($a=null),La!==null&&vu(La)&&(La=null),ll.forEach(jv),cl.forEach(jv)}function ku(r,i){r.blockedOn===i&&(r.blockedOn=null,Qh||(Qh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,WC)))}var wu=null;function _v(r){wu!==r&&(wu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wu===r&&(wu=null);for(var i=0;i<r.length;i+=3){var o=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(Xh(d||o)===null)continue;break}var y=Yi(o);y!==null&&(r.splice(i,3),i-=3,Kf(y,{pending:!0,data:p,method:o.method,action:d},d,p))}}))}function Ts(r){function i(R){return ku(R,r)}Da!==null&&ku(Da,r),$a!==null&&ku($a,r),La!==null&&ku(La,r),ll.forEach(i),cl.forEach(i);for(var o=0;o<Pa.length;o++){var d=Pa[o];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Pa.length&&(o=Pa[0],o.blockedOn===null);)zv(o),o.blockedOn===null&&Pa.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(d=0;d<o.length;d+=3){var p=o[d],y=o[d+1],k=p[Tn]||null;if(typeof y=="function")k||_v(o);else if(k){var N=null;if(y&&y.hasAttribute("formAction")){if(p=y,k=y[Tn]||null)N=k.formAction;else if(Xh(p)!==null)continue}else N=k.action;typeof N=="function"?o[d+1]=N:(o.splice(d,3),d-=3),_v(o)}}}function Nv(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(o,20)}function o(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Wh(r){this._internalRoot=r}Su.prototype.render=Wh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,d=Jn();yv(o,d,r,i,null,null)},Su.prototype.unmount=Wh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;yv(r.current,2,null,r,null,null),ru(),i[qi]=null}};function Su(r){this._internalRoot=r}Su.prototype.unstable_scheduleHydration=function(r){if(r){var i=Lx();r={blockedOn:null,target:r,priority:i};for(var o=0;o<Pa.length&&i!==0&&i<Pa[o].priority;o++);Pa.splice(o,0,r),o===0&&zv(r)}};var Cv=t.version;if(Cv!=="19.2.4")throw Error(a(527,Cv,"19.2.4"));V.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 eT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{vn=zu.inject(eT),Jt=zu}catch{}}return fl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var o=!1,d="",p=Db,y=$b,k=Lb;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=gv(r,1,!1,null,null,o,d,null,p,y,k,Nv),r[qi]=i.current,Rh(r),new Wh(i)},fl.hydrateRoot=function(r,i,o){if(!s(r))throw Error(a(299));var d=!1,p="",y=Db,k=$b,N=Lb,R=null;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(k=o.onCaughtError),o.onRecoverableError!==void 0&&(N=o.onRecoverableError),o.formState!==void 0&&(R=o.formState)),i=gv(r,1,!0,i,o??null,d,p,R,y,k,N,Nv),i.context=xv(null),o=i.current,d=Jn(),d=Id(d),p=Sa(d),p.callback=null,za(o,p,d),o=d,i.current.lanes=o,ko(i,o),Ar(i),r[qi]=i.current,Rh(r),new Su(i)},fl.version="19.2.4",fl}var Pv;function uT(){if(Pv)return nm.exports;Pv=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(),nm.exports=cT(),nm.exports}var dT=uT();var Uv="popstate";function fT(e={}){function t(a,s){let{pathname:c,search:l,hash:f}=a.location;return ap("",{pathname:c,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:Dl(s)}return mT(t,n,null,e)}function zt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hT(){return Math.random().toString(36).substring(2,10)}function Vv(e,t){return{usr:e.state,key:e.key,idx:t}}function ap(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?io(t):t,state:n,key:t&&t.key||a||hT()}}function Dl({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 io(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 mT(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:c=!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 x(){f="POP";let O=g(),T=O==null?null:O-m;m=O,h&&h({action:f,location:S.location,delta:T})}function b(O,T){f="PUSH";let E=ap(S.location,O,T);m=g()+1;let C=Vv(E,m),$=S.createHref(E);try{l.pushState(C,"",$)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign($)}c&&h&&h({action:f,location:S.location,delta:1})}function v(O,T){f="REPLACE";let E=ap(S.location,O,T);m=g();let C=Vv(E,m),$=S.createHref(E);l.replaceState(C,"",$),c&&h&&h({action:f,location:S.location,delta:0})}function j(O){return pT(O)}let S={get action(){return f},get location(){return e(s,l)},listen(O){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(Uv,x),h=O,()=>{s.removeEventListener(Uv,x),h=null}},createHref(O){return t(s,O)},createURL:j,encodeLocation(O){let T=j(O);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:b,replace:v,go(O){return l.go(O)}};return S}function pT(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:Dl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function xS(e,t,n="/"){return gT(e,t,n,!1)}function gT(e,t,n,a){let s=typeof t=="string"?io(t):t,c=fa(s.pathname||"/",n);if(c==null)return null;let l=yS(e);xT(l);let f=null;for(let h=0;f==null&&h<l.length;++h){let m=CT(c);f=_T(l[h],m,a)}return f}function yS(e,t=[],n=[],a="",s=!1){let c=(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 x=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 "${x}".`),yS(l.children,t,b,x,h)),!(l.path==null&&!l.index)&&t.push({path:x,score:zT(x,l.index),routesMeta:b})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))c(l,f);else for(let h of bS(l.path))c(l,f,!0,h)}),t}function bS(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),c=n.replace(/\?$/,"");if(a.length===0)return s?[c,""]:[c];let l=bS(a.join("/")),f=[];return f.push(...l.map(h=>h===""?c:[c,h].join("/"))),s&&f.push(...l),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function xT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var yT=/^:[\w-]+$/,bT=3,vT=2,kT=1,wT=10,ST=-2,Bv=e=>e==="*";function zT(e,t){let n=e.split("/"),a=n.length;return n.some(Bv)&&(a+=ST),t&&(a+=vT),n.filter(s=>!Bv(s)).reduce((s,c)=>s+(yT.test(c)?bT:c===""?kT:wT),a)}function jT(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 _T(e,t,n=!1){let{routesMeta:a}=e,s={},c="/",l=[];for(let f=0;f<a.length;++f){let h=a[f],m=f===a.length-1,g=c==="/"?t:t.slice(c.length)||"/",x=ad({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),b=h.route;if(!x&&m&&n&&!a[a.length-1].route.index&&(x=ad({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!x)return null;Object.assign(s,x.params),l.push({params:s,pathname:ua([c,x.pathname]),pathnameBase:OT(ua([c,x.pathnameBase])),route:b}),x.pathnameBase!=="/"&&(c=ua([c,x.pathnameBase]))}return l}function ad(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=NT(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let c=s[0],l=c.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:x},b)=>{if(g==="*"){let j=f[b]||"";l=c.slice(0,c.length-j.length).replace(/(.)\/+$/,"$1")}const v=f[b];return x&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:l,pattern:e}}function NT(e,t=!1,n=!0){jr(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 CT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jr(!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 fa(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 TT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ET(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?io(e):e,c;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?c=Iv(n.substring(1),"/"):c=Iv(n,t)):c=t,{pathname:c,search:MT(a),hash:RT(s)}}function Iv(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 sm(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 AT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cg(e){let t=AT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function ug(e,t,n,a=!1){let s;typeof e=="string"?s=io(e):(s={...e},zt(!s.pathname||!s.pathname.includes("?"),sm("?","pathname","search",s)),zt(!s.pathname||!s.pathname.includes("#"),sm("#","pathname","hash",s)),zt(!s.search||!s.search.includes("#"),sm("#","search","hash",s)));let c=e===""||s.pathname==="",l=c?"/":s.pathname,f;if(l==null)f=n;else{let x=t.length-1;if(!a&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),x-=1;s.pathname=b.join("/")}f=x>=0?t[x]:"/"}let h=ET(s,f),m=l&&l!=="/"&&l.endsWith("/"),g=(c||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var ua=e=>e.join("/").replace(/\/\/+/g,"/"),OT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),MT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,RT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,DT=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 $T(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function LT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var vS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function kS(e,t){let n=e;if(typeof n!="string"||!TT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(vS)try{let c=new URL(window.location.href),l=n.startsWith("//")?new URL(c.protocol+n):new URL(n),f=fa(l.pathname,t);l.origin===c.origin&&f!=null?n=f+l.search+l.hash:s=!0}catch{jr(!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 wS=["POST","PUT","PATCH","DELETE"];new Set(wS);var PT=["GET",...wS];new Set(PT);var so=z.createContext(null);so.displayName="DataRouter";var jd=z.createContext(null);jd.displayName="DataRouterState";var UT=z.createContext(!1),SS=z.createContext({isTransitioning:!1});SS.displayName="ViewTransition";var VT=z.createContext(new Map);VT.displayName="Fetchers";var BT=z.createContext(null);BT.displayName="Await";var Qn=z.createContext(null);Qn.displayName="Navigation";var Ql=z.createContext(null);Ql.displayName="Location";var Br=z.createContext({outlet:null,matches:[],isDataRoute:!1});Br.displayName="Route";var dg=z.createContext(null);dg.displayName="RouteError";var zS="REACT_ROUTER_ERROR",IT="REDIRECT",ZT="ROUTE_ERROR_RESPONSE";function HT(e){if(e.startsWith(`${zS}:${IT}:{`))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 FT(e){if(e.startsWith(`${zS}:${ZT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new DT(t.status,t.statusText,t.data)}catch{}}function qT(e,{relative:t}={}){zt(oo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=z.useContext(Qn),{hash:s,pathname:c,search:l}=Wl(e,{relative:t}),f=c;return n!=="/"&&(f=c==="/"?n:ua([n,c])),a.createHref({pathname:f,search:l,hash:s})}function oo(){return z.useContext(Ql)!=null}function Nr(){return zt(oo(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Ql).location}var jS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _S(e){z.useContext(Qn).static||z.useLayoutEffect(e)}function fg(){let{isDataRoute:e}=z.useContext(Br);return e?iE():GT()}function GT(){zt(oo(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(so),{basename:t,navigator:n}=z.useContext(Qn),{matches:a}=z.useContext(Br),{pathname:s}=Nr(),c=JSON.stringify(cg(a)),l=z.useRef(!1);return _S(()=>{l.current=!0}),z.useCallback((h,m={})=>{if(jr(l.current,jS),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=ug(h,JSON.parse(c),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,c,s,e])}z.createContext(null);function Wl(e,{relative:t}={}){let{matches:n}=z.useContext(Br),{pathname:a}=Nr(),s=JSON.stringify(cg(n));return z.useMemo(()=>ug(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function YT(e,t){return NS(e,t)}function NS(e,t,n,a,s){zt(oo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=z.useContext(Qn),{matches:l}=z.useContext(Br),f=l[l.length-1],h=f?f.params:{},m=f?f.pathname:"/",g=f?f.pathnameBase:"/",x=f&&f.route;{let E=x&&x.path||"";TS(m,!x||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let b=Nr(),v;if(t){let E=typeof t=="string"?io(t):t;zt(g==="/"||E.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 "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=b;let j=v.pathname||"/",S=j;if(g!=="/"){let E=g.replace(/^\//,"").split("/");S="/"+j.replace(/^\//,"").split("/").slice(E.length).join("/")}let O=xS(e,{pathname:S});jr(x||O!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),jr(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.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 T=WT(O&&O.map(E=>Object.assign({},E,{params:Object.assign({},h,E.params),pathname:ua([g,c.encodeLocation?c.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?g:ua([g,c.encodeLocation?c.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,n,a,s);return t&&T?z.createElement(Ql.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},T):T}function JT(){let e=aE(),t=$T(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},c={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:c},"ErrorBoundary")," or"," ",z.createElement("code",{style:c},"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 KT=z.createElement(JT,null),CS=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=FT(e.digest);n&&(e=n)}let t=e!==void 0?z.createElement(Br.Provider,{value:this.props.routeContext},z.createElement(dg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(XT,{error:e},t):t}};CS.contextType=UT;var om=new WeakMap;function XT({children:e,error:t}){let{basename:n}=z.useContext(Qn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=HT(t.digest);if(a){let s=om.get(t);if(s)throw s;let c=kS(a.location,n);if(vS&&!om.get(t))if(c.isExternal||a.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:a.replace}));throw om.set(t,l),l}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function QT({routeContext:e,match:t,children:n}){let a=z.useContext(so);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),z.createElement(Br.Provider,{value:e},n)}function WT(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 c=e,l=n?.errors;if(l!=null){let g=c.findIndex(x=>x.route.id&&l?.[x.route.id]!==void 0);zt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let f=!1,h=-1;if(n)for(let g=0;g<c.length;g++){let x=c[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=g),x.route.id){let{loaderData:b,errors:v}=n,j=x.route.loader&&!b.hasOwnProperty(x.route.id)&&(!v||v[x.route.id]===void 0);if(x.route.lazy||j){f=!0,h>=0?c=c.slice(0,h+1):c=[c[0]];break}}}let m=n&&a?(g,x)=>{a(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:LT(n.matches),errorInfo:x})}:void 0;return c.reduceRight((g,x,b)=>{let v,j=!1,S=null,O=null;n&&(v=l&&x.route.id?l[x.route.id]:void 0,S=x.route.errorElement||KT,f&&(h<0&&b===0?(TS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,O=null):h===b&&(j=!0,O=x.route.hydrateFallbackElement||null)));let T=t.concat(c.slice(0,b+1)),E=()=>{let C;return v?C=S:j?C=O:x.route.Component?C=z.createElement(x.route.Component,null):x.route.element?C=x.route.element:C=g,z.createElement(QT,{match:x,routeContext:{outlet:g,matches:T,isDataRoute:n!=null},children:C})};return n&&(x.route.ErrorBoundary||x.route.errorElement||b===0)?z.createElement(CS,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:E(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:m}):E()},null)}function hg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eE(e){let t=z.useContext(so);return zt(t,hg(e)),t}function tE(e){let t=z.useContext(jd);return zt(t,hg(e)),t}function nE(e){let t=z.useContext(Br);return zt(t,hg(e)),t}function mg(e){let t=nE(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 rE(){return mg("useRouteId")}function aE(){let e=z.useContext(dg),t=tE("useRouteError"),n=mg("useRouteError");return e!==void 0?e:t.errors?.[n]}function iE(){let{router:e}=eE("useNavigate"),t=mg("useNavigate"),n=z.useRef(!1);return _S(()=>{n.current=!0}),z.useCallback(async(s,c={})=>{jr(n.current,jS),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...c}))},[e,t])}var Zv={};function TS(e,t,n){!t&&!Zv[e]&&(Zv[e]=!0,jr(!1,n))}z.memo(sE);function sE({routes:e,future:t,state:n,onError:a}){return NS(e,void 0,n,a,t)}function ES({to:e,replace:t,state:n,relative:a}){zt(oo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=z.useContext(Qn);jr(!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:c}=z.useContext(Br),{pathname:l}=Nr(),f=fg(),h=ug(e,cg(c),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 Qt(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 oE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:c=!1,unstable_useTransitions:l}){zt(!oo(),"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:c,unstable_useTransitions:l,future:{}}),[f,s,c,l]);typeof n=="string"&&(n=io(n));let{pathname:m="/",search:g="",hash:x="",state:b=null,key:v="default"}=n,j=z.useMemo(()=>{let S=fa(m,f);return S==null?null:{location:{pathname:S,search:g,hash:x,state:b,key:v},navigationType:a}},[f,m,g,x,b,v,a]);return jr(j!=null,`<Router basename="${f}"> is not able to match the URL "${m}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:z.createElement(Qn.Provider,{value:h},z.createElement(Ql.Provider,{children:t,value:j}))}function Hv({children:e,location:t}){return YT(ip(e),t)}function ip(e,t=[]){let n=[];return z.Children.forEach(e,(a,s)=>{if(!z.isValidElement(a))return;let c=[...t,s];if(a.type===z.Fragment){n.push.apply(n,ip(a.props.children,c));return}zt(a.type===Qt,`[${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||c.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=ip(a.props.children,c)),n.push(l)}),n}var Gu="get",Yu="application/x-www-form-urlencoded";function _d(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function lE(e){return _d(e)&&e.tagName.toLowerCase()==="button"}function cE(e){return _d(e)&&e.tagName.toLowerCase()==="form"}function uE(e){return _d(e)&&e.tagName.toLowerCase()==="input"}function dE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fE(e,t){return e.button===0&&(!t||t==="_self")&&!dE(e)}var ju=null;function hE(){if(ju===null)try{new FormData(document.createElement("form"),0),ju=!1}catch{ju=!0}return ju}var mE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lm(e){return e!=null&&!mE.has(e)?(jr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yu}"`),null):e}function pE(e,t){let n,a,s,c,l;if(cE(e)){let f=e.getAttribute("action");a=f?fa(f,t):null,n=e.getAttribute("method")||Gu,s=lm(e.getAttribute("enctype"))||Yu,c=new FormData(e)}else if(lE(e)||uE(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?fa(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Gu,s=lm(e.getAttribute("formenctype"))||lm(f.getAttribute("enctype"))||Yu,c=new FormData(f,e),!hE()){let{name:m,type:g,value:x}=e;if(g==="image"){let b=m?`${m}.`:"";c.append(`${b}x`,"0"),c.append(`${b}y`,"0")}else m&&c.append(m,x)}}else{if(_d(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Gu,a=null,s=Yu,l=e}return c&&s==="text/plain"&&(l=c,c=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:c,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function pg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gE(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&&fa(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function xE(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 yE(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 bE(e,t,n){let a=await Promise.all(e.map(async s=>{let c=t.routes[s.route.id];if(c){let l=await xE(c,n);return l.links?l.links():[]}return[]}));return SE(a.flat(1).filter(yE).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Fv(e,t,n,a,s,c){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 c==="assets"?t.filter((h,m)=>l(h,m)||f(h,m)):c==="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 x=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 x=="boolean")return x}return!0}):[]}function vE(e,t,{includeHydrateFallback:n}={}){return kE(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let c=[s.module];return s.clientActionModule&&(c=c.concat(s.clientActionModule)),s.clientLoaderModule&&(c=c.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(c=c.concat(s.hydrateFallbackModule)),s.imports&&(c=c.concat(s.imports)),c}).flat(1))}function kE(e){return[...new Set(e)]}function wE(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 c=JSON.stringify(wE(s));return n.has(c)||(n.add(c),a.push({key:c,link:s})),a},[])}function AS(){let e=z.useContext(so);return pg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function zE(){let e=z.useContext(jd);return pg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gg=z.createContext(void 0);gg.displayName="FrameworkContext";function OS(){let e=z.useContext(gg);return pg(e,"You must render this element inside a <HydratedRouter> element"),e}function jE(e,t){let n=z.useContext(gg),[a,s]=z.useState(!1),[c,l]=z.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:x}=t,b=z.useRef(null);z.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=T=>{T.forEach(E=>{l(E.isIntersecting)})},O=new IntersectionObserver(S,{threshold:.5});return b.current&&O.observe(b.current),()=>{O.disconnect()}}},[e]),z.useEffect(()=>{if(a){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[a]);let v=()=>{s(!0)},j=()=>{s(!1),l(!1)};return n?e!=="intent"?[c,b,{}]:[c,b,{onFocus:hl(f,v),onBlur:hl(h,j),onMouseEnter:hl(m,v),onMouseLeave:hl(g,j),onTouchStart:hl(x,v)}]:[!1,b,{}]}function hl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function _E({page:e,...t}){let{router:n}=AS(),a=z.useMemo(()=>xS(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?z.createElement(CE,{page:e,matches:a,...t}):null}function NE(e){let{manifest:t,routeModules:n}=OS(),[a,s]=z.useState([]);return z.useEffect(()=>{let c=!1;return bE(e,t,n).then(l=>{c||s(l)}),()=>{c=!0}},[e,t,n]),a}function CE({page:e,matches:t,...n}){let a=Nr(),{future:s,manifest:c,routeModules:l}=OS(),{basename:f}=AS(),{loaderData:h,matches:m}=zE(),g=z.useMemo(()=>Fv(e,t,m,c,a,"data"),[e,t,m,c,a]),x=z.useMemo(()=>Fv(e,t,m,c,a,"assets"),[e,t,m,c,a]),b=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let S=new Set,O=!1;if(t.forEach(E=>{let C=c.routes[E.route.id];!C||!C.hasLoader||(!g.some($=>$.route.id===E.route.id)&&E.route.id in h&&l[E.route.id]?.shouldRevalidate||C.hasClientLoader?O=!0:S.add(E.route.id))}),S.size===0)return[];let T=gE(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return O&&S.size>0&&T.searchParams.set("_routes",t.filter(E=>S.has(E.route.id)).map(E=>E.route.id).join(",")),[T.pathname+T.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,a,c,g,t,e,l]),v=z.useMemo(()=>vE(x,c),[x,c]),j=NE(x);return z.createElement(z.Fragment,null,b.map(S=>z.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),v.map(S=>z.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),j.map(({key:S,link:O})=>z.createElement("link",{key:S,nonce:n.nonce,...O,crossOrigin:O.crossOrigin??n.crossOrigin})))}function TE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var EE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{EE&&(window.__reactRouterVersion="7.13.0")}catch{}function AE({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=z.useRef();s.current==null&&(s.current=fT({window:a,v5Compat:!0}));let c=s.current,[l,f]=z.useState({action:c.action,location:c.location}),h=z.useCallback(m=>{n===!1?f(m):z.startTransition(()=>f(m))},[n]);return z.useLayoutEffect(()=>c.listen(h),[c,h]),z.createElement(oE,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:c,unstable_useTransitions:n})}var MS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ka=z.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:c,replace:l,state:f,target:h,to:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...v},j){let{basename:S,unstable_useTransitions:O}=z.useContext(Qn),T=typeof m=="string"&&MS.test(m),E=kS(m,S);m=E.to;let C=qT(m,{relative:s}),[$,D,M]=jE(a,v),Z=DE(m,{replace:l,state:f,target:h,preventScrollReset:g,relative:s,viewTransition:x,unstable_defaultShouldRevalidate:b,unstable_useTransitions:O});function U(de){t&&t(de),de.defaultPrevented||Z(de)}let K=z.createElement("a",{...v,...M,href:E.absoluteURL||C,onClick:E.isExternal||c?t:U,ref:TE(j,D),target:h,"data-discover":!T&&n==="render"?"true":void 0});return $&&!T?z.createElement(z.Fragment,null,K,z.createElement(_E,{page:C})):K});Ka.displayName="Link";var OE=z.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:c,to:l,viewTransition:f,children:h,...m},g){let x=Wl(l,{relative:m.relative}),b=Nr(),v=z.useContext(jd),{navigator:j,basename:S}=z.useContext(Qn),O=v!=null&&VE(x)&&f===!0,T=j.encodeLocation?j.encodeLocation(x).pathname:x.pathname,E=b.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(E=E.toLowerCase(),C=C?C.toLowerCase():null,T=T.toLowerCase()),C&&S&&(C=fa(C,S)||C);const $=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let D=E===T||!s&&E.startsWith(T)&&E.charAt($)==="/",M=C!=null&&(C===T||!s&&C.startsWith(T)&&C.charAt(T.length)==="/"),Z={isActive:D,isPending:M,isTransitioning:O},U=D?t:void 0,K;typeof a=="function"?K=a(Z):K=[a,D?"active":null,M?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let de=typeof c=="function"?c(Z):c;return z.createElement(Ka,{...m,"aria-current":U,className:K,ref:g,style:de,to:l,viewTransition:f},typeof h=="function"?h(Z):h)});OE.displayName="NavLink";var ME=z.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:c,method:l=Gu,action:f,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b,...v},j)=>{let{unstable_useTransitions:S}=z.useContext(Qn),O=PE(),T=UE(f,{relative:m}),E=l.toLowerCase()==="get"?"get":"post",C=typeof f=="string"&&MS.test(f),$=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let M=D.nativeEvent.submitter,Z=M?.getAttribute("formmethod")||l,U=()=>O(M||D.currentTarget,{fetcherKey:t,method:Z,navigate:n,replace:s,state:c,relative:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:b});S&&n!==!1?z.startTransition(()=>U()):U()};return z.createElement("form",{ref:j,method:E,action:T,onSubmit:a?h:$,...v,"data-discover":!C&&e==="render"?"true":void 0})});ME.displayName="Form";function RE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function RS(e){let t=z.useContext(so);return zt(t,RE(e)),t}function DE(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:c,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=fg(),g=Nr(),x=Wl(e,{relative:c});return z.useCallback(b=>{if(fE(b,t)){b.preventDefault();let v=n!==void 0?n:Dl(g)===Dl(x),j=()=>m(e,{replace:v,state:a,preventScrollReset:s,relative:c,viewTransition:l,unstable_defaultShouldRevalidate:f});h?z.startTransition(()=>j()):j()}},[g,m,x,n,a,t,e,s,c,l,f,h])}var $E=0,LE=()=>`__${String(++$E)}__`;function PE(){let{router:e}=RS("useSubmit"),{basename:t}=z.useContext(Qn),n=rE(),a=e.fetch,s=e.navigate;return z.useCallback(async(c,l={})=>{let{action:f,method:h,encType:m,formData:g,body:x}=pE(c,t);if(l.navigate===!1){let b=l.fetcherKey||LE();await a(b,n,l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:x,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:x,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 UE(e,{relative:t}={}){let{basename:n}=z.useContext(Qn),a=z.useContext(Br);zt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),c={...Wl(e||".",{relative:t})},l=Nr();if(e==null){c.search=l.search;let f=new URLSearchParams(c.search),h=f.getAll("index");if(h.some(g=>g==="")){f.delete("index"),h.filter(x=>x).forEach(x=>f.append("index",x));let g=f.toString();c.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(c.pathname=c.pathname==="/"?n:ua([n,c.pathname])),Dl(c)}function VE(e,{relative:t}={}){let n=z.useContext(SS);zt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=RS("useViewTransitionState"),s=Wl(e,{relative:t});if(!n.isTransitioning)return!1;let c=fa(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=fa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return ad(s.pathname,l)!=null||ad(s.pathname,c)!=null}const DS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const BE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const IE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const qv=e=>{const t=IE(e);return t.charAt(0).toUpperCase()+t.slice(1)};var ZE={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 HE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const FE=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:c,iconNode:l,...f},h)=>z.createElement("svg",{ref:h,...ZE,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:DS("lucide",s),...!c&&!HE(f)&&{"aria-hidden":"true"},...f},[...l.map(([m,g])=>z.createElement(m,g)),...Array.isArray(c)?c:[c]]));const me=(e,t)=>{const n=z.forwardRef(({className:a,...s},c)=>z.createElement(FE,{ref:c,iconNode:t,className:DS(`lucide-${BE(qv(e))}`,`lucide-${e}`,a),...s}));return n.displayName=qv(e),n};const qE=[["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"}]],Mi=me("activity",qE);const GE=[["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"}]],YE=me("archive",GE);const JE=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],KE=me("arrow-down",JE);const XE=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],QE=me("arrow-left",XE);const WE=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],e4=me("arrow-up",WE);const t4=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],n4=me("ban",t4);const r4=[["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"}]],$l=me("bell",r4);const a4=[["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"}]],Gv=me("bot",a4);const i4=[["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"}]],s4=me("box",i4);const o4=[["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"}]],l4=me("brain",o4);const c4=[["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"}]],$S=me("calendar",c4);const u4=[["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"}]],sp=me("chart-column",u4);const d4=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],f4=me("check-check",d4);const h4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],op=me("check",h4);const m4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],LS=me("chevron-down",m4);const p4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xg=me("chevron-right",p4);const g4=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],PS=me("chevron-up",g4);const x4=[["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"}]],lo=me("circle-alert",x4);const y4=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],US=me("circle-check-big",y4);const b4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],yg=me("circle-check",b4);const v4=[["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"}]],Ll=me("circle-x",v4);const k4=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_r=me("clock",k4);const w4=[["path",{d:"M13 16a3 3 0 0 1 0 6H7a5 5 0 1 1 4.9-6z",key:"ie2ih4"}],["path",{d:"M18.376 14.512a6 6 0 0 0 3.461-4.127c.148-.625-.659-.97-1.248-.714a4 4 0 0 1-5.259-5.26c.255-.589-.09-1.395-.716-1.248a6 6 0 0 0-4.594 5.36",key:"zwnc1e"}]],S4=me("cloud-moon",w4);const z4=[["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"}]],j4=me("copy",z4);const _4=[["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"}]],bg=me("cpu",_4);const N4=[["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"}]],Hs=me("database",N4);const C4=[["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"}]],Pl=me("dollar-sign",C4);const T4=[["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"}]],ec=me("eye",T4);const E4=[["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"}]],Yv=me("file-text",E4);const A4=[["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"}]],O4=me("folder-open",A4);const M4=[["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"}]],R4=me("funnel",M4);const D4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],$4=me("globe",D4);const L4=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],P4=me("hard-drive",L4);const U4=[["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"}]],V4=me("hash",U4);const B4=[["path",{d:"M14 18a2 2 0 0 0-4 0",key:"1v8fkw"}],["path",{d:"m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11",key:"1fkr7p"}],["path",{d:"M2 11h20",key:"3eubbj"}],["circle",{cx:"17",cy:"18",r:"3",key:"82mm0e"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],Qs=me("hat-glasses",B4);const I4=[["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"}]],Z4=me("history",I4);const H4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],F4=me("info",H4);const q4=[["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"}]],lp=me("layout-dashboard",q4);const G4=[["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"}]],Ul=me("list-checks",G4);const Y4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],VS=me("loader-circle",Y4);const J4=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],K4=me("lock",J4);const X4=[["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"}]],Jv=me("log-out",X4);const Q4=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],W4=me("menu",Q4);const eA=[["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"}]],Kv=me("message-square-plus",eA);const tA=[["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"}]],Vl=me("message-square",tA);const nA=[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["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"}]],rA=me("moon-star",nA);const aA=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],iA=me("monitor",aA);const sA=[["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"}]],oA=me("pause",sA);const lA=[["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"}]],cA=me("pen",lA);const uA=[["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"}]],tc=me("pencil",uA);const dA=[["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"}]],fA=me("play",dA);const hA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ws=me("plus",hA);const mA=[["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"}]],id=me("puzzle",mA);const pA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],BS=me("radio",pA);const gA=[["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"}]],Ga=me("refresh-cw",gA);const xA=[["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"}]],Xv=me("rotate-ccw",xA);const yA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],bA=me("search",yA);const vA=[["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"}]],kA=me("send",vA);const wA=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],SA=me("server",wA);const zA=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Qv=me("settings-2",zA);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"}]],cp=me("settings",jA);const _A=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],up=me("shield-check",_A);const NA=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],CA=me("shield-off",NA);const TA=[["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"}]],EA=me("sun",TA);const AA=[["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"}]],vg=me("tag",AA);const OA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Nl=me("terminal",OA);const MA=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],kg=me("toggle-left",MA);const RA=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],wg=me("toggle-right",RA);const DA=[["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"}]],ha=me("trash-2",DA);const $A=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],LA=me("trending-up",$A);const PA=[["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"}]],_u=me("upload",PA);const UA=[["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"}]],Sg=me("user",UA);const VA=[["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"}]],Pi=me("wand-sparkles",VA);const BA=[["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"}]],dp=me("webhook",BA);const IA=[["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"}]],IS=me("wifi-off",IA);const ZA=[["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"}]],Ju=me("wifi",ZA);const HA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],FA=me("wrench",HA);const qA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bi=me("x",qA);var cm={exports:{}},um={};var Wv;function GA(){if(Wv)return um;Wv=1;var e=zd();function t(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue;function f(x,b){var v=b(),j=a({inst:{value:v,getSnapshot:b}}),S=j[0].inst,O=j[1];return c(function(){S.value=v,S.getSnapshot=b,h(S)&&O({inst:S})},[x,v,b]),s(function(){return h(S)&&O({inst:S}),x(function(){h(S)&&O({inst:S})})},[x]),l(v),v}function h(x){var b=x.getSnapshot;x=x.value;try{var v=b();return!n(x,v)}catch{return!0}}function m(x,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return um.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,um}var e1;function YA(){return e1||(e1=1,cm.exports=GA()),cm.exports}var t1=YA();const ZS=0,HS=1,FS=2,n1=3;var r1=Object.prototype.hasOwnProperty;function fp(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--&&fp(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(r1.call(e,n)&&++a&&!r1.call(t,n)||!(n in t)||!fp(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const la=new WeakMap,ca=()=>{},pn=ca(),hp=Object,Ke=e=>e===pn,Mr=e=>typeof e=="function",Xa=(e,t)=>({...e,...t}),qS=e=>Mr(e.then),dm={},Nu={},zg="undefined",nc=typeof window!=zg,mp=typeof document!=zg,JA=nc&&"Deno"in window,KA=()=>nc&&typeof window.requestAnimationFrame!=zg,GS=(e,t)=>{const n=la.get(e);return[()=>!Ke(t)&&e.get(t)||dm,a=>{if(!Ke(t)){const s=e.get(t);t in Nu||(Nu[t]=s),n[5](t,Xa(s,a),s||dm)}},n[6],()=>!Ke(t)&&t in Nu?Nu[t]:!Ke(t)&&e.get(t)||dm]};let pp=!0;const XA=()=>pp,[gp,xp]=nc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ca,ca],QA=()=>{const e=mp&&document.visibilityState;return Ke(e)||e!=="hidden"},WA=e=>(mp&&document.addEventListener("visibilitychange",e),gp("focus",e),()=>{mp&&document.removeEventListener("visibilitychange",e),xp("focus",e)}),e5=e=>{const t=()=>{pp=!0,e()},n=()=>{pp=!1};return gp("online",t),gp("offline",n),()=>{xp("online",t),xp("offline",n)}},t5={isOnline:XA,isVisible:QA},n5={initFocus:WA,initReconnect:e5},a1=!lg.useId,Fs=!nc||JA,r5=e=>KA()?window.requestAnimationFrame(e):setTimeout(e,1),fm=Fs?z.useEffect:z.useLayoutEffect,hm=typeof navigator<"u"&&navigator.connection,i1=!Fs&&hm&&(["slow-2g","2g"].includes(hm.effectiveType)||hm.saveData),Cu=new WeakMap,a5=e=>hp.prototype.toString.call(e),mm=(e,t)=>e===`[object ${t}]`;let i5=0;const yp=e=>{const t=typeof e,n=a5(e),a=mm(n,"Date"),s=mm(n,"RegExp"),c=mm(n,"Object");let l,f;if(hp(e)===e&&!a&&!s){if(l=Cu.get(e),l)return l;if(l=++i5+"~",Cu.set(e,l),Array.isArray(e)){for(l="@",f=0;f<e.length;f++)l+=yp(e[f])+",";Cu.set(e,l)}if(c){l="#";const h=hp.keys(e).sort();for(;!Ke(f=h.pop());)Ke(e[f])||(l+=f+":"+yp(e[f])+",");Cu.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},jg=e=>{if(Mr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?yp(e):"",[e,t]};let s5=0;const bp=()=>++s5;async function YS(...e){const[t,n,a,s]=e,c=Xa({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let l=c.populateCache;const f=c.rollbackOnError;let h=c.optimisticData;const m=b=>typeof f=="function"?f(b):f!==!1,g=c.throwOnError;if(Mr(n)){const b=n,v=[],j=t.keys();for(const S of j)!/^\$(inf|sub)\$/.test(S)&&b(t.get(S)._k)&&v.push(S);return Promise.all(v.map(x))}return x(n);async function x(b){const[v]=jg(b);if(!v)return;const[j,S]=GS(t,v),[O,T,E,C]=la.get(t),$=()=>{const oe=O[v];return(Mr(c.revalidate)?c.revalidate(j().data,b):c.revalidate!==!1)&&(delete E[v],delete C[v],oe&&oe[0])?oe[0](FS).then(()=>j().data):j().data};if(e.length<3)return $();let D=a,M,Z=!1;const U=bp();T[v]=[U,0];const K=!Ke(h),de=j(),ae=de.data,le=de._c,ne=Ke(le)?ae:le;if(K&&(h=Mr(h)?h(ne,ae):h,S({data:h,_c:ne})),Mr(D))try{D=D(ne)}catch(oe){M=oe,Z=!0}if(D&&qS(D))if(D=await D.catch(oe=>{M=oe,Z=!0}),U!==T[v][0]){if(Z)throw M;return D}else Z&&K&&m(M)&&(l=!0,S({data:ne,_c:pn}));if(l&&!Z)if(Mr(l)){const oe=l(D,ne);S({data:oe,error:pn,_c:pn})}else S({data:D,error:pn,_c:pn});if(T[v][1]=bp(),Promise.resolve($()).then(()=>{S({_c:pn})}),Z){if(g)throw M;return}return D}}const s1=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},o5=(e,t)=>{if(!la.has(e)){const n=Xa(n5,t),a=Object.create(null),s=YS.bind(pn,e);let c=ca;const l=Object.create(null),f=(g,x)=>{const b=l[g]||[];return l[g]=b,b.push(x),()=>b.splice(b.indexOf(x),1)},h=(g,x,b)=>{e.set(g,x);const v=l[g];if(v)for(const j of v)j(x,b)},m=()=>{if(!la.has(e)&&(la.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,f]),!Fs)){const g=n.initFocus(setTimeout.bind(pn,s1.bind(pn,a,ZS))),x=n.initReconnect(setTimeout.bind(pn,s1.bind(pn,a,HS)));c=()=>{g&&g(),x&&x(),la.delete(e)}}};return m(),[e,s,m,c]}return[e,la.get(e)[4]]},l5=(e,t,n,a,s)=>{const c=n.errorRetryCount,l=s.retryCount,f=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Ke(c)&&l>c||setTimeout(a,f,s)},c5=fp,[JS,Pn]=o5(new Map),u5=Xa({onLoadingSlow:ca,onSuccess:ca,onError:ca,onErrorRetry:l5,onDiscarded:ca,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:i1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:i1?5e3:3e3,compare:c5,isPaused:()=>!1,cache:JS,mutate:Pn,fallback:{}},t5),d5=(e,t)=>{const n=Xa(e,t);if(t){const{use:a,fallback:s}=e,{use:c,fallback:l}=t;a&&c&&(n.use=a.concat(c)),s&&l&&(n.fallback=Xa(s,l))}return n},f5=z.createContext({}),h5="$inf$",KS=nc&&window.__SWR_DEVTOOLS_USE__,m5=KS?window.__SWR_DEVTOOLS_USE__:[],p5=()=>{KS&&(window.__SWR_DEVTOOLS_REACT__=lg)},g5=e=>Mr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],x5=()=>{const e=z.useContext(f5);return z.useMemo(()=>Xa(u5,e),[e])},y5=e=>(t,n,a)=>e(t,n&&((...c)=>{const[l]=jg(t),[,,,f]=la.get(JS);if(l.startsWith(h5))return n(...c);const h=f[l];return Ke(h)?n(...c):(delete f[l],h)}),a),b5=m5.concat(y5),v5=e=>function(...n){const a=x5(),[s,c,l]=g5(n),f=d5(a,l);let h=e;const{use:m}=f,g=(m||[]).concat(b5);for(let x=g.length;x--;)h=g[x](h);return h(s,c||f.fetcher||null,f)},k5=(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())}};p5();const pm=lg.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}}),gm={dedupe:!0},o1=Promise.resolve(pn),w5=(e,t,n)=>{const{cache:a,compare:s,suspense:c,fallbackData:l,revalidateOnMount:f,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:x,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[j,S,O,T]=la.get(a),[E,C]=jg(e),$=z.useRef(!1),D=z.useRef(!1),M=z.useRef(E),Z=z.useRef(t),U=z.useRef(n),K=()=>U.current,de=()=>K().isVisible()&&K().isOnline(),[ae,le,ne,oe]=GS(a,E),ie=z.useRef({}).current,B=Ke(l)?Ke(n.fallback)?pn:n.fallback[E]:l,V=(Ie,nt)=>{for(const dt in ie){const ot=dt;if(ot==="data"){if(!s(Ie[ot],nt[ot])&&(!Ke(Ie[ot])||!s(pe,nt[ot])))return!1}else if(nt[ot]!==Ie[ot])return!1}return!0},G=z.useMemo(()=>{const Ie=!E||!t?!1:Ke(f)?K().isPaused()||c?!1:h!==!1:f,nt=Yt=>{const yt=Xa(Yt);return delete yt._k,Ie?{isValidating:!0,isLoading:!0,...yt}:yt},dt=ae(),ot=oe(),nn=nt(dt),Wn=dt===ot?nn:nt(ot);let Dt=nn;return[()=>{const Yt=nt(ae());return V(Yt,Dt)?(Dt.data=Yt.data,Dt.isLoading=Yt.isLoading,Dt.isValidating=Yt.isValidating,Dt.error=Yt.error,Dt):(Dt=Yt,Yt)},()=>Wn]},[a,E]),ce=t1.useSyncExternalStore(z.useCallback(Ie=>ne(E,(nt,dt)=>{V(dt,nt)||Ie()}),[a,E]),G[0],G[1]),A=!$.current,_=j[E]&&j[E].length>0,H=ce.data,w=Ke(H)?B&&qS(B)?pm(B):B:H,J=ce.error,he=z.useRef(w),pe=b?Ke(H)?Ke(he.current)?w:he.current:H:w,xe=E&&Ke(w),Pe=!Fs&&t1.useSyncExternalStore(()=>ca,()=>!1,()=>!0);v&&Pe&&!c&&xe&&console.warn(`Missing pre-initiated data for serialized key "${E}" 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 Ee=_&&!Ke(J)?!1:A&&!Ke(f)?f:K().isPaused()?!1:c?Ke(w)?!1:h:Ke(w)||h,xt=!!(E&&t&&A&&Ee),L=Ke(ce.isValidating)?xt:ce.isValidating,Oe=Ke(ce.isLoading)?xt:ce.isLoading,Ue=z.useCallback(async Ie=>{const nt=Z.current;if(!E||!nt||D.current||K().isPaused())return!1;let dt,ot,nn=!0;const Wn=Ie||{},Dt=!O[E]||!Wn.dedupe,Yt=()=>a1?!D.current&&E===M.current&&$.current:E===M.current,yt={isValidating:!1,isLoading:!1},Fi=()=>{le(yt)},W=()=>{const we=O[E];we&&we[1]===ot&&delete O[E]},fe={isValidating:!0};Ke(ae().data)&&(fe.isLoading=!0);try{if(Dt&&(le(fe),n.loadingTimeout&&Ke(ae().data)&&setTimeout(()=>{nn&&Yt()&&K().onLoadingSlow(E,n)},n.loadingTimeout),O[E]=[nt(C),bp()]),[dt,ot]=O[E],dt=await dt,Dt&&setTimeout(W,n.dedupingInterval),!O[E]||O[E][1]!==ot)return Dt&&Yt()&&K().onDiscarded(E),!1;yt.error=pn;const we=S[E];if(!Ke(we)&&(ot<=we[0]||ot<=we[1]||we[1]===0))return Fi(),Dt&&Yt()&&K().onDiscarded(E),!1;const Ne=ae().data;yt.data=s(Ne,dt)?Ne:dt,Dt&&Yt()&&K().onSuccess(dt,E,n)}catch(we){W();const Ne=K(),{shouldRetryOnError:Je}=Ne;Ne.isPaused()||(yt.error=we,Dt&&Yt()&&(Ne.onError(we,E,Ne),(Je===!0||Mr(Je)&&Je(we))&&(!K().revalidateOnFocus||!K().revalidateOnReconnect||de())&&Ne.onErrorRetry(we,E,Ne,bn=>{const In=j[E];In&&In[0]&&In[0](n1,bn)},{retryCount:(Wn.retryCount||0)+1,dedupe:!0})))}return nn=!1,Fi(),!0},[E,a]),Ye=z.useCallback((...Ie)=>YS(a,M.current,...Ie),[]);if(fm(()=>{Z.current=t,U.current=n,Ke(H)||(he.current=H)}),fm(()=>{if(!E)return;const Ie=Ue.bind(pn,gm);let nt=0;K().revalidateOnFocus&&(nt=Date.now()+K().focusThrottleInterval);const ot=k5(E,j,(nn,Wn={})=>{if(nn==ZS){const Dt=Date.now();K().revalidateOnFocus&&Dt>nt&&de()&&(nt=Dt+K().focusThrottleInterval,Ie())}else if(nn==HS)K().revalidateOnReconnect&&de()&&Ie();else{if(nn==FS)return Ue();if(nn==n1)return Ue(Wn)}});return D.current=!1,M.current=E,$.current=!0,le({_k:C}),Ee&&(O[E]||(Ke(w)||Fs?Ie():r5(Ie))),()=>{D.current=!0,ot()}},[E]),fm(()=>{let Ie;function nt(){const ot=Mr(m)?m(ae().data):m;ot&&Ie!==-1&&(Ie=setTimeout(dt,ot))}function dt(){!ae().error&&(g||K().isVisible())&&(x||K().isOnline())?Ue(gm).then(nt):nt()}return nt(),()=>{Ie&&(clearTimeout(Ie),Ie=-1)}},[m,g,x,E]),z.useDebugValue(pe),c){if(!a1&&Fs&&xe)throw new Error("Fallback data is required when using Suspense in SSR.");xe&&(Z.current=t,U.current=n,D.current=!1);const Ie=T[E],nt=!Ke(Ie)&&xe?Ye(Ie):o1;if(pm(nt),!Ke(J)&&xe)throw J;const dt=xe?Ue(gm):o1;!Ke(pe)&&xe&&(dt.status="fulfilled",dt.value=!0),pm(dt)}return{mutate:Ye,get data(){return ie.data=!0,pe},get error(){return ie.error=!0,J},get isValidating(){return ie.isValidating=!0,L},get isLoading(){return ie.isLoading=!0,Oe}}},We=v5(w5),S5="x-architect-pass",Es="/api";class Ya{static instance;constructor(){}static getInstance(){return Ya.instance||(Ya.instance=new Ya),Ya.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[S5]=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(`${Es}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${Es}${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(`${Es}${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(`${Es}${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(`${Es}${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 c=await fetch(`${Es}${t}`,{method:"POST",headers:this.getHeaders(),body:s});return this.handleResponse(c)}}const ge=Ya.getInstance(),Bl="/api",_g=e=>{const t=e.startsWith(Bl)?e.substring(Bl.length):e;return ge.get(t)};function XS(){return We(`${Bl}/status`,_g,{refreshInterval:5e3})}function z5(){return We(`${Bl}/logs`,_g)}function j5(e){return We(e?`${Bl}/logs/${e}?limit=1000`:null,_g,{refreshInterval:2e3})}function QS(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 _5(){const{data:e}=XS();return u.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:[u.jsxs("div",{className:"flex gap-4",children:[u.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),u.jsxs("span",{children:["PID: ",e?.pid||"-"]}),u.jsxs("span",{children:["UPTIME: ",e?QS(e.uptimeSeconds):"-"]})]}),u.jsxs("div",{className:"flex gap-4 opacity-70",children:[u.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),u.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const Ng=z.createContext({});function Cg(e){const t=z.useRef(null);return t.current===null&&(t.current=e()),t.current}const WS=typeof window<"u",ez=WS?z.useLayoutEffect:z.useEffect,Nd=z.createContext(null);function Tg(e,t){e.indexOf(t)===-1&&e.push(t)}function Eg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const $r=(e,t,n)=>n>t?t:n<e?e:n;let Ag=()=>{};const ma={},tz=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function nz(e){return typeof e=="object"&&e!==null}const rz=e=>/^0[^.\s]+$/u.test(e);function Og(e){let t;return()=>(t===void 0&&(t=e()),t)}const pr=e=>e,N5=(e,t)=>n=>t(e(n)),rc=(...e)=>e.reduce(N5),Il=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class Mg{constructor(){this.subscriptions=[]}add(t){return Tg(this.subscriptions,t),()=>Eg(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 c=0;c<s;c++){const l=this.subscriptions[c];l&&l(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const da=e=>e*1e3,mr=e=>e/1e3;function az(e,t){return t?e*(1e3/t):0}const iz=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C5=1e-7,T5=12;function E5(e,t,n,a,s){let c,l,f=0;do l=t+(n-t)/2,c=iz(l,a,s)-e,c>0?n=l:t=l;while(Math.abs(c)>C5&&++f<T5);return l}function ac(e,t,n,a){if(e===t&&n===a)return pr;const s=c=>E5(c,0,1,e,n);return c=>c===0||c===1?c:iz(s(c),t,a)}const sz=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oz=e=>t=>1-e(1-t),lz=ac(.33,1.53,.69,.99),Rg=oz(lz),cz=sz(Rg),uz=e=>(e*=2)<1?.5*Rg(e):.5*(2-Math.pow(2,-10*(e-1))),Dg=e=>1-Math.sin(Math.acos(e)),dz=oz(Dg),fz=sz(Dg),A5=ac(.42,0,1,1),O5=ac(0,0,.58,1),hz=ac(.42,0,.58,1),M5=e=>Array.isArray(e)&&typeof e[0]!="number",mz=e=>Array.isArray(e)&&typeof e[0]=="number",R5={linear:pr,easeIn:A5,easeInOut:hz,easeOut:O5,circIn:Dg,circInOut:fz,circOut:dz,backIn:Rg,backInOut:cz,backOut:lz,anticipate:uz},D5=e=>typeof e=="string",l1=e=>{if(mz(e)){Ag(e.length===4);const[t,n,a,s]=e;return ac(t,n,a,s)}else if(D5(e))return R5[e];return e},Tu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $5(e,t){let n=new Set,a=new Set,s=!1,c=!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,x=!1,b=!1)=>{const j=b&&s?n:a;return x&&l.add(g),j.has(g)||j.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(f=g,s){c=!0;return}s=!0,[n,a]=[a,n],n.forEach(h),n.clear(),s=!1,c&&(c=!1,m.process(g))}};return m}const L5=40;function pz(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},c=()=>n=!0,l=Tu.reduce((C,$)=>(C[$]=$5(c),C),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:g,update:x,preRender:b,render:v,postRender:j}=l,S=()=>{const C=ma.useManualTiming?s.timestamp:performance.now();n=!1,ma.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(C-s.timestamp,L5),1)),s.timestamp=C,s.isProcessing=!0,f.process(s),h.process(s),m.process(s),g.process(s),x.process(s),b.process(s),v.process(s),j.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(S))},O=()=>{n=!0,a=!0,s.isProcessing||e(S)};return{schedule:Tu.reduce((C,$)=>{const D=l[$];return C[$]=(M,Z=!1,U=!1)=>(n||O(),D.schedule(M,Z,U)),C},{}),cancel:C=>{for(let $=0;$<Tu.length;$++)l[Tu[$]].cancel(C)},state:s,steps:l}}const{schedule:kt,cancel:Qa,state:dn,steps:xm}=pz(typeof requestAnimationFrame<"u"?requestAnimationFrame:pr,!0);let Ku;function P5(){Ku=void 0}const jn={now:()=>(Ku===void 0&&jn.set(dn.isProcessing||ma.useManualTiming?dn.timestamp:performance.now()),Ku),set:e=>{Ku=e,queueMicrotask(P5)}},gz=e=>t=>typeof t=="string"&&t.startsWith(e),xz=gz("--"),U5=gz("var(--"),$g=e=>U5(e)?V5.test(e.split("/*")[0].trim()):!1,V5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function c1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const co={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Zl={...co,transform:e=>$r(0,1,e)},Eu={...co,default:1},Cl=e=>Math.round(e*1e5)/1e5,Lg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function B5(e){return e==null}const I5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pg=(e,t)=>n=>!!(typeof n=="string"&&I5.test(n)&&n.startsWith(e)||t&&!B5(n)&&Object.prototype.hasOwnProperty.call(n,t)),yz=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,c,l,f]=a.match(Lg);return{[e]:parseFloat(s),[t]:parseFloat(c),[n]:parseFloat(l),alpha:f!==void 0?parseFloat(f):1}},Z5=e=>$r(0,255,e),ym={...co,transform:e=>Math.round(Z5(e))},Ri={test:Pg("rgb","red"),parse:yz("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+ym.transform(e)+", "+ym.transform(t)+", "+ym.transform(n)+", "+Cl(Zl.transform(a))+")"};function H5(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 vp={test:Pg("#"),parse:H5,transform:Ri.transform},ic=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ha=ic("deg"),Dr=ic("%"),ke=ic("px"),F5=ic("vh"),q5=ic("vw"),u1={...Dr,parse:e=>Dr.parse(e)/100,transform:e=>Dr.transform(e*100)},Ls={test:Pg("hsl","hue"),parse:yz("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Dr.transform(Cl(t))+", "+Dr.transform(Cl(n))+", "+Cl(Zl.transform(a))+")"},Ht={test:e=>Ri.test(e)||vp.test(e)||Ls.test(e),parse:e=>Ri.test(e)?Ri.parse(e):Ls.test(e)?Ls.parse(e):vp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ri.transform(e):Ls.transform(e),getAnimatableNone:e=>{const t=Ht.parse(e);return t.alpha=0,Ht.transform(t)}},G5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Y5(e){return isNaN(e)&&typeof e=="string"&&(e.match(Lg)?.length||0)+(e.match(G5)?.length||0)>0}const bz="number",vz="color",J5="var",K5="var(",d1="${}",X5=/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 Hl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let c=0;const f=t.replace(X5,h=>(Ht.test(h)?(a.color.push(c),s.push(vz),n.push(Ht.parse(h))):h.startsWith(K5)?(a.var.push(c),s.push(J5),n.push(h)):(a.number.push(c),s.push(bz),n.push(parseFloat(h))),++c,d1)).split(d1);return{values:n,split:f,indexes:a,types:s}}function kz(e){return Hl(e).values}function wz(e){const{split:t,types:n}=Hl(e),a=t.length;return s=>{let c="";for(let l=0;l<a;l++)if(c+=t[l],s[l]!==void 0){const f=n[l];f===bz?c+=Cl(s[l]):f===vz?c+=Ht.transform(s[l]):c+=s[l]}return c}}const Q5=e=>typeof e=="number"?0:Ht.test(e)?Ht.getAnimatableNone(e):e;function W5(e){const t=kz(e);return wz(e)(t.map(Q5))}const Wa={test:Y5,parse:kz,createTransformer:wz,getAnimatableNone:W5};function bm(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 e3({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,c=0,l=0;if(!t)s=c=l=n;else{const f=n<.5?n*(1+t):n+t-n*t,h=2*n-f;s=bm(h,f,e+1/3),c=bm(h,f,e),l=bm(h,f,e-1/3)}return{red:Math.round(s*255),green:Math.round(c*255),blue:Math.round(l*255),alpha:a}}function sd(e,t){return n=>n>0?t:e}const Nt=(e,t,n)=>e+(t-e)*n,vm=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},t3=[vp,Ri,Ls],n3=e=>t3.find(t=>t.test(e));function f1(e){const t=n3(e);if(!t)return!1;let n=t.parse(e);return t===Ls&&(n=e3(n)),n}const h1=(e,t)=>{const n=f1(e),a=f1(t);if(!n||!a)return sd(e,t);const s={...n};return c=>(s.red=vm(n.red,a.red,c),s.green=vm(n.green,a.green,c),s.blue=vm(n.blue,a.blue,c),s.alpha=Nt(n.alpha,a.alpha,c),Ri.transform(s))},kp=new Set(["none","hidden"]);function r3(e,t){return kp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function a3(e,t){return n=>Nt(e,t,n)}function Ug(e){return typeof e=="number"?a3:typeof e=="string"?$g(e)?sd:Ht.test(e)?h1:o3:Array.isArray(e)?Sz:typeof e=="object"?Ht.test(e)?h1:i3:sd}function Sz(e,t){const n=[...e],a=n.length,s=e.map((c,l)=>Ug(c)(c,t[l]));return c=>{for(let l=0;l<a;l++)n[l]=s[l](c);return n}}function i3(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=Ug(e[s])(e[s],t[s]));return s=>{for(const c in a)n[c]=a[c](s);return n}}function s3(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const c=t.types[s],l=e.indexes[c][a[c]],f=e.values[l]??0;n[s]=f,a[c]++}return n}const o3=(e,t)=>{const n=Wa.createTransformer(t),a=Hl(e),s=Hl(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?kp.has(e)&&!s.values.length||kp.has(t)&&!a.values.length?r3(e,t):rc(Sz(s3(a,s),s.values),n):sd(e,t)};function zz(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Nt(e,t,n):Ug(e)(e,t)}const l3=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>kt.update(t,n),stop:()=>Qa(t),now:()=>dn.isProcessing?dn.timestamp:jn.now()}},jz=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let c=0;c<s;c++)a+=Math.round(e(c/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},od=2e4;function Vg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<od;)t+=n,a=e.next(t);return t>=od?1/0:t}function c3(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(Vg(a),od);return{type:"keyframes",ease:c=>a.next(s*c).value/t,duration:mr(s)}}const u3=5;function _z(e,t,n){const a=Math.max(t-u3,0);return az(n-e(a),t-a)}const Rt={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},km=.001;function d3({duration:e=Rt.duration,bounce:t=Rt.bounce,velocity:n=Rt.velocity,mass:a=Rt.mass}){let s,c,l=1-t;l=$r(Rt.minDamping,Rt.maxDamping,l),e=$r(Rt.minDuration,Rt.maxDuration,mr(e)),l<1?(s=m=>{const g=m*l,x=g*e,b=g-n,v=wp(m,l),j=Math.exp(-x);return km-b/v*j},c=m=>{const x=m*l*e,b=x*n+n,v=Math.pow(l,2)*Math.pow(m,2)*e,j=Math.exp(-x),S=wp(Math.pow(m,2),l);return(-s(m)+km>0?-1:1)*((b-v)*j)/S}):(s=m=>{const g=Math.exp(-m*e),x=(m-n)*e+1;return-km+g*x},c=m=>{const g=Math.exp(-m*e),x=(n-m)*(e*e);return g*x});const f=5/e,h=h3(s,c,f);if(e=da(e),isNaN(h))return{stiffness:Rt.stiffness,damping:Rt.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const f3=12;function h3(e,t,n){let a=n;for(let s=1;s<f3;s++)a=a-e(a)/t(a);return a}function wp(e,t){return e*Math.sqrt(1-t*t)}const m3=["duration","bounce"],p3=["stiffness","damping","mass"];function m1(e,t){return t.some(n=>e[n]!==void 0)}function g3(e){let t={velocity:Rt.velocity,stiffness:Rt.stiffness,damping:Rt.damping,mass:Rt.mass,isResolvedFromDuration:!1,...e};if(!m1(e,p3)&&m1(e,m3))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,c=2*$r(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Rt.mass,stiffness:s,damping:c}}else{const n=d3(e);t={...t,...n,mass:Rt.mass},t.isResolvedFromDuration=!0}return t}function ld(e=Rt.visualDuration,t=Rt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:s}=n;const c=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],f={done:!1,value:c},{stiffness:h,damping:m,mass:g,duration:x,velocity:b,isResolvedFromDuration:v}=g3({...n,velocity:-mr(n.velocity||0)}),j=b||0,S=m/(2*Math.sqrt(h*g)),O=l-c,T=mr(Math.sqrt(h/g)),E=Math.abs(O)<5;a||(a=E?Rt.restSpeed.granular:Rt.restSpeed.default),s||(s=E?Rt.restDelta.granular:Rt.restDelta.default);let C;if(S<1){const D=wp(T,S);C=M=>{const Z=Math.exp(-S*T*M);return l-Z*((j+S*T*O)/D*Math.sin(D*M)+O*Math.cos(D*M))}}else if(S===1)C=D=>l-Math.exp(-T*D)*(O+(j+T*O)*D);else{const D=T*Math.sqrt(S*S-1);C=M=>{const Z=Math.exp(-S*T*M),U=Math.min(D*M,300);return l-Z*((j+S*T*O)*Math.sinh(U)+D*O*Math.cosh(U))/D}}const $={calculatedDuration:v&&x||null,next:D=>{const M=C(D);if(v)f.done=D>=x;else{let Z=D===0?j:0;S<1&&(Z=D===0?da(j):_z(C,D,M));const U=Math.abs(Z)<=a,K=Math.abs(l-M)<=s;f.done=U&&K}return f.value=f.done?l:M,f},toString:()=>{const D=Math.min(Vg($),od),M=jz(Z=>$.next(D*Z).value,D,30);return D+"ms "+M},toTransition:()=>{}};return $}ld.applyToOptions=e=>{const t=c3(e,100,ld);return e.ease=t.ease,e.duration=da(t.duration),e.type="keyframes",e};function Sp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:c=500,modifyTarget:l,min:f,max:h,restDelta:m=.5,restSpeed:g}){const x=e[0],b={done:!1,value:x},v=U=>f!==void 0&&U<f||h!==void 0&&U>h,j=U=>f===void 0?h:h===void 0||Math.abs(f-U)<Math.abs(h-U)?f:h;let S=n*t;const O=x+S,T=l===void 0?O:l(O);T!==O&&(S=T-x);const E=U=>-S*Math.exp(-U/a),C=U=>T+E(U),$=U=>{const K=E(U),de=C(U);b.done=Math.abs(K)<=m,b.value=b.done?T:de};let D,M;const Z=U=>{v(b.value)&&(D=U,M=ld({keyframes:[b.value,j(b.value)],velocity:_z(C,U,b.value),damping:s,stiffness:c,restDelta:m,restSpeed:g}))};return Z(0),{calculatedDuration:null,next:U=>{let K=!1;return!M&&D===void 0&&(K=!0,$(U),Z(U)),D!==void 0&&U>=D?M.next(U-D):(!K&&$(U),b)}}}function x3(e,t,n){const a=[],s=n||ma.mix||zz,c=e.length-1;for(let l=0;l<c;l++){let f=s(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||pr:t;f=rc(h,f)}a.push(f)}return a}function y3(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const c=e.length;if(Ag(c===t.length),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=x3(t,a,s),h=f.length,m=g=>{if(l&&g<e[0])return t[0];let x=0;if(h>1)for(;x<e.length-2&&!(g<e[x+1]);x++);const b=Il(e[x],e[x+1],g);return f[x](b)};return n?g=>m($r(e[0],e[c-1],g)):m}function b3(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Il(0,t,a);e.push(Nt(n,1,s))}}function v3(e){const t=[0];return b3(t,e.length-1),t}function k3(e,t){return e.map(n=>n*t)}function w3(e,t){return e.map(()=>t||hz).splice(0,e.length-1)}function Tl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=M5(a)?a.map(l1):l1(a),c={done:!1,value:t[0]},l=k3(n&&n.length===t.length?n:v3(t),e),f=y3(l,t,{ease:Array.isArray(s)?s:w3(t,s)});return{calculatedDuration:e,next:h=>(c.value=f(h),c.done=h>=e,c)}}const S3=e=>e!==null;function Bg(e,{repeat:t,repeatType:n="loop"},a,s=1){const c=e.filter(S3),f=s<0||t&&n!=="loop"&&t%2===1?0:c.length-1;return!f||a===void 0?c[f]:a}const z3={decay:Sp,inertia:Sp,tween:Tl,keyframes:Tl,spring:ld};function Nz(e){typeof e.type=="string"&&(e.type=z3[e.type])}class Ig{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 j3=e=>e/100;class Zg extends Ig{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!==jn.now()&&this.tick(jn.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;Nz(t);const{type:n=Tl,repeat:a=0,repeatDelay:s=0,repeatType:c,velocity:l=0}=t;let{keyframes:f}=t;const h=n||Tl;h!==Tl&&typeof f[0]!="number"&&(this.mixKeyframes=rc(j3,zz(f[0],f[1])),f=[0,100]);const m=h({...t,keyframes:f});c==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=Vg(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:c,mirroredGenerator:l,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:x,repeatType:b,repeatDelay:v,type:j,onUpdate:S,finalKeyframe:O}=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 T=this.currentTime-m*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?T<0:T>s;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,$=a;if(x){const U=Math.min(this.currentTime,s)/f;let K=Math.floor(U),de=U%1;!de&&U>=1&&(de=1),de===1&&K--,K=Math.min(K,x+1),K%2&&(b==="reverse"?(de=1-de,v&&(de-=v/f)):b==="mirror"&&($=l)),C=$r(0,1,de)*f}const D=E?{done:!1,value:g[0]}:$.next(C);c&&(D.value=c(D.value));let{done:M}=D;!E&&h!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const Z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return Z&&j!==Sp&&(D.value=Bg(g,this.options,O,this.speed)),S&&S(D.value),Z&&this.finish(),D}then(t,n){return this.finished.then(t,n)}get duration(){return mr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mr(t)}get time(){return mr(this.currentTime)}set time(t){t=da(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(jn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=mr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=l3,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(jn.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 _3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Di=e=>e*180/Math.PI,zp=e=>{const t=Di(Math.atan2(e[1],e[0]));return jp(t)},N3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zp,rotateZ:zp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},jp=e=>(e=e%360,e<0&&(e+=360),e),p1=zp,g1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),x1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),C3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:g1,scaleY:x1,scale:e=>(g1(e)+x1(e))/2,rotateX:e=>jp(Di(Math.atan2(e[6],e[5]))),rotateY:e=>jp(Di(Math.atan2(-e[2],e[0]))),rotateZ:p1,rotate:p1,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _p(e){return e.includes("scale")?1:0}function Np(e,t){if(!e||e==="none")return _p(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=C3,s=n;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=N3,s=f}if(!s)return _p(t);const c=a[t],l=s[1].split(",").map(E3);return typeof c=="function"?c(l):l[c]}const T3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Np(n,t)};function E3(e){return parseFloat(e.trim())}const uo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fo=new Set(uo),y1=e=>e===co||e===ke,A3=new Set(["x","y","z"]),O3=uo.filter(e=>!A3.has(e));function M3(e){const t=[];return O3.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Ja={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})=>Np(t,"x"),y:(e,{transform:t})=>Np(t,"y")};Ja.translateX=Ja.x;Ja.translateY=Ja.y;const $i=new Set;let Cp=!1,Tp=!1,Ep=!1;function Cz(){if(Tp){const e=Array.from($i).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=M3(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(([c,l])=>{a.getValue(c)?.set(l)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Tp=!1,Cp=!1,$i.forEach(e=>e.complete(Ep)),$i.clear()}function Tz(){$i.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Tp=!0)})}function R3(){Ep=!0,Tz(),Cz(),Ep=!1}class Hg{constructor(t,n,a,s,c,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=c,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?($i.add(this),Cp||(Cp=!0,kt.read(Tz),kt.resolveKeyframes(Cz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const c=s?.get(),l=t[t.length-1];if(c!==void 0)t[0]=c;else if(a&&n){const f=a.readValue(n,l);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=l),s&&c===void 0&&s.set(t[0])}_3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$i.delete(this)}cancel(){this.state==="scheduled"&&($i.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const D3=e=>e.startsWith("--");function $3(e,t,n){D3(t)?e.style.setProperty(t,n):e.style[t]=n}const L3=Og(()=>window.ScrollTimeline!==void 0),P3={};function U3(e,t){const n=Og(e);return()=>P3[t]??n()}const Ez=U3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sl=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,b1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sl([0,.65,.55,1]),circOut:Sl([.55,0,1,.45]),backIn:Sl([.31,.01,.66,-.59]),backOut:Sl([.33,1.53,.69,.99])};function Az(e,t){if(e)return typeof e=="function"?Ez()?jz(e,t):"ease-out":mz(e)?Sl(e):Array.isArray(e)?e.map(n=>Az(n,t)||b1.easeOut):b1[e]}function V3(e,t,n,{delay:a=0,duration:s=300,repeat:c=0,repeatType:l="loop",ease:f="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const x=Az(f,s);Array.isArray(x)&&(g.easing=x);const b={delay:a,duration:s,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:c+1,direction:l==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(g,b)}function Oz(e){return typeof e=="function"&&"applyToOptions"in e}function B3({type:e,...t}){return Oz(e)&&Ez()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class I3 extends Ig{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:c,allowFlatten:l=!1,finalKeyframe:f,onComplete:h}=t;this.isPseudoElement=!!c,this.allowFlatten=l,this.options=t,Ag(typeof t.type!="string");const m=B3(t);this.animation=V3(n,a,s,m,c),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const g=Bg(s,this.options,f,this.speed);this.updateMotionValue?this.updateMotionValue(g):$3(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 mr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mr(t)}get time(){return mr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=da(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&&L3()?(this.animation.timeline=t,pr):n(this)}}const Mz={anticipate:uz,backInOut:cz,circInOut:fz};function Z3(e){return e in Mz}function H3(e){typeof e.ease=="string"&&Z3(e.ease)&&(e.ease=Mz[e.ease])}const wm=10;class F3 extends I3{constructor(t){H3(t),Nz(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:c,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const f=new Zg({...l,autoplay:!1}),h=Math.max(wm,jn.now()-this.startTime),m=$r(0,wm,h-wm);n.setWithVelocity(f.sample(Math.max(0,h-m)).value,f.sample(h).value,m),f.stop()}}const v1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Wa.test(e)||e==="0")&&!e.startsWith("url("));function q3(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 G3(e,t,n,a){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const c=e[e.length-1],l=v1(s,t),f=v1(c,t);return!l||!f?!1:q3(e)||(n==="spring"||Oz(n))&&a}function Ap(e){e.duration=0,e.type="keyframes"}const Y3=new Set(["opacity","clipPath","filter","transform"]),J3=Og(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function K3(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:c,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return J3()&&n&&Y3.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&c!==0&&l!=="inertia"}const X3=40;class Q3 extends Ig{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:l="loop",keyframes:f,name:h,motionValue:m,element:g,...x}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=jn.now();const b={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:c,repeatType:l,name:h,motionValue:m,element:g,...x},v=g?.KeyframeResolver||Hg;this.keyframeResolver=new v(f,(j,S,O)=>this.onKeyframesResolved(j,S,b,!O),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:c,type:l,velocity:f,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=jn.now(),G3(t,c,l,f)||((ma.instantAnimations||!h)&&g?.(Bg(t,a,n)),t[0]=t[t.length-1],Ap(a),a.repeat=0);const b={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>X3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&K3(b),j=b.motionValue?.owner?.current,S=v?new F3({...b,element:j}):new Zg(b);S.finished.then(()=>{this.notifyFinished()}).catch(pr),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}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(),R3()),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 Rz(e,t,n,a=0,s=1){const c=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,f=(l-1)*a;return typeof n=="function"?n(c,l):s===1?c*a:f-c*a}const W3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eO(e){const t=W3.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function Dz(e,t,n=1){const[a,s]=eO(e);if(!a)return;const c=window.getComputedStyle(t).getPropertyValue(a);if(c){const l=c.trim();return tz(l)?parseFloat(l):l}return $g(s)?Dz(s,t,n+1):s}const tO={type:"spring",stiffness:500,damping:25,restSpeed:10},nO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),rO={type:"keyframes",duration:.8},aO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},iO=(e,{keyframes:t})=>t.length>2?rO:fo.has(e)?e.startsWith("scale")?nO(t[1]):tO:aO,sO=e=>e!==null;function oO(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(sO),c=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[c]}function Fg(e,t){return e?.[t]??e?.default??e}function lO({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:s,repeat:c,repeatType:l,repeatDelay:f,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const qg=(e,t,n,a={},s,c)=>l=>{const f=Fg(a,e)||{},h=f.delay||a.delay||0;let{elapsed:m=0}=a;m=m-da(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:c?void 0:s};lO(f)||Object.assign(g,iO(e,g)),g.duration&&(g.duration=da(g.duration)),g.repeatDelay&&(g.repeatDelay=da(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let x=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(Ap(g),g.delay===0&&(x=!0)),(ma.instantAnimations||ma.skipAnimations)&&(x=!0,Ap(g),g.delay=0),g.allowFlatten=!f.type&&!f.ease,x&&!c&&t.get()!==void 0){const b=oO(g.keyframes,f);if(b!==void 0){kt.update(()=>{g.onUpdate(b),g.onComplete()});return}}return f.isSync?new Zg(g):new Q3(g)};function k1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Gg(e,t,n,a){if(typeof t=="function"){const[s,c]=k1(a);t=t(n!==void 0?n:e.custom,s,c)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,c]=k1(a);t=t(n!==void 0?n:e.custom,s,c)}return t}function qs(e,t,n){const a=e.getProps();return Gg(a,t,n!==void 0?n:a.custom,e)}const $z=new Set(["width","height","top","left","right","bottom",...uo]),w1=30,cO=e=>!isNaN(parseFloat(e));class uO{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=jn.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 c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=jn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=cO(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 Mg);const a=this.events[t].add(n);return t==="change"?()=>{a(),kt.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=jn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>w1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,w1);return az(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 eo(e,t){return new uO(e,t)}const Op=e=>Array.isArray(e);function dO(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,eo(n))}function fO(e){return Op(e)?e[e.length-1]||0:e}function hO(e,t){const n=qs(e,t);let{transitionEnd:a={},transition:s={},...c}=n||{};c={...c,...a};for(const l in c){const f=fO(c[l]);dO(e,l,f)}}const xn=e=>!!(e&&e.getVelocity);function mO(e){return!!(xn(e)&&e.add)}function Mp(e,t){const n=e.getValue("willChange");if(mO(n))return n.add(t);if(!n&&ma.WillChange){const a=new ma.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Yg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const pO="framerAppearId",Lz="data-"+Yg(pO);function Pz(e){return e.props[Lz]}function gO({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Uz(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:c=e.getDefaultTransition(),transitionEnd:l,...f}=t;const h=c?.reduceMotion;a&&(c=a);const m=[],g=s&&e.animationState&&e.animationState.getState()[s];for(const x in f){const b=e.getValue(x,e.latestValues[x]??null),v=f[x];if(v===void 0||g&&gO(g,x))continue;const j={delay:n,...Fg(c||{},x)},S=b.get();if(S!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===S&&!j.velocity)continue;let O=!1;if(window.MotionHandoffAnimation){const C=Pz(e);if(C){const $=window.MotionHandoffAnimation(C,x,kt);$!==null&&(j.startTime=$,O=!0)}}Mp(e,x);const T=h??e.shouldReduceMotion;b.start(qg(x,b,v,T&&$z.has(x)?{type:!1}:j,e,O));const E=b.animation;E&&m.push(E)}return l&&Promise.all(m).then(()=>{kt.update(()=>{l&&hO(e,l)})}),m}function Rp(e,t,n={}){const a=qs(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const c=a?()=>Promise.all(Uz(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:x}=s;return xO(e,t,h,m,g,x,n)}:()=>Promise.resolve(),{when:f}=s;if(f){const[h,m]=f==="beforeChildren"?[c,l]:[l,c];return h().then(()=>m())}else return Promise.all([c(),l(n.delay)])}function xO(e,t,n=0,a=0,s=0,c=1,l){const f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.push(Rp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+Rz(e.variantChildren,h,a,s,c)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function yO(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(c=>Rp(e,c,n));a=Promise.all(s)}else if(typeof t=="string")a=Rp(e,t,n);else{const s=typeof t=="function"?qs(e,t,n.custom):t;a=Promise.all(Uz(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const bO={test:e=>e==="auto",parse:e=>e},Vz=e=>t=>t.test(e),Bz=[co,ke,Dr,Ha,q5,F5,bO],S1=e=>Bz.find(Vz(e));function vO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||rz(e):!0}const kO=new Set(["brightness","contrast","saturate","opacity"]);function wO(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(Lg)||[];if(!a)return e;const s=n.replace(a,"");let c=kO.has(t)?1:0;return a!==n&&(c*=100),t+"("+c+s+")"}const SO=/\b([a-z-]*)\(.*?\)/gu,Dp={...Wa,getAnimatableNone:e=>{const t=e.match(SO);return t?t.map(wO).join(" "):e}},z1={...co,transform:Math.round},zO={rotate:Ha,rotateX:Ha,rotateY:Ha,rotateZ:Ha,scale:Eu,scaleX:Eu,scaleY:Eu,scaleZ:Eu,skew:Ha,skewX:Ha,skewY:Ha,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Zl,originX:u1,originY:u1,originZ:ke},Jg={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...zO,zIndex:z1,fillOpacity:Zl,strokeOpacity:Zl,numOctaves:z1},jO={...Jg,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:Dp,WebkitFilter:Dp},Iz=e=>jO[e];function Zz(e,t){let n=Iz(e);return n!==Dp&&(n=Wa),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _O=new Set(["auto","none","0"]);function NO(e,t,n){let a=0,s;for(;a<e.length&&!s;){const c=e[a];typeof c=="string"&&!_O.has(c)&&Hl(c).values.length&&(s=e[a]),a++}if(s&&n)for(const c of t)e[c]=Zz(n,s)}class CO extends Hg{constructor(t,n,a,s,c){super(t,n,a,s,c,!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 x=t[g];if(typeof x=="string"&&(x=x.trim(),$g(x))){const b=Dz(x,n.current);b!==void 0&&(t[g]=b),g===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!$z.has(a)||t.length!==2)return;const[s,c]=t,l=S1(s),f=S1(c),h=c1(s),m=c1(c);if(h!==m&&Ja[a]){this.needsMeasurement=!0;return}if(l!==f)if(y1(l)&&y1(f))for(let g=0;g<t.length;g++){const x=t[g];typeof x=="string"&&(t[g]=parseFloat(x))}else Ja[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||vO(t[s]))&&a.push(s);a.length&&NO(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=Ja[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 c=a.length-1,l=a[c];a[c]=Ja[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 TO(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 Hz=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function $p(e){return nz(e)&&"offsetHeight"in e}const{schedule:Kg}=pz(queueMicrotask,!1),zr={x:!1,y:!1};function Fz(){return zr.x||zr.y}function EO(e){return e==="x"||e==="y"?zr[e]?null:(zr[e]=!0,()=>{zr[e]=!1}):zr.x||zr.y?null:(zr.x=zr.y=!0,()=>{zr.x=zr.y=!1})}function qz(e,t){const n=TO(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function j1(e){return!(e.pointerType==="touch"||Fz())}function AO(e,t,n={}){const[a,s,c]=qz(e,n),l=f=>{if(!j1(f))return;const{target:h}=f,m=t(h,f);if(typeof m!="function"||!h)return;const g=x=>{j1(x)&&(m(x),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,s)};return a.forEach(f=>{f.addEventListener("pointerenter",l,s)}),c}const Gz=(e,t)=>t?e===t?!0:Gz(e,t.parentElement):!1,Xg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,OO=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yz(e){return OO.has(e.tagName)||e.isContentEditable===!0}const Xu=new WeakSet;function _1(e){return t=>{t.key==="Enter"&&e(t)}}function Sm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const MO=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=_1(()=>{if(Xu.has(n))return;Sm(n,"down");const s=_1(()=>{Sm(n,"up")}),c=()=>Sm(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",c,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function N1(e){return Xg(e)&&!Fz()}function RO(e,t,n={}){const[a,s,c]=qz(e,n),l=f=>{const h=f.currentTarget;if(!N1(f))return;Xu.add(h);const m=t(h,f),g=(v,j)=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",b),Xu.has(h)&&Xu.delete(h),N1(v)&&typeof m=="function"&&m(v,{success:j})},x=v=>{g(v,h===window||h===document||n.useGlobalTarget||Gz(h,v.target))},b=v=>{g(v,!1)};window.addEventListener("pointerup",x,s),window.addEventListener("pointercancel",b,s)};return a.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",l,s),$p(f)&&(f.addEventListener("focus",m=>MO(m,s)),!Yz(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),c}function Jz(e){return nz(e)&&"ownerSVGElement"in e}function DO(e){return Jz(e)&&e.tagName==="svg"}const $O=[...Bz,Ht,Wa],LO=e=>$O.find(Vz(e)),C1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ps=()=>({x:C1(),y:C1()}),T1=()=>({min:0,max:0}),Wt=()=>({x:T1(),y:T1()}),Lp={current:null},Kz={current:!1},PO=typeof window<"u";function UO(){if(Kz.current=!0,!!PO)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lp.current=e.matches;e.addEventListener("change",t),t()}else Lp.current=!1}const VO=new WeakMap;function Cd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fl(e){return typeof e=="string"||Array.isArray(e)}const Qg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wg=["initial",...Qg];function Td(e){return Cd(e.animate)||Wg.some(t=>Fl(e[t]))}function Xz(e){return!!(Td(e)||e.variants)}function BO(e,t,n){for(const a in t){const s=t[a],c=n[a];if(xn(s))e.addValue(a,s);else if(xn(c))e.addValue(a,eo(s,{owner:e}));else if(c!==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,eo(l!==void 0?l:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const E1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let cd={};function Qz(e){cd=e}function IO(){return cd}class ZO{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:c,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=Hg,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=jn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,kt.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=!!c,this.isControllingVariants=Td(n),this.isVariantNode=Xz(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...x}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in x){const v=x[b];h[b]!==void 0&&xn(v)&&v.set(h[b])}}mount(t){this.current=t,VO.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:(Kz.current||UO(),this.shouldReduceMotion=Lp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Qa(this.notifyUpdate),Qa(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=fo.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&kt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),c&&c(),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 cd){const n=cd[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 c=this.features[t];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Wt()}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<E1.length;a++){const s=E1[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const c="on"+s,l=t[c];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=BO(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=eo(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"&&(tz(a)||rz(a))?a=parseFloat(a):!LO(a)&&Wa.test(n)&&(a=Zz(t,n)),this.setBaseTarget(t,xn(a)?a.get():a)),xn(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 c=Gg(this.props,n,this.presenceContext?.custom);c&&(a=c[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!xn(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 Mg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Kg.render(this.render)}}class Wz extends ZO{constructor(){super(...arguments),this.KeyframeResolver=CO}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;xn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ri{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ej({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function HO({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FO(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 zm(e){return e===void 0||e===1}function Pp({scale:e,scaleX:t,scaleY:n}){return!zm(e)||!zm(t)||!zm(n)}function Ai(e){return Pp(e)||tj(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tj(e){return A1(e.x)||A1(e.y)}function A1(e){return e&&e!=="0%"}function ud(e,t,n){const a=e-n,s=t*a;return n+s}function O1(e,t,n,a,s){return s!==void 0&&(e=ud(e,s,a)),ud(e,n,a)+t}function Up(e,t=0,n=1,a,s){e.min=O1(e.min,t,n,a,s),e.max=O1(e.max,t,n,a,s)}function nj(e,{x:t,y:n}){Up(e.x,t.translate,t.scale,t.originPoint),Up(e.y,n.translate,n.scale,n.originPoint)}const M1=.999999999999,R1=1.0000000000001;function qO(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let c,l;for(let f=0;f<s;f++){c=n[f],l=c.projectionDelta;const{visualElement:h}=c.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Vs(e,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,nj(e,l)),a&&Ai(c.latestValues)&&Vs(e,c.latestValues))}t.x<R1&&t.x>M1&&(t.x=1),t.y<R1&&t.y>M1&&(t.y=1)}function Us(e,t){e.min=e.min+t,e.max=e.max+t}function D1(e,t,n,a,s=.5){const c=Nt(e.min,e.max,s);Up(e,t,n,c,a)}function Vs(e,t){D1(e.x,t.x,t.scaleX,t.scale,t.originX),D1(e.y,t.y,t.scaleY,t.scale,t.originY)}function rj(e,t){return ej(FO(e.getBoundingClientRect(),t))}function GO(e,t,n){const a=rj(e,n),{scroll:s}=t;return s&&(Us(a.x,s.offset.x),Us(a.y,s.offset.y)),a}const YO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JO=uo.length;function KO(e,t,n){let a="",s=!0;for(let c=0;c<JO;c++){const l=uo[c],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=Hz(f,Jg[l]);if(!h){s=!1;const g=YO[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function ex(e,t,n){const{style:a,vars:s,transformOrigin:c}=e;let l=!1,f=!1;for(const h in t){const m=t[h];if(fo.has(h)){l=!0;continue}else if(xz(h)){s[h]=m;continue}else{const g=Hz(m,Jg[h]);h.startsWith("origin")?(f=!0,c[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=KO(t,e.transform,n):a.transform&&(a.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:g=0}=c;a.transformOrigin=`${h} ${m} ${g}`}}function aj(e,{style:t,vars:n},a,s){const c=e.style;let l;for(l in t)c[l]=t[l];s?.applyProjectionStyles(c,a);for(l in n)c.setProperty(l,n[l])}function $1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ml={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=$1(e,t.target.x),a=$1(e,t.target.y);return`${n}% ${a}%`}},XO={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=Wa.parse(e);if(s.length>5)return a;const c=Wa.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=Nt(f,h,.5);return typeof s[2+l]=="number"&&(s[2+l]/=m),typeof s[3+l]=="number"&&(s[3+l]/=m),c(s)}},Vp={borderRadius:{...ml,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ml,borderTopRightRadius:ml,borderBottomLeftRadius:ml,borderBottomRightRadius:ml,boxShadow:XO};function ij(e,{layout:t,layoutId:n}){return fo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Vp[e]||e==="opacity")}function tx(e,t,n){const a=e.style,s=t?.style,c={};if(!a)return c;for(const l in a)(xn(a[l])||s&&xn(s[l])||ij(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(c[l]=a[l]);return c}function QO(e){return window.getComputedStyle(e)}class WO extends Wz{constructor(){super(...arguments),this.type="html",this.renderInstance=aj}readValueFromInstance(t,n){if(fo.has(n))return this.projection?.isProjecting?_p(n):T3(t,n);{const a=QO(t),s=(xz(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rj(t,n)}build(t,n,a){ex(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return tx(t,n,a)}}const eM={offset:"stroke-dashoffset",array:"stroke-dasharray"},tM={offset:"strokeDashoffset",array:"strokeDasharray"};function nM(e,t,n=1,a=0,s=!0){e.pathLength=1;const c=s?eM:tM;e[c.offset]=`${-a}`,e[c.array]=`${t} ${n}`}const rM=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function sj(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:c=1,pathOffset:l=0,...f},h,m,g){if(ex(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:b}=e;x.transform&&(b.transform=x.transform,delete x.transform),(b.transform||x.transformOrigin)&&(b.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),b.transform&&(b.transformBox=g?.transformBox??"fill-box",delete x.transformBox);for(const v of rM)x[v]!==void 0&&(b[v]=x[v],delete x[v]);t!==void 0&&(x.x=t),n!==void 0&&(x.y=n),a!==void 0&&(x.scale=a),s!==void 0&&nM(x,s,c,l,!1)}const oj=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"]),lj=e=>typeof e=="string"&&e.toLowerCase()==="svg";function aM(e,t,n,a){aj(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(oj.has(s)?s:Yg(s),t.attrs[s])}function cj(e,t,n){const a=tx(e,t,n);for(const s in e)if(xn(e[s])||xn(t[s])){const c=uo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[c]=e[s]}return a}class iM extends Wz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fo.has(n)){const a=Iz(n);return a&&a.default||0}return n=oj.has(n)?n:Yg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return cj(t,n,a)}build(t,n,a){sj(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){aM(t,n,a,s)}mount(t){this.isSVGTag=lj(t.tagName),super.mount(t)}}const sM=Wg.length;function uj(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?uj(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sM;n++){const a=Wg[n],s=e.props[a];(Fl(s)||s===!1)&&(t[a]=s)}return t}function dj(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 oM=[...Qg].reverse(),lM=Qg.length;function cM(e){return t=>Promise.all(t.map(({animation:n,options:a})=>yO(e,n,a)))}function uM(e){let t=cM(e),n=L1(),a=!0;const s=h=>(m,g)=>{const x=qs(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(x){const{transition:b,transitionEnd:v,...j}=x;m={...m,...j,...v}}return m};function c(h){t=h(e)}function l(h){const{props:m}=e,g=uj(e.parent)||{},x=[],b=new Set;let v={},j=1/0;for(let O=0;O<lM;O++){const T=oM[O],E=n[T],C=m[T]!==void 0?m[T]:g[T],$=Fl(C),D=T===h?E.isActive:null;D===!1&&(j=O);let M=C===g[T]&&C!==m[T]&&$;if(M&&a&&e.manuallyAnimateOnMount&&(M=!1),E.protectedKeys={...v},!E.isActive&&D===null||!C&&!E.prevProp||Cd(C)||typeof C=="boolean")continue;const Z=dM(E.prevProp,C);let U=Z||T===h&&E.isActive&&!M&&$||O>j&&$,K=!1;const de=Array.isArray(C)?C:[C];let ae=de.reduce(s(T),{});D===!1&&(ae={});const{prevResolvedValues:le={}}=E,ne={...le,...ae},oe=V=>{U=!0,b.has(V)&&(K=!0,b.delete(V)),E.needsAnimating[V]=!0;const G=e.getValue(V);G&&(G.liveStyle=!1)};for(const V in ne){const G=ae[V],ce=le[V];if(v.hasOwnProperty(V))continue;let A=!1;Op(G)&&Op(ce)?A=!dj(G,ce):A=G!==ce,A?G!=null?oe(V):b.add(V):G!==void 0&&b.has(V)?oe(V):E.protectedKeys[V]=!0}E.prevProp=C,E.prevResolvedValues=ae,E.isActive&&(v={...v,...ae}),a&&e.blockInitialAnimation&&(U=!1);const ie=M&&Z;U&&(!ie||K)&&x.push(...de.map(V=>{const G={type:T};if(typeof V=="string"&&a&&!ie&&e.manuallyAnimateOnMount&&e.parent){const{parent:ce}=e,A=qs(ce,V);if(ce.enteringChildren&&A){const{delayChildren:_}=A.transition||{};G.delay=Rz(ce.enteringChildren,e,_)}}return{animation:V,options:G}}))}if(b.size){const O={};if(typeof m.initial!="boolean"){const T=qs(e,Array.isArray(m.initial)?m.initial[0]:m.initial);T&&T.transition&&(O.transition=T.transition)}b.forEach(T=>{const E=e.getBaseTarget(T),C=e.getValue(T);C&&(C.liveStyle=!0),O[T]=E??null}),x.push({animation:O})}let S=!!x.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(S=!1),a=!1,S?t(x):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(x=>x.animationState?.setActive(h,m)),n[h].isActive=m;const g=l(h);for(const x in n)n[x].protectedKeys={};return g}return{animateChanges:l,setActive:f,setAnimateFunction:c,getState:()=>n,reset:()=>{n=L1()}}}function dM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dj(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function L1(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}function P1(e,t){e.min=t.min,e.max=t.max}function wr(e,t){P1(e.x,t.x),P1(e.y,t.y)}function U1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const fj=1e-4,fM=1-fj,hM=1+fj,hj=.01,mM=0-hj,pM=0+hj;function _n(e){return e.max-e.min}function gM(e,t,n){return Math.abs(e-t)<=n}function V1(e,t,n,a=.5){e.origin=a,e.originPoint=Nt(t.min,t.max,e.origin),e.scale=_n(n)/_n(t),e.translate=Nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=fM&&e.scale<=hM||isNaN(e.scale))&&(e.scale=1),(e.translate>=mM&&e.translate<=pM||isNaN(e.translate))&&(e.translate=0)}function El(e,t,n,a){V1(e.x,t.x,n.x,a?a.originX:void 0),V1(e.y,t.y,n.y,a?a.originY:void 0)}function B1(e,t,n){e.min=n.min+t.min,e.max=e.min+_n(t)}function xM(e,t,n){B1(e.x,t.x,n.x),B1(e.y,t.y,n.y)}function I1(e,t,n){e.min=t.min-n.min,e.max=e.min+_n(t)}function dd(e,t,n){I1(e.x,t.x,n.x),I1(e.y,t.y,n.y)}function Z1(e,t,n,a,s){return e-=t,e=ud(e,1/n,a),s!==void 0&&(e=ud(e,1/s,a)),e}function yM(e,t=0,n=1,a=.5,s,c=e,l=e){if(Dr.test(t)&&(t=parseFloat(t),t=Nt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let f=Nt(c.min,c.max,a);e===c&&(f-=t),e.min=Z1(e.min,t,n,f,s),e.max=Z1(e.max,t,n,f,s)}function H1(e,t,[n,a,s],c,l){yM(e,t[n],t[a],t[s],t.scale,c,l)}const bM=["x","scaleX","originX"],vM=["y","scaleY","originY"];function F1(e,t,n,a){H1(e.x,t,bM,n?n.x:void 0,a?a.x:void 0),H1(e.y,t,vM,n?n.y:void 0,a?a.y:void 0)}function q1(e){return e.translate===0&&e.scale===1}function mj(e){return q1(e.x)&&q1(e.y)}function G1(e,t){return e.min===t.min&&e.max===t.max}function kM(e,t){return G1(e.x,t.x)&&G1(e.y,t.y)}function Y1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pj(e,t){return Y1(e.x,t.x)&&Y1(e.y,t.y)}function J1(e){return _n(e.x)/_n(e.y)}function K1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function dr(e){return[e("x"),e("y")]}function wM(e,t,n){let a="";const s=e.x.translate/t.x,c=e.y.translate/t.y,l=n?.z||0;if((s||c||l)&&(a=`translate3d(${s}px, ${c}px, ${l}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:x,rotateY:b,skewX:v,skewY:j}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),x&&(a+=`rotateX(${x}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),j&&(a+=`skewY(${j}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 gj=["TopLeft","TopRight","BottomLeft","BottomRight"],SM=gj.length,X1=e=>typeof e=="string"?parseFloat(e):e,Q1=e=>typeof e=="number"||ke.test(e);function zM(e,t,n,a,s,c){s?(e.opacity=Nt(0,n.opacity??1,jM(a)),e.opacityExit=Nt(t.opacity??1,0,_M(a))):c&&(e.opacity=Nt(t.opacity??1,n.opacity??1,a));for(let l=0;l<SM;l++){const f=`border${gj[l]}Radius`;let h=W1(t,f),m=W1(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||Q1(h)===Q1(m)?(e[f]=Math.max(Nt(X1(h),X1(m),a),0),(Dr.test(m)||Dr.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||n.rotate)&&(e.rotate=Nt(t.rotate||0,n.rotate||0,a))}function W1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const jM=xj(0,.5,dz),_M=xj(.5,.95,pr);function xj(e,t,n){return a=>a<e?0:a>t?1:n(Il(e,t,a))}function NM(e,t,n){const a=xn(e)?e:eo(e);return a.start(qg("",a,t,n)),a.animation}function ql(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const CM=(e,t)=>e.depth-t.depth;class TM{constructor(){this.children=[],this.isDirty=!1}add(t){Tg(this.children,t),this.isDirty=!0}remove(t){Eg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CM),this.isDirty=!1,this.children.forEach(t)}}function EM(e,t){const n=jn.now(),a=({timestamp:s})=>{const c=s-n;c>=t&&(Qa(a),e(c-t))};return kt.setup(a,!0),()=>Qa(a)}function Qu(e){return xn(e)?e.get():e}class AM{constructor(){this.members=[]}add(t){Tg(this.members,t),t.scheduleRender()}remove(t){if(Eg(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 c=this.members[s];if(c.isPresent!==!1){a=c;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,c=t.options.layoutDependency;s!==void 0&&c!==void 0&&s===c||(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 Wu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},jm=["","X","Y","Z"],OM=1e3;let MM=0;function _m(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function yj(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Pz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",kt,!(s||c))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&yj(a)}function bj({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(l={},f=t?.()){this.id=MM++,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($M),this.nodes.forEach(VM),this.nodes.forEach(BM),this.nodes.forEach(LM)},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 TM)}addEventListener(l,f){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Mg),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=Jz(l)&&!DO(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,x=0;const b=()=>this.root.updateBlockedByResize=!1;kt.read(()=>{x=window.innerWidth}),e(l,()=>{const v=window.innerWidth;v!==x&&(x=v,this.root.updateBlockedByResize=!0,g&&g(),g=EM(b,250),Wu.hasAnimatedSinceResize&&(Wu.hasAnimatedSinceResize=!1,this.nodes.forEach(nk)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||m.getDefaultTransition()||qM,{onLayoutAnimationStart:S,onLayoutAnimationComplete:O}=m.getProps(),T=!this.targetLayout||!pj(this.targetLayout,v),E=!x&&b;if(this.options.layoutRoot||this.resumeFrom||E||x&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Fg(j,"layout"),onPlay:S,onComplete:O};(m.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(g,E)}else x||nk(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(),Qa(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(IM),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&&yj(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const x=this.path[g];x.shouldResetTransform=!0,x.updateScroll("snapshot"),x.options.layoutRoot&&x.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(ek);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(tk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(UM),this.nodes.forEach(RM),this.nodes.forEach(DM)):this.nodes.forEach(tk),this.clearAllSnapshots();const f=jn.now();dn.delta=$r(0,1e3/60,f-dn.timestamp),dn.timestamp=f,dn.isProcessing=!0,xm.update.process(dn),xm.preRender.process(dn),xm.render.process(dn),dn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(PM),this.sharedNodes.forEach(ZM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_n(this.snapshot.measuredBox.x)&&!_n(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=Wt(),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&&!mj(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(f||Ai(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)),GM(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Wt();const f=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(YM))){const{scroll:m}=this.root;m&&(Us(f.x,m.offset.x),Us(f.y,m.offset.y))}return f}removeElementScroll(l){const f=Wt();if(wr(f,l),this.scroll?.wasRoot)return f;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:x}=m;m!==this.root&&g&&x.layoutScroll&&(g.wasRoot&&wr(f,l),Us(f.x,g.offset.x),Us(f.y,g.offset.y))}return f}applyTransform(l,f=!1){const h=Wt();wr(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&&Vs(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),Ai(g.latestValues)&&Vs(h,g.latestValues)}return Ai(this.latestValues)&&Vs(h,this.latestValues),h}removeTransform(l){const f=Wt();wr(f,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!Ai(m.latestValues))continue;Pp(m.latestValues)&&m.updateSnapshot();const g=Wt(),x=m.measurePageBox();wr(g,x),F1(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return Ai(this.latestValues)&&F1(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:x}=this.options;if(!this.layout||!(g||x))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=Wt(),this.targetWithTransforms=Wt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):wr(this.target,this.layout.layoutBox),nj(this.target,this.targetDelta)):wr(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||Pp(this.parent.latestValues)||tj(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=Wt(),this.relativeTargetOrigin=Wt(),dd(this.relativeTargetOrigin,f,h),wr(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;wr(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;qO(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=Wt());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(U1(this.prevProjectionDelta.x,this.projectionDelta.x),U1(this.prevProjectionDelta.y,this.projectionDelta.y)),El(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!K1(this.projectionDelta.x,this.prevProjectionDelta.x)||!K1(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=Ps(),this.projectionDelta=Ps(),this.projectionDeltaWithTransform=Ps()}setAnimationOrigin(l,f=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},x=Ps();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const b=Wt(),v=h?h.source:void 0,j=this.layout?this.layout.source:void 0,S=v!==j,O=this.getStack(),T=!O||O.members.length<=1,E=!!(S&&!T&&this.options.crossfade===!0&&!this.path.some(FM));this.animationProgress=0;let C;this.mixTargetDelta=$=>{const D=$/1e3;rk(x.x,l.x,D),rk(x.y,l.y,D),this.setTargetDelta(x),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(dd(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),HM(this.relativeTarget,this.relativeTargetOrigin,b,D),C&&kM(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Wt()),wr(C,this.relativeTarget)),S&&(this.animationValues=g,zM(g,m,this.latestValues,D,E,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Qa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=kt.update(()=>{Wu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=eo(0)),this.currentAnimation=NM(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(OM),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&&vj(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Wt();const x=_n(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+x;const b=_n(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+b}wr(f,h),Vs(f,g),El(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(l,f){this.sharedNodes.has(l)||this.sharedNodes.set(l,new AM),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&&_m("z",l,m,this.animationValues);for(let g=0;g<jm.length;g++)_m(`rotate${jm[g]}`,l,m,this.animationValues),_m(`skew${jm[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=Qu(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=Qu(f?.pointerEvents)||""),this.hasProjected&&!Ai(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let x=wM(this.projectionDeltaWithTransform,this.treeScale,g);h&&(x=h(g,x)),l.transform=x;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 j in Vp){if(g[j]===void 0)continue;const{correct:S,applyTo:O,isCSSVariable:T}=Vp[j],E=x==="none"?g[j]:S(g[j],m);if(O){const C=O.length;for(let $=0;$<C;$++)l[O[$]]=E}else T?this.options.visualElement.renderState.vars[j]=E:l[j]=E}this.options.layoutId&&(l.pointerEvents=m===this?Qu(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(ek),this.root.sharedNodes.clear()}}}function RM(e){e.updateLayout()}function DM(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,c=t.source!==e.layout.source;s==="size"?dr(g=>{const x=c?t.measuredBox[g]:t.layoutBox[g],b=_n(x);x.min=n[g].min,x.max=x.min+b}):vj(s,t.layoutBox,n)&&dr(g=>{const x=c?t.measuredBox[g]:t.layoutBox[g],b=_n(n[g]);x.max=x.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+b)});const l=Ps();El(l,n,t.layoutBox);const f=Ps();c?El(f,e.applyTransform(a,!0),t.measuredBox):El(f,n,t.layoutBox);const h=!mj(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:x,layout:b}=g;if(x&&b){const v=Wt();dd(v,t.layoutBox,x.layoutBox);const j=Wt();dd(j,n,b.layoutBox),pj(v,j)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=j,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 $M(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 LM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function PM(e){e.clearSnapshot()}function ek(e){e.clearMeasurements()}function tk(e){e.isLayoutDirty=!1}function UM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function VM(e){e.resolveTargetDelta()}function BM(e){e.calcProjection()}function IM(e){e.resetSkewAndRotation()}function ZM(e){e.removeLeadSnapshot()}function rk(e,t,n){e.translate=Nt(t.translate,0,n),e.scale=Nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ak(e,t,n,a){e.min=Nt(t.min,n.min,a),e.max=Nt(t.max,n.max,a)}function HM(e,t,n,a){ak(e.x,t.x,n.x,a),ak(e.y,t.y,n.y,a)}function FM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const qM={duration:.45,ease:[.4,0,.1,1]},ik=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sk=ik("applewebkit/")&&!ik("chrome/")?Math.round:pr;function ok(e){e.min=sk(e.min),e.max=sk(e.max)}function GM(e){ok(e.x),ok(e.y)}function vj(e,t,n){return e==="position"||e==="preserve-aspect"&&!gM(J1(t),J1(n),.2)}function YM(e){return e!==e.root&&e.scroll?.wasRoot}const JM=bj({attachResizeListener:(e,t)=>ql(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Nm={current:void 0},kj=bj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Nm.current){const e=new JM({});e.mount(window),e.setOptions({layoutScroll:!0}),Nm.current=e}return Nm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),nx=z.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function lk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function KM(...e){return t=>{let n=!1;const a=e.map(s=>{const c=lk(s,t);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let s=0;s<a.length;s++){const c=a[s];typeof c=="function"?c():lk(e[s],null)}}}}function XM(...e){return z.useCallback(KM(...e),e)}class QM extends z.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=$p(a)&&a.offsetWidth||0,c=$p(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=c-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function WM({children:e,isPresent:t,anchorX:n,anchorY:a,root:s}){const c=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(nx),m=e.props?.ref??e?.ref,g=XM(l,m);return z.useInsertionEffect(()=>{const{width:x,height:b,top:v,left:j,right:S,bottom:O}=f.current;if(t||!l.current||!x||!b)return;const T=n==="left"?`left: ${j}`:`right: ${S}`,E=a==="bottom"?`bottom: ${O}`:`top: ${v}`;l.current.dataset.motionPopId=c;const C=document.createElement("style");h&&(C.nonce=h);const $=s??document.head;return $.appendChild(C),C.sheet&&C.sheet.insertRule(`
|
|
12
|
-
[data-motion-pop-id="${c}"] {
|
|
13
|
-
position: absolute !important;
|
|
14
|
-
width: ${x}px !important;
|
|
15
|
-
height: ${b}px !important;
|
|
16
|
-
${T}px !important;
|
|
17
|
-
${E}px !important;
|
|
18
|
-
}
|
|
19
|
-
`),()=>{$.contains(C)&&$.removeChild(C)}},[t]),u.jsx(QM,{isPresent:t,childRef:l,sizeRef:f,children:z.cloneElement(e,{ref:g})})}const eR=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:c,mode:l,anchorX:f,anchorY:h,root:m})=>{const g=Cg(tR),x=z.useId();let b=!0,v=z.useMemo(()=>(b=!1,{id:x,initial:t,isPresent:n,custom:s,onExitComplete:j=>{g.set(j,!0);for(const S of g.values())if(!S)return;a&&a()},register:j=>(g.set(j,!1),()=>g.delete(j))}),[n,g,a]);return c&&b&&(v={...v}),z.useMemo(()=>{g.forEach((j,S)=>g.set(S,!1))},[n]),z.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=u.jsx(WM,{isPresent:n,anchorX:f,anchorY:h,root:m,children:e})),u.jsx(Nd.Provider,{value:v,children:e})};function tR(){return new Map}function wj(e=!0){const t=z.useContext(Nd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,c=z.useId();z.useEffect(()=>{if(e)return s(c)},[e]);const l=z.useCallback(()=>e&&a&&a(c),[c,a,e]);return!n&&a?[!1,l]:[!0]}const Au=e=>e.key||"";function ck(e){const t=[];return z.Children.forEach(e,n=>{z.isValidElement(n)&&t.push(n)}),t}const nR=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:c="sync",propagate:l=!1,anchorX:f="left",anchorY:h="top",root:m})=>{const[g,x]=wj(l),b=z.useMemo(()=>ck(e),[e]),v=l&&!g?[]:b.map(Au),j=z.useRef(!0),S=z.useRef(b),O=Cg(()=>new Map),T=z.useRef(new Set),[E,C]=z.useState(b),[$,D]=z.useState(b);ez(()=>{j.current=!1,S.current=b;for(let U=0;U<$.length;U++){const K=Au($[U]);v.includes(K)?(O.delete(K),T.current.delete(K)):O.get(K)!==!0&&O.set(K,!1)}},[$,v.length,v.join("-")]);const M=[];if(b!==E){let U=[...b];for(let K=0;K<$.length;K++){const de=$[K],ae=Au(de);v.includes(ae)||(U.splice(K,0,de),M.push(de))}return c==="wait"&&M.length&&(U=M),D(ck(U)),C(b),null}const{forceRender:Z}=z.useContext(Ng);return u.jsx(u.Fragment,{children:$.map(U=>{const K=Au(U),de=l&&!g?!1:b===$||v.includes(K),ae=()=>{if(T.current.has(K))return;if(T.current.add(K),O.has(K))O.set(K,!0);else return;let le=!0;O.forEach(ne=>{ne||(le=!1)}),le&&(Z?.(),D(S.current),l&&x?.(),a&&a())};return u.jsx(eR,{isPresent:de,initial:!j.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:c,root:m,onExitComplete:de?void 0:ae,anchorX:f,anchorY:h,children:U},K)})})},Sj=z.createContext({strict:!1}),uk={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 dk=!1;function rR(){if(dk)return;const e={};for(const t in uk)e[t]={isEnabled:n=>uk[t].some(a=>!!n[a])};Qz(e),dk=!0}function zj(){return rR(),IO()}function aR(e){const t=zj();for(const n in e)t[n]={...t[n],...e[n]};Qz(t)}const iR=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 fd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iR.has(e)}let jj=e=>!fd(e);function sR(e){typeof e=="function"&&(jj=t=>t.startsWith("on")?!fd(t):e(t))}try{sR(require("@emotion/is-prop-valid").default)}catch{}function oR(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(jj(s)||n===!0&&fd(s)||!t&&!fd(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Ed=z.createContext({});function lR(e,t){if(Td(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Fl(n)?n:void 0,animate:Fl(a)?a:void 0}}return e.inherit!==!1?t:{}}function cR(e){const{initial:t,animate:n}=lR(e,z.useContext(Ed));return z.useMemo(()=>({initial:t,animate:n}),[fk(t),fk(n)])}function fk(e){return Array.isArray(e)?e.join(" "):e}const rx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _j(e,t,n){for(const a in t)!xn(t[a])&&!ij(a,n)&&(e[a]=t[a])}function uR({transformTemplate:e},t){return z.useMemo(()=>{const n=rx();return ex(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dR(e,t){const n=e.style||{},a={};return _j(a,n,e),Object.assign(a,uR(e,t)),a}function fR(e,t){const n={},a=dR(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 Nj=()=>({...rx(),attrs:{}});function hR(e,t,n,a){const s=z.useMemo(()=>{const c=Nj();return sj(c,t,lj(a),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};_j(c,e.style,e),s.style={...c,...s.style}}return s}const mR=["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 ax(e){return typeof e!="string"||e.includes("-")?!1:!!(mR.indexOf(e)>-1||/[A-Z]/u.test(e))}function pR(e,t,n,{latestValues:a},s,c=!1,l){const h=(l??ax(e)?hR:fR)(t,a,s,e),m=oR(t,typeof e=="string",c),g=e!==z.Fragment?{...m,...h,ref:n}:{},{children:x}=t,b=z.useMemo(()=>xn(x)?x.get():x,[x]);return z.createElement(e,{...g,children:b})}function gR({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:xR(n,a,s,e),renderState:t()}}function xR(e,t,n,a){const s={},c=a(e,{});for(const b in c)s[b]=Qu(c[b]);let{initial:l,animate:f}=e;const h=Td(e),m=Xz(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 x=g?f:l;if(x&&typeof x!="boolean"&&!Cd(x)){const b=Array.isArray(x)?x:[x];for(let v=0;v<b.length;v++){const j=Gg(e,b[v]);if(j){const{transitionEnd:S,transition:O,...T}=j;for(const E in T){let C=T[E];if(Array.isArray(C)){const $=g?C.length-1:0;C=C[$]}C!==null&&(s[E]=C)}for(const E in S)s[E]=S[E]}}}return s}const Cj=e=>(t,n)=>{const a=z.useContext(Ed),s=z.useContext(Nd),c=()=>gR(e,t,a,s);return n?c():Cg(c)},yR=Cj({scrapeMotionValuesFromProps:tx,createRenderState:rx}),bR=Cj({scrapeMotionValuesFromProps:cj,createRenderState:Nj}),vR=Symbol.for("motionComponentSymbol");function kR(e,t,n){const a=z.useRef(n);z.useInsertionEffect(()=>{a.current=n});const s=z.useRef(null);return z.useCallback(c=>{c&&e.onMount?.(c),t&&(c?t.mount(c):t.unmount());const l=a.current;if(typeof l=="function")if(c){const f=l(c);typeof f=="function"&&(s.current=f)}else s.current?(s.current(),s.current=null):l(c);else l&&(l.current=c)},[t])}const Tj=z.createContext({});function zl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wR(e,t,n,a,s,c){const{visualElement:l}=z.useContext(Ed),f=z.useContext(Sj),h=z.useContext(Nd),m=z.useContext(nx).reducedMotion,g=z.useRef(null),x=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:c}),x.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const b=g.current,v=z.useContext(Tj);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&SR(g.current,n,s,v);const j=z.useRef(!1);z.useInsertionEffect(()=>{b&&j.current&&b.update(n,h)});const S=n[Lz],O=z.useRef(!!S&&!window.MotionHandoffIsComplete?.(S)&&window.MotionHasOptimisedAnimation?.(S));return ez(()=>{x.current=!0,b&&(j.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),O.current&&b.animationState&&b.animationState.animateChanges())}),z.useEffect(()=>{b&&(!O.current&&b.animationState&&b.animationState.animateChanges(),O.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(S)}),O.current=!1),b.enteringChildren=void 0)}),b}function SR(e,t,n,a){const{layoutId:s,layout:c,drag:l,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ej(e.parent)),e.projection.setOptions({layoutId:s,layout:c,alwaysMeasureLayout:!!l||f&&zl(f),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function Ej(e){if(e)return e.options.allowProjection!==!1?e.projection:Ej(e.parent)}function Cm(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&aR(a);const c=n?n==="svg":ax(e),l=c?bR:yR;function f(m,g){let x;const b={...z.useContext(nx),...m,layoutId:zR(m)},{isStatic:v}=b,j=cR(m),S=l(m,v);if(!v&&WS){jR();const O=_R(b);x=O.MeasureLayout,j.visualElement=wR(e,S,b,s,O.ProjectionNode,c)}return u.jsxs(Ed.Provider,{value:j,children:[x&&j.visualElement?u.jsx(x,{visualElement:j.visualElement,...b}):null,pR(e,m,kR(S,j.visualElement,g),S,v,t,c)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=z.forwardRef(f);return h[vR]=e,h}function zR({layoutId:e}){const t=z.useContext(Ng).id;return t&&e!==void 0?t+"-"+e:e}function jR(e,t){z.useContext(Sj).strict}function _R(e){const t=zj(),{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 NR(e,t){if(typeof Proxy>"u")return Cm;const n=new Map,a=(c,l)=>Cm(c,l,e,t),s=(c,l)=>a(c,l);return new Proxy(s,{get:(c,l)=>l==="create"?a:(n.has(l)||n.set(l,Cm(l,void 0,e,t)),n.get(l))})}const CR=(e,t)=>t.isSVG??ax(e)?new iM(t):new WO(t,{allowProjection:e!==z.Fragment});class TR extends ri{constructor(t){super(t),t.animationState||(t.animationState=uM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Cd(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 ER=0;class AR extends ri{constructor(){super(...arguments),this.id=ER++}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 OR={animation:{Feature:TR},exit:{Feature:AR}};function sc(e){return{point:{x:e.pageX,y:e.pageY}}}const MR=e=>t=>Xg(t)&&e(t,sc(t));function Al(e,t,n,a){return ql(e,t,MR(n),a)}const Aj=({current:e})=>e?e.ownerDocument.defaultView:null,hk=(e,t)=>Math.abs(e-t);function RR(e,t){const n=hk(e.x,t.x),a=hk(e.y,t.y);return Math.sqrt(n**2+a**2)}const mk=new Set(["auto","scroll"]);class Oj{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:c=!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=Em(this.lastMoveEventInfo,this.history),j=this.startEvent!==null,S=RR(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!j&&!S)return;const{point:O}=v,{timestamp:T}=dn;this.history.push({...O,timestamp:T});const{onStart:E,onMove:C}=this.handlers;j||(E&&E(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,v)},this.handlePointerMove=(v,j)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Tm(j,this.transformPagePoint),kt.update(this.updatePoint,!0)},this.handlePointerUp=(v,j)=>{this.end();const{onEnd:S,onSessionEnd:O,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=Em(v.type==="pointercancel"?this.lastMoveEventInfo:Tm(j,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,E),O&&O(v,E)},!Xg(t))return;this.dragSnapToOrigin=c,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=s||window;const h=sc(t),m=Tm(h,this.transformPagePoint),{point:g}=m,{timestamp:x}=dn;this.history=[{...g,timestamp:x}];const{onSessionStart:b}=n;b&&b(t,Em(m,this.history)),this.removeListeners=rc(Al(this.contextWindow,"pointermove",this.handlePointerMove),Al(this.contextWindow,"pointerup",this.handlePointerUp),Al(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(mk.has(a.overflowX)||mk.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},c={x:s.x-n.x,y:s.y-n.y};c.x===0&&c.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,s),kt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Qa(this.updatePoint)}}function Tm(e,t){return t?{point:t(e.point)}:e}function pk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Em({point:e},t){return{point:e,delta:pk(e,Mj(t)),offset:pk(e,DR(t)),velocity:$R(t,.1)}}function DR(e){return e[0]}function Mj(e){return e[e.length-1]}function $R(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=Mj(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>da(t)));)n--;if(!a)return{x:0,y:0};const c=mr(s.timestamp-a.timestamp);if(c===0)return{x:0,y:0};const l={x:(s.x-a.x)/c,y:(s.y-a.y)/c};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function LR(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?Nt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?Nt(n,e,a.max):Math.min(e,n)),e}function gk(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 PR(e,{top:t,left:n,bottom:a,right:s}){return{x:gk(e.x,n,s),y:gk(e.y,t,a)}}function xk(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 UR(e,t){return{x:xk(e.x,t.x),y:xk(e.y,t.y)}}function VR(e,t){let n=.5;const a=_n(e),s=_n(t);return s>a?n=Il(t.min,t.max-a,e.min):a>s&&(n=Il(e.min,e.max-s,t.min)),$r(0,1,n)}function BR(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 Bp=.35;function IR(e=Bp){return e===!1?e=0:e===!0&&(e=Bp),{x:yk(e,"left","right"),y:yk(e,"top","bottom")}}function yk(e,t,n){return{min:bk(e,t),max:bk(e,n)}}function bk(e,t){return typeof e=="number"?e:e[t]||0}const ZR=new WeakMap;class HR{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=Wt(),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 c=x=>{n?(this.stopAnimation(),this.snapToCursor(sc(x).point)):this.pauseAnimation()},l=(x,b)=>{this.stopAnimation();const{drag:v,dragPropagation:j,onDragStart:S}=this.getProps();if(v&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=EO(v),!this.openDragLock))return;this.latestPointerEvent=x,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),dr(T=>{let E=this.getAxisMotionValue(T).get()||0;if(Dr.test(E)){const{projection:C}=this.visualElement;if(C&&C.layout){const $=C.layout.layoutBox[T];$&&(E=_n($)*(parseFloat(E)/100))}}this.originPoint[T]=E}),S&&kt.postRender(()=>S(x,b)),Mp(this.visualElement,"transform");const{animationState:O}=this.visualElement;O&&O.setActive("whileDrag",!0)},f=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:j,onDirectionLock:S,onDrag:O}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:T}=b;if(j&&this.currentDirection===null){this.currentDirection=FR(T),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",b.point,T),this.updateAxis("y",b.point,T),this.visualElement.render(),O&&O(x,b)},h=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b,this.stop(x,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>dr(x=>this.getAnimationState(x)==="paused"&&this.getAxisMotionValue(x).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Oj(t,{onSessionStart:c,onStart:l,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:Aj(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!s||!a)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:f}=this.getProps();f&&kt.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||!Ou(t,s,this.currentDirection))return;const c=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=LR(l,this.constraints[t],this.elastic[t])),c.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&&zl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=PR(a.layoutBox,t):this.constraints=!1,this.elastic=IR(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&dr(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=BR(a.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const c=GO(a,s.root,this.visualElement.getTransformPagePoint());let l=UR(s.layout.layoutBox,c);if(n){const f=n(HO(l));this.hasMutatedConstraints=!!f,f&&(l=ej(f))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:c,dragSnapToOrigin:l,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=dr(g=>{if(!Ou(g,n,this.currentDirection))return;let x=h&&h[g]||{};l&&(x={min:0,max:0});const b=s?200:1e6,v=s?40:1e7,j={type:"inertia",velocity:a?t[g]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...c,...x};return this.startAxisValueAnimation(g,j)});return Promise.all(m).then(f)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Mp(this.visualElement,t),a.start(qg(t,a,0,n,this.visualElement,!1))}stopAnimation(){dr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){dr(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){dr(n=>{const{drag:a}=this.getProps();if(!Ou(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,c=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:f}=s.layout.layoutBox[n],h=c.get()||0;c.set(t[n]-Nt(l,f,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!zl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};dr(l=>{const f=this.getAxisMotionValue(l);if(f&&this.constraints!==!1){const h=f.get();s[l]=VR({min:h,max:h},this.constraints[l])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),dr(l=>{if(!Ou(l,t,null))return;const f=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];f.set(Nt(h,m,s[l]))})}addListeners(){if(!this.visualElement.current)return;ZR.set(this.visualElement,this);const t=this.visualElement.current,n=Al(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),x=h.target,b=x!==t&&Yz(x);m&&g&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();zl(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,c=s.addEventListener("measure",a);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),kt.read(a);const l=ql(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(dr(g=>{const x=this.getAxisMotionValue(g);x&&(this.originPoint[g]+=h[g].translate,x.set(x.get()+h[g].translate))}),this.visualElement.render())}));return()=>{l(),n(),c(),f&&f()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:c=!1,dragElastic:l=Bp,dragMomentum:f=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:c,dragElastic:l,dragMomentum:f}}}function Ou(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function FR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class qR extends ri{constructor(t){super(t),this.removeGroupControls=pr,this.removeListeners=pr,this.controls=new HR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pr}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 vk=e=>(t,n)=>{e&&kt.postRender(()=>e(t,n))};class GR extends ri{constructor(){super(...arguments),this.removePointerDownListener=pr}onPointerDown(t){this.session=new Oj(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Aj(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:vk(t),onStart:vk(n),onMove:a,onEnd:(c,l)=>{delete this.session,s&&kt.postRender(()=>s(c,l))}}}mount(){this.removePointerDownListener=Al(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 Am=!1;class YR extends z.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:c}=t;c&&(n.group&&n.group.add(c),a&&a.register&&s&&a.register(c),Am&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:c}=this.props,{projection:l}=a;return l&&(l.isPresent=c,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),Am=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==c?l.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?l.promote():l.relegate()||kt.postRender(()=>{const f=l.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Kg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;Am=!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 Rj(e){const[t,n]=wj(),a=z.useContext(Ng);return u.jsx(YR,{...e,layoutGroup:a,switchLayoutGroup:z.useContext(Tj),isPresent:t,safeToRemove:n})}const JR={pan:{Feature:GR},drag:{Feature:qR,ProjectionNode:kj,MeasureLayout:Rj}};function kk(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,c=a[s];c&&kt.postRender(()=>c(t,sc(t)))}class KR extends ri{mount(){const{current:t}=this.node;t&&(this.unmount=AO(t,(n,a)=>(kk(this.node,a,"Start"),s=>kk(this.node,s,"End"))))}unmount(){}}class XR extends ri{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=rc(ql(this.node.current,"focus",()=>this.onFocus()),ql(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wk(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),c=a[s];c&&kt.postRender(()=>c(t,sc(t)))}class QR extends ri{mount(){const{current:t}=this.node;t&&(this.unmount=RO(t,(n,a)=>(wk(this.node,a,"Start"),(s,{success:c})=>wk(this.node,s,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ip=new WeakMap,Om=new WeakMap,WR=e=>{const t=Ip.get(e.target);t&&t(e)},eD=e=>{e.forEach(WR)};function tD({root:e,...t}){const n=e||document;Om.has(n)||Om.set(n,{});const a=Om.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(eD,{root:e,...t})),a[s]}function nD(e,t,n){const a=tD(t);return Ip.set(e,n),a.observe(e),()=>{Ip.delete(e),a.unobserve(e)}}const rD={some:0,all:1};class aD extends ri{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:c}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:rD[s]},f=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,c&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:x}=this.node.getProps(),b=m?g:x;b&&b(h)};return nD(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(iD(t,n))&&this.startObserver()}unmount(){}}function iD({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sD={inView:{Feature:aD},tap:{Feature:QR},focus:{Feature:XR},hover:{Feature:KR}},oD={layout:{ProjectionNode:kj,MeasureLayout:Rj}},lD={...OR,...sD,...JR,...oD},Le=NR(lD,CR),Dj=()=>{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 cD({onMenuClick:e,themeIcon:t,themeLabel:n,onThemeToggle:a}){return u.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:[u.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Mi,{className:"w-6 h-6"}),"MORPHEUS"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:a,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":`Tema: ${n}`,title:n,children:u.jsx(t,{className:"w-5 h-5"})}),u.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:u.jsx(W4,{className:"w-6 h-6"})})]})]})}const Fa={list:()=>ge.get("/webhooks"),get:e=>ge.get(`/webhooks/${e}`),create:e=>ge.post("/webhooks",e),update:(e,t)=>ge.put(`/webhooks/${e}`,t),delete:e=>ge.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 ge.get(`/webhooks/notifications${n}`)},unreadCount:()=>ge.get("/webhooks/notifications/unread-count"),markRead:e=>ge.post("/webhooks/notifications/read",{ids:e})},Lr=({open:e,onOpenChange:t,children:n})=>e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),u.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,to=({className:e,children:t})=>u.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:u.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),Pr=({children:e})=>u.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}),Ur=({className:e,children:t})=>u.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),uD=({className:e,children:t})=>u.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),hr=({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 u.jsx("button",{className:f,...a})};function dD({isOpen:e,onClose:t,onConfirm:n}){return u.jsx(Lr,{open:e,onOpenChange:t,children:u.jsxs(to,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[u.jsx(Pr,{children:u.jsx(Ur,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),u.jsxs("div",{children:[u.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."}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[u.jsx(hr,{variant:"outline",onClick:t,children:"Cancel"}),u.jsx(hr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const qa={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 ge.get(`/tasks${n}`)},get:e=>ge.get(`/tasks/${e}`),stats:()=>ge.get("/tasks/stats"),retry:e=>ge.post(`/tasks/${e}/retry`,{}),cancel:e=>ge.post(`/tasks/${e}/cancel`,{})},ed=["matrix","dark-soft","azure","azure-dark"],fD=new Set(["matrix","dark-soft","azure-dark"]),hD={matrix:iA,"dark-soft":S4,azure:EA,"azure-dark":rA},Sk={matrix:"Matrix","dark-soft":"Dark Soft",azure:"Azure","azure-dark":"Azure Dark"};function mD(){const e=localStorage.getItem("theme");return e==="dark"?"matrix":e==="light"?"azure":e&&ed.includes(e)?e:"matrix"}function pD({children:e}){const t=Nr(),[n,a]=z.useState(mD),[s,c]=z.useState(!1),[l,f]=z.useState(!1),{logout:h}=Dj(),m=()=>a(E=>ed[(ed.indexOf(E)+1)%ed.length]),g=hD[n],{data:x}=We("/webhooks/notifications/unread-count",()=>Fa.unreadCount(),{refreshInterval:1e4}),b=x?.count??0,{data:v}=We("/tasks/stats",()=>qa.stats(),{refreshInterval:5e3}),j=(v?.pending??0)+(v?.running??0),S=async()=>{try{await ge.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(E){console.error("Failed to restart:",E),alert("Failed to restart the agent. Please try again.")}};z.useEffect(()=>{const E=fD.has(n);document.documentElement.classList.toggle("dark",E),document.documentElement.setAttribute("data-theme",n),localStorage.setItem("theme",n)},[n]),z.useEffect(()=>{c(!1)},[t.pathname]);const O=[{icon:lp,label:"Dashboard",path:"/"},{icon:Vl,label:"Chat",path:"/chat"},{icon:cp,label:"Zaion",path:"/zaion"},{icon:Qs,label:"Smiths",path:"/smiths"},{icon:id,label:"MCP Servers",path:"/mcp-servers"},{icon:Pi,label:"Skills",path:"/skills"},{icon:sp,label:"Usage Stats",path:"/stats"},{icon:Mi,label:"Sati Memories",path:"/sati-memories"},{icon:dp,label:"Webhooks",path:"/webhooks"},{icon:$l,label:"Notifications",path:"/notifications"},{icon:Ul,label:"Tasks",path:"/tasks"},{icon:Hs,label:"Trinity DBs",path:"/trinity-databases"},{icon:_r,label:"Chronos",path:"/chronos"},{icon:Nl,label:"Logs",path:"/logs"},{icon:Pl,label:"Model Pricing",path:"/model-pricing"}],T=[{icon:lp,label:"Dashboard",path:"/"},{icon:Vl,label:"Chat",path:"/chat"},{icon:cp,label:"Zaion",path:"/zaion"},{icon:Qs,label:"Smiths",path:"/smiths"},{icon:id,label:"MCP Servers",path:"/mcp-servers"},{icon:Pi,label:"Skills",path:"/skills"},{icon:sp,label:"Usage Stats",path:"/stats"},{icon:Mi,label:"Sati Memories",path:"/sati-memories"},{icon:dp,label:"Webhooks",path:"/webhooks"},{icon:$l,label:"Notifications",path:"/notifications"},{icon:Ul,label:"Tasks",path:"/tasks"},{icon:Hs,label:"Trinity DBs",path:"/trinity-databases"},{icon:_r,label:"Chronos",path:"/chronos"},{icon:Nl,label:"Logs",path:"/logs"},{icon:Pl,label:"Model Pricing",path:"/model-pricing"},{icon:Nl,label:"Logs",path:"/logs"}];return u.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:[u.jsx(cD,{onMenuClick:()=>c(!0),themeIcon:g,themeLabel:Sk[n],onThemeToggle:m}),u.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",u.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:[u.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[u.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Mi,{className:"w-6 h-6"}),"MORPHEUS"]}),u.jsx("button",{onClick:m,className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors",title:Sk[n],children:u.jsx(g,{className:"w-4 h-4"})})]}),u.jsx("nav",{className:"flex-1 p-2 space-y-0.5",children:O.map(E=>{const C=t.pathname===E.path;return u.jsxs(Ka,{to:E.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${C?"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:[E.path==="/notifications"?u.jsxs("div",{className:"relative shrink-0",children:[u.jsx(E.icon,{className:"w-4 h-4"}),b>0&&u.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:b>9?"9+":b})]}):u.jsx(E.icon,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:E.label}),E.path==="/tasks"&&j>0&&u.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:j>99?"99+":j}),E.path==="/notifications"&&b>0&&u.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:b>99?"99+":b})]},E.path)})}),u.jsx("div",{className:"p-2",children:u.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:[u.jsx(Xv,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:"Restart"})]})}),u.jsx("div",{className:"p-2",children:u.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:[u.jsx(Jv,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:"Logout"})]})})]}),u.jsx(nR,{children:s&&u.jsxs(Le.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>c(!1),children:[u.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),u.jsxs(Le.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:E=>E.stopPropagation(),children:[u.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[u.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Mi,{className:"w-6 h-6"}),"MORPHEUS"]}),u.jsx("button",{onClick:()=>c(!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:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsx("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:T.map(E=>{const C=t.pathname===E.path;return u.jsxs(Ka,{to:E.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${C?"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:()=>c(!1),children:[E.path==="/notifications"?u.jsxs("div",{className:"relative",children:[u.jsx(E.icon,{className:"w-5 h-5"}),b>0&&u.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:b>9?"9+":b})]}):u.jsx(E.icon,{className:"w-5 h-5"}),u.jsx("span",{children:E.label}),E.path==="/tasks"&&j>0&&u.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:j>99?"99+":j}),E.path==="/notifications"&&b>0&&u.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:b>99?"99+":b})]},E.path)})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>{f(!0),c(!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:[u.jsx(Xv,{className:"w-5 h-5"}),u.jsx("span",{children:"Restart"})]})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>{h(),c(!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:[u.jsx(Jv,{className:"w-5 h-5"}),u.jsx("span",{children:"Logout"})]})})]})]})}),u.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[u.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),n==="matrix"&&u.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-20"})]})]}),u.jsx(_5,{}),u.jsx(dD,{isOpen:l,onClose:()=>f(!1),onConfirm:S})]})}const gD={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},Mm=({title:e,value:t,icon:n,subValue:a})=>u.jsxs(Le.div,{variants:gD,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:[u.jsxs("div",{className:"flex justify-between items-start mb-4",children:[u.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),u.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"})]}),u.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&u.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),Zp={fetchUsageStats:async()=>ge.get("/stats/usage"),fetchGroupedUsageStats:async()=>ge.get("/stats/usage/grouped")},Va=Ya.getInstance(),ur={fetchServers:async()=>Va.get("/mcp/servers"),addServer:async(e,t)=>Va.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>Va.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>Va.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>Va.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>Va.post("/mcp/reload",{}),fetchStatus:async()=>Va.get("/mcp/status"),fetchStats:async()=>Va.get("/mcp/stats")},As=Ya.getInstance(),Oi={fetchSkills:async()=>As.get("/skills"),fetchSkill:async e=>As.get(`/skills/${encodeURIComponent(e)}`),reloadSkills:async()=>As.post("/skills/reload",{}),enableSkill:async e=>As.post(`/skills/${encodeURIComponent(e)}/enable`,{}),disableSkill:async e=>As.post(`/skills/${encodeURIComponent(e)}/disable`,{}),uploadSkill:async e=>As.uploadFile("/skills/upload",e)},xD={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.07}}},pl={hidden:{opacity:0,y:12},show:{opacity:1,y:0}};function gl({icon:e,title:t,to:n,children:a,status:s="neutral"}){const c=s==="ok"?"border-emerald-300/60 dark:border-emerald-700/40":s==="warn"?"border-amber-300/60 dark:border-amber-700/40":s==="error"?"border-red-300/60 dark:border-red-700/40":"border-azure-border dark:border-matrix-primary/50";return u.jsxs(Ka,{to:n,className:`group flex flex-col gap-3 rounded-lg border bg-white dark:bg-black p-4 hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors ${c}`,children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(e,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),u.jsx("span",{className:"text-sm font-semibold text-azure-text dark:text-matrix-highlight",children:t})]}),u.jsx(xg,{className:"w-3.5 h-3.5 text-azure-text-secondary dark:text-matrix-tertiary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),u.jsx("div",{className:"space-y-1.5",children:a})]})}function $n({label:e,value:t,highlight:n}){return u.jsxs("div",{className:"flex items-center justify-between text-xs",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:e}),u.jsx("span",{className:n?"font-semibold text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary",children:t})]})}function yD({status:e}){return e==="completed"?u.jsx(yg,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"}):e==="failed"?u.jsx(Ll,{className:"w-3.5 h-3.5 text-red-500 shrink-0"}):e==="running"?u.jsx(VS,{className:"w-3.5 h-3.5 text-blue-500 animate-spin shrink-0"}):u.jsx(_r,{className:"w-3.5 h-3.5 text-yellow-500 shrink-0"})}function bD(){const{data:e}=XS(),{data:t}=We("/tasks/stats",()=>qa.stats(),{refreshInterval:5e3}),{data:n}=We("/api/stats/usage",()=>Zp.fetchUsageStats(),{refreshInterval:3e4}),{data:a}=We("/api/mcp/stats",()=>ur.fetchStats(),{refreshInterval:3e4}),{data:s}=We("/api/smiths",()=>ge.get("/api/smiths"),{refreshInterval:1e4}),{data:c=[]}=We("/api/chronos",()=>ge.get("/api/chronos"),{refreshInterval:3e4}),{data:l}=We("/api/skills",()=>Oi.fetchSkills(),{refreshInterval:6e4}),{data:f=[]}=We(["/tasks",{limit:5}],()=>qa.list({limit:5}),{refreshInterval:5e3}),h=(n?.totalInputTokens??0)+(n?.totalOutputTokens??0),m=n?.totalEstimatedCostUsd!=null,g=n?.totalEstimatedCostUsd??0,x=D=>D>=1e6?`${(D/1e6).toFixed(1)}M`:D>=1e3?`${(D/1e3).toFixed(1)}k`:String(D),b=c.filter(D=>D.enabled),v=b.filter(D=>D.next_run_at).sort((D,M)=>D.next_run_at-M.next_run_at)[0],j=v?.next_run_at?(()=>{const D=v.next_run_at-Date.now();return D<0?"due now":D<6e4?`${Math.floor(D/1e3)}s`:D<36e5?`${Math.floor(D/6e4)}m`:`${Math.floor(D/36e5)}h`})():null,S=(t?.pending??0)+(t?.running??0),O=t?.failed?"warn":S>0?"ok":"neutral",T=(a?.totalTools??0)>0?"ok":"neutral",E=(s?.online??0)>0?"ok":(s?.total??0)>0?"warn":"neutral",C=b.length>0?"ok":"neutral",$=(l?.enabled??0)>0?"ok":"neutral";return u.jsxs(Le.div,{className:"space-y-6",variants:xD,initial:"hidden",animate:"show",children:[u.jsxs(Le.div,{variants:pl,className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(lp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Dashboard"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Overview of the Morpheus agent runtime."})]})]}),u.jsxs(Le.div,{variants:pl,className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[u.jsx(Mm,{title:"Agent Status",value:e?.status.toUpperCase()??"CONNECTING...",icon:Mi,subValue:e?`PID: ${e.pid}`:""}),u.jsx(Mm,{title:"Uptime",value:e?QS(e.uptimeSeconds):"-",icon:_r,subValue:e?`${e.uptimeSeconds.toFixed(0)}s elapsed`:""}),u.jsx(Mm,{title:"Version",value:e?.projectVersion??"-",icon:bg,subValue:`Node ${e?.nodeVersion??"-"}`})]}),u.jsxs(Le.div,{variants:pl,className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Provider"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(l4,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight shrink-0"}),u.jsx("p",{className:"text-base font-bold text-azure-text dark:text-matrix-highlight truncate",children:e?.llmProvider?.toUpperCase()??"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Model"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(s4,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight shrink-0"}),u.jsx("p",{className:"text-sm font-bold text-azure-text dark:text-matrix-highlight truncate leading-tight",children:e?.llmModel??"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Total Tokens"}),u.jsx("p",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:h>0?x(h):"—"}),u.jsxs("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:[x(n?.totalInputTokens??0)," in · ",x(n?.totalOutputTokens??0)," out"]})]}),u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Est. Cost"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Pl,{className:"w-4 h-4 text-emerald-500 shrink-0"}),u.jsx("p",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:m?`$${g.toFixed(4)}`:"—"})]}),u.jsx("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:m?"accumulated total":"configure pricing to track"})]})]}),u.jsxs(Le.div,{variants:pl,children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-3",children:"Platform"}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:[u.jsxs(gl,{icon:Pi,title:"Skills",to:"/skills",status:$,children:[u.jsx($n,{label:"Enabled",value:l?`${l.enabled} / ${l.total}`:"—",highlight:(l?.enabled??0)>0}),u.jsx($n,{label:"Total",value:l?.total??"—"})]}),u.jsxs(gl,{icon:id,title:"MCP Servers",to:"/mcp-servers",status:T,children:[u.jsx($n,{label:"Tools loaded",value:a?.totalTools??"—",highlight:!!a?.totalTools}),u.jsx($n,{label:"Servers",value:a?.servers?.length??"—"}),a?.lastLoadedAt&&u.jsx($n,{label:"Last loaded",value:new Date(a.lastLoadedAt).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),u.jsxs(gl,{icon:Qs,title:"Smiths",to:"/smiths",status:E,children:[u.jsx($n,{label:"Online",value:s?`${s.online} / ${s.total}`:"—",highlight:(s?.online??0)>0}),u.jsx($n,{label:"System",value:s?.enabled?"enabled":"disabled"})]}),u.jsxs(gl,{icon:Ul,title:"Tasks",to:"/tasks",status:O,children:[u.jsx($n,{label:"Running",value:t?.running??"—",highlight:!!t?.running}),u.jsx($n,{label:"Pending",value:t?.pending??"—"}),u.jsx($n,{label:"Completed",value:t?.completed??"—"}),(t?.failed??0)>0&&u.jsx($n,{label:"Failed",value:t.failed})]}),u.jsxs(gl,{icon:_r,title:"Chronos",to:"/chronos",status:C,children:[u.jsx($n,{label:"Active jobs",value:b.length,highlight:b.length>0}),u.jsx($n,{label:"Total jobs",value:c.length}),j&&u.jsx($n,{label:"Next run",value:`in ${j}`})]})]})]}),f.length>0&&u.jsxs(Le.div,{variants:pl,children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:"Recent Tasks"}),u.jsxs(Ka,{to:"/tasks",className:"flex items-center gap-0.5 text-xs text-azure-primary dark:text-matrix-highlight hover:underline",children:["View all ",u.jsx(xg,{className:"w-3 h-3"})]})]}),u.jsx("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:f.map((D,M)=>u.jsxs("div",{className:`flex items-center gap-3 px-4 py-2.5 ${M<f.length-1?"border-b border-azure-border dark:border-matrix-primary/30":""} hover:bg-azure-surface/60 dark:hover:bg-zinc-900/50 transition-colors`,children:[u.jsx(yD,{status:D.status}),u.jsx("span",{className:"font-mono text-[10px] text-azure-text-secondary dark:text-matrix-tertiary w-16 shrink-0",children:D.id.slice(0,8)}),u.jsx("span",{className:"flex-1 text-xs text-azure-text dark:text-matrix-secondary truncate",children:D.input.slice(0,100)}),u.jsx("span",{className:"text-[10px] font-mono uppercase text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:D.agent}),u.jsx("span",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:new Date(D.created_at).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]},D.id))})]})]})}const vD=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:c,onRenameSession:l,isOpen:f,toggleSidebar:h})=>{const[m,g]=z.useState(null),[x,b]=z.useState(""),v=z.useRef(null);z.useEffect(()=>{m&&v.current&&v.current.focus()},[m]);const j=(E,C)=>{E.stopPropagation(),g(C.id),b(C.title||"Untitled Session")},S=E=>{E?.stopPropagation(),m&&x.trim()&&(l(m,x.trim()),g(null))},O=E=>{E?.stopPropagation(),g(null)},T=E=>{E.key==="Enter"?S():E.key==="Escape"&&O()};return f?u.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:[u.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:[u.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),u.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:u.jsx(Vl,{size:18})})]}),u.jsx("div",{className:"p-4",children:u.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:[u.jsx(Kv,{size:18}),u.jsx("span",{children:"New Chat"})]})}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(E=>u.jsxs("div",{onClick:()=>n(E.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===E.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:[u.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===E.id?u.jsx("div",{className:"flex items-center gap-1 w-full",onClick:C=>C.stopPropagation(),children:u.jsx("input",{ref:v,type:"text",value:x,onChange:C=>b(C.target.value),onKeyDown:T,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"})}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:`text-sm font-medium truncate ${t===E.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:E.title||"Untitled Session"}),u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(E.started_at).toLocaleString()})]})}),u.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===E.id?u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:S,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:u.jsx(op,{size:14})}),u.jsx("button",{onClick:O,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:u.jsx(Bi,{size:14})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:C=>j(C,E),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:u.jsx(tc,{size:14})}),u.jsx("button",{onClick:C=>{C.stopPropagation(),s(E.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:u.jsx(YE,{size:14})}),u.jsx("button",{onClick:C=>{C.stopPropagation(),c(E.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:u.jsx(ha,{size:14})})]})})]},E.id)),e.length===0&&u.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):u.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:[u.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:u.jsx(Vl,{})}),u.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),u.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:u.jsx(Kv,{size:20})})]})};function kD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zD={};function zk(e,t){return(zD.jsx?SD:wD).test(e)}const jD=/[ \t\n\f\r]/g;function _D(e){return typeof e=="object"?e.type==="text"?jk(e.value):!1:jk(e)}function jk(e){return e.replace(jD,"")===""}class oc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}oc.prototype.normal={};oc.prototype.property={};oc.prototype.space=void 0;function $j(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new oc(n,a,t)}function Hp(e){return e.toLowerCase()}class Vn{constructor(t,n){this.attribute=n,this.property=t}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let ND=0;const De=Ii(),Zt=Ii(),Fp=Ii(),ue=Ii(),pt=Ii(),Gs=Ii(),Kn=Ii();function Ii(){return 2**++ND}const qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Zt,commaOrSpaceSeparated:Kn,commaSeparated:Gs,number:ue,overloadedBoolean:Fp,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),Rm=Object.keys(qp);class ix extends Vn{constructor(t,n,a,s){let c=-1;if(super(t,n),_k(this,"space",s),typeof a=="number")for(;++c<Rm.length;){const l=Rm[c];_k(this,Rm[c],(a&qp[l])===qp[l])}}}ix.prototype.defined=!0;function _k(e,t,n){n&&(e[t]=n)}function ho(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const c=new ix(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),t[a]=c,n[Hp(a)]=a,n[Hp(c.attribute)]=a}return new oc(t,n,e.space)}const Lj=ho({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:pt,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:ue,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:pt,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Zt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Pj(e,t){return t in e?e[t]:t}function Uj(e,t){return Pj(e,t.toLowerCase())}const CD=ho({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gs,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:pt,autoFocus:De,autoPlay:De,blocking:pt,capture:null,charSet:null,checked:De,cite:null,className:pt,cols:ue,colSpan:null,content:null,contentEditable:Zt,controls:De,controlsList:pt,coords:ue|Gs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Fp,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:pt,height:ue,hidden:Fp,high:ue,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:pt,itemRef:pt,itemScope:De,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:ue,pattern:null,ping:pt,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:pt,required:De,reversed:De,rows:ue,rowSpan:ue,sandbox:pt,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:Zt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:Uj}),TD=ho({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:Kn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:pt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Gs,g2:Gs,glyphName:Gs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Pj}),Vj=ho({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()}}),Bj=ho({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Uj}),Ij=ho({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ED={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"},AD=/[A-Z]/g,Nk=/-[a-z]/g,OD=/^data[-\w.:]+$/i;function MD(e,t){const n=Hp(t);let a=t,s=Vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&OD.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(Nk,DD);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!Nk.test(c)){let l=c.replace(AD,RD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=ix}return new s(a,t)}function RD(e){return"-"+e.toLowerCase()}function DD(e){return e.charAt(1).toUpperCase()}const $D=$j([Lj,CD,Vj,Bj,Ij],"html"),sx=$j([Lj,TD,Vj,Bj,Ij],"svg");function LD(e){return e.join(" ").trim()}var Os={},Dm,Ck;function PD(){if(Ck)return Dm;Ck=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
20
|
-
`,m="/",g="*",x="",b="comment",v="declaration";function j(O,T){if(typeof O!="string")throw new TypeError("First argument must be a string");if(!O)return[];T=T||{};var E=1,C=1;function $(oe){var ie=oe.match(t);ie&&(E+=ie.length);var B=oe.lastIndexOf(h);C=~B?oe.length-B:C+oe.length}function D(){var oe={line:E,column:C};return function(ie){return ie.position=new M(oe),K(),ie}}function M(oe){this.start=oe,this.end={line:E,column:C},this.source=T.source}M.prototype.content=O;function Z(oe){var ie=new Error(T.source+":"+E+":"+C+": "+oe);if(ie.reason=oe,ie.filename=T.source,ie.line=E,ie.column=C,ie.source=O,!T.silent)throw ie}function U(oe){var ie=oe.exec(O);if(ie){var B=ie[0];return $(B),O=O.slice(B.length),ie}}function K(){U(n)}function de(oe){var ie;for(oe=oe||[];ie=ae();)ie!==!1&&oe.push(ie);return oe}function ae(){var oe=D();if(!(m!=O.charAt(0)||g!=O.charAt(1))){for(var ie=2;x!=O.charAt(ie)&&(g!=O.charAt(ie)||m!=O.charAt(ie+1));)++ie;if(ie+=2,x===O.charAt(ie-1))return Z("End of comment missing");var B=O.slice(2,ie-2);return C+=2,$(B),O=O.slice(ie),C+=2,oe({type:b,comment:B})}}function le(){var oe=D(),ie=U(a);if(ie){if(ae(),!U(s))return Z("property missing ':'");var B=U(c),V=oe({type:v,property:S(ie[0].replace(e,x)),value:B?S(B[0].replace(e,x)):x});return U(l),V}}function ne(){var oe=[];de(oe);for(var ie;ie=le();)ie!==!1&&(oe.push(ie),de(oe));return oe}return K(),ne()}function S(O){return O?O.replace(f,x):x}return Dm=j,Dm}var Tk;function UD(){if(Tk)return Os;Tk=1;var e=Os&&Os.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Os,"__esModule",{value:!0}),Os.default=n;const t=e(PD());function n(a,s){let c=null;if(!a||typeof a!="string")return c;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&&(c=c||{},c[m]=g)}),c}return Os}var xl={},Ek;function VD(){if(Ek)return xl;Ek=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=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={}),c(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(s,f):m=m.replace(a,f),m.replace(t,l))};return xl.camelCase=h,xl}var yl,Ak;function BD(){if(Ak)return yl;Ak=1;var e=yl&&yl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(UD()),n=VD();function a(s,c){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(f,h){f&&h&&(l[(0,n.camelCase)(f,c)]=h)}),l}return a.default=a,yl=a,yl}var ID=BD();const ZD=og(ID),Zj=Hj("end"),ox=Hj("start");function Hj(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 HD(e){const t=ox(e),n=Zj(e);if(t&&n)return{start:t,end:n}}function Ol(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ok(e.position):"start"in e||"end"in e?Ok(e):"line"in e||"column"in e?Gp(e):""}function Gp(e){return Mk(e&&e.line)+":"+Mk(e&&e.column)}function Ok(e){return Gp(e&&e.start)+"-"+Gp(e&&e.end)}function Mk(e){return e&&typeof e=="number"?e:1}class yn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",c={},l=!1;if(n&&("line"in n&&"column"in n?c={place:n}:"start"in n&&"end"in n?c={place:n}:"type"in n?c={ancestors:[n],place:n.position}:c={...n}),typeof t=="string"?s=t:!c.cause&&t&&(l=!0,s=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?c.ruleId=a:(c.source=a.slice(0,h),c.ruleId=a.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.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=Ol(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=l&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}yn.prototype.file="";yn.prototype.name="";yn.prototype.reason="";yn.prototype.message="";yn.prototype.stack="";yn.prototype.column=void 0;yn.prototype.line=void 0;yn.prototype.ancestors=void 0;yn.prototype.cause=void 0;yn.prototype.fatal=void 0;yn.prototype.place=void 0;yn.prototype.ruleId=void 0;yn.prototype.source=void 0;const lx={}.hasOwnProperty,FD=new Map,qD=/[A-Z]/g,GD=new Set(["table","tbody","thead","tfoot","tr"]),YD=new Set(["td","th"]),Fj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function JD(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=r$(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=n$(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"?sx:$D,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=qj(s,e,void 0);return c&&typeof c!="string"?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}function qj(e,t,n){if(t.type==="element")return KD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return XD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return WD(e,t,n);if(t.type==="mdxjsEsm")return QD(e,t);if(t.type==="root")return e$(e,t,n);if(t.type==="text")return t$(e,t)}function KD(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=sx,e.schema=s),e.ancestors.push(t);const c=Yj(e,t.tagName,!1),l=a$(e,t);let f=ux(e,t);return GD.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!_D(h):!0})),Gj(e,l,c,t),cx(l,f),e.ancestors.pop(),e.schema=a,e.create(t,c,l,n)}function XD(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)}Gl(e,t.position)}function QD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gl(e,t.position)}function WD(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=sx,e.schema=s),e.ancestors.push(t);const c=t.name===null?e.Fragment:Yj(e,t.name,!0),l=i$(e,t),f=ux(e,t);return Gj(e,l,c,t),cx(l,f),e.ancestors.pop(),e.schema=a,e.create(t,c,l,n)}function e$(e,t,n){const a={};return cx(a,ux(e,t)),e.create(t,e.Fragment,a,n)}function t$(e,t){return t.value}function Gj(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function cx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function n$(e,t,n){return a;function a(s,c,l,f){const m=Array.isArray(l.children)?n:t;return f?m(c,l,f):m(c,l)}}function r$(e,t){return n;function n(a,s,c,l){const f=Array.isArray(c.children),h=ox(a);return t(s,c,l,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function a$(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&lx.call(t.properties,s)){const c=s$(e,s,t.properties[s]);if(c){const[l,f]=c;e.tableCellAlignToStyle&&l==="align"&&typeof f=="string"&&YD.has(t.tagName)?a=f:n[l]=f}}if(a){const c=n.style||(n.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function i$(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const c=a.data.estree.body[0];c.type;const l=c.expression;l.type;const f=l.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Gl(e,t.position);else{const s=a.name;let c;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,c=e.evaluater.evaluateExpression(f.expression)}else Gl(e,t.position);else c=a.value===null?!0:a.value;n[s]=c}return n}function ux(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:FD;for(;++a<t.children.length;){const c=t.children[a];let l;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const m=s.get(h)||0;l=h+"-"+m,s.set(h,m+1)}}const f=qj(e,c,l);f!==void 0&&n.push(f)}return n}function s$(e,t,n){const a=MD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?kD(n):LD(n)),a.property==="style"){let s=typeof n=="object"?n:o$(e,String(n));return e.stylePropertyNameCase==="css"&&(s=l$(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?ED[a.property]||a.property:a.attribute,n]}}function o$(e,t){try{return ZD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new yn("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=Fj+"#cannot-parse-style-attribute",s}}function Yj(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let c=-1,l;for(;++c<s.length;){const f=zk(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};l=l?{type:"MemberExpression",object:l,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}a=l}else a=zk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return lx.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Gl(e)}function Gl(e,t){const n=new yn("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=Fj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function l$(e){const t={};let n;for(n in e)lx.call(e,n)&&(t[c$(n)]=e[n]);return t}function c$(e){let t=e.replace(qD,u$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function u$(e){return"-"+e.toLowerCase()}const $m={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"]},d$={};function f$(e,t){const n=d$,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Jj(e,a,s)}function Jj(e,t,n){if(h$(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 Rk(e.children,t,n)}return Array.isArray(e)?Rk(e,t,n):""}function Rk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=Jj(e[s],t,n);return a.join("")}function h$(e){return!!(e&&typeof e=="object")}const Dk=document.createElement("i");function dx(e){const t="&"+e+";";Dk.innerHTML=t;const n=Dk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vr(e,t,n,a){const s=e.length;let c=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);c<a.length;)l=a.slice(c,c+1e4),l.unshift(t,0),e.splice(...l),c+=1e4,t+=1e4}function fr(e,t){return e.length>0?(Vr(e,e.length,0,t),e):t}const $k={}.hasOwnProperty;function m$(e){const t={};let n=-1;for(;++n<e.length;)p$(t,e[n]);return t}function p$(e,t){let n;for(n in t){const s=($k.call(e,n)?e[n]:void 0)||(e[n]={}),c=t[n];let l;if(c)for(l in c){$k.call(s,l)||(s[l]=[]);const f=c[l];g$(s[l],Array.isArray(f)?f:f?[f]:[])}}}function g$(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Vr(e,0,0,a)}function Kj(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 Ys(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rr=ai(/[A-Za-z]/),Xn=ai(/[\dA-Za-z]/),x$=ai(/[#-'*+\--9=?A-Z^-~]/);function Yp(e){return e!==null&&(e<32||e===127)}const Jp=ai(/\d/),y$=ai(/[\dA-Fa-f]/),b$=ai(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function Un(e){return e!==null&&(e<0||e===32)}function tt(e){return e===-2||e===-1||e===32}const v$=ai(new RegExp("\\p{P}|\\p{S}","u")),k$=ai(/\s/);function ai(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function mo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const c=e.charCodeAt(n);let l="";if(c===37&&Xn(e.charCodeAt(n+1))&&Xn(e.charCodeAt(n+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(l=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(n+1);c<56320&&f>56319&&f<57344?(l=String.fromCharCode(c,f),s=1):l="�"}else l=String.fromCharCode(c);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 gt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let c=0;return l;function l(h){return tt(h)?(e.enter(n),f(h)):t(h)}function f(h){return tt(h)&&c++<s?(e.consume(h),f):(e.exit(n),t(h))}}const w$={tokenize:S$};function S$(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"),gt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),c(f)}function c(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 Ce(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),l)}}const z$={tokenize:j$},Lk={tokenize:_$};function j$(e){const t=this,n=[];let a=0,s,c,l;return f;function f(C){if(a<n.length){const $=n[a];return t.containerState=$[1],e.attempt($[0].continuation,h,m)(C)}return m(C)}function h(C){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&E();const $=t.events.length;let D=$,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}T(a);let Z=$;for(;Z<t.events.length;)t.events[Z][1].end={...M},Z++;return Vr(t.events,D+1,0,t.events.slice($)),t.events.length=Z,m(C)}return f(C)}function m(C){if(a===n.length){if(!s)return b(C);if(s.currentConstruct&&s.currentConstruct.concrete)return j(C);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Lk,g,x)(C)}function g(C){return s&&E(),T(a),b(C)}function x(C){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,j(C)}function b(C){return t.containerState={},e.attempt(Lk,v,j)(C)}function v(C){return a++,n.push([t.currentConstruct,t.containerState]),b(C)}function j(C){if(C===null){s&&E(),T(0),e.consume(C);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),S(C)}function S(C){if(C===null){O(e.exit("chunkFlow"),!0),T(0),e.consume(C);return}return Ce(C)?(e.consume(C),O(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(C),S)}function O(C,$){const D=t.sliceStream(C);if($&&D.push(null),C.previous=c,c&&(c.next=C),c=C,s.defineSkip(C.start),s.write(D),t.parser.lazy[C.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<l&&(!s.events[M][1].end||s.events[M][1].end.offset>l))return;const Z=t.events.length;let U=Z,K,de;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(K){de=t.events[U][1].end;break}K=!0}for(T(a),M=Z;M<t.events.length;)t.events[M][1].end={...de},M++;Vr(t.events,U+1,0,t.events.slice(Z)),t.events.length=M}}function T(C){let $=n.length;for(;$-- >C;){const D=n[$];t.containerState=D[1],D[0].exit.call(t,e)}n.length=C}function E(){s.write([null]),c=void 0,s=void 0,t.containerState._closeFlow=void 0}}function _$(e,t,n){return gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pk(e){if(e===null||Un(e)||k$(e))return 1;if(v$(e))return 2}function fx(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const c=e[s].resolveAll;c&&!a.includes(c)&&(t=c(t,n),a.push(c))}return t}const Kp={name:"attention",resolveAll:N$,tokenize:C$};function N$(e,t){let n=-1,a,s,c,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 x={...e[a][1].end},b={...e[n][1].start};Uk(x,-h),Uk(b,h),l={type:h>1?"strongSequence":"emphasisSequence",start:x,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},c={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=fr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=fr(m,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",c,t]]),m=fr(m,fx(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=fr(m,[["exit",c,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=fr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Vr(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 C$(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Pk(a);let c;return l;function l(h){return c=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===c)return e.consume(h),f;const m=e.exit("attentionSequence"),g=Pk(h),x=!g||g===2&&s||n.includes(h),b=!s||s===2&&g||n.includes(a);return m._open=!!(c===42?x:x&&(s||!b)),m._close=!!(c===42?b:b&&(g||!x)),t(h)}}function Uk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const T$={name:"autolink",tokenize:E$};function E$(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"),c}function c(v){return Rr(v)?(e.consume(v),l):v===64?n(v):m(v)}function l(v){return v===43||v===45||v===46||Xn(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||Xn(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||Yp(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),g):x$(v)?(e.consume(v),m):n(v)}function g(v){return Xn(v)?x(v):n(v)}function x(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||Xn(v))&&a++<63){const j=v===45?b:x;return e.consume(v),j}return n(v)}}const Ad={partial:!0,tokenize:A$};function A$(e,t,n){return a;function a(c){return tt(c)?gt(e,s,"linePrefix")(c):s(c)}function s(c){return c===null||Ce(c)?t(c):n(c)}}const Xj={continuation:{tokenize:M$},exit:R$,name:"blockQuote",tokenize:O$};function O$(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"),c}return n(l)}function c(l){return tt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function M$(e,t,n){const a=this;return s;function s(l){return tt(l)?gt(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):c(l)}function c(l){return e.attempt(Xj,t,n)(l)}}function R$(e){e.exit("blockQuote")}const Qj={name:"characterEscape",tokenize:D$};function D$(e,t,n){return a;function a(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),s}function s(c){return b$(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(c)}}const Wj={name:"characterReference",tokenize:$$};function $$(e,t,n){const a=this;let s=0,c,l;return f;function f(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),h}function h(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,l=Xn,g(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,l=y$,g):(e.enter("characterReferenceValue"),c=7,l=Jp,g(x))}function g(x){if(x===59&&s){const b=e.exit("characterReferenceValue");return l===Xn&&!dx(a.sliceSerialize(b))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(x)&&s++<c?(e.consume(x),g):n(x)}}const Vk={partial:!0,tokenize:P$},Bk={concrete:!0,name:"codeFenced",tokenize:L$};function L$(e,t,n){const a=this,s={partial:!0,tokenize:D};let c=0,l=0,f;return h;function h(M){return m(M)}function m(M){const Z=a.events[a.events.length-1];return c=Z&&Z[1].type==="linePrefix"?Z[2].sliceSerialize(Z[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===f?(l++,e.consume(M),g):l<3?n(M):(e.exit("codeFencedFenceSequence"),tt(M)?gt(e,x,"whitespace")(M):x(M))}function x(M){return M===null||Ce(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(Vk,S,$)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||Ce(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(M)):tt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gt(e,v,"whitespace")(M)):M===96&&M===f?n(M):(e.consume(M),b)}function v(M){return M===null||Ce(M)?x(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(M))}function j(M){return M===null||Ce(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(M)):M===96&&M===f?n(M):(e.consume(M),j)}function S(M){return e.attempt(s,$,O)(M)}function O(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),T}function T(M){return c>0&&tt(M)?gt(e,E,"linePrefix",c+1)(M):E(M)}function E(M){return M===null||Ce(M)?e.check(Vk,S,$)(M):(e.enter("codeFlowValue"),C(M))}function C(M){return M===null||Ce(M)?(e.exit("codeFlowValue"),E(M)):(e.consume(M),C)}function $(M){return e.exit("codeFenced"),t(M)}function D(M,Z,U){let K=0;return de;function de(ie){return M.enter("lineEnding"),M.consume(ie),M.exit("lineEnding"),ae}function ae(ie){return M.enter("codeFencedFence"),tt(ie)?gt(M,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):le(ie)}function le(ie){return ie===f?(M.enter("codeFencedFenceSequence"),ne(ie)):U(ie)}function ne(ie){return ie===f?(K++,M.consume(ie),ne):K>=l?(M.exit("codeFencedFenceSequence"),tt(ie)?gt(M,oe,"whitespace")(ie):oe(ie)):U(ie)}function oe(ie){return ie===null||Ce(ie)?(M.exit("codeFencedFence"),Z(ie)):U(ie)}}}function P$(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"),c)}function c(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const Lm={name:"codeIndented",tokenize:V$},U$={partial:!0,tokenize:B$};function V$(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),gt(e,c,"linePrefix",5)(m)}function c(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):Ce(m)?e.attempt(U$,l,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ce(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function B$(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):gt(e,c,"linePrefix",5)(l)}function c(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):Ce(l)?s(l):n(l)}}const I$={name:"codeText",previous:H$,resolve:Z$,tokenize:F$};function Z$(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 H$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function F$(e,t,n){let a=0,s,c;return l;function l(x){return e.enter("codeText"),e.enter("codeTextSequence"),f(x)}function f(x){return x===96?(e.consume(x),a++,f):(e.exit("codeTextSequence"),h(x))}function h(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),h):x===96?(c=e.enter("codeTextSequence"),s=0,g(x)):Ce(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Ce(x)?(e.exit("codeTextData"),h(x)):(e.consume(x),m)}function g(x){return x===96?(e.consume(x),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(c.type="codeTextData",m(x))}}class q${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 c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&bl(this.left,a),c.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),bl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bl(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);bl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bl(this.left,n.reverse())}}}function bl(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 e_(e){const t={};let n=-1,a,s,c,l,f,h,m;const g=new q$(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,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,G$(g,n)),n=t[n],m=!0);else if(a[1]._container){for(c=n,s=void 0;c--;)if(l=g.get(c),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=c);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 Vr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function G$(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const c=[];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,x,b=-1,v=n,j=0,S=0;const O=[S];for(;v;){for(;e.get(++s)[1]!==v;);c.push(s),v._tokenizer||(g=a.sliceStream(v),v.next||g.push(null),x&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),x=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&&(S=b+1,O.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):O.pop(),b=O.length;b--;){const T=f.slice(O[b],O[b+1]),E=c.pop();h.push([E,E+T.length-1]),e.splice(E,2,T)}for(h.reverse(),b=-1;++b<h.length;)m[j+h[b][0]]=j+h[b][1],j+=h[b][1]-h[b][0]-1;return m}const Y$={resolve:K$,tokenize:X$},J$={partial:!0,tokenize:Q$};function K$(e){return e_(e),e}function X$(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?c(f):Ce(f)?e.check(J$,l,c)(f):(e.consume(f),s)}function c(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 Q$(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),gt(e,c,"linePrefix")}function c(l){if(l===null||Ce(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 t_(e,t,n,a,s,c,l,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return x;function x(T){return T===60?(e.enter(a),e.enter(s),e.enter(c),e.consume(T),e.exit(c),b):T===null||T===32||T===41||Yp(T)?n(T):(e.enter(a),e.enter(l),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(T))}function b(T){return T===62?(e.enter(c),e.consume(T),e.exit(c),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===62?(e.exit("chunkString"),e.exit(f),b(T)):T===null||T===60||Ce(T)?n(T):(e.consume(T),T===92?j:v)}function j(T){return T===60||T===62||T===92?(e.consume(T),v):v(T)}function S(T){return!g&&(T===null||T===41||Un(T))?(e.exit("chunkString"),e.exit(f),e.exit(l),e.exit(a),t(T)):g<m&&T===40?(e.consume(T),g++,S):T===41?(e.consume(T),g--,S):T===null||T===32||T===40||Yp(T)?n(T):(e.consume(T),T===92?O:S)}function O(T){return T===40||T===41||T===92?(e.consume(T),S):S(T)}}function n_(e,t,n,a,s,c){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(c),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(c),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):Ce(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||Ce(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!tt(v)),v===92?b:x)}function b(v){return v===91||v===92||v===93?(e.consume(v),f++,x):x(v)}}function r_(e,t,n,a,s,c){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(c),m(b))}function m(b){return b===l?(e.exit(c),h(l)):b===null?n(b):Ce(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),gt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===l||b===null||Ce(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?x:g)}function x(b){return b===l||b===92?(e.consume(b),g):g(b)}}function Ml(e,t){let n;return a;function a(s){return Ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):tt(s)?gt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const W$={name:"definition",tokenize:t6},e6={partial:!0,tokenize:n6};function t6(e,t,n){const a=this;let s;return c;function c(v){return e.enter("definition"),l(v)}function l(v){return n_.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=Ys(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 Un(v)?Ml(e,m)(v):m(v)}function m(v){return t_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(e6,x,x)(v)}function x(v){return tt(v)?gt(e,b,"whitespace")(v):b(v)}function b(v){return v===null||Ce(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function n6(e,t,n){return a;function a(f){return Un(f)?Ml(e,s)(f):n(f)}function s(f){return r_(e,c,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return tt(f)?gt(e,l,"whitespace")(f):l(f)}function l(f){return f===null||Ce(f)?t(f):n(f)}}const r6={name:"hardBreakEscape",tokenize:a6};function a6(e,t,n){return a;function a(c){return e.enter("hardBreakEscape"),e.consume(c),s}function s(c){return Ce(c)?(e.exit("hardBreakEscape"),t(c)):n(c)}}const i6={name:"headingAtx",resolve:s6,tokenize:o6};function s6(e,t){let n=e.length-2,a=3,s,c;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},c={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Vr(e,a,n-a+1,[["enter",s,t],["enter",c,t],["exit",c,t],["exit",s,t]])),e}function o6(e,t,n){let a=0;return s;function s(g){return e.enter("atxHeading"),c(g)}function c(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&a++<6?(e.consume(g),l):g===null||Un(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ce(g)?(e.exit("atxHeading"),t(g)):tt(g)?gt(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||Un(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const l6=["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"],Ik=["pre","script","style","textarea"],c6={concrete:!0,name:"htmlFlow",resolveTo:f6,tokenize:h6},u6={partial:!0,tokenize:p6},d6={partial:!0,tokenize:m6};function f6(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 h6(e,t,n){const a=this;let s,c,l,f,h;return m;function m(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),x}function x(w){return w===33?(e.consume(w),b):w===47?(e.consume(w),c=!0,S):w===63?(e.consume(w),s=3,a.interrupt?t:A):Rr(w)?(e.consume(w),l=String.fromCharCode(w),O):n(w)}function b(w){return w===45?(e.consume(w),s=2,v):w===91?(e.consume(w),s=5,f=0,j):Rr(w)?(e.consume(w),s=4,a.interrupt?t:A):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:A):n(w)}function j(w){const J="CDATA[";return w===J.charCodeAt(f++)?(e.consume(w),f===J.length?a.interrupt?t:le:j):n(w)}function S(w){return Rr(w)?(e.consume(w),l=String.fromCharCode(w),O):n(w)}function O(w){if(w===null||w===47||w===62||Un(w)){const J=w===47,he=l.toLowerCase();return!J&&!c&&Ik.includes(he)?(s=1,a.interrupt?t(w):le(w)):l6.includes(l.toLowerCase())?(s=6,J?(e.consume(w),T):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):c?E(w):C(w))}return w===45||Xn(w)?(e.consume(w),l+=String.fromCharCode(w),O):n(w)}function T(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function E(w){return tt(w)?(e.consume(w),E):de(w)}function C(w){return w===47?(e.consume(w),de):w===58||w===95||Rr(w)?(e.consume(w),$):tt(w)?(e.consume(w),C):de(w)}function $(w){return w===45||w===46||w===58||w===95||Xn(w)?(e.consume(w),$):D(w)}function D(w){return w===61?(e.consume(w),M):tt(w)?(e.consume(w),D):C(w)}function M(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,Z):tt(w)?(e.consume(w),M):U(w)}function Z(w){return w===h?(e.consume(w),h=null,K):w===null||Ce(w)?n(w):(e.consume(w),Z)}function U(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Un(w)?D(w):(e.consume(w),U)}function K(w){return w===47||w===62||tt(w)?C(w):n(w)}function de(w){return w===62?(e.consume(w),ae):n(w)}function ae(w){return w===null||Ce(w)?le(w):tt(w)?(e.consume(w),ae):n(w)}function le(w){return w===45&&s===2?(e.consume(w),B):w===60&&s===1?(e.consume(w),V):w===62&&s===4?(e.consume(w),_):w===63&&s===3?(e.consume(w),A):w===93&&s===5?(e.consume(w),ce):Ce(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(u6,H,ne)(w)):w===null||Ce(w)?(e.exit("htmlFlowData"),ne(w)):(e.consume(w),le)}function ne(w){return e.check(d6,oe,H)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ie}function ie(w){return w===null||Ce(w)?ne(w):(e.enter("htmlFlowData"),le(w))}function B(w){return w===45?(e.consume(w),A):le(w)}function V(w){return w===47?(e.consume(w),l="",G):le(w)}function G(w){if(w===62){const J=l.toLowerCase();return Ik.includes(J)?(e.consume(w),_):le(w)}return Rr(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),G):le(w)}function ce(w){return w===93?(e.consume(w),A):le(w)}function A(w){return w===62?(e.consume(w),_):w===45&&s===2?(e.consume(w),A):le(w)}function _(w){return w===null||Ce(w)?(e.exit("htmlFlowData"),H(w)):(e.consume(w),_)}function H(w){return e.exit("htmlFlow"),t(w)}}function m6(e,t,n){const a=this;return s;function s(l){return Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),c):n(l)}function c(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function p6(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Ad,t,n)}}const g6={name:"htmlText",tokenize:x6};function x6(e,t,n){const a=this;let s,c,l;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),m):A===47?(e.consume(A),D):A===63?(e.consume(A),C):Rr(A)?(e.consume(A),U):n(A)}function m(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),c=0,j):Rr(A)?(e.consume(A),E):n(A)}function g(A){return A===45?(e.consume(A),v):n(A)}function x(A){return A===null?n(A):A===45?(e.consume(A),b):Ce(A)?(l=x,V(A)):(e.consume(A),x)}function b(A){return A===45?(e.consume(A),v):x(A)}function v(A){return A===62?B(A):A===45?b(A):x(A)}function j(A){const _="CDATA[";return A===_.charCodeAt(c++)?(e.consume(A),c===_.length?S:j):n(A)}function S(A){return A===null?n(A):A===93?(e.consume(A),O):Ce(A)?(l=S,V(A)):(e.consume(A),S)}function O(A){return A===93?(e.consume(A),T):S(A)}function T(A){return A===62?B(A):A===93?(e.consume(A),T):S(A)}function E(A){return A===null||A===62?B(A):Ce(A)?(l=E,V(A)):(e.consume(A),E)}function C(A){return A===null?n(A):A===63?(e.consume(A),$):Ce(A)?(l=C,V(A)):(e.consume(A),C)}function $(A){return A===62?B(A):C(A)}function D(A){return Rr(A)?(e.consume(A),M):n(A)}function M(A){return A===45||Xn(A)?(e.consume(A),M):Z(A)}function Z(A){return Ce(A)?(l=Z,V(A)):tt(A)?(e.consume(A),Z):B(A)}function U(A){return A===45||Xn(A)?(e.consume(A),U):A===47||A===62||Un(A)?K(A):n(A)}function K(A){return A===47?(e.consume(A),B):A===58||A===95||Rr(A)?(e.consume(A),de):Ce(A)?(l=K,V(A)):tt(A)?(e.consume(A),K):B(A)}function de(A){return A===45||A===46||A===58||A===95||Xn(A)?(e.consume(A),de):ae(A)}function ae(A){return A===61?(e.consume(A),le):Ce(A)?(l=ae,V(A)):tt(A)?(e.consume(A),ae):K(A)}function le(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,ne):Ce(A)?(l=le,V(A)):tt(A)?(e.consume(A),le):(e.consume(A),oe)}function ne(A){return A===s?(e.consume(A),s=void 0,ie):A===null?n(A):Ce(A)?(l=ne,V(A)):(e.consume(A),ne)}function oe(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Un(A)?K(A):(e.consume(A),oe)}function ie(A){return A===47||A===62||Un(A)?K(A):n(A)}function B(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function V(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),G}function G(A){return tt(A)?gt(e,ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ce(A)}function ce(A){return e.enter("htmlTextData"),l(A)}}const hx={name:"labelEnd",resolveAll:k6,resolveTo:w6,tokenize:S6},y6={tokenize:z6},b6={tokenize:j6},v6={tokenize:_6};function k6(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&&Vr(e,0,e.length,n),e}function w6(e,t){let n=e.length,a=0,s,c,l,f;for(;n--;)if(s=e[n][1],c){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&&(c=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[c+a+2][1].end},end:{...e[l-2][1].start}};return f=[["enter",h,t],["enter",m,t]],f=fr(f,e.slice(c+1,c+a+3)),f=fr(f,[["enter",g,t]]),f=fr(f,fx(t.parser.constructs.insideSpan.null,e.slice(c+a+4,l-3),t)),f=fr(f,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),f=fr(f,e.slice(l+1)),f=fr(f,[["exit",h,t]]),Vr(e,c,e.length,f),e}function S6(e,t,n){const a=this;let s=a.events.length,c,l;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){c=a.events[s][1];break}return f;function f(b){return c?c._inactive?x(b):(l=a.parser.defined.includes(Ys(a.sliceSerialize({start:c.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(y6,g,l?g:x)(b):b===91?e.attempt(b6,g,l?m:x)(b):l?g(b):x(b)}function m(b){return e.attempt(v6,g,x)(b)}function g(b){return t(b)}function x(b){return c._balanced=!0,n(b)}}function z6(e,t,n){return a;function a(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),s}function s(x){return Un(x)?Ml(e,c)(x):c(x)}function c(x){return x===41?g(x):t_(e,l,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function l(x){return Un(x)?Ml(e,h)(x):g(x)}function f(x){return n(x)}function h(x){return x===34||x===39||x===40?r_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):g(x)}function m(x){return Un(x)?Ml(e,g)(x):g(x)}function g(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function j6(e,t,n){const a=this;return s;function s(f){return n_.call(a,e,c,l,"reference","referenceMarker","referenceString")(f)}function c(f){return a.parser.defined.includes(Ys(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function l(f){return n(f)}}function _6(e,t,n){return a;function a(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),s}function s(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):n(c)}}const N6={name:"labelStartImage",resolveAll:hx.resolveAll,tokenize:C6};function C6(e,t,n){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(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 T6={name:"labelStartLink",resolveAll:hx.resolveAll,tokenize:E6};function E6(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"),c}function c(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const Pm={name:"lineEnding",tokenize:A6};function A6(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),gt(e,t,"linePrefix")}}const td={name:"thematicBreak",tokenize:O6};function O6(e,t,n){let a=0,s;return c;function c(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||Ce(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),tt(m)?gt(e,f,"whitespace")(m):f(m))}}const Ln={continuation:{tokenize:$6},exit:P6,name:"list",tokenize:D6},M6={partial:!0,tokenize:U6},R6={partial:!0,tokenize:L6};function D6(e,t,n){const a=this,s=a.events[a.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return f;function f(v){const j=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Jp(v)){if(a.containerState.type||(a.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(td,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 Jp(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(Ad,a.interrupt?n:g,e.attempt(M6,b,x))}function g(v){return a.containerState.initialBlankLine=!0,c++,b(v)}function x(v){return tt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return a.containerState.size=c+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function $6(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Ad,s,c);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,gt(e,t,"listItemIndent",a.containerState.size+1)(f)}function c(f){return a.containerState.furtherBlankLines||!tt(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(R6,t,l)(f))}function l(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,gt(e,e.attempt(Ln,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function L6(e,t,n){const a=this;return gt(e,s,"listItemIndent",a.containerState.size+1);function s(c){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(c):n(c)}}function P6(e){e.exit(this.containerState.type)}function U6(e,t,n){const a=this;return gt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const l=a.events[a.events.length-1];return!tt(c)&&l&&l[1].type==="listItemPrefixWhitespace"?t(c):n(c)}}const Zk={name:"setextUnderline",resolveTo:V6,tokenize:B6};function V6(e,t){let n=e.length,a,s,c;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),!c&&e[n][1].type==="definition"&&(c=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",c?(e.splice(s,0,["enter",l,t]),e.splice(c+1,0,["exit",e[a][1],t]),e[a][1].end={...e[c][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function B6(e,t,n){const a=this;let s;return c;function c(m){let g=a.events.length,x;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){x=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||x)?(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"),tt(m)?gt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ce(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const I6={tokenize:Z6};function Z6(e){const t=this,n=e.attempt(Ad,a,e.attempt(this.parser.constructs.flowInitial,s,gt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Y$,s)),"linePrefix")));return n;function a(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const H6={resolveAll:i_()},F6=a_("string"),q6=a_("text");function a_(e){return{resolveAll:i_(e==="text"?G6:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],c=n.attempt(s,l,f);return l;function l(g){return m(g)?c(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"),c(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const x=s[g];let b=-1;if(x)for(;++b<x.length;){const v=x[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function i_(e){return t;function t(n,a){let s=-1,c;for(;++s<=n.length;)c===void 0?n[s]&&n[s][1].type==="data"&&(c=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==c+2&&(n[c][1].end=n[s-1][1].end,n.splice(c+2,s-c-2),s=c+2),c=void 0);return e?e(n,a):n}}function G6(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 c=s.length,l=-1,f=0,h;for(;c--;){const m=s[c];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){c++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?l:a.start._bufferIndex+l,_index:a.start._index+c,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 Y6={42:Ln,43:Ln,45:Ln,48:Ln,49:Ln,50:Ln,51:Ln,52:Ln,53:Ln,54:Ln,55:Ln,56:Ln,57:Ln,62:Xj},J6={91:W$},K6={[-2]:Lm,[-1]:Lm,32:Lm},X6={35:i6,42:td,45:[Zk,td],60:c6,61:Zk,95:td,96:Bk,126:Bk},Q6={38:Wj,92:Qj},W6={[-5]:Pm,[-4]:Pm,[-3]:Pm,33:N6,38:Wj,42:Kp,60:[T$,g6],91:T6,92:[r6,Qj],93:hx,95:Kp,96:I$},e9={null:[Kp,H6]},t9={null:[42,95]},n9={null:[]},r9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:t9,contentInitial:J6,disable:n9,document:Y6,flow:X6,flowInitial:K6,insideSpan:e9,string:Q6,text:W6},Symbol.toStringTag,{value:"Module"}));function a9(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={},c=[];let l=[],f=[];const h={attempt:Z(D),check:Z(M),consume:E,enter:C,exit:$,interrupt:Z(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:S,events:[],now:j,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:x};let g=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function x(ae){return l=fr(l,ae),O(),l[l.length-1]!==null?[]:(U(t,0),m.events=fx(c,m.events,m),m.events)}function b(ae,le){return s9(v(ae),le)}function v(ae){return i9(l,ae)}function j(){const{_bufferIndex:ae,_index:le,line:ne,column:oe,offset:ie}=a;return{_bufferIndex:ae,_index:le,line:ne,column:oe,offset:ie}}function S(ae){s[ae.line]=ae.column,de()}function O(){let ae;for(;a._index<l.length;){const le=l[a._index];if(typeof le=="string")for(ae=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ae&&a._bufferIndex<le.length;)T(le.charCodeAt(a._bufferIndex));else T(le)}}function T(ae){g=g(ae)}function E(ae){Ce(ae)?(a.line++,a.column=1,a.offset+=ae===-3?2:1,de()):ae!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=ae}function C(ae,le){const ne=le||{};return ne.type=ae,ne.start=j(),m.events.push(["enter",ne,m]),f.push(ne),ne}function $(ae){const le=f.pop();return le.end=j(),m.events.push(["exit",le,m]),le}function D(ae,le){U(ae,le.from)}function M(ae,le){le.restore()}function Z(ae,le){return ne;function ne(oe,ie,B){let V,G,ce,A;return Array.isArray(oe)?H(oe):"tokenize"in oe?H([oe]):_(oe);function _(pe){return xe;function xe(Pe){const Ee=Pe!==null&&pe[Pe],xt=Pe!==null&&pe.null,L=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(xt)?xt:xt?[xt]:[]];return H(L)(Pe)}}function H(pe){return V=pe,G=0,pe.length===0?B:w(pe[G])}function w(pe){return xe;function xe(Pe){return A=K(),ce=pe,pe.partial||(m.currentConstruct=pe),pe.name&&m.parser.constructs.disable.null.includes(pe.name)?he():pe.tokenize.call(le?Object.assign(Object.create(m),le):m,h,J,he)(Pe)}}function J(pe){return ae(ce,A),ie}function he(pe){return A.restore(),++G<V.length?w(V[G]):B}}}function U(ae,le){ae.resolveAll&&!c.includes(ae)&&c.push(ae),ae.resolve&&Vr(m.events,le,m.events.length-le,ae.resolve(m.events.slice(le),m)),ae.resolveTo&&(m.events=ae.resolveTo(m.events,m))}function K(){const ae=j(),le=m.previous,ne=m.currentConstruct,oe=m.events.length,ie=Array.from(f);return{from:oe,restore:B};function B(){a=ae,m.previous=le,m.currentConstruct=ne,m.events.length=oe,f=ie,de()}}function de(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function i9(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,c=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(a,c)];else{if(l=e.slice(n,s),a>-1){const f=l[0];typeof f=="string"?l[0]=f.slice(a):l.shift()}c>0&&l.push(e[s].slice(0,c))}return l}function s9(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const c=e[n];let l;if(typeof c=="string")l=c;else switch(c){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(c)}s=c===-2,a.push(l)}return a.join("")}function o9(e){const a={constructs:m$([r9,...(e||{}).extensions||[]]),content:s(w$),defined:[],document:s(z$),flow:s(I6),lazy:{},string:s(F6),text:s(q6)};return a;function s(c){return l;function l(f){return a9(a,c,f)}}}function l9(e){for(;!e_(e););return e}const Hk=/[\0\t\n\r]/g;function c9(){let e=1,t="",n=!0,a;return s;function s(c,l,f){const h=[];let m,g,x,b,v;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(l||void 0).decode(c)),x=0,t="",n&&(c.charCodeAt(0)===65279&&x++,n=void 0);x<c.length;){if(Hk.lastIndex=x,m=Hk.exec(c),b=m&&m.index!==void 0?m.index:c.length,v=c.charCodeAt(b),!m){t=c.slice(x);break}if(v===10&&x===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),x<b&&(h.push(c.slice(x,b)),e+=b-x),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}x=b+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const u9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function d9(e){return e.replace(u9,f9)}function f9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),c=s===120||s===88;return Kj(n.slice(c?2:1),c?16:10)}return dx(n)||e}const s_={}.hasOwnProperty;function h9(e,t,n){return typeof t!="string"&&(n=t,t=void 0),m9(n)(l9(o9(n).document().write(c9()(e,t,!0))))}function m9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(ot),autolinkProtocol:K,autolinkEmail:K,atxHeading:c(wt),blockQuote:c(xt),characterEscape:K,characterReference:K,codeFenced:c(L),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:c(L,l),codeText:c(Oe,l),codeTextData:K,data:K,codeFlowValue:K,definition:c(Ue),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:c(Ye),hardBreakEscape:c(Ie),hardBreakTrailing:c(Ie),htmlFlow:c(nt,l),htmlFlowData:K,htmlText:c(nt,l),htmlTextData:K,image:c(dt),label:l,link:c(ot),listItem:c(Wn),listItemValue:b,listOrdered:c(nn,x),listUnordered:c(nn),paragraph:c(Dt),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:c(wt),strong:c(Yt),thematicBreak:c(Fi)},exit:{atxHeading:h(),atxHeadingSequence:D,autolink:h(),autolinkEmail:Ee,autolinkProtocol:Pe,blockQuote:h(),characterEscapeValue:de,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:pe,characterReference:xe,codeFenced:h(O),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:j,codeFlowValue:de,codeIndented:h(T),codeText:h(ie),codeTextData:de,data:de,definition:h(),definitionDestinationString:$,definitionLabelString:E,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ne),htmlFlowData:de,htmlText:h(oe),htmlTextData:de,image:h(V),label:ce,labelText:G,lineEnding:ae,link:h(B),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:J,resourceDestinationString:A,resourceTitleString:_,resource:H,setextHeading:h(U),setextHeadingLineSequence:Z,setextHeadingText:M,strong:h(),thematicBreak:h()}};o_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let fe={type:"root",children:[]};const we={stack:[fe],tokenStack:[],config:t,enter:f,exit:m,buffer:l,resume:g,data:n},Ne=[];let Je=-1;for(;++Je<W.length;)if(W[Je][1].type==="listOrdered"||W[Je][1].type==="listUnordered")if(W[Je][0]==="enter")Ne.push(Je);else{const bn=Ne.pop();Je=s(W,bn,Je)}for(Je=-1;++Je<W.length;){const bn=t[W[Je][0]];s_.call(bn,W[Je][1].type)&&bn[W[Je][1].type].call(Object.assign({sliceSerialize:W[Je][2].sliceSerialize},we),W[Je][1])}if(we.tokenStack.length>0){const bn=we.tokenStack[we.tokenStack.length-1];(bn[1]||Fk).call(we,void 0,bn[0])}for(fe.position={start:Ba(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ba(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)fe=t.transforms[Je](fe)||fe;return fe}function s(W,fe,we){let Ne=fe-1,Je=-1,bn=!1,In,vn,Jt,Cn;for(;++Ne<=we;){const ft=W[Ne];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?Je++:Je--,Cn=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(In&&!Cn&&!Je&&!Jt&&(Jt=Ne),Cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Cn=void 0}if(!Je&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||Je===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(In){let pa=Ne;for(vn=void 0;pa--;){const yr=W[pa];if(yr[1].type==="lineEnding"||yr[1].type==="lineEndingBlank"){if(yr[0]==="exit")continue;vn&&(W[vn][1].type="lineEndingBlank",bn=!0),yr[1].type="lineEnding",vn=pa}else if(!(yr[1].type==="linePrefix"||yr[1].type==="blockQuotePrefix"||yr[1].type==="blockQuotePrefixWhitespace"||yr[1].type==="blockQuoteMarker"||yr[1].type==="listItemIndent"))break}Jt&&(!vn||Jt<vn)&&(In._spread=!0),In.end=Object.assign({},vn?W[vn][1].start:ft[1].end),W.splice(vn||Ne,0,["exit",In,ft[2]]),Ne++,we++}if(ft[1].type==="listItemPrefix"){const pa={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};In=pa,W.splice(Ne,0,["enter",pa,ft[2]]),Ne++,we++,Jt=void 0,Cn=!0}}}return W[fe][1]._spread=bn,we}function c(W,fe){return we;function we(Ne){f.call(this,W(Ne),Ne),fe&&fe.call(this,Ne)}}function l(){this.stack.push({type:"fragment",children:[]})}function f(W,fe,we){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([fe,we||void 0]),W.position={start:Ba(fe.start),end:void 0}}function h(W){return fe;function fe(we){W&&W.call(this,we),m.call(this,we)}}function m(W,fe){const we=this.stack.pop(),Ne=this.tokenStack.pop();if(Ne)Ne[0].type!==W.type&&(fe?fe.call(this,W,Ne[0]):(Ne[1]||Fk).call(this,W,Ne[0]));else throw new Error("Cannot close `"+W.type+"` ("+Ol({start:W.start,end:W.end})+"): it’s not open");we.position.end=Ba(W.end)}function g(){return f$(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function b(W){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function v(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=W}function j(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=W}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function O(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.value=W.replace(/(\r?\n|\r)$/g,"")}function E(W){const fe=this.resume(),we=this.stack[this.stack.length-1];we.label=fe,we.identifier=Ys(this.sliceSerialize(W)).toLowerCase()}function C(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.title=W}function $(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.url=W}function D(W){const fe=this.stack[this.stack.length-1];if(!fe.depth){const we=this.sliceSerialize(W).length;fe.depth=we}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function Z(W){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function K(W){const we=this.stack[this.stack.length-1].children;let Ne=we[we.length-1];(!Ne||Ne.type!=="text")&&(Ne=yt(),Ne.position={start:Ba(W.start),end:void 0},we.push(Ne)),this.stack.push(Ne)}function de(W){const fe=this.stack.pop();fe.value+=this.sliceSerialize(W),fe.position.end=Ba(W.end)}function ae(W){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=fe.children[fe.children.length-1];we.position.end=Ba(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(K.call(this,W),de.call(this,W))}function le(){this.data.atHardBreak=!0}function ne(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.value=W}function oe(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.value=W}function ie(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.value=W}function B(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=fe,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function V(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=fe,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function G(W){const fe=this.sliceSerialize(W),we=this.stack[this.stack.length-2];we.label=d9(fe),we.identifier=Ys(fe).toLowerCase()}function ce(){const W=this.stack[this.stack.length-1],fe=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ne=W.children;we.children=Ne}else we.alt=fe}function A(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.url=W}function _(){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.title=W}function H(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function J(W){const fe=this.resume(),we=this.stack[this.stack.length-1];we.label=fe,we.identifier=Ys(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function he(W){this.data.characterReferenceType=W.type}function pe(W){const fe=this.sliceSerialize(W),we=this.data.characterReferenceType;let Ne;we?(Ne=Kj(fe,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ne=dx(fe);const Je=this.stack[this.stack.length-1];Je.value+=Ne}function xe(W){const fe=this.stack.pop();fe.position.end=Ba(W.end)}function Pe(W){de.call(this,W);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(W)}function Ee(W){de.call(this,W);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(W)}function xt(){return{type:"blockquote",children:[]}}function L(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ye(){return{type:"emphasis",children:[]}}function wt(){return{type:"heading",depth:0,children:[]}}function Ie(){return{type:"break"}}function nt(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function ot(){return{type:"link",title:null,url:"",children:[]}}function nn(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Wn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Dt(){return{type:"paragraph",children:[]}}function Yt(){return{type:"strong",children:[]}}function yt(){return{type:"text",value:""}}function Fi(){return{type:"thematicBreak"}}}function Ba(e){return{line:e.line,column:e.column,offset:e.offset}}function o_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?o_(e,a):p9(e,a)}}function p9(e,t){let n;for(n in t)if(s_.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 Fk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ol({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ol({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ol({start:t.start,end:t.end})+") is still open")}function g9(e){const t=this;t.parser=n;function n(a){return h9(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function x9(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 y9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
23
|
-
`}]}function b9(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 c={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function v9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=mo(a.toLowerCase()),c=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=c+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 S9(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 z9(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function l_(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),c=s[0];c&&c.type==="text"?c.value="["+c.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 j9(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return l_(e,t);const s={src:mo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const c={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,c),e.applyData(t,c)}function _9(e,t){const n={src:mo(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 N9(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 C9(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return l_(e,t);const s={href:mo(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const c={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function T9(e,t){const n={href:mo(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 E9(e,t,n){const a=e.all(t),s=n?A9(n):c_(t),c={},l=[];if(typeof t.checked=="boolean"){const g=a[0];let x;g&&g.type==="element"&&g.tagName==="p"?x=g:(x={type:"element",tagName:"p",properties:{},children:[]},a.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.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:c,children:l};return e.patch(t,m),e.applyData(t,m)}function A9(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=c_(n[a])}return t}function c_(e){const t=e.spread;return t??e.children.length>1}function O9(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 c={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,c),e.applyData(t,c)}function M9(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R9(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function D9(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $9(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=ox(t.children[1]),h=Zj(t.children[t.children.length-1]);f&&h&&(l.position={start:f,end:h}),s.push(l)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)}function L9(e,t,n){const a=n?n.children:void 0,c=(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 x=t.children[h],b={},v=l?l[h]:void 0;v&&(b.align=v);let j={type:"element",tagName:c,properties:b,children:[]};x&&(j.children=e.all(x),e.patch(x,j),j=e.applyData(x,j)),m.push(j)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function P9(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const qk=9,Gk=32;function U9(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const c=[];for(;a;)c.push(Yk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return c.push(Yk(t.slice(s),s>0,!1)),c.join("")}function Yk(e,t,n){let a=0,s=e.length;if(t){let c=e.codePointAt(a);for(;c===qk||c===Gk;)a++,c=e.codePointAt(a)}if(n){let c=e.codePointAt(s-1);for(;c===qk||c===Gk;)s--,c=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function V9(e,t){const n={type:"text",value:U9(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function B9(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const I9={blockquote:x9,break:y9,code:b9,delete:v9,emphasis:k9,footnoteReference:w9,heading:S9,html:z9,imageReference:j9,image:_9,inlineCode:N9,linkReference:C9,link:T9,listItem:E9,list:O9,paragraph:M9,root:R9,strong:D9,table:$9,tableCell:P9,tableRow:L9,text:V9,thematicBreak:B9,toml:Mu,yaml:Mu,definition:Mu,footnoteDefinition:Mu};function Mu(){}const u_=-1,Od=0,Rl=1,hd=2,mx=3,px=4,gx=5,xx=6,d_=7,f_=8,Jk=typeof self=="object"?self:globalThis,Z9=(e,t)=>{const n=(s,c)=>(e.set(c,s),s),a=s=>{if(e.has(s))return e.get(s);const[c,l]=t[s];switch(c){case Od:case u_:return n(l,s);case Rl:{const f=n([],s);for(const h of l)f.push(a(h));return f}case hd:{const f=n({},s);for(const[h,m]of l)f[a(h)]=a(m);return f}case mx:return n(new Date(l),s);case px:{const{source:f,flags:h}=l;return n(new RegExp(f,h),s)}case gx:{const f=n(new Map,s);for(const[h,m]of l)f.set(a(h),a(m));return f}case xx:{const f=n(new Set,s);for(const h of l)f.add(a(h));return f}case d_:{const{name:f,message:h}=l;return n(new Jk[f](h),s)}case f_: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 Jk[c](l),s)};return a},Kk=e=>Z9(new Map,e)(0),Ms="",{toString:H9}={},{keys:F9}=Object,vl=e=>{const t=typeof e;if(t!=="object"||!e)return[Od,t];const n=H9.call(e).slice(8,-1);switch(n){case"Array":return[Rl,Ms];case"Object":return[hd,Ms];case"Date":return[mx,Ms];case"RegExp":return[px,Ms];case"Map":return[gx,Ms];case"Set":return[xx,Ms];case"DataView":return[Rl,n]}return n.includes("Array")?[Rl,n]:n.includes("Error")?[d_,n]:[hd,n]},Ru=([e,t])=>e===Od&&(t==="function"||t==="symbol"),q9=(e,t,n,a)=>{const s=(l,f)=>{const h=a.push(l)-1;return n.set(f,h),h},c=l=>{if(n.has(l))return n.get(l);let[f,h]=vl(l);switch(f){case Od:{let g=l;switch(h){case"bigint":f=f_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([u_],l)}return s([f,g],l)}case Rl:{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=[],x=s([f,g],l);for(const b of l)g.push(c(b));return x}case hd:{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 c(l.toJSON());const g=[],x=s([f,g],l);for(const b of F9(l))(e||!Ru(vl(l[b])))&&g.push([c(b),c(l[b])]);return x}case mx:return s([f,l.toISOString()],l);case px:{const{source:g,flags:x}=l;return s([f,{source:g,flags:x}],l)}case gx:{const g=[],x=s([f,g],l);for(const[b,v]of l)(e||!(Ru(vl(b))||Ru(vl(v))))&&g.push([c(b),c(v)]);return x}case xx:{const g=[],x=s([f,g],l);for(const b of l)(e||!Ru(vl(b)))&&g.push(c(b));return x}}const{message:m}=l;return s([f,{name:h,message:m}],l)};return c},Xk=(e,{json:t,lossy:n}={})=>{const a=[];return q9(!(t||n),!!t,new Map,a)(e),a},md=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Kk(Xk(e,t)):structuredClone(e):(e,t)=>Kk(Xk(e,t));function G9(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 Y9(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function J9(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||G9,a=e.options.footnoteBackLabel||Y9,s=e.options.footnoteLabel||"Footnotes",c=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),x=String(m.identifier).toUpperCase(),b=mo(x.toLowerCase());let v=0;const j=[],S=e.footnoteCounts.get(x);for(;S!==void 0&&++v<=S;){j.length>0&&j.push({type:"text",value:" "});let E=typeof n=="string"?n:n(h,v);typeof E=="string"&&(E={type:"text",value:E}),j.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(E)?E:[E]})}const O=g[g.length-1];if(O&&O.type==="element"&&O.tagName==="p"){const E=O.children[O.children.length-1];E&&E.type==="text"?E.value+=" ":O.children.push({type:"text",value:" "}),O.children.push(...j)}else g.push(...j);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(m,T),f.push(T)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...md(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 h_=(function(e){if(e==null)return W9;if(typeof e=="function")return Md(e);if(typeof e=="object")return Array.isArray(e)?K9(e):X9(e);if(typeof e=="string")return Q9(e);throw new Error("Expected function, string, or object as test")});function K9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=h_(e[n]);return Md(a);function a(...s){let c=-1;for(;++c<t.length;)if(t[c].apply(this,s))return!0;return!1}}function X9(e){const t=e;return Md(n);function n(a){const s=a;let c;for(c in e)if(s[c]!==t[c])return!1;return!0}}function Q9(e){return Md(t);function t(n){return n&&n.type===e}}function Md(e){return t;function t(n,a,s){return!!(eL(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function W9(){return!0}function eL(e){return e!==null&&typeof e=="object"&&"type"in e}const m_=[],tL=!0,Qk=!1,nL="skip";function rL(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const c=h_(s),l=a?-1:1;f(e,void 0,[])();function f(h,m,g){const x=h&&typeof h=="object"?h:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=m_,j,S,O;if((!t||c(h,m,g[g.length-1]||void 0))&&(v=aL(n(h,g)),v[0]===Qk))return v;if("children"in h&&h.children){const T=h;if(T.children&&v[0]!==nL)for(S=(a?T.children.length:-1)+l,O=g.concat(T);S>-1&&S<T.children.length;){const E=T.children[S];if(j=f(E,S,O)(),j[0]===Qk)return j;S=typeof j[1]=="number"?j[1]:S+l}}return v}}}function aL(e){return Array.isArray(e)?e:typeof e=="number"?[tL,e]:e==null?m_:[e]}function p_(e,t,n,a){let s,c,l;typeof t=="function"&&typeof n!="function"?(c=void 0,l=t,s=n):(c=t,l=n,s=a),rL(e,c,f,s);function f(h,m){const g=m[m.length-1],x=g?g.children.indexOf(h):void 0;return l(h,x,g)}}const Xp={}.hasOwnProperty,iL={};function sL(e,t){const n=t||iL,a=new Map,s=new Map,c=new Map,l={...I9,...n.handlers},f={all:m,applyData:lL,definitionById:a,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:l,one:h,options:n,patch:oL,wrap:uL};return p_(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const x=g.type==="definition"?a:s,b=String(g.identifier).toUpperCase();x.has(b)||x.set(b,g)}}),f;function h(g,x){const b=g.type,v=f.handlers[b];if(Xp.call(f.handlers,b)&&v)return v(f,g,x);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in g){const{children:S,...O}=g,T=md(O);return T.children=f.all(g),T}return md(g)}return(f.options.unknownHandler||cL)(f,g,x)}function m(g){const x=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const j=f.one(b[v],g);if(j){if(v&&b[v-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=Wk(j.value)),!Array.isArray(j)&&j.type==="element")){const S=j.children[0];S&&S.type==="text"&&(S.value=Wk(S.value))}Array.isArray(j)?x.push(...j):x.push(j)}}}return x}}function oL(e,t){e.position&&(t.position=HD(e))}function lL(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,c=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"&&c&&Object.assign(n.properties,md(c)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function cL(e,t){const n=t.data||{},a="value"in t&&!(Xp.call(n,"hProperties")||Xp.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 uL(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 Wk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ew(e,t){const n=sL(e,t),a=n.one(e,void 0),s=J9(n),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
|
|
32
|
-
`},s),c}function dL(e,t){return e&&"run"in e?async function(n,a){const s=ew(n,{file:a,...t});await e.run(s,a)}:function(n,a){return ew(n,{file:a,...e||t})}}function tw(e){if(e)throw e}var Um,nw;function fL(){if(nw)return Um;nw=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]"},c=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!x)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 Um=function h(){var m,g,x,b,v,j,S=arguments[0],O=1,T=arguments.length,E=!1;for(typeof S=="boolean"&&(E=S,S=arguments[1]||{},O=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});O<T;++O)if(m=arguments[O],m!=null)for(g in m)x=f(S,g),b=f(m,g),S!==b&&(E&&b&&(c(b)||(v=s(b)))?(v?(v=!1,j=x&&s(x)?x:[]):j=x&&c(x)?x:{},l(S,{name:g,newValue:h(E,j,b)})):typeof b<"u"&&l(S,{name:g,newValue:b}));return S},Um}var hL=fL();const Vm=og(hL);function Qp(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 mL(){const e=[],t={run:n,use:a};return t;function n(...s){let c=-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[++c];let x=-1;if(h){l(h);return}for(;++x<s.length;)(m[x]===null||m[x]===void 0)&&(m[x]=s[x]);s=m,g?pL(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 pL(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(c,s):h instanceof Error?s(h):c(h))}function s(l,...f){n||(n=!0,t(l,...f))}function c(l){s(null,l)}}const Or={basename:gL,dirname:xL,extname:yL,join:bL,sep:"/"};function gL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');lc(e);let n=0,a=-1,s=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(c){n=s+1;break}}else a<0&&(c=!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(c){n=s+1;break}}else l<0&&(c=!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 xL(e){if(lc(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 yL(e){lc(e);let t=e.length,n=-1,a=0,s=-1,c=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:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||n<0||c===0||c===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function bL(...e){let t=-1,n;for(;++t<e.length;)lc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":vL(n)}function vL(e){lc(e);const t=e.codePointAt(0)===47;let n=kL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kL(e,t){let n="",a=0,s=-1,c=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||c===1))if(s!==l-1&&c===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,c=0;continue}}else if(n.length>0){n="",a=0,s=l,c=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,c=0}else f===46&&c>-1?c++:c=-1}return n}function lc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wL={cwd:SL};function SL(){return"/"}function Wp(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(!Wp(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 jL(e)}function jL(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 Bm=["history","path","basename","stem","extname","dirname"];class g_{constructor(t){let n;t?Wp(t)?n={path:t}:typeof t=="string"||_L(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":wL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Bm.length;){const c=Bm[a];c in n&&n[c]!==void 0&&n[c]!==null&&(this[c]=c==="history"?[...n[c]]:n[c])}let s;for(s in n)Bm.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Or.basename(this.path):void 0}set basename(t){Zm(t,"basename"),Im(t,"basename"),this.path=Or.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Or.dirname(this.path):void 0}set dirname(t){rw(this.basename,"dirname"),this.path=Or.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Or.extname(this.path):void 0}set extname(t){if(Im(t,"extname"),rw(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=Or.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wp(t)&&(t=zL(t)),Zm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Or.basename(this.path,this.extname):void 0}set stem(t){Zm(t,"stem"),Im(t,"stem"),this.path=Or.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 yn(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 Im(e,t){if(e&&e.includes(Or.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Or.sep+"`")}function Zm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _L(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NL=(function(e){const a=this.constructor.prototype,s=a[e],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),CL={}.hasOwnProperty;class yx extends NL{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=mL()}copy(){const t=new yx;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Vm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qm("data",this.frozen),this.namespace[t]=n,this):CL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qm("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=Du(t),a=this.parser||this.Parser;return Hm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Hm("process",this.parser||this.Parser),Fm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(c,l){const f=Du(t),h=a.parse(f);a.run(h,f,function(g,x,b){if(g||!x||!b)return m(g);const v=x,j=a.stringify(v,b);AL(j)?b.value=j:b.result=j,m(g,b)});function m(g,x){g||!x?l(g):c?c(x):n(void 0,x)}}}processSync(t){let n=!1,a;return this.freeze(),Hm("processSync",this.parser||this.Parser),Fm("processSync",this.compiler||this.Compiler),this.process(t,s),iw("processSync","process",n),a;function s(c,l){n=!0,tw(c),a=l}}run(t,n,a){aw(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?c(void 0,a):new Promise(c);function c(l,f){const h=Du(n);s.run(t,h,m);function m(g,x,b){const v=x||t;g?f(g):l?l(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,s;return this.run(t,n,c),iw("runSync","run",a),s;function c(l,f){tw(l),s=f,a=!0}}stringify(t,n){this.freeze();const a=Du(n),s=this.compiler||this.Compiler;return Fm("stringify",s),aw(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(qm("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 c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...x]=m;h(g,x)}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=Vm(!0,s.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const x=m[g];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let x=-1,b=-1;for(;++x<a.length;)if(a[x][0]===m){b=x;break}if(b===-1)a.push([m,...g]);else if(g.length>0){let[v,...j]=g;const S=a[b][1];Qp(S)&&Qp(v)&&(v=Vm(!0,S,v)),a[b]=[m,v,...j]}}}}const TL=new yx().freeze();function Hm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qm(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 aw(e){if(!Qp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Du(e){return EL(e)?e:new g_(e)}function EL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AL(e){return typeof e=="string"||OL(e)}function OL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ML="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sw=[],ow={allowDangerousHtml:!0},RL=/^(https?|ircs?|mailto|xmpp)$/i,DL=[{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 $L(e){const t=LL(e),n=PL(e);return UL(t.runSync(t.parse(n),n),e)}function LL(e){const t=e.rehypePlugins||sw,n=e.remarkPlugins||sw,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ow}:ow;return TL().use(g9).use(n).use(dL,a).use(t)}function PL(e){const t=e.children||"",n=new g_;return typeof t=="string"&&(n.value=t),n}function UL(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,c=t.disallowedElements,l=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||VL;for(const g of DL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+ML+g.id,void 0);return p_(e,m),JD(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(g,x,b){if(g.type==="raw"&&b&&typeof x=="number")return l?b.children.splice(x,1):b.children[x]={type:"text",value:g.value},x;if(g.type==="element"){let v;for(v in $m)if(Object.hasOwn($m,v)&&Object.hasOwn(g.properties,v)){const j=g.properties[v],S=$m[v];(S===null||S.includes(g.tagName))&&(g.properties[v]=h(String(j||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):c?c.includes(g.tagName):!1;if(!v&&a&&typeof x=="number"&&(v=!a(g,x,b)),v&&b&&typeof x=="number")return f&&g.children?b.children.splice(x,1,...g.children):b.children.splice(x,1),x}}}function VL(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||RL.test(e.slice(0,t))?e:""}const BL=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a})=>{const[s,c]=z.useState(""),l=z.useRef(null),f=()=>{l.current?.scrollIntoView({behavior:"smooth"})};z.useEffect(()=>{f()},[e,n]);const h=j=>{j.preventDefault(),!(!s.trim()||n)&&(t(s),c(""))},m=j=>j.session_id?.startsWith("sati-evaluation-")||j.tool_name?.toLowerCase().includes("sati")||j.tool_call_id?.toLowerCase().includes("sati")?!0:Array.isArray(j.tool_calls)?j.tool_calls.some(S=>String(S?.name||"").toLowerCase().includes("sati")):!1,g=j=>m(j)?"SATI Memory":"Tool Call",x=j=>{if(typeof j=="string")try{return JSON.stringify(JSON.parse(j),null,2)}catch{return j}try{return JSON.stringify(j,null,2)}catch{return String(j)}},b=j=>{const S=j.usage_metadata;if(!S||typeof S!="object")return null;const O=S.input_tokens??S.prompt_tokens??S.input??0,T=S.output_tokens??S.completion_tokens??S.output??0,E=Number(O),C=Number(T);if(!Number.isFinite(E)&&!Number.isFinite(C))return null;const $=Number.isFinite(E)?Math.max(0,Math.round(E)):0,D=Number.isFinite(C)?Math.max(0,Math.round(C)):0;return $===0&&D===0?null:{input:$,output:D}},v=j=>j.toLocaleString("pt-BR");return a?u.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[u.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((j,S)=>{const O=b(j),T=j.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 u.jsxs("div",{className:`flex gap-4 ${j.type==="human"?"justify-end":"justify-start"}`,children:[j.type!=="human"&&u.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${j.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:j.type==="tool"?u.jsx(bg,{size:16}):u.jsx(Gv,{size:18})}),u.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-sm ${j.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":j.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:[j.type==="tool"&&u.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[u.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(j)}),u.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:x(j.content)})]}),j.type==="ai"&&u.jsxs(u.Fragment,{children:[u.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:u.jsx($L,{children:j.content})}),Array.isArray(j.tool_calls)&&j.tool_calls.length>0&&u.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:[u.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(j)}),u.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:x(j.tool_calls)})]})]}),j.type==="human"&&u.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:j.content}),O&&u.jsx("div",{className:"mt-3 flex justify-end",children:u.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${T}`,children:[u.jsx(e4,{size:12}),u.jsx("span",{children:v(O.input)}),u.jsx("span",{className:"opacity-60",children:"/"}),u.jsx("span",{children:v(O.output)}),u.jsx(KE,{size:12})]})})]}),j.type==="human"&&u.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:u.jsx(Sg,{size:18})})]},S)}),n&&u.jsxs("div",{className:"flex gap-4 justify-start",children:[u.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:u.jsx(Gv,{size:18})}),u.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:[u.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),u.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),u.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),u.jsx("div",{ref:l})]}),u.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:u.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[u.jsx("input",{type:"text",value:s,onChange:j=>c(j.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}),u.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:u.jsx(kA,{size:20})})]})})]}):u.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:[u.jsx(IL,{size:48,className:"mb-4 opacity-20"}),u.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},IL=({size:e,className:t})=>u.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:u.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"})}),Ia={getSessions:async()=>ge.get("/sessions"),createSession:async()=>ge.post("/sessions",{}),deleteSession:async e=>ge.delete(`/sessions/${e}`),renameSession:async(e,t)=>ge.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>ge.post(`/sessions/${e}/archive`,{}),getMessages:async e=>ge.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>ge.post("/chat",{sessionId:e,message:t})};function x_({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:c="Confirm",variant:l="default"}){return u.jsx(Lr,{open:e,onOpenChange:t,children:u.jsxs(to,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[u.jsx(Pr,{children:u.jsx(Ur,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),u.jsx("div",{className:"py-4",children:u.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:s})}),u.jsxs(uD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[u.jsx(hr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),u.jsx(hr,{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:c})]})]})})}const ZL=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(null),[s,c]=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 $=setInterval(async()=>{if(!g.current)try{const M=(await Ia.getMessages(n)).filter(Z=>Z.type!=="system");c(Z=>{if(M.length!==Z.length)return M;const U=M.at(-1)?.created_at??0,K=Z.at(-1)?.created_at??0;return U>K?M:Z})}catch{}},3e3);return()=>clearInterval($)},[n]);const[x,b]=z.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const $=await Ia.getSessions();t($)}catch($){console.error("Failed to load sessions:",$)}};z.useEffect(()=>{v()},[]),z.useEffect(()=>{n?j(n):c([])},[n]);const j=async $=>{try{const D=await Ia.getMessages($);c(D.filter(M=>M.type!=="system"))}catch(D){console.error("Failed to load messages:",D)}},S=async()=>{try{const $=await Ia.createSession();await v(),a($.id)}catch($){console.error("Failed to create session:",$)}},O=async $=>{if(!n)return;const D={type:"human",content:$};c(M=>[...M,D]),f(!0);try{await Ia.sendMessage(n,$),await j(n),await v()}catch(M){console.error("Failed to send message:",M)}finally{f(!1)}},T=$=>{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 Ia.archiveSession($),n===$&&a(null),await v()}catch(D){console.error("Failed to archive session:",D)}}})},E=$=>{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 Ia.deleteSession($),n===$&&a(null),await v()}catch(D){console.error("Failed to delete session:",D)}}})},C=async($,D)=>{try{await Ia.renameSession($,D),await v()}catch(M){console.error("Failed to rename session:",M)}};return u.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[u.jsx(vD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:S,onArchiveSession:T,onDeleteSession:E,onRenameSession:C,isOpen:h,toggleSidebar:()=>m(!h)}),u.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:u.jsx(BL,{messages:s,onSendMessage:O,isLoading:l,activeSessionId:n})}),u.jsx(x_,{isOpen:x.isOpen,onClose:()=>b($=>({...$,isOpen:!1})),onConfirm:x.onConfirm,title:x.title,description:x.description,confirmJson:x.confirmJson,variant:x.variant})]})};function HL(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return We(`/chronos${n}`,()=>ge.get(`/chronos${n}`))}function FL(e,t=50){return We(e?`/chronos/${e}/executions?limit=${t}`:null,()=>ge.get(`/chronos/${e}/executions?limit=${t}`))}function y_(){return We("/config/chronos",()=>ge.get("/config/chronos"))}const Li={createJob:e=>ge.post("/chronos",e),updateJob:(e,t)=>ge.put(`/chronos/${e}`,t),deleteJob:e=>ge.delete(`/chronos/${e}`),enableJob:e=>ge.patch(`/chronos/${e}/enable`,{}),disableJob:e=>ge.patch(`/chronos/${e}/disable`,{}),getConfig:()=>ge.get("/config/chronos"),updateConfig:e=>ge.post("/config/chronos",e),preview:(e,t,n)=>ge.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function wn({title:e,description:t,children:n}){return u.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:[u.jsxs("div",{className:"mb-4",children:[u.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),u.jsx("div",{className:"space-y-4",children:n})]})}const qL=(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},GL=(e,t)=>({classGroupId:e,validator:t}),b_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),pd="-",lw=[],YL="arbitrary..",JL=e=>{const t=XL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return KL(l);const f=l.split(pd),h=f[0]===""&&f.length>1?1:0;return v_(f,h,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const h=a[l],m=n[l];return h?m?qL(m,h):h:m||lw}return n[l]||lw}}},v_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],c=n.nextPart.get(s);if(c){const m=v_(e,t+1,c);if(m)return m}const l=n.validators;if(l===null)return;const f=t===0?e.join(pd):e.slice(t).join(pd),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(f))return g.classGroupId}},KL=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?YL+a:void 0})(),XL=e=>{const{theme:t,classGroups:n}=e;return QL(n,t)},QL=(e,t)=>{const n=b_();for(const a in e){const s=e[a];bx(s,n,a,t)}return n},bx=(e,t,n,a)=>{const s=e.length;for(let c=0;c<s;c++){const l=e[c];WL(l,t,n,a)}},WL=(e,t,n,a)=>{if(typeof e=="string"){e8(e,t,n);return}if(typeof e=="function"){t8(e,t,n,a);return}n8(e,t,n,a)},e8=(e,t,n)=>{const a=e===""?t:k_(t,e);a.classGroupId=n},t8=(e,t,n,a)=>{if(r8(e)){bx(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(GL(n,e))},n8=(e,t,n,a)=>{const s=Object.entries(e),c=s.length;for(let l=0;l<c;l++){const[f,h]=s[l];bx(h,k_(t,f),n,a)}},k_=(e,t)=>{let n=e;const a=t.split(pd),s=a.length;for(let c=0;c<s;c++){const l=a[c];let f=n.nextPart.get(l);f||(f=b_(),n.nextPart.set(l,f)),n=f}return n},r8=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,a8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(c,l)=>{n[c]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(c){let l=n[c];if(l!==void 0)return l;if((l=a[c])!==void 0)return s(c,l),l},set(c,l){c in n?n[c]=l:s(c,l)}}},eg="!",cw=":",i8=[],uw=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),s8=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const c=[];let l=0,f=0,h=0,m;const g=s.length;for(let S=0;S<g;S++){const O=s[S];if(l===0&&f===0){if(O===cw){c.push(s.slice(h,S)),h=S+1;continue}if(O==="/"){m=S;continue}}O==="["?l++:O==="]"?l--:O==="("?f++:O===")"&&f--}const x=c.length===0?s:s.slice(h);let b=x,v=!1;x.endsWith(eg)?(b=x.slice(0,-1),v=!0):x.startsWith(eg)&&(b=x.slice(1),v=!0);const j=m&&m>h?m-h:void 0;return uw(c,v,b,j)};if(t){const s=t+cw,c=a;a=l=>l.startsWith(s)?c(l.slice(s.length)):uw(i8,!1,l,void 0,!0)}if(n){const s=a;a=c=>n({className:c,parseClassName:s})}return a},o8=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let c=0;c<n.length;c++){const l=n[c],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}},l8=e=>({cache:a8(e.cacheSize),parseClassName:s8(e),sortModifiers:o8(e),...JL(e)}),c8=/\s+/,u8=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:c}=t,l=[],f=e.trim().split(c8);let h="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{isExternal:x,modifiers:b,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:S}=n(g);if(x){h=g+(h.length>0?" "+h:h);continue}let O=!!S,T=a(O?j.substring(0,S):j);if(!T){if(!O){h=g+(h.length>0?" "+h:h);continue}if(T=a(j),!T){h=g+(h.length>0?" "+h:h);continue}O=!1}const E=b.length===0?"":b.length===1?b[0]:c(b).join(":"),C=v?E+eg:E,$=C+T;if(l.indexOf($)>-1)continue;l.push($);const D=s(T,O);for(let M=0;M<D.length;++M){const Z=D[M];l.push(C+Z)}h=g+(h.length>0?" "+h:h)}return h},d8=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=w_(n))&&(s&&(s+=" "),s+=a);return s},w_=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=w_(e[a]))&&(n&&(n+=" "),n+=t);return n},f8=(e,...t)=>{let n,a,s,c;const l=h=>{const m=t.reduce((g,x)=>x(g),e());return n=l8(m),a=n.cache.get,s=n.cache.set,c=f,f(h)},f=h=>{const m=a(h);if(m)return m;const g=u8(h,n);return s(h,g),g};return c=l,(...h)=>c(d8(...h))},h8=[],Xt=e=>{const t=n=>n[e]||h8;return t.isThemeGetter=!0,t},S_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,z_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,m8=/^\d+\/\d+$/,p8=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,g8=/\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$/,x8=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y8=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b8=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>m8.test(e),$e=e=>!!e&&!Number.isNaN(Number(e)),Za=e=>!!e&&Number.isInteger(Number(e)),Gm=e=>e.endsWith("%")&&$e(e.slice(0,-1)),oa=e=>p8.test(e),v8=()=>!0,k8=e=>g8.test(e)&&!x8.test(e),j_=()=>!1,w8=e=>y8.test(e),S8=e=>b8.test(e),z8=e=>!be(e)&&!ve(e),j8=e=>po(e,C_,j_),be=e=>S_.test(e),Ti=e=>po(e,T_,k8),Ym=e=>po(e,E8,$e),dw=e=>po(e,__,j_),_8=e=>po(e,N_,S8),$u=e=>po(e,E_,w8),ve=e=>z_.test(e),kl=e=>go(e,T_),N8=e=>go(e,A8),fw=e=>go(e,__),C8=e=>go(e,C_),T8=e=>go(e,N_),Lu=e=>go(e,E_,!0),po=(e,t,n)=>{const a=S_.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},go=(e,t,n=!1)=>{const a=z_.exec(e);return a?a[1]?t(a[1]):n:!1},__=e=>e==="position"||e==="percentage",N_=e=>e==="image"||e==="url",C_=e=>e==="length"||e==="size"||e==="bg-size",T_=e=>e==="length",E8=e=>e==="number",A8=e=>e==="family-name",E_=e=>e==="shadow",O8=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),a=Xt("font-weight"),s=Xt("tracking"),c=Xt("leading"),l=Xt("breakpoint"),f=Xt("container"),h=Xt("spacing"),m=Xt("radius"),g=Xt("shadow"),x=Xt("inset-shadow"),b=Xt("text-shadow"),v=Xt("drop-shadow"),j=Xt("blur"),S=Xt("perspective"),O=Xt("aspect"),T=Xt("ease"),E=Xt("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...$(),ve,be],M=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto","contain","none"],U=()=>[ve,be,h],K=()=>[Rs,"full","auto",...U()],de=()=>[Za,"none","subgrid",ve,be],ae=()=>["auto",{span:["full",Za,ve,be]},Za,ve,be],le=()=>[Za,"auto",ve,be],ne=()=>["auto","min","max","fr",ve,be],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...U()],V=()=>[Rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],G=()=>[e,ve,be],ce=()=>[...$(),fw,dw,{position:[ve,be]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",C8,j8,{size:[ve,be]}],H=()=>[Gm,kl,Ti],w=()=>["","none","full",m,ve,be],J=()=>["",$e,kl,Ti],he=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[$e,Gm,fw,dw],Pe=()=>["","none",j,ve,be],Ee=()=>["none",$e,ve,be],xt=()=>["none",$e,ve,be],L=()=>[$e,ve,be],Oe=()=>[Rs,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oa],breakpoint:[oa],color:[v8],container:[oa],"drop-shadow":[oa],ease:["in","out","in-out"],font:[z8],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oa],shadow:[oa],spacing:["px",$e],text:[oa],"text-shadow":[oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rs,be,ve,O]}],container:["container"],columns:[{columns:[$e,be,ve,f]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Za,"auto",ve,be]}],basis:[{basis:[Rs,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,Rs,"auto","initial","none",be]}],grow:[{grow:["",$e,ve,be]}],shrink:[{shrink:["",$e,ve,be]}],order:[{order:[Za,"first","last","none",ve,be]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,kl,Ti]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ve,Ym]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gm,be]}],"font-family":[{font:[N8,be,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,ve,be]}],"line-clamp":[{"line-clamp":[$e,"none",ve,Ym]}],leading:[{leading:[c,...U()]}],"list-image":[{"list-image":["none",ve,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",ve,Ti]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[$e,"auto",ve,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Za,ve,be],radial:["",ve,be],conic:[Za,ve,be]},T8,_8]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],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:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,ve,be]}],"outline-w":[{outline:["",$e,kl,Ti]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",g,Lu,$u]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",x,Lu,$u]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[$e,Ti]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",b,Lu,$u]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[$e,ve,be]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"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":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[ve,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"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":$()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,be]}],filter:[{filter:["","none",ve,be]}],blur:[{blur:Pe()}],brightness:[{brightness:[$e,ve,be]}],contrast:[{contrast:[$e,ve,be]}],"drop-shadow":[{"drop-shadow":["","none",v,Lu,$u]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",$e,ve,be]}],"hue-rotate":[{"hue-rotate":[$e,ve,be]}],invert:[{invert:["",$e,ve,be]}],saturate:[{saturate:[$e,ve,be]}],sepia:[{sepia:["",$e,ve,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,be]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[$e,ve,be]}],"backdrop-contrast":[{"backdrop-contrast":[$e,ve,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,ve,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,ve,be]}],"backdrop-invert":[{"backdrop-invert":["",$e,ve,be]}],"backdrop-opacity":[{"backdrop-opacity":[$e,ve,be]}],"backdrop-saturate":[{"backdrop-saturate":[$e,ve,be]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,ve,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",ve,be]}],ease:[{ease:["linear","initial",T,ve,be]}],delay:[{delay:[$e,ve,be]}],animate:[{animate:["none",E,ve,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ve,be]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:xt()}],"scale-x":[{"scale-x":xt()}],"scale-y":[{"scale-y":xt()}],"scale-z":[{"scale-z":xt()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[ve,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"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:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",ve,be]}],"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":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",ve,be]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[$e,kl,Ti,Ym]}],stroke:[{stroke:["none",...G()]}],"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"]}},Js=f8(O8);function Ge({label:e,error:t,helperText:n,className:a,...s}){return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),u.jsx("input",{className:Js("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&&u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&u.jsx("p",{className:"text-xs text-red-500",children:t})]})}function mn({label:e,options:t,error:n,helperText:a,className:s,...c}){return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),u.jsx("select",{className:Js("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),...c,children:t.map(l=>u.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&u.jsx("p",{className:"text-xs text-red-500",children:n})]})}function It({label:e,error:t,helperText:n,className:a,...s}){return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),u.jsx("input",{type:"number",className:Js("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&&u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&u.jsx("p",{className:"text-xs text-red-500",children:t})]})}function Sr({label:e,checked:t,onChange:n,helperText:a,disabled:s}){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:Js("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",s&&"opacity-50"),children:e}),a&&u.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),u.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!s&&n(!t),className:Js("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:u.jsx("span",{className:Js("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const en={fetchConfig:async()=>ge.get("/config"),updateConfig:async e=>ge.post("/config",e),getSatiConfig:async()=>ge.get("/config/sati"),updateSatiConfig:async e=>ge.post("/config/sati",e),deleteSatiConfig:async()=>ge.delete("/config/sati"),getApocConfig:async()=>ge.get("/config/apoc"),updateApocConfig:async e=>ge.post("/config/apoc",e),deleteApocConfig:async()=>ge.delete("/config/apoc"),getNeoConfig:async()=>ge.get("/config/neo"),updateNeoConfig:async e=>ge.post("/config/neo",e),deleteNeoConfig:async()=>ge.delete("/config/neo"),getTrinityConfig:async()=>ge.get("/config/trinity"),updateTrinityConfig:async e=>ge.post("/config/trinity",e),deleteTrinityConfig:async()=>ge.delete("/config/trinity"),getEncryptionStatus:async()=>ge.get("/config/encryption-status"),getEnvOverrides:async()=>ge.get("/config/env-overrides"),getSmithsConfig:async()=>await ge.get("/smiths/config"),updateSmithsConfig:async e=>ge.put("/smiths/config",e),getSmithsList:async()=>ge.get("/smiths"),pingSmith:async e=>ge.post(`/smiths/${e}/ping`,{}),removeSmith:async e=>ge.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 x=0;x<g.length;x++){const b=g[x];b in f||(f[b]=m[b].bind(f))}}const s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function l(f){var h;const m=n?.Parent?new c: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 Ks=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},A_=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const O_={};function ei(e){return O_}function M_(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 tg(e,t){return typeof t=="bigint"?t.toString():t}function Rd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vx(e){return e==null}function kx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function M8(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 c=n>s?n:s,l=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return l%f/10**c}const hw=Symbol("evaluating");function rt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==hw)return a===void 0&&(a=hw,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Zi(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 mw(e){return JSON.stringify(e)}function R8(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const R_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const D8=Rd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function no(e){if(Yl(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Yl(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function D_(e){return no(e)?{...e}:Array.isArray(e)?[...e]:e}const $8=new Set(["string","number","symbol"]);function ro(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 ze(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function L8(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const P8={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 U8(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 c=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 Zi(this,"shape",l),l},checks:[]});return si(e,c)}function V8(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 c=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 Zi(this,"shape",l),l},checks:[]});return si(e,c)}function B8(e,t){if(!no(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const c=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(c,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 c={...e._zod.def.shape,...t};return Zi(this,"shape",c),c}});return si(e,s)}function I8(e,t){if(!no(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 Zi(this,"shape",a),a}});return si(e,n)}function Z8(e,t){const n=ii(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Zi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return si(e,n)}function H8(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 Zi(this,"shape",h),h},checks:[]});return si(t,l)}function F8(e,t,n){const a=ii(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=new e({type:"nonoptional",innerType:s[l]}))}else for(const l in s)c[l]=new e({type:"nonoptional",innerType:s[l]});return Zi(this,"shape",c),c}});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 Is(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Pu(e){return typeof e=="string"?e:e?.message}function ti(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Pu(e.inst?._zod.def?.error?.(e))??Pu(t?.error?.(e))??Pu(n.customError?.(e))??Pu(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function wx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Jl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const $_=(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,tg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},L_=ee("$ZodError",$_),P_=ee("$ZodError",$_,{Parent:Error});function q8(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 G8(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>a({issues:l}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)n._errors.push(t(c));else{let l=n,f=0;for(;f<c.path.length;){const h=c.path[f];f===c.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(c))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const Sx=e=>(t,n,a,s)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise)throw new Ks;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>ti(h,c,ei())));throw R_(f,s?.callee),f}return l.value},zx=e=>async(t,n,a,s)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>ti(h,c,ei())));throw R_(f,s?.callee),f}return l.value},Dd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new Ks;return c.issues.length?{success:!1,error:new(e??L_)(c.issues.map(l=>ti(l,s,ei())))}:{success:!0,data:c.value}},Y8=Dd(P_),$d=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},s);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(l=>ti(l,s,ei())))}:{success:!0,data:c.value}},J8=$d(P_),K8=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sx(e)(t,n,s)},X8=e=>(t,n,a)=>Sx(e)(t,n,a),Q8=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return zx(e)(t,n,s)},W8=e=>async(t,n,a)=>zx(e)(t,n,a),eP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Dd(e)(t,n,s)},tP=e=>(t,n,a)=>Dd(e)(t,n,a),nP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return $d(e)(t,n,s)},rP=e=>async(t,n,a)=>$d(e)(t,n,a),aP=/^[cC][^\s-]{8,}$/,iP=/^[0-9a-z]+$/,sP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oP=/^[0-9a-vA-V]{20}$/,lP=/^[A-Za-z0-9]{27}$/,cP=/^[a-zA-Z0-9_-]{21}$/,uP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dP=/^([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})$/,pw=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)$/,fP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mP(){return new RegExp(hP,"u")}const pP=/^(?:(?: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])$/,gP=/^(([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}|:))$/,xP=/^((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])$/,yP=/^(([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])$/,bP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,U_=/^[A-Za-z0-9_-]*$/,vP=/^\+[1-9]\d{6,14}$/,V_="(?:(?:\\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])))",kP=new RegExp(`^${V_}$`);function B_(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 wP(e){return new RegExp(`^${B_(e)}$`)}function SP(e){const t=B_({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(`^${V_}T(?:${a})$`)}const zP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},jP=/^-?\d+$/,I_=/^-?\d+(?:\.\d+)?$/,_P=/^(?:true|false)$/i,NP=/^[^A-Z]*$/,CP=/^[^a-z]*$/,Bn=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Z_={number:"number",bigint:"bigint",object:"date"},H_=ee("$ZodCheckLessThan",(e,t)=>{Bn.init(e,t);const n=Z_[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,c=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(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})}}),F_=ee("$ZodCheckGreaterThan",(e,t)=>{Bn.init(e,t);const n=Z_[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,c=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(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})}}),TP=ee("$ZodCheckMultipleOf",(e,t)=>{Bn.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):M8(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})}}),EP=ee("$ZodCheckNumberFormat",(e,t)=>{Bn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,c]=P8[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=s,f.maximum=c,n&&(f.pattern=jP)}),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>c&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),AP=ee("$ZodCheckMaxLength",(e,t)=>{var n;Bn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!vx(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=wx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),OP=ee("$ZodCheckMinLength",(e,t)=>{var n;Bn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!vx(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=wx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),MP=ee("$ZodCheckLengthEquals",(e,t)=>{var n;Bn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!vx(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,c=s.length;if(c===t.length)return;const l=wx(s),f=c>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})}}),Ld=ee("$ZodCheckStringFormat",(e,t)=>{var n,a;Bn.init(e,t),e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.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=()=>{})}),RP=ee("$ZodCheckRegex",(e,t)=>{Ld.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})}}),DP=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=NP),Ld.init(e,t)}),$P=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=CP),Ld.init(e,t)}),LP=ee("$ZodCheckIncludes",(e,t)=>{Bn.init(e,t);const n=ro(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.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})}}),PP=ee("$ZodCheckStartsWith",(e,t)=>{Bn.init(e,t);const n=new RegExp(`^${ro(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})}}),UP=ee("$ZodCheckEndsWith",(e,t)=>{Bn.init(e,t);const n=new RegExp(`.*${ro(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})}}),VP=ee("$ZodCheckOverwrite",(e,t)=>{Bn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let BP=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)),c=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of c)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,s.join(`
|
|
34
|
-
`))}};const IP={major:4,minor:3,patch:6},Ct=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=IP;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const c of s._zod.onattach)c(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 x of f){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=x._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},c=(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=>c(g,l,f)):c(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)}}rt(e,"~standard",()=>({validate:s=>{try{const c=Y8(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return J8(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),jx=ee("$ZodString",(e,t)=>{Ct.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}}),jt=ee("$ZodStringFormat",(e,t)=>{Ld.init(e,t),jx.init(e,t)}),ZP=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dP),jt.init(e,t)}),HP=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=pw(a))}else t.pattern??(t.pattern=pw());jt.init(e,t)}),FP=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=fP),jt.init(e,t)}),qP=ee("$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})}}}),GP=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=mP()),jt.init(e,t)}),YP=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=cP),jt.init(e,t)}),JP=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=aP),jt.init(e,t)}),KP=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iP),jt.init(e,t)}),XP=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=sP),jt.init(e,t)}),QP=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oP),jt.init(e,t)}),WP=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lP),jt.init(e,t)}),eU=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=SP(t)),jt.init(e,t)}),tU=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=kP),jt.init(e,t)}),nU=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=wP(t)),jt.init(e,t)}),rU=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=uP),jt.init(e,t)}),aU=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pP),jt.init(e,t),e._zod.bag.format="ipv4"}),iU=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gP),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})}}}),sU=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=xP),jt.init(e,t)}),oU=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=yP),jt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,c]=a;if(!c)throw new Error;const l=Number(c);if(`${l}`!==c)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 q_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const lU=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=bP),jt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{q_(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function cU(e){if(!U_.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return q_(n)}const uU=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=U_),jt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{cU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),dU=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vP),jt.init(e,t)});function fU(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 hU=ee("$ZodJWT",(e,t)=>{jt.init(e,t),e._zod.check=n=>{fU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),G_=ee("$ZodNumber",(e,t)=>{Ct.init(e,t),e._zod.pattern=e._zod.bag.pattern??I_,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 c=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,...c?{received:c}:{}}),n}}),mU=ee("$ZodNumberFormat",(e,t)=>{EP.init(e,t),G_.init(e,t)}),pU=ee("$ZodBoolean",(e,t)=>{Ct.init(e,t),e._zod.pattern=_P,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}}),gU=ee("$ZodUnknown",(e,t)=>{Ct.init(e,t),e._zod.parse=n=>n}),xU=ee("$ZodNever",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function gw(e,t,n){e.issues.length&&t.issues.push(...Is(n,e.issues)),t.value[n]=e.value}const yU=ee("$ZodArray",(e,t)=>{Ct.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 c=[];for(let l=0;l<s.length;l++){const f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?c.push(h.then(m=>gw(m,n,l))):gw(h,n,l)}return c.length?Promise.all(c).then(()=>n):n}});function gd(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Is(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Y_(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=L8(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function J_(e,t,n,a,s,c){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const x in t){if(f.has(x))continue;if(m==="never"){l.push(x);continue}const b=h.run({value:t[x],issues:[]},a);b instanceof Promise?e.push(b.then(v=>gd(v,n,x,t,g))):gd(b,n,x,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const bU=ee("$ZodObject",(e,t)=>{if(Ct.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=Rd(()=>Y_(t));rt(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const x of g.values)h[m].add(x)}}return h});const s=Yl,c=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=[],x=l.shape;for(const b of l.keys){const v=x[b],j=v._zod.optout==="optional",S=v._zod.run({value:m[b],issues:[]},h);S instanceof Promise?g.push(S.then(O=>gd(O,f,b,m,j))):gd(S,f,b,m,j)}return c?J_(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),vU=ee("$ZodObjectJIT",(e,t)=>{bU.init(e,t);const n=e._zod.parse,a=Rd(()=>Y_(t)),s=b=>{const v=new BP(["shape","payload","ctx"]),j=a.value,S=C=>{const $=mw(C);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};v.write("const input = payload.value;");const O=Object.create(null);let T=0;for(const C of j.keys)O[C]=`key_${T++}`;v.write("const newResult = {};");for(const C of j.keys){const $=O[C],D=mw(C),Z=b[C]?._zod?.optout==="optional";v.write(`const ${$} = ${S(C)};`),Z?v.write(`
|
|
35
|
-
if (${$}.issues.length) {
|
|
36
|
-
if (${D} in input) {
|
|
37
|
-
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
38
|
-
...iss,
|
|
39
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
40
|
-
})));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (${$}.value === undefined) {
|
|
45
|
-
if (${D} in input) {
|
|
46
|
-
newResult[${D}] = undefined;
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
newResult[${D}] = ${$}.value;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
`):v.write(`
|
|
53
|
-
if (${$}.issues.length) {
|
|
54
|
-
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
55
|
-
...iss,
|
|
56
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
57
|
-
})));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (${$}.value === undefined) {
|
|
61
|
-
if (${D} in input) {
|
|
62
|
-
newResult[${D}] = undefined;
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
newResult[${D}] = ${$}.value;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,$)=>E(b,C,$)};let c;const l=Yl,f=!O_.jitless,m=f&&D8.value,g=t.catchall;let x;e._zod.parse=(b,v)=>{x??(x=a.value);const j=b.value;return l(j)?f&&m&&v?.async===!1&&v.jitless!==!0?(c||(c=s(t.shape)),b=c(b,v),g?J_([],j,b,v,x,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),b)}});function xw(e,t,n,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const s=e.filter(c=>!Bs(c));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(c=>c.issues.map(l=>ti(l,a,ei())))}),t)}const K_=ee("$ZodUnion",(e,t)=>{Ct.init(e,t),rt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),rt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),rt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),rt(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${s.map(c=>kx(c.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,c)=>{if(n)return a(s,c);let l=!1;const f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},c);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=>xw(h,s,e,c)):xw(f,s,e,c)}}),kU=ee("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,K_.init(e,t);const n=e._zod.parse;rt(e._zod,"propValues",()=>{const s={};for(const c of t.options){const l=c._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);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=Rd(()=>{const s=t.options,c=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(c.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);c.set(h,l)}}return c});e._zod.parse=(s,c)=>{const l=s.value;if(!Yl(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,c):t.unionFallback?n(s,c):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),s)}}),wU=ee("$ZodIntersection",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,c=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return c instanceof Promise||l instanceof Promise?Promise.all([c,l]).then(([h,m])=>yw(n,h,m)):yw(n,c,l)}});function ng(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(no(e)&&no(t)){const n=Object.keys(t),a=Object.keys(e).filter(c=>n.indexOf(c)!==-1),s={...e,...t};for(const c of a){const l=ng(e[c],t[c]);if(!l.valid)return{valid:!1,mergeErrorPath:[c,...l.mergeErrorPath]};s[c]=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],c=t[a],l=ng(s,c);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yw(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 c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&s&&e.issues.push({...s,keys:c}),Bs(e))return e;const l=ng(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 SU=ee("$ZodRecord",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!no(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const c=[],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?c.push(g.then(x=>{x.issues.length&&n.issues.push(...Is(m,x.issues)),n.value[m]=x.value})):(g.issues.length&&n.issues.push(...Is(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"&&I_.test(f)&&h.issues.length){const x=t.keyType._zod.run({value:Number(f),issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(h=x)}if(h.issues.length){t.mode==="loose"?n.value[f]=s[f]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>ti(x,a,ei())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:s[f],issues:[]},a);g instanceof Promise?c.push(g.then(x=>{x.issues.length&&n.issues.push(...Is(f,x.issues)),n.value[h.value]=x.value})):(g.issues.length&&n.issues.push(...Is(f,g.issues)),n.value[h.value]=g.value)}}return c.length?Promise.all(c).then(()=>n):n}}),zU=ee("$ZodEnum",(e,t)=>{Ct.init(e,t);const n=M_(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>$8.has(typeof s)).map(s=>typeof s=="string"?ro(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),jU=ee("$ZodLiteral",(e,t)=>{if(Ct.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"?ro(a):a?ro(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const c=a.value;return n.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),_U=ee("$ZodTransform",(e,t)=>{Ct.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new A_(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 bw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const X_=ee("$ZodOptional",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",rt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),rt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kx(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(c=>bw(c,n.value)):bw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),NU=ee("$ZodExactOptional",(e,t)=>{X_.init(e,t),rt(e._zod,"values",()=>t.innerType._zod.values),rt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),CU=ee("$ZodNullable",(e,t)=>{Ct.init(e,t),rt(e._zod,"optin",()=>t.innerType._zod.optin),rt(e._zod,"optout",()=>t.innerType._zod.optout),rt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kx(n.source)}|null)$`):void 0}),rt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),TU=ee("$ZodDefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",rt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(c=>vw(c,t)):vw(s,t)}});function vw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const EU=ee("$ZodPrefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",rt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),AU=ee("$ZodNonOptional",(e,t)=>{Ct.init(e,t),rt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(c=>kw(c,e)):kw(s,e)}});function kw(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 OU=ee("$ZodCatch",(e,t)=>{Ct.init(e,t),rt(e._zod,"optin",()=>t.innerType._zod.optin),rt(e._zod,"optout",()=>t.innerType._zod.optout),rt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(l=>ti(l,a,ei()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(c=>ti(c,a,ei()))},input:n.value}),n.issues=[]),n)}}),MU=ee("$ZodPipe",(e,t)=>{Ct.init(e,t),rt(e._zod,"values",()=>t.in._zod.values),rt(e._zod,"optin",()=>t.in._zod.optin),rt(e._zod,"optout",()=>t.out._zod.optout),rt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(n,a);return c instanceof Promise?c.then(l=>Uu(l,t.in,a)):Uu(c,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(c=>Uu(c,t.out,a)):Uu(s,t.out,a)}});function Uu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const RU=ee("$ZodReadonly",(e,t)=>{Ct.init(e,t),rt(e._zod,"propValues",()=>t.innerType._zod.propValues),rt(e._zod,"values",()=>t.innerType._zod.values),rt(e._zod,"optin",()=>t.innerType?._zod?.optin),rt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(ww):ww(s)}});function ww(e){return e.value=Object.freeze(e.value),e}const DU=ee("$ZodCustom",(e,t)=>{Bn.init(e,t),Ct.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(c=>Sw(c,n,a,e));Sw(s,n,a,e)}});function Sw(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(Jl(s))}}var zw;let $U=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 LU(){return new $U}(zw=globalThis).__zod_globalRegistry??(zw.__zod_globalRegistry=LU());const jl=globalThis.__zod_globalRegistry;function PU(e,t){return new e({type:"string",...ze(t)})}function UU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function jw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function VU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function BU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function IU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function ZU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function HU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function FU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function qU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function GU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function YU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function JU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function KU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function XU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function QU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function WU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function e7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function t7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function n7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function r7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function a7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function i7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function s7(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function o7(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function l7(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function c7(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function u7(e,t){return new e({type:"number",checks:[],...ze(t)})}function d7(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function f7(e,t){return new e({type:"boolean",...ze(t)})}function h7(e){return new e({type:"unknown"})}function m7(e,t){return new e({type:"never",...ze(t)})}function _w(e,t){return new H_({check:"less_than",...ze(t),value:e,inclusive:!1})}function Jm(e,t){return new H_({check:"less_than",...ze(t),value:e,inclusive:!0})}function Nw(e,t){return new F_({check:"greater_than",...ze(t),value:e,inclusive:!1})}function Km(e,t){return new F_({check:"greater_than",...ze(t),value:e,inclusive:!0})}function Cw(e,t){return new TP({check:"multiple_of",...ze(t),value:e})}function Q_(e,t){return new AP({check:"max_length",...ze(t),maximum:e})}function xd(e,t){return new OP({check:"min_length",...ze(t),minimum:e})}function W_(e,t){return new MP({check:"length_equals",...ze(t),length:e})}function p7(e,t){return new RP({check:"string_format",format:"regex",...ze(t),pattern:e})}function g7(e){return new DP({check:"string_format",format:"lowercase",...ze(e)})}function x7(e){return new $P({check:"string_format",format:"uppercase",...ze(e)})}function y7(e,t){return new LP({check:"string_format",format:"includes",...ze(t),includes:e})}function b7(e,t){return new PP({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function v7(e,t){return new UP({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function xo(e){return new VP({check:"overwrite",tx:e})}function k7(e){return xo(t=>t.normalize(e))}function w7(){return xo(e=>e.trim())}function S7(){return xo(e=>e.toLowerCase())}function z7(){return xo(e=>e.toUpperCase())}function j7(){return xo(e=>R8(e))}function _7(e,t,n){return new e({type:"array",element:t,...ze(n)})}function N7(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function C7(e){const t=T7(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Jl(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(Jl(s))}},e(n.value,n)));return t}function T7(e,t){const n=new Bn({check:"custom",...ze(t)});return n._zod.check=e,n}function e2(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??jl,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 Ft(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.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 x=e._zod.parent;x&&(l.ref||(l.ref=x),Ft(x,t,g),t.seen.get(x).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&Sn(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 t2(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 x=e.external.registry.get(l[0])?.id,b=e.external.uri??(j=>j);if(x)return{ref:b(x)};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}},c=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 x in g)delete g[x];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]){c(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){c(l);continue}}if(e.metadataRegistry.get(l[0])?.id){c(l);continue}if(f.cycle){c(l);continue}if(f.count>1&&e.reused==="ref"){c(l);continue}}}function n2(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 S in h)S==="$ref"||S==="allOf"||S in m||delete h[S];if(v.$ref&&b.def)for(const S in h)S==="$ref"||S==="allOf"||S in b.def&&JSON.stringify(h[S])===JSON.stringify(b.def[S])&&delete h[S]}const x=l._zod.parent;if(x&&x!==g){a(x);const b=e.seen.get(x);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 c=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:yd(t,"input",e.processors),output:yd(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Sn(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 Sn(a.element,n);if(a.type==="set")return Sn(a.valueType,n);if(a.type==="lazy")return Sn(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 Sn(a.innerType,n);if(a.type==="intersection")return Sn(a.left,n)||Sn(a.right,n);if(a.type==="record"||a.type==="map")return Sn(a.keyType,n)||Sn(a.valueType,n);if(a.type==="pipe")return Sn(a.in,n)||Sn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(Sn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(Sn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(Sn(s,n))return!0;return!!(a.rest&&Sn(a.rest,n))}return!1}const E7=(e,t={})=>n=>{const a=e2({...n,processors:t});return Ft(e,a),t2(a,e),n2(a,e)},yd=(e,t,n={})=>a=>{const{libraryOptions:s,target:c}=a??{},l=e2({...s??{},target:c,io:t,processors:n});return Ft(e,l),t2(l,e),n2(l,e)},A7={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},O7=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:c,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof l=="number"&&(s.maxLength=l),f&&(s.format=A7[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(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},M7=(e,t,n,a)=>{const s=n,{minimum:c,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 c=="number"&&(s.minimum=c,typeof g=="number"&&t.target!=="draft-04"&&(g>=c?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)},R7=(e,t,n,a)=>{n.type="boolean"},D7=(e,t,n,a)=>{n.not={}},$7=(e,t,n,a)=>{},L7=(e,t,n,a)=>{const s=e._zod.def,c=M_(s.entries);c.every(l=>typeof l=="number")&&(n.type="number"),c.every(l=>typeof l=="string")&&(n.type="string"),n.enum=c},P7=(e,t,n,a)=>{const s=e._zod.def,c=[];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");c.push(Number(l))}else c.push(l);if(c.length!==0)if(c.length===1){const l=c[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else c.every(l=>typeof l=="number")&&(n.type="number"),c.every(l=>typeof l=="string")&&(n.type="string"),c.every(l=>typeof l=="boolean")&&(n.type="boolean"),c.every(l=>l===null)&&(n.type="null"),n.enum=c},U7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},V7=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},B7=(e,t,n,a)=>{const s=n,c=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=Ft(c.element,t,{...a,path:[...a.path,"items"]})},I7=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object",s.properties={};const l=c.shape;for(const m in l)s.properties[m]=Ft(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].filter(m=>{const g=c.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),c.catchall?._zod.def.type==="never"?s.additionalProperties=!1:c.catchall?c.catchall&&(s.additionalProperties=Ft(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Z7=(e,t,n,a)=>{const s=e._zod.def,c=s.inclusive===!1,l=s.options.map((f,h)=>Ft(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",h]}));c?n.oneOf=l:n.anyOf=l},H7=(e,t,n,a)=>{const s=e._zod.def,c=Ft(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=Ft(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(c)?c.allOf:[c],...f(l)?l.allOf:[l]];n.allOf=h},F7=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object";const l=c.keyType,h=l._zod.bag?.patterns;if(c.mode==="loose"&&h&&h.size>0){const g=Ft(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const x of h)s.patternProperties[x.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ft(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Ft(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=l._zod.values;if(m){const g=[...m].filter(x=>typeof x=="string"||typeof x=="number");g.length>0&&(s.required=g)}},q7=(e,t,n,a)=>{const s=e._zod.def,c=Ft(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},G7=(e,t,n,a)=>{const s=e._zod.def;Ft(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},Y7=(e,t,n,a)=>{const s=e._zod.def;Ft(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},J7=(e,t,n,a)=>{const s=e._zod.def;Ft(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},K7=(e,t,n,a)=>{const s=e._zod.def;Ft(s.innerType,t,a);const c=t.seen.get(e);c.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},X7=(e,t,n,a)=>{const s=e._zod.def,c=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ft(c,t,a);const l=t.seen.get(e);l.ref=c},Q7=(e,t,n,a)=>{const s=e._zod.def;Ft(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.readOnly=!0},r2=(e,t,n,a)=>{const s=e._zod.def;Ft(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},W7=ee("ZodISODateTime",(e,t)=>{eU.init(e,t),Et.init(e,t)});function eV(e){return s7(W7,e)}const tV=ee("ZodISODate",(e,t)=>{tU.init(e,t),Et.init(e,t)});function nV(e){return o7(tV,e)}const rV=ee("ZodISOTime",(e,t)=>{nU.init(e,t),Et.init(e,t)});function aV(e){return l7(rV,e)}const iV=ee("ZodISODuration",(e,t)=>{rU.init(e,t),Et.init(e,t)});function sV(e){return c7(iV,e)}const oV=(e,t)=>{L_.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>G8(e,n)},flatten:{value:n=>q8(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tg,2)}},isEmpty:{get(){return e.issues.length===0}}})},gr=ee("ZodError",oV,{Parent:Error}),lV=Sx(gr),cV=zx(gr),uV=Dd(gr),dV=$d(gr),fV=K8(gr),hV=X8(gr),mV=Q8(gr),pV=W8(gr),gV=eP(gr),xV=tP(gr),yV=nP(gr),bV=rP(gr),Tt=ee("ZodType",(e,t)=>(Ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:yd(e,"input"),output:yd(e,"output")}}),e.toJSONSchema=E7(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)=>lV(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>uV(e,n,a),e.parseAsync=async(n,a)=>cV(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>dV(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>fV(e,n,a),e.decode=(n,a)=>hV(e,n,a),e.encodeAsync=async(n,a)=>mV(e,n,a),e.decodeAsync=async(n,a)=>pV(e,n,a),e.safeEncode=(n,a)=>gV(e,n,a),e.safeDecode=(n,a)=>xV(e,n,a),e.safeEncodeAsync=async(n,a)=>yV(e,n,a),e.safeDecodeAsync=async(n,a)=>bV(e,n,a),e.refine=(n,a)=>e.check(hB(n,a)),e.superRefine=n=>e.check(mB(n)),e.overwrite=n=>e.check(xo(n)),e.optional=()=>Mw(e),e.exactOptional=()=>eB(e),e.nullable=()=>Rw(e),e.nullish=()=>Mw(Rw(e)),e.nonoptional=n=>sB(e,n),e.array=()=>ni(e),e.or=n=>o2([e,n]),e.and=n=>YV(e,n),e.transform=n=>Dw(e,QV(n)),e.default=n=>rB(e,n),e.prefault=n=>iB(e,n),e.catch=n=>lB(e,n),e.pipe=n=>Dw(e,n),e.readonly=()=>dB(e),e.describe=n=>{const a=e.clone();return jl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return jl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return jl.get(e);const a=e.clone();return jl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),a2=ee("_ZodString",(e,t)=>{jx.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>O7(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(p7(...a)),e.includes=(...a)=>e.check(y7(...a)),e.startsWith=(...a)=>e.check(b7(...a)),e.endsWith=(...a)=>e.check(v7(...a)),e.min=(...a)=>e.check(xd(...a)),e.max=(...a)=>e.check(Q_(...a)),e.length=(...a)=>e.check(W_(...a)),e.nonempty=(...a)=>e.check(xd(1,...a)),e.lowercase=a=>e.check(g7(a)),e.uppercase=a=>e.check(x7(a)),e.trim=()=>e.check(w7()),e.normalize=(...a)=>e.check(k7(...a)),e.toLowerCase=()=>e.check(S7()),e.toUpperCase=()=>e.check(z7()),e.slugify=()=>e.check(j7())}),vV=ee("ZodString",(e,t)=>{jx.init(e,t),a2.init(e,t),e.email=n=>e.check(UU(kV,n)),e.url=n=>e.check(HU(wV,n)),e.jwt=n=>e.check(i7(LV,n)),e.emoji=n=>e.check(FU(SV,n)),e.guid=n=>e.check(jw(Tw,n)),e.uuid=n=>e.check(VU(Vu,n)),e.uuidv4=n=>e.check(BU(Vu,n)),e.uuidv6=n=>e.check(IU(Vu,n)),e.uuidv7=n=>e.check(ZU(Vu,n)),e.nanoid=n=>e.check(qU(zV,n)),e.guid=n=>e.check(jw(Tw,n)),e.cuid=n=>e.check(GU(jV,n)),e.cuid2=n=>e.check(YU(_V,n)),e.ulid=n=>e.check(JU(NV,n)),e.base64=n=>e.check(n7(RV,n)),e.base64url=n=>e.check(r7(DV,n)),e.xid=n=>e.check(KU(CV,n)),e.ksuid=n=>e.check(XU(TV,n)),e.ipv4=n=>e.check(QU(EV,n)),e.ipv6=n=>e.check(WU(AV,n)),e.cidrv4=n=>e.check(e7(OV,n)),e.cidrv6=n=>e.check(t7(MV,n)),e.e164=n=>e.check(a7($V,n)),e.datetime=n=>e.check(eV(n)),e.date=n=>e.check(nV(n)),e.time=n=>e.check(aV(n)),e.duration=n=>e.check(sV(n))});function Fe(e){return PU(vV,e)}const Et=ee("ZodStringFormat",(e,t)=>{jt.init(e,t),a2.init(e,t)}),kV=ee("ZodEmail",(e,t)=>{FP.init(e,t),Et.init(e,t)}),Tw=ee("ZodGUID",(e,t)=>{ZP.init(e,t),Et.init(e,t)}),Vu=ee("ZodUUID",(e,t)=>{HP.init(e,t),Et.init(e,t)}),wV=ee("ZodURL",(e,t)=>{qP.init(e,t),Et.init(e,t)}),SV=ee("ZodEmoji",(e,t)=>{GP.init(e,t),Et.init(e,t)}),zV=ee("ZodNanoID",(e,t)=>{YP.init(e,t),Et.init(e,t)}),jV=ee("ZodCUID",(e,t)=>{JP.init(e,t),Et.init(e,t)}),_V=ee("ZodCUID2",(e,t)=>{KP.init(e,t),Et.init(e,t)}),NV=ee("ZodULID",(e,t)=>{XP.init(e,t),Et.init(e,t)}),CV=ee("ZodXID",(e,t)=>{QP.init(e,t),Et.init(e,t)}),TV=ee("ZodKSUID",(e,t)=>{WP.init(e,t),Et.init(e,t)}),EV=ee("ZodIPv4",(e,t)=>{aU.init(e,t),Et.init(e,t)}),AV=ee("ZodIPv6",(e,t)=>{iU.init(e,t),Et.init(e,t)}),OV=ee("ZodCIDRv4",(e,t)=>{sU.init(e,t),Et.init(e,t)}),MV=ee("ZodCIDRv6",(e,t)=>{oU.init(e,t),Et.init(e,t)}),RV=ee("ZodBase64",(e,t)=>{lU.init(e,t),Et.init(e,t)}),DV=ee("ZodBase64URL",(e,t)=>{uU.init(e,t),Et.init(e,t)}),$V=ee("ZodE164",(e,t)=>{dU.init(e,t),Et.init(e,t)}),LV=ee("ZodJWT",(e,t)=>{hU.init(e,t),Et.init(e,t)}),i2=ee("ZodNumber",(e,t)=>{G_.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>M7(e,a,s),e.gt=(a,s)=>e.check(Nw(a,s)),e.gte=(a,s)=>e.check(Km(a,s)),e.min=(a,s)=>e.check(Km(a,s)),e.lt=(a,s)=>e.check(_w(a,s)),e.lte=(a,s)=>e.check(Jm(a,s)),e.max=(a,s)=>e.check(Jm(a,s)),e.int=a=>e.check(Ew(a)),e.safe=a=>e.check(Ew(a)),e.positive=a=>e.check(Nw(0,a)),e.nonnegative=a=>e.check(Km(0,a)),e.negative=a=>e.check(_w(0,a)),e.nonpositive=a=>e.check(Jm(0,a)),e.multipleOf=(a,s)=>e.check(Cw(a,s)),e.step=(a,s)=>e.check(Cw(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 Nn(e){return u7(i2,e)}const PV=ee("ZodNumberFormat",(e,t)=>{mU.init(e,t),i2.init(e,t)});function Ew(e){return d7(PV,e)}const UV=ee("ZodBoolean",(e,t)=>{pU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>R7(e,n,a)});function gn(e){return f7(UV,e)}const VV=ee("ZodUnknown",(e,t)=>{gU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$7()});function Aw(){return h7(VV)}const BV=ee("ZodNever",(e,t)=>{xU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>D7(e,n,a)});function IV(e){return m7(BV,e)}const ZV=ee("ZodArray",(e,t)=>{yU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>B7(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(xd(n,a)),e.nonempty=n=>e.check(xd(1,n)),e.max=(n,a)=>e.check(Q_(n,a)),e.length=(n,a)=>e.check(W_(n,a)),e.unwrap=()=>e.element});function ni(e,t){return _7(ZV,e,t)}const HV=ee("ZodObject",(e,t)=>{vU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>I7(e,n,a,s),rt(e,"shape",()=>t.shape),e.keyof=()=>oi(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Aw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Aw()}),e.strict=()=>e.clone({...e._zod.def,catchall:IV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>B8(e,n),e.safeExtend=n=>I8(e,n),e.merge=n=>Z8(e,n),e.pick=n=>U8(e,n),e.omit=n=>V8(e,n),e.partial=(...n)=>H8(l2,e,n[0]),e.required=(...n)=>F8(c2,e,n[0])});function tn(e,t){const n={type:"object",shape:e??{},...ze(t)};return new HV(n)}const s2=ee("ZodUnion",(e,t)=>{K_.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Z7(e,n,a,s),e.options=t.options});function o2(e,t){return new s2({type:"union",options:e,...ze(t)})}const FV=ee("ZodDiscriminatedUnion",(e,t)=>{s2.init(e,t),kU.init(e,t)});function qV(e,t,n){return new FV({type:"union",options:t,discriminator:e,...ze(n)})}const GV=ee("ZodIntersection",(e,t)=>{wU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>H7(e,n,a,s)});function YV(e,t){return new GV({type:"intersection",left:e,right:t})}const JV=ee("ZodRecord",(e,t)=>{SU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>F7(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function nd(e,t,n){return new JV({type:"record",keyType:e,valueType:t,...ze(n)})}const rg=ee("ZodEnum",(e,t)=>{zU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>L7(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 c={};for(const l of a)if(n.has(l))c[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new rg({...t,checks:[],...ze(s),entries:c})},e.exclude=(a,s)=>{const c={...t.entries};for(const l of a)if(n.has(l))delete c[l];else throw new Error(`Key ${l} not found in enum`);return new rg({...t,checks:[],...ze(s),entries:c})}});function oi(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new rg({type:"enum",entries:n,...ze(t)})}const KV=ee("ZodLiteral",(e,t)=>{jU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>P7(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 Ow(e,t){return new KV({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const XV=ee("ZodTransform",(e,t)=>{_U.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>V7(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new A_(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(Jl(c,n.value,t));else{const l=c;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Jl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(c=>(n.value=c,n)):(n.value=s,n)}});function QV(e){return new XV({type:"transform",transform:e})}const l2=ee("ZodOptional",(e,t)=>{X_.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>r2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Mw(e){return new l2({type:"optional",innerType:e})}const WV=ee("ZodExactOptional",(e,t)=>{NU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>r2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function eB(e){return new WV({type:"optional",innerType:e})}const tB=ee("ZodNullable",(e,t)=>{CU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>q7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Rw(e){return new tB({type:"nullable",innerType:e})}const nB=ee("ZodDefault",(e,t)=>{TU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Y7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rB(e,t){return new nB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():D_(t)}})}const aB=ee("ZodPrefault",(e,t)=>{EU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>J7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function iB(e,t){return new aB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():D_(t)}})}const c2=ee("ZodNonOptional",(e,t)=>{AU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>G7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function sB(e,t){return new c2({type:"nonoptional",innerType:e,...ze(t)})}const oB=ee("ZodCatch",(e,t)=>{OU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>K7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lB(e,t){return new oB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const cB=ee("ZodPipe",(e,t)=>{MU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>X7(e,n,a,s),e.in=t.in,e.out=t.out});function Dw(e,t){return new cB({type:"pipe",in:e,out:t})}const uB=ee("ZodReadonly",(e,t)=>{RU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Q7(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function dB(e){return new uB({type:"readonly",innerType:e})}const fB=ee("ZodCustom",(e,t)=>{DU.init(e,t),Tt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>U7(e,n)});function hB(e,t={}){return N7(fB,e,t)}function mB(e){return C7(e)}const mt={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}},pB=tn({provider:oi(["google","openai","openrouter","ollama"]).default(mt.audio.provider),model:Fe().min(1).default(mt.audio.model),enabled:gn().default(mt.audio.enabled),apiKey:Fe().optional(),base_url:Fe().optional(),maxDurationSeconds:Nn().default(mt.audio.maxDurationSeconds),supportedMimeTypes:ni(Fe()).default(mt.audio.supportedMimeTypes)}),yo=tn({provider:oi(["openai","anthropic","openrouter","ollama","gemini"]).default(mt.llm.provider),model:Fe().min(1).default(mt.llm.model),temperature:Nn().min(0).max(1).default(mt.llm.temperature),max_tokens:Nn().int().positive().optional(),api_key:Fe().optional(),base_url:Fe().optional(),context_window:Nn().int().positive().optional()}),gB=yo.extend({memory_limit:Nn().int().positive().optional(),enabled_archived_sessions:gn().default(!0)}),xB=yo.extend({working_dir:Fe().optional(),timeout_ms:Nn().int().positive().optional(),execution_mode:oi(["sync","async"]).default("async")}),yB=yo.extend({execution_mode:oi(["sync","async"]).default("async")}),bB=yo.extend({execution_mode:oi(["sync","async"]).default("async")}),vB=yo.extend({skills_dir:Fe().optional()}),kB=tn({telegram_notify_all:gn().optional()}).optional(),wB=tn({timezone:Fe().default("UTC"),check_interval_ms:Nn().min(6e4).default(6e4),max_active_jobs:Nn().min(1).max(1e3).default(100)}),SB=tn({sandbox_dir:Fe().optional(),readonly_mode:gn().default(!1),allowed_shell_commands:ni(Fe()).default([]),enable_filesystem:gn().default(!0),enable_shell:gn().default(!0),enable_git:gn().default(!0),enable_network:gn().default(!0),timeout_ms:Nn().int().positive().default(3e4)}),zB=tn({name:Fe().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/,"Smith name must be lowercase alphanumeric with hyphens/underscores"),host:Fe().min(1),port:Nn().int().min(1).max(65535).default(7900),auth_token:Fe().min(1),tls:gn().default(!1)}),jB=tn({enabled:gn().default(!1),execution_mode:oi(["sync","async"]).default("async"),heartbeat_interval_ms:Nn().int().min(5e3).default(3e4),connection_timeout_ms:Nn().int().min(1e3).default(1e4),task_timeout_ms:Nn().int().min(1e3).default(6e4),entries:ni(zB).default([])}),_B=tn({agent:tn({name:Fe().default(mt.agent.name),personality:Fe().default(mt.agent.personality)}).default(mt.agent),llm:yo.default(mt.llm),sati:gB.optional(),neo:yB.optional(),apoc:xB.optional(),trinity:bB.optional(),keymaker:vB.optional(),webhooks:kB,audio:pB.default(mt.audio),memory:tn({limit:Nn().int().positive().optional()}).default(mt.memory),runtime:tn({async_tasks:tn({enabled:gn().default(mt.runtime?.async_tasks.enabled)}).default(mt.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:wB.optional(),devkit:SB.optional(),smiths:jB.optional(),verbose_mode:gn().default(!0),channels:tn({telegram:tn({enabled:gn().default(!1),token:Fe().optional(),allowedUsers:ni(Fe()).default([])}).default(mt.channels.telegram),discord:tn({enabled:gn().default(!1),token:Fe().optional(),allowedUsers:ni(Fe()).default([])}).default(mt.channels.discord)}).default(mt.channels),ui:tn({enabled:gn().default(mt.ui.enabled),port:Nn().default(mt.ui.port)}).default(mt.ui),logging:tn({enabled:gn().default(mt.logging.enabled),level:oi(["debug","info","warn","error"]).default(mt.logging.level),retention:Fe().default(mt.logging.retention)}).default(mt.logging)}),NB=qV("transport",[tn({transport:Ow("stdio"),command:Fe().min(1,"Command is required for stdio transport"),args:ni(Fe()).optional().default([]),env:nd(Fe(),Fe()).optional().default({}),_comment:Fe().optional()}),tn({transport:Ow("http"),url:Fe().url("Valid URL is required for http transport"),headers:nd(Fe(),Fe()).optional().default({}),args:ni(Fe()).optional().default([]),env:nd(Fe(),Fe()).optional().default({}),_comment:Fe().optional()})]);nd(Fe(),o2([NB,Fe()]));function se(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 x=0;x<g.length;x++){const b=g[x];b in f||(f[b]=m[b].bind(f))}}const s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function l(f){var h;const m=n?.Parent?new c: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 Xs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class u2 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const d2={};function Ui(e){return d2}function f2(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 ag(e,t){return typeof t=="bigint"?t.toString():t}function _x(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Nx(e){return e==null}function Cx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const $w=Symbol("evaluating");function st(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==$w)return a===void 0&&(a=$w,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Hi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function li(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Lw(e){return JSON.stringify(e)}function CB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const h2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const TB=_x(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Kl(e){if(bd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(bd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function m2(e){return Kl(e)?{...e}:Array.isArray(e)?[...e]:e}const EB=new Set(["string","number","symbol"]);function ao(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ci(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Te(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function AB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function OB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=li(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 Hi(this,"shape",l),l},checks:[]});return ci(e,c)}function MB(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 c=li(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 Hi(this,"shape",l),l},checks:[]});return ci(e,c)}function RB(e,t){if(!Kl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const c=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(c,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=li(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Hi(this,"shape",c),c}});return ci(e,s)}function DB(e,t){if(!Kl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=li(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Hi(this,"shape",a),a}});return ci(e,n)}function $B(e,t){const n=li(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Hi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ci(e,n)}function LB(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=li(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 Hi(this,"shape",h),h},checks:[]});return ci(t,l)}function PB(e,t,n){const a=li(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=new e({type:"nonoptional",innerType:s[l]}))}else for(const l in s)c[l]=new e({type:"nonoptional",innerType:s[l]});return Hi(this,"shape",c),c}});return ci(t,a)}function Zs(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 p2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Bu(e){return typeof e=="string"?e:e?.message}function Vi(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Bu(e.inst?._zod.def?.error?.(e))??Bu(t?.error?.(e))??Bu(n.customError?.(e))??Bu(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Tx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Xl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const g2=(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,ag,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},x2=se("$ZodError",g2),y2=se("$ZodError",g2,{Parent:Error});function UB(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function VB(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>a({issues:l}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)n._errors.push(t(c));else{let l=n,f=0;for(;f<c.path.length;){const h=c.path[f];f===c.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(c))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const Ex=e=>(t,n,a,s)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise)throw new Xs;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Vi(h,c,Ui())));throw h2(f,s?.callee),f}return l.value},Ax=e=>async(t,n,a,s)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},c);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Vi(h,c,Ui())));throw h2(f,s?.callee),f}return l.value},Pd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new Xs;return c.issues.length?{success:!1,error:new(e??x2)(c.issues.map(l=>Vi(l,s,Ui())))}:{success:!0,data:c.value}},BB=Pd(y2),Ud=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},s);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(l=>Vi(l,s,Ui())))}:{success:!0,data:c.value}},IB=Ud(y2),ZB=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ex(e)(t,n,s)},HB=e=>(t,n,a)=>Ex(e)(t,n,a),FB=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ax(e)(t,n,s)},qB=e=>async(t,n,a)=>Ax(e)(t,n,a),GB=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Pd(e)(t,n,s)},YB=e=>(t,n,a)=>Pd(e)(t,n,a),JB=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ud(e)(t,n,s)},KB=e=>async(t,n,a)=>Ud(e)(t,n,a),XB=/^[cC][^\s-]{8,}$/,QB=/^[0-9a-z]+$/,WB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eI=/^[0-9a-vA-V]{20}$/,tI=/^[A-Za-z0-9]{27}$/,nI=/^[a-zA-Z0-9_-]{21}$/,rI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,aI=/^([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})$/,Pw=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)$/,iI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function oI(){return new RegExp(sI,"u")}const lI=/^(?:(?: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])$/,cI=/^(([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}|:))$/,uI=/^((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])$/,dI=/^(([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])$/,fI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b2=/^[A-Za-z0-9_-]*$/,hI=/^\+[1-9]\d{6,14}$/,v2="(?:(?:\\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])))",mI=new RegExp(`^${v2}$`);function k2(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pI(e){return new RegExp(`^${k2(e)}$`)}function gI(e){const t=k2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${v2}T(?:${a})$`)}const xI=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},yI=/^[^A-Z]*$/,bI=/^[^a-z]*$/,Ir=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vI=se("$ZodCheckMaxLength",(e,t)=>{var n;Ir.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Nx(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=Tx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),kI=se("$ZodCheckMinLength",(e,t)=>{var n;Ir.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Nx(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=Tx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),wI=se("$ZodCheckLengthEquals",(e,t)=>{var n;Ir.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Nx(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,c=s.length;if(c===t.length)return;const l=Tx(s),f=c>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})}}),Vd=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Ir.init(e,t),e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.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=()=>{})}),SI=se("$ZodCheckRegex",(e,t)=>{Vd.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})}}),zI=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yI),Vd.init(e,t)}),jI=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bI),Vd.init(e,t)}),_I=se("$ZodCheckIncludes",(e,t)=>{Ir.init(e,t);const n=ao(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.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})}}),NI=se("$ZodCheckStartsWith",(e,t)=>{Ir.init(e,t);const n=new RegExp(`^${ao(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})}}),CI=se("$ZodCheckEndsWith",(e,t)=>{Ir.init(e,t);const n=new RegExp(`.*${ao(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})}}),TI=se("$ZodCheckOverwrite",(e,t)=>{Ir.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class EI{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)),c=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of c)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,s.join(`
|
|
72
|
-
`))}}const AI={major:4,minor:3,patch:6},qt=se("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=AI;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const c of s._zod.onattach)c(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=Zs(l),g;for(const x of f){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(m)continue;const b=l.issues.length,v=x._zod.check(l);if(v instanceof Promise&&h?.async===!1)throw new Xs;if(g||v instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await v,l.issues.length!==b&&(m||(m=Zs(l,b)))});else{if(l.issues.length===b)continue;m||(m=Zs(l,b))}}return g?g.then(()=>l):l},c=(l,f,h)=>{if(Zs(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Xs;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=>c(g,l,f)):c(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Xs;return h.then(m=>s(m,a,f))}return s(h,a,f)}}st(e,"~standard",()=>({validate:s=>{try{const c=BB(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return IB(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),Ox=se("$ZodString",(e,t)=>{qt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??xI(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=se("$ZodStringFormat",(e,t)=>{Vd.init(e,t),Ox.init(e,t)}),OI=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=aI),_t.init(e,t)}),MI=se("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Pw(a))}else t.pattern??(t.pattern=Pw());_t.init(e,t)}),RI=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=iI),_t.init(e,t)}),DI=se("$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})}}}),$I=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=oI()),_t.init(e,t)}),LI=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=nI),_t.init(e,t)}),PI=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=XB),_t.init(e,t)}),UI=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=QB),_t.init(e,t)}),VI=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=WB),_t.init(e,t)}),BI=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eI),_t.init(e,t)}),II=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tI),_t.init(e,t)}),ZI=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=gI(t)),_t.init(e,t)}),HI=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mI),_t.init(e,t)}),FI=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pI(t)),_t.init(e,t)}),qI=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rI),_t.init(e,t)}),GI=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=lI),_t.init(e,t),e._zod.bag.format="ipv4"}),YI=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=cI),_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})}}}),JI=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=uI),_t.init(e,t)}),KI=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=dI),_t.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,c]=a;if(!c)throw new Error;const l=Number(c);if(`${l}`!==c)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function w2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const XI=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=fI),_t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{w2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function QI(e){if(!b2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return w2(n)}const WI=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=b2),_t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{QI(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),eZ=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hI),_t.init(e,t)});function tZ(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 nZ=se("$ZodJWT",(e,t)=>{_t.init(e,t),e._zod.check=n=>{tZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rZ=se("$ZodUnknown",(e,t)=>{qt.init(e,t),e._zod.parse=n=>n}),aZ=se("$ZodNever",(e,t)=>{qt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Uw(e,t,n){e.issues.length&&t.issues.push(...p2(n,e.issues)),t.value[n]=e.value}const iZ=se("$ZodArray",(e,t)=>{qt.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 c=[];for(let l=0;l<s.length;l++){const f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?c.push(h.then(m=>Uw(m,n,l))):Uw(h,n,l)}return c.length?Promise.all(c).then(()=>n):n}});function vd(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...p2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function S2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=AB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function z2(e,t,n,a,s,c){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const x in t){if(f.has(x))continue;if(m==="never"){l.push(x);continue}const b=h.run({value:t[x],issues:[]},a);b instanceof Promise?e.push(b.then(v=>vd(v,n,x,t,g))):vd(b,n,x,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const sZ=se("$ZodObject",(e,t)=>{if(qt.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=_x(()=>S2(t));st(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 x of g.values)h[m].add(x)}}return h});const s=bd,c=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=[],x=l.shape;for(const b of l.keys){const v=x[b],j=v._zod.optout==="optional",S=v._zod.run({value:m[b],issues:[]},h);S instanceof Promise?g.push(S.then(O=>vd(O,f,b,m,j))):vd(S,f,b,m,j)}return c?z2(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),oZ=se("$ZodObjectJIT",(e,t)=>{sZ.init(e,t);const n=e._zod.parse,a=_x(()=>S2(t)),s=b=>{const v=new EI(["shape","payload","ctx"]),j=a.value,S=C=>{const $=Lw(C);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};v.write("const input = payload.value;");const O=Object.create(null);let T=0;for(const C of j.keys)O[C]=`key_${T++}`;v.write("const newResult = {};");for(const C of j.keys){const $=O[C],D=Lw(C),Z=b[C]?._zod?.optout==="optional";v.write(`const ${$} = ${S(C)};`),Z?v.write(`
|
|
73
|
-
if (${$}.issues.length) {
|
|
74
|
-
if (${D} in input) {
|
|
75
|
-
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
76
|
-
...iss,
|
|
77
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
78
|
-
})));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (${$}.value === undefined) {
|
|
83
|
-
if (${D} in input) {
|
|
84
|
-
newResult[${D}] = undefined;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
newResult[${D}] = ${$}.value;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
`):v.write(`
|
|
91
|
-
if (${$}.issues.length) {
|
|
92
|
-
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
93
|
-
...iss,
|
|
94
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
95
|
-
})));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (${$}.value === undefined) {
|
|
99
|
-
if (${D} in input) {
|
|
100
|
-
newResult[${D}] = undefined;
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
newResult[${D}] = ${$}.value;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,$)=>E(b,C,$)};let c;const l=bd,f=!d2.jitless,m=f&&TB.value,g=t.catchall;let x;e._zod.parse=(b,v)=>{x??(x=a.value);const j=b.value;return l(j)?f&&m&&v?.async===!1&&v.jitless!==!0?(c||(c=s(t.shape)),b=c(b,v),g?z2([],j,b,v,x,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),b)}});function Vw(e,t,n,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const s=e.filter(c=>!Zs(c));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(c=>c.issues.map(l=>Vi(l,a,Ui())))}),t)}const lZ=se("$ZodUnion",(e,t)=>{qt.init(e,t),st(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),st(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),st(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),st(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${s.map(c=>Cx(c.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,c)=>{if(n)return a(s,c);let l=!1;const f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},c);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=>Vw(h,s,e,c)):Vw(f,s,e,c)}}),cZ=se("$ZodIntersection",(e,t)=>{qt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,c=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return c instanceof Promise||l instanceof Promise?Promise.all([c,l]).then(([h,m])=>Bw(n,h,m)):Bw(n,c,l)}});function ig(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(Kl(e)&&Kl(t)){const n=Object.keys(t),a=Object.keys(e).filter(c=>n.indexOf(c)!==-1),s={...e,...t};for(const c of a){const l=ig(e[c],t[c]);if(!l.valid)return{valid:!1,mergeErrorPath:[c,...l.mergeErrorPath]};s[c]=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],c=t[a],l=ig(s,c);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Bw(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&s&&e.issues.push({...s,keys:c}),Zs(e))return e;const l=ig(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 uZ=se("$ZodEnum",(e,t)=>{qt.init(e,t);const n=f2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>EB.has(typeof s)).map(s=>typeof s=="string"?ao(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),dZ=se("$ZodLiteral",(e,t)=>{if(qt.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"?ao(a):a?ao(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const c=a.value;return n.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),fZ=se("$ZodTransform",(e,t)=>{qt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new u2(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 Xs;return n.value=s,n}});function Iw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const j2=se("$ZodOptional",(e,t)=>{qt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Cx(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(c=>Iw(c,n.value)):Iw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),hZ=se("$ZodExactOptional",(e,t)=>{j2.init(e,t),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),mZ=se("$ZodNullable",(e,t)=>{qt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Cx(n.source)}|null)$`):void 0}),st(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)}),pZ=se("$ZodDefault",(e,t)=>{qt.init(e,t),e._zod.optin="optional",st(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(c=>Zw(c,t)):Zw(s,t)}});function Zw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const gZ=se("$ZodPrefault",(e,t)=>{qt.init(e,t),e._zod.optin="optional",st(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))}),xZ=se("$ZodNonOptional",(e,t)=>{qt.init(e,t),st(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(c=>Hw(c,e)):Hw(s,e)}});function Hw(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 yZ=se("$ZodCatch",(e,t)=>{qt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(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(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(l=>Vi(l,a,Ui()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(c=>Vi(c,a,Ui()))},input:n.value}),n.issues=[]),n)}}),bZ=se("$ZodPipe",(e,t)=>{qt.init(e,t),st(e._zod,"values",()=>t.in._zod.values),st(e._zod,"optin",()=>t.in._zod.optin),st(e._zod,"optout",()=>t.out._zod.optout),st(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(n,a);return c instanceof Promise?c.then(l=>Iu(l,t.in,a)):Iu(c,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(c=>Iu(c,t.out,a)):Iu(s,t.out,a)}});function Iu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const vZ=se("$ZodReadonly",(e,t)=>{qt.init(e,t),st(e._zod,"propValues",()=>t.innerType._zod.propValues),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"optin",()=>t.innerType?._zod?.optin),st(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(Fw):Fw(s)}});function Fw(e){return e.value=Object.freeze(e.value),e}const kZ=se("$ZodCustom",(e,t)=>{Ir.init(e,t),qt.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(c=>qw(c,n,a,e));qw(s,n,a,e)}});function qw(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(Xl(s))}}var Gw;class wZ{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 SZ(){return new wZ}(Gw=globalThis).__zod_globalRegistry??(Gw.__zod_globalRegistry=SZ());const _l=globalThis.__zod_globalRegistry;function zZ(e,t){return new e({type:"string",...Te(t)})}function jZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function Yw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function _Z(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function NZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}function CZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}function TZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}function EZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}function AZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}function OZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}function MZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}function RZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}function DZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}function $Z(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}function LZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}function PZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}function UZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}function VZ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}function BZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}function IZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}function ZZ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}function HZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}function FZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}function qZ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}function GZ(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}function YZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}function JZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}function KZ(e){return new e({type:"unknown"})}function XZ(e,t){return new e({type:"never",...Te(t)})}function _2(e,t){return new vI({check:"max_length",...Te(t),maximum:e})}function kd(e,t){return new kI({check:"min_length",...Te(t),minimum:e})}function N2(e,t){return new wI({check:"length_equals",...Te(t),length:e})}function QZ(e,t){return new SI({check:"string_format",format:"regex",...Te(t),pattern:e})}function WZ(e){return new zI({check:"string_format",format:"lowercase",...Te(e)})}function eH(e){return new jI({check:"string_format",format:"uppercase",...Te(e)})}function tH(e,t){return new _I({check:"string_format",format:"includes",...Te(t),includes:e})}function nH(e,t){return new NI({check:"string_format",format:"starts_with",...Te(t),prefix:e})}function rH(e,t){return new CI({check:"string_format",format:"ends_with",...Te(t),suffix:e})}function bo(e){return new TI({check:"overwrite",tx:e})}function aH(e){return bo(t=>t.normalize(e))}function iH(){return bo(e=>e.trim())}function sH(){return bo(e=>e.toLowerCase())}function oH(){return bo(e=>e.toUpperCase())}function lH(){return bo(e=>CB(e))}function cH(e,t,n){return new e({type:"array",element:t,...Te(n)})}function uH(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}function dH(e){const t=fH(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Xl(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(Xl(s))}},e(n.value,n)));return t}function fH(e,t){const n=new Ir({check:"custom",...Te(t)});return n._zod.check=e,n}function C2(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??_l,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,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.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 x=e._zod.parent;x&&(l.ref||(l.ref=x),fn(x,t,g),t.seen.get(x).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 T2(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 x=e.external.registry.get(l[0])?.id,b=e.external.uri??(j=>j);if(x)return{ref:b(x)};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}},c=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 x in g)delete g[x];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]){c(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){c(l);continue}}if(e.metadataRegistry.get(l[0])?.id){c(l);continue}if(f.cycle){c(l);continue}if(f.count>1&&e.reused==="ref"){c(l);continue}}}function E2(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 S in h)S==="$ref"||S==="allOf"||S in m||delete h[S];if(v.$ref&&b.def)for(const S in h)S==="$ref"||S==="allOf"||S in b.def&&JSON.stringify(h[S])===JSON.stringify(b.def[S])&&delete h[S]}const x=l._zod.parent;if(x&&x!==g){a(x);const b=e.seen.get(x);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 c=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:wd(t,"input",e.processors),output:wd(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 hH=(e,t={})=>n=>{const a=C2({...n,processors:t});return fn(e,a),T2(a,e),E2(a,e)},wd=(e,t,n={})=>a=>{const{libraryOptions:s,target:c}=a??{},l=C2({...s??{},target:c,io:t,processors:n});return fn(e,l),T2(l,e),E2(l,e)},mH={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pH=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:c,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof l=="number"&&(s.maxLength=l),f&&(s.format=mH[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(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},gH=(e,t,n,a)=>{n.not={}},xH=(e,t,n,a)=>{},yH=(e,t,n,a)=>{const s=e._zod.def,c=f2(s.entries);c.every(l=>typeof l=="number")&&(n.type="number"),c.every(l=>typeof l=="string")&&(n.type="string"),n.enum=c},bH=(e,t,n,a)=>{const s=e._zod.def,c=[];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");c.push(Number(l))}else c.push(l);if(c.length!==0)if(c.length===1){const l=c[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else c.every(l=>typeof l=="number")&&(n.type="number"),c.every(l=>typeof l=="string")&&(n.type="string"),c.every(l=>typeof l=="boolean")&&(n.type="boolean"),c.every(l=>l===null)&&(n.type="null"),n.enum=c},vH=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kH=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wH=(e,t,n,a)=>{const s=n,c=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(c.element,t,{...a,path:[...a.path,"items"]})},SH=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object",s.properties={};const l=c.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=c.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),c.catchall?._zod.def.type==="never"?s.additionalProperties=!1:c.catchall?c.catchall&&(s.additionalProperties=fn(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},zH=(e,t,n,a)=>{const s=e._zod.def,c=s.inclusive===!1,l=s.options.map((f,h)=>fn(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",h]}));c?n.oneOf=l:n.anyOf=l},jH=(e,t,n,a)=>{const s=e._zod.def,c=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(c)?c.allOf:[c],...f(l)?l.allOf:[l]];n.allOf=h},_H=(e,t,n,a)=>{const s=e._zod.def,c=fn(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},NH=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},CH=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},TH=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},EH=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const c=t.seen.get(e);c.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},AH=(e,t,n,a)=>{const s=e._zod.def,c=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;fn(c,t,a);const l=t.seen.get(e);l.ref=c},OH=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.readOnly=!0},A2=(e,t,n,a)=>{const s=e._zod.def;fn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},MH=se("ZodISODateTime",(e,t)=>{ZI.init(e,t),At.init(e,t)});function RH(e){return qZ(MH,e)}const DH=se("ZodISODate",(e,t)=>{HI.init(e,t),At.init(e,t)});function $H(e){return GZ(DH,e)}const LH=se("ZodISOTime",(e,t)=>{FI.init(e,t),At.init(e,t)});function PH(e){return YZ(LH,e)}const UH=se("ZodISODuration",(e,t)=>{qI.init(e,t),At.init(e,t)});function VH(e){return JZ(UH,e)}const O2=(e,t)=>{x2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>VB(e,n)},flatten:{value:n=>UB(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ag,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ag,2)}},isEmpty:{get(){return e.issues.length===0}}})},BH=se("ZodError",O2),xr=se("ZodError",O2,{Parent:Error}),IH=Ex(xr),ZH=Ax(xr),HH=Pd(xr),FH=Ud(xr),qH=ZB(xr),GH=HB(xr),YH=FB(xr),JH=qB(xr),KH=GB(xr),XH=YB(xr),QH=JB(xr),WH=KB(xr),Gt=se("ZodType",(e,t)=>(qt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wd(e,"input"),output:wd(e,"output")}}),e.toJSONSchema=hH(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(li(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)=>ci(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>IH(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>HH(e,n,a),e.parseAsync=async(n,a)=>ZH(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>FH(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>qH(e,n,a),e.decode=(n,a)=>GH(e,n,a),e.encodeAsync=async(n,a)=>YH(e,n,a),e.decodeAsync=async(n,a)=>JH(e,n,a),e.safeEncode=(n,a)=>KH(e,n,a),e.safeDecode=(n,a)=>XH(e,n,a),e.safeEncodeAsync=async(n,a)=>QH(e,n,a),e.safeDecodeAsync=async(n,a)=>WH(e,n,a),e.refine=(n,a)=>e.check(qF(n,a)),e.superRefine=n=>e.check(GF(n)),e.overwrite=n=>e.check(bo(n)),e.optional=()=>Qw(e),e.exactOptional=()=>MF(e),e.nullable=()=>Ww(e),e.nullish=()=>Qw(Ww(e)),e.nonoptional=n=>UF(e,n),e.array=()=>wF(e),e.or=n=>R2([e,n]),e.and=n=>NF(e,n),e.transform=n=>eS(e,AF(n)),e.default=n=>$F(e,n),e.prefault=n=>PF(e,n),e.catch=n=>BF(e,n),e.pipe=n=>eS(e,n),e.readonly=()=>HF(e),e.describe=n=>{const a=e.clone();return _l.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return _l.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return _l.get(e);const a=e.clone();return _l.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),M2=se("_ZodString",(e,t)=>{Ox.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>pH(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(QZ(...a)),e.includes=(...a)=>e.check(tH(...a)),e.startsWith=(...a)=>e.check(nH(...a)),e.endsWith=(...a)=>e.check(rH(...a)),e.min=(...a)=>e.check(kd(...a)),e.max=(...a)=>e.check(_2(...a)),e.length=(...a)=>e.check(N2(...a)),e.nonempty=(...a)=>e.check(kd(1,...a)),e.lowercase=a=>e.check(WZ(a)),e.uppercase=a=>e.check(eH(a)),e.trim=()=>e.check(iH()),e.normalize=(...a)=>e.check(aH(...a)),e.toLowerCase=()=>e.check(sH()),e.toUpperCase=()=>e.check(oH()),e.slugify=()=>e.check(lH())}),eF=se("ZodString",(e,t)=>{Ox.init(e,t),M2.init(e,t),e.email=n=>e.check(jZ(tF,n)),e.url=n=>e.check(EZ(nF,n)),e.jwt=n=>e.check(FZ(xF,n)),e.emoji=n=>e.check(AZ(rF,n)),e.guid=n=>e.check(Yw(Jw,n)),e.uuid=n=>e.check(_Z(Zu,n)),e.uuidv4=n=>e.check(NZ(Zu,n)),e.uuidv6=n=>e.check(CZ(Zu,n)),e.uuidv7=n=>e.check(TZ(Zu,n)),e.nanoid=n=>e.check(OZ(aF,n)),e.guid=n=>e.check(Yw(Jw,n)),e.cuid=n=>e.check(MZ(iF,n)),e.cuid2=n=>e.check(RZ(sF,n)),e.ulid=n=>e.check(DZ(oF,n)),e.base64=n=>e.check(IZ(mF,n)),e.base64url=n=>e.check(ZZ(pF,n)),e.xid=n=>e.check($Z(lF,n)),e.ksuid=n=>e.check(LZ(cF,n)),e.ipv4=n=>e.check(PZ(uF,n)),e.ipv6=n=>e.check(UZ(dF,n)),e.cidrv4=n=>e.check(VZ(fF,n)),e.cidrv6=n=>e.check(BZ(hF,n)),e.e164=n=>e.check(HZ(gF,n)),e.datetime=n=>e.check(RH(n)),e.date=n=>e.check($H(n)),e.time=n=>e.check(PH(n)),e.duration=n=>e.check(VH(n))});function Xm(e){return zZ(eF,e)}const At=se("ZodStringFormat",(e,t)=>{_t.init(e,t),M2.init(e,t)}),tF=se("ZodEmail",(e,t)=>{RI.init(e,t),At.init(e,t)}),Jw=se("ZodGUID",(e,t)=>{OI.init(e,t),At.init(e,t)}),Zu=se("ZodUUID",(e,t)=>{MI.init(e,t),At.init(e,t)}),nF=se("ZodURL",(e,t)=>{DI.init(e,t),At.init(e,t)}),rF=se("ZodEmoji",(e,t)=>{$I.init(e,t),At.init(e,t)}),aF=se("ZodNanoID",(e,t)=>{LI.init(e,t),At.init(e,t)}),iF=se("ZodCUID",(e,t)=>{PI.init(e,t),At.init(e,t)}),sF=se("ZodCUID2",(e,t)=>{UI.init(e,t),At.init(e,t)}),oF=se("ZodULID",(e,t)=>{VI.init(e,t),At.init(e,t)}),lF=se("ZodXID",(e,t)=>{BI.init(e,t),At.init(e,t)}),cF=se("ZodKSUID",(e,t)=>{II.init(e,t),At.init(e,t)}),uF=se("ZodIPv4",(e,t)=>{GI.init(e,t),At.init(e,t)}),dF=se("ZodIPv6",(e,t)=>{YI.init(e,t),At.init(e,t)}),fF=se("ZodCIDRv4",(e,t)=>{JI.init(e,t),At.init(e,t)}),hF=se("ZodCIDRv6",(e,t)=>{KI.init(e,t),At.init(e,t)}),mF=se("ZodBase64",(e,t)=>{XI.init(e,t),At.init(e,t)}),pF=se("ZodBase64URL",(e,t)=>{WI.init(e,t),At.init(e,t)}),gF=se("ZodE164",(e,t)=>{eZ.init(e,t),At.init(e,t)}),xF=se("ZodJWT",(e,t)=>{nZ.init(e,t),At.init(e,t)}),yF=se("ZodUnknown",(e,t)=>{rZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xH()});function Kw(){return KZ(yF)}const bF=se("ZodNever",(e,t)=>{aZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gH(e,n,a)});function vF(e){return XZ(bF,e)}const kF=se("ZodArray",(e,t)=>{iZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>wH(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(kd(n,a)),e.nonempty=n=>e.check(kd(1,n)),e.max=(n,a)=>e.check(_2(n,a)),e.length=(n,a)=>e.check(N2(n,a)),e.unwrap=()=>e.element});function wF(e,t){return cH(kF,e,t)}const SF=se("ZodObject",(e,t)=>{oZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>SH(e,n,a,s),st(e,"shape",()=>t.shape),e.keyof=()=>CF(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Kw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Kw()}),e.strict=()=>e.clone({...e._zod.def,catchall:vF()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>RB(e,n),e.safeExtend=n=>DB(e,n),e.merge=n=>$B(e,n),e.pick=n=>OB(e,n),e.omit=n=>MB(e,n),e.partial=(...n)=>LB(D2,e,n[0]),e.required=(...n)=>PB($2,e,n[0])});function zF(e,t){const n={type:"object",shape:e??{},...Te(t)};return new SF(n)}const jF=se("ZodUnion",(e,t)=>{lZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>zH(e,n,a,s),e.options=t.options});function R2(e,t){return new jF({type:"union",options:e,...Te(t)})}const _F=se("ZodIntersection",(e,t)=>{cZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>jH(e,n,a,s)});function NF(e,t){return new _F({type:"intersection",left:e,right:t})}const sg=se("ZodEnum",(e,t)=>{uZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>yH(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 c={};for(const l of a)if(n.has(l))c[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new sg({...t,checks:[],...Te(s),entries:c})},e.exclude=(a,s)=>{const c={...t.entries};for(const l of a)if(n.has(l))delete c[l];else throw new Error(`Key ${l} not found in enum`);return new sg({...t,checks:[],...Te(s),entries:c})}});function CF(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new sg({type:"enum",entries:n,...Te(t)})}const TF=se("ZodLiteral",(e,t)=>{dZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>bH(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 Xw(e,t){return new TF({type:"literal",values:Array.isArray(e)?e:[e],...Te(t)})}const EF=se("ZodTransform",(e,t)=>{fZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>kH(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new u2(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(Xl(c,n.value,t));else{const l=c;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Xl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(c=>(n.value=c,n)):(n.value=s,n)}});function AF(e){return new EF({type:"transform",transform:e})}const D2=se("ZodOptional",(e,t)=>{j2.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>A2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Qw(e){return new D2({type:"optional",innerType:e})}const OF=se("ZodExactOptional",(e,t)=>{hZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>A2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function MF(e){return new OF({type:"optional",innerType:e})}const RF=se("ZodNullable",(e,t)=>{mZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_H(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Ww(e){return new RF({type:"nullable",innerType:e})}const DF=se("ZodDefault",(e,t)=>{pZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>CH(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $F(e,t){return new DF({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():m2(t)}})}const LF=se("ZodPrefault",(e,t)=>{gZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>TH(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function PF(e,t){return new LF({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():m2(t)}})}const $2=se("ZodNonOptional",(e,t)=>{xZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>NH(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function UF(e,t){return new $2({type:"nonoptional",innerType:e,...Te(t)})}const VF=se("ZodCatch",(e,t)=>{yZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>EH(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BF(e,t){return new VF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const IF=se("ZodPipe",(e,t)=>{bZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>AH(e,n,a,s),e.in=t.in,e.out=t.out});function eS(e,t){return new IF({type:"pipe",in:e,out:t})}const ZF=se("ZodReadonly",(e,t)=>{vZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>OH(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function HF(e){return new ZF({type:"readonly",innerType:e})}const FF=se("ZodCustom",(e,t)=>{kZ.init(e,t),Gt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vH(e,n)});function qF(e,t={}){return uH(FF,e,t)}function GF(e){return dH(e)}const YF=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"devkit",label:"DevKit"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"chronos",label:"Chronos"}],JF=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],wl=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function KF(){const{data:e,error:t}=We("/api/config",en.fetchConfig),{data:n}=We("/api/config/sati",en.getSatiConfig),{data:a}=We("/api/config/apoc",en.getApocConfig),{data:s}=We("/api/config/neo",en.getNeoConfig),{data:c}=We("/api/config/trinity",en.getTrinityConfig),{data:l}=We("/api/config/encryption-status",()=>en.getEncryptionStatus()),{data:f}=We("/api/config/env-overrides",()=>en.getEnvOverrides()),{data:h}=y_(),[m,g]=z.useState(null),[x,b]=z.useState(null),[v,j]=z.useState(null),[S,O]=z.useState(null),[T,E]=z.useState(null),[C,$]=z.useState(null),[D,M]=z.useState("general"),[Z,U]=z.useState("oracle"),[K,de]=z.useState(!1),[ae,le]=z.useState({}),[ne,oe]=z.useState(null);z.useEffect(()=>{e&&!x&&b(e)},[e]),z.useEffect(()=>{n&&!v&&j(n)},[n]),z.useEffect(()=>{a&&!T?E(a):!a&&!T&&x&&E({...x.apoc??x.llm,temperature:x.apoc?.temperature??.2,timeout_ms:x.apoc?.timeout_ms??3e4})},[a,x]),z.useEffect(()=>{s&&!S?O(s):!s&&!S&&x&&O({...x.neo??x.llm,temperature:x.neo?.temperature??.2})},[s,x]),z.useEffect(()=>{c&&!C?$(c):!c&&!C&&x&&$({...x.trinity??x.llm,temperature:x.trinity?.temperature??.2})},[c,x]),z.useEffect(()=>{h&&!m&&g(h)},[h]);const ie=JSON.stringify(e)!==JSON.stringify(x)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(S)||JSON.stringify(a)!==JSON.stringify(T)||JSON.stringify(c)!==JSON.stringify(C)||JSON.stringify(h)!==JSON.stringify(m),B={general:JSON.stringify(e?.agent)!==JSON.stringify(x?.agent)||e?.verbose_mode!==x?.verbose_mode,agents:JSON.stringify(e?.llm)!==JSON.stringify(x?.llm)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(S)||JSON.stringify(a)!==JSON.stringify(T)||JSON.stringify(c)!==JSON.stringify(C),devkit:JSON.stringify(e?.devkit)!==JSON.stringify(x?.devkit),audio:JSON.stringify(e?.audio)!==JSON.stringify(x?.audio),channels:JSON.stringify(e?.channels?.telegram)!==JSON.stringify(x?.channels?.telegram)||JSON.stringify(e?.channels?.discord)!==JSON.stringify(x?.channels?.discord)||JSON.stringify(e?.webhooks)!==JSON.stringify(x?.webhooks),ui:JSON.stringify(e?.ui)!==JSON.stringify(x?.ui),logging:JSON.stringify(e?.logging)!==JSON.stringify(x?.logging),chronos:JSON.stringify(h)!==JSON.stringify(m)},V=(L,Oe)=>{if(!l?.apiKeysEncrypted)return null;const{morpheusSecretSet:Ue,apiKeysEncrypted:Ye}=l,wt=Ye[L];return!Oe?u.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[G(L)]?null:Ue?wt?u.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"}):u.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"}):u.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"})},G=L=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[L],ce=L=>!f||!f[L]?null:u.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"}),A=L=>!!(f&&f[L]),_=(L,Oe)=>{if(!x)return;const Ue=JSON.parse(JSON.stringify(x));let Ye=Ue;for(let wt=0;wt<L.length-1;wt++)(Ye[L[wt]]===void 0||Ye[L[wt]]===null)&&(Ye[L[wt]]={}),Ye=Ye[L[wt]];Ye[L[L.length-1]]=Oe,b(Ue);try{_B.parse(Ue),le({})}catch(wt){if(wt instanceof BH){const Ie={};wt.errors.forEach(nt=>{const dt=nt.path.join(".");Ie[dt]=nt.message}),le(Ie)}}},H=(L,Oe)=>{v&&j({...v,[L]:Oe})},w=(L,Oe)=>{T&&E({...T,[L]:Oe})},J=(L,Oe)=>{S&&O({...S,[L]:Oe})},he=(L,Oe)=>{C&&$({...C,[L]:Oe})},pe=()=>{!x||!C||$({...C,provider:x.llm.provider,model:x.llm.model,api_key:x.llm.api_key})},xe=()=>{!x||!v||j({...v,provider:x.llm.provider,model:x.llm.model,api_key:x.llm.api_key})},Pe=()=>{!x||!T||E({...T,provider:x.llm.provider,model:x.llm.model,api_key:x.llm.api_key})},Ee=()=>{!x||!S||O({...S,provider:x.llm.provider,model:x.llm.model,api_key:x.llm.api_key})},xt=async()=>{if(x){de(!0),oe(null);try{const L=await en.updateConfig(x);v&&await en.updateSatiConfig(v),S&&await en.updateNeoConfig(S),T&&await en.updateApocConfig(T),C&&await en.updateTrinityConfig(C),m&&await Li.updateConfig(m),Pn("/api/config"),Pn("/api/config/sati"),Pn("/api/config/neo"),Pn("/api/config/apoc"),Pn("/api/config/trinity"),Pn("/api/config/chronos"),le({});const Oe=L._restartRequired||[],Ue=Oe.length>0?`Settings saved and applied. Some changes require restart: ${Oe.join(", ")}`:"Settings saved and applied successfully.";oe({type:"success",message:Ue}),setTimeout(()=>oe(null),5e3)}catch(L){if(oe({type:"error",message:L.message}),L.details&&Array.isArray(L.details)){const Oe={};L.details.forEach(Ue=>{const Ye=Ue.path.join(".");Oe[Ye]=Ue.message}),le(Oe)}}finally{de(!1)}}};return t?u.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):x?u.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[u.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(cp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Zaion Settings"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Configure agents, models, channels, and runtime behavior."})]})]}),u.jsx("button",{onClick:xt,disabled:!ie||Object.keys(ae).length>0||K,className:`px-4 py-2 rounded font-medium transition-colors ${ie&&Object.keys(ae).length===0?"bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90":"bg-azure-border text-azure-text-secondary cursor-not-allowed dark:bg-matrix-primary/50 dark:text-matrix-highlight/50"}`,children:K?"Saving...":"Save Changes"})]}),ne&&u.jsxs("div",{className:`flex items-start justify-between gap-3 p-4 rounded border ${ne.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:[u.jsx("span",{className:"text-sm",children:ne.message}),u.jsx("button",{type:"button",onClick:()=>oe(null),className:"shrink-0 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:u.jsx(Bi,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:u.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:YF.map(L=>u.jsxs("button",{onClick:()=>M(L.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 flex items-center gap-1.5 ${D===L.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:[L.label,B[L.id]&&u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0"})]},L.id))})}),u.jsxs("div",{className:"space-y-6",children:[D==="general"&&u.jsxs(wn,{title:"Agent Identity",children:[u.jsx(Ge,{label:"Agent Name",value:x.agent.name,onChange:L=>_(["agent","name"],L.target.value),error:ae["agent.name"]}),u.jsx(Ge,{label:"Personality",value:x.agent.personality,onChange:L=>_(["agent","personality"],L.target.value),error:ae["agent.personality"]}),u.jsx(mn,{label:"Verbose Mode",value:x.verbose_mode!==!1?"true":"false",onChange:L=>_(["verbose_mode"],L.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."})]}),D==="agents"&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:JF.map(L=>u.jsx("button",{onClick:()=>U(L.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${Z===L.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:L.label},L.id))}),Z==="oracle"&&u.jsxs(wn,{title:"Oracle Agent",children:[u.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"}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ce("llm.provider")]}),u.jsx(mn,{label:"",value:x.llm.provider,onChange:L=>_(["llm","provider"],L.target.value),options:wl,error:ae["llm.provider"],disabled:A("llm.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ce("llm.model")]}),u.jsx(Ge,{label:"",value:x.llm.model,onChange:L=>_(["llm","model"],L.target.value),disabled:A("llm.model")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ce("llm.temperature")]}),u.jsx(It,{label:"",value:x.llm.temperature,onChange:L=>_(["llm","temperature"],parseFloat(L.target.value)),step:.1,min:0,max:1,error:ae["llm.temperature"],disabled:A("llm.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),ce("llm.max_tokens")]}),u.jsx(It,{label:"",value:x.llm.max_tokens??"",onChange:L=>_(["llm","max_tokens"],L.target.value?parseInt(L.target.value):void 0),min:1,error:ae["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:A("llm.max_tokens")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),ce("llm.context_window")]}),u.jsx(It,{label:"",value:x.llm.context_window??100,onChange:L=>_(["llm","context_window"],parseInt(L.target.value)),min:1,step:1,error:ae["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:A("llm.context_window")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ce("llm.api_key"),V("oracle",x.llm.api_key)]})]}),u.jsx(Ge,{label:"",type:"password",value:x.llm.api_key||"",onChange:L=>_(["llm","api_key"],L.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:A("llm.api_key")}),x.llm.provider==="openrouter"&&u.jsx(Ge,{label:"Base URL",value:x.llm.base_url||"https://openrouter.ai/api/v1",onChange:L=>_(["llm","base_url"],L.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),Z==="sati"&&u.jsxs(wn,{title:"Sati Agent",children:[u.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"}),u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{type:"button",onClick:xe,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"}),u.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&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ce("sati.provider")]}),u.jsx(mn,{label:"",value:v.provider,onChange:L=>H("provider",L.target.value),options:wl,disabled:A("sati.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ce("sati.model")]}),u.jsx(Ge,{label:"",value:v.model,onChange:L=>H("model",L.target.value),disabled:A("sati.model")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ce("sati.api_key"),V("sati",v.api_key)]})]}),u.jsx(Ge,{label:"",type:"password",value:v.api_key||"",onChange:L=>H("api_key",L.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:A("sati.api_key")}),v.provider==="openrouter"&&u.jsx(Ge,{label:"Base URL",value:v.base_url||"https://openrouter.ai/api/v1",onChange:L=>H("base_url",L.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),u.jsx(It,{label:"Memory Limit",value:v.memory_limit??10,onChange:L=>H("memory_limit",parseInt(L.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),u.jsx(Sr,{label:"Enable Archived Sessions in Memory Retrieval",checked:v.enabled_archived_sessions??!0,onChange:L=>H("enabled_archived_sessions",L)})]})]}),Z==="neo"&&u.jsxs(wn,{title:"Neo Agent",children:[u.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"}),u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{type:"button",onClick:Ee,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"}),u.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"})]}),S&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ce("neo.provider")]}),u.jsx(mn,{label:"",value:S.provider,onChange:L=>J("provider",L.target.value),options:wl,disabled:A("neo.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ce("neo.model")]}),u.jsx(Ge,{label:"",value:S.model,onChange:L=>J("model",L.target.value),disabled:A("neo.model")}),u.jsx(Ge,{label:"Personality",value:S.personality||"analytical_engineer",onChange:L=>J("personality",L.target.value),placeholder:"analytical_engineer",helperText:"e.g., analytical_engineer, meticulous_auditor, systems_thinker"}),u.jsx(mn,{label:"Execution Mode",value:S.execution_mode||"async",onChange:L=>J("execution_mode",L.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ce("neo.temperature")]}),u.jsx(It,{label:"",value:S.temperature,onChange:L=>J("temperature",parseFloat(L.target.value)),step:.1,min:0,max:1,disabled:A("neo.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),ce("neo.max_tokens")]}),u.jsx(It,{label:"",value:S.max_tokens??"",onChange:L=>J("max_tokens",L.target.value?parseInt(L.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:A("neo.max_tokens")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),ce("neo.context_window")]}),u.jsx(It,{label:"",value:S.context_window??100,onChange:L=>J("context_window",parseInt(L.target.value)),min:1,step:1,disabled:A("neo.context_window")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ce("neo.api_key"),V("neo",S.api_key)]})]}),u.jsx(Ge,{label:"",type:"password",value:S.api_key||"",onChange:L=>J("api_key",L.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:A("neo.api_key")}),S.provider==="openrouter"&&u.jsx(Ge,{label:"Base URL",value:S.base_url||"https://openrouter.ai/api/v1",onChange:L=>J("base_url",L.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),Z==="trinity"&&u.jsxs(wn,{title:"Trinity Agent",children:[u.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)"}),u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{type:"button",onClick:pe,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),C&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ce("trinity.provider")]}),u.jsx(mn,{label:"",value:C.provider,onChange:L=>he("provider",L.target.value),options:wl,disabled:A("trinity.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ce("trinity.model")]}),u.jsx(Ge,{label:"",value:C.model,onChange:L=>he("model",L.target.value),disabled:A("trinity.model")}),u.jsx(Ge,{label:"Personality",value:C.personality||"data_specialist",onChange:L=>he("personality",L.target.value),placeholder:"data_specialist",helperText:"e.g., data_specialist, query_optimizer, db_architect"}),u.jsx(mn,{label:"Execution Mode",value:C.execution_mode||"async",onChange:L=>he("execution_mode",L.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ce("trinity.temperature")]}),u.jsx(It,{label:"",value:C.temperature,onChange:L=>he("temperature",parseFloat(L.target.value)),step:.1,min:0,max:1,disabled:A("trinity.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),ce("trinity.max_tokens")]}),u.jsx(It,{label:"",value:C.max_tokens??"",onChange:L=>he("max_tokens",L.target.value?parseInt(L.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:A("trinity.max_tokens")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ce("trinity.api_key"),V("trinity",C.api_key)]})]}),u.jsx(Ge,{label:"",type:"password",value:C.api_key||"",onChange:L=>he("api_key",L.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:A("trinity.api_key")}),C.provider==="openrouter"&&u.jsx(Ge,{label:"Base URL",value:C.base_url||"https://openrouter.ai/api/v1",onChange:L=>he("base_url",L.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),Z==="apoc"&&u.jsxs(wn,{title:"Apoc Agent",children:[u.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"}),u.jsxs("div",{className:"mb-4",children:[u.jsx("button",{type:"button",onClick:Pe,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),u.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"})]}),T&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ce("apoc.provider")]}),u.jsx(mn,{label:"",value:T.provider,onChange:L=>w("provider",L.target.value),options:wl,disabled:A("apoc.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),ce("apoc.model")]}),u.jsx(Ge,{label:"",value:T.model,onChange:L=>w("model",L.target.value),disabled:A("apoc.model")}),u.jsx(Ge,{label:"Personality",value:T.personality||"pragmatic_dev",onChange:L=>w("personality",L.target.value),placeholder:"pragmatic_dev",helperText:"e.g., pragmatic_dev, cautious_admin, automation_specialist"}),u.jsx(mn,{label:"Execution Mode",value:T.execution_mode||"async",onChange:L=>w("execution_mode",L.target.value),options:[{value:"async",label:"Async (background task)"},{value:"sync",label:"Sync (inline response)"}]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),ce("apoc.temperature")]}),u.jsx(It,{label:"",value:T.temperature,onChange:L=>w("temperature",parseFloat(L.target.value)),step:.1,min:0,max:1,disabled:A("apoc.temperature")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ce("apoc.api_key"),V("apoc",T.api_key)]})]}),u.jsx(Ge,{label:"",type:"password",value:T.api_key||"",onChange:L=>w("api_key",L.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:A("apoc.api_key")}),T.provider==="openrouter"&&u.jsx(Ge,{label:"Base URL",value:T.base_url||"https://openrouter.ai/api/v1",onChange:L=>w("base_url",L.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),u.jsx(It,{label:"Timeout (ms)",value:T.timeout_ms??3e4,onChange:L=>w("timeout_ms",parseInt(L.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),D==="devkit"&&u.jsxs(u.Fragment,{children:[u.jsxs(wn,{title:"DevKit Security",children:[u.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."}),u.jsx(Ge,{label:"Sandbox Directory",value:x.devkit?.sandbox_dir||"",onChange:L=>_(["devkit","sandbox_dir"],L.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:A("devkit.sandbox_dir")}),u.jsx(mn,{label:"Read-Only Mode",value:x.devkit?.readonly_mode?"true":"false",onChange:L=>_(["devkit","readonly_mode"],L.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:A("devkit.readonly_mode")}),u.jsx(It,{label:"Timeout (ms)",value:x.devkit?.timeout_ms??3e4,onChange:L=>_(["devkit","timeout_ms"],parseInt(L.target.value)),min:1e3,step:1e3,helperText:"Default timeout for shell and system operations in milliseconds.",disabled:A("devkit.timeout_ms")})]}),u.jsxs(wn,{title:"Tool Categories",children:[u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Enable or disable entire categories of DevKit tools."}),u.jsx(Sr,{label:"Filesystem (read, write, list, copy, move, delete files)",checked:x.devkit?.enable_filesystem!==!1,onChange:L=>_(["devkit","enable_filesystem"],L)}),u.jsx(Sr,{label:"Shell (run_command, run_script, which)",checked:x.devkit?.enable_shell!==!1,onChange:L=>_(["devkit","enable_shell"],L)}),u.jsx(Sr,{label:"Git (status, diff, commit, push, pull, clone, branch)",checked:x.devkit?.enable_git!==!1,onChange:L=>_(["devkit","enable_git"],L)}),u.jsx(Sr,{label:"Network (http_request, ping, dns_lookup, download_file)",checked:x.devkit?.enable_network!==!1,onChange:L=>_(["devkit","enable_network"],L)})]}),u.jsxs(wn,{title:"Shell Command Allowlist",children:[u.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)."}),u.jsx(Ge,{label:"Allowed Commands",value:(x.devkit?.allowed_shell_commands||[]).join(", "),onChange:L=>_(["devkit","allowed_shell_commands"],L.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),placeholder:"e.g. node, npm, git, python, cargo",helperText:"Comma-separated list of allowed binary names. Empty = all commands allowed.",disabled:A("devkit.allowed_shell_commands")})]})]}),D==="audio"&&u.jsxs(wn,{title:"Audio Transcription",children:[u.jsx(Sr,{label:"Enable Audio",checked:x.audio.enabled,onChange:L=>_(["audio","enabled"],L)}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),ce("audio.provider")]}),u.jsx(mn,{label:"",value:x.audio.provider||"google",onChange:L=>_(["audio","provider"],L.target.value),options:[{label:"Google Gemini",value:"google"},{label:"OpenAI (Whisper)",value:"openai"},{label:"OpenRouter (multimodal)",value:"openrouter"},{label:"Ollama (Whisper local)",value:"ollama"}],error:ae["audio.provider"],disabled:A("audio.provider")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model"}),ce("audio.model")]}),u.jsx(Ge,{label:"",value:x.audio.model,onChange:L=>_(["audio","model"],L.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:ae["audio.model"],disabled:A("audio.model")}),x.audio.provider==="ollama"&&u.jsx(Ge,{label:"Base URL",value:x.audio.base_url||"",onChange:L=>_(["audio","base_url"],L.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2",children:[ce("audio.apiKey"),V("audio",x.audio.apiKey)]})]}),u.jsx(Ge,{label:"",type:"password",value:x.audio.apiKey||"",onChange:L=>_(["audio","apiKey"],L.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:A("audio.apiKey")}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Duration (Seconds)"}),ce("audio.maxDurationSeconds")]}),u.jsx(It,{label:"",value:x.audio.maxDurationSeconds,onChange:L=>_(["audio","maxDurationSeconds"],parseInt(L.target.value)),min:1,disabled:A("audio.maxDurationSeconds")}),u.jsx(Ge,{label:"Supported Mime Types",value:x.audio.supportedMimeTypes.join(", "),onChange:L=>_(["audio","supportedMimeTypes"],L.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),D==="channels"&&u.jsxs(u.Fragment,{children:[u.jsxs(wn,{title:"Telegram",children:[u.jsx(Sr,{label:"Enable Telegram",checked:x.channels.telegram.enabled,onChange:L=>_(["channels","telegram","enabled"],L)}),x.channels.telegram.enabled&&u.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[u.jsx(Ge,{label:"Bot Token",type:"password",value:x.channels.telegram.token||"",onChange:L=>_(["channels","telegram","token"],L.target.value)}),u.jsx(Ge,{label:"Allowed Users (comma separated)",value:x.channels.telegram.allowedUsers.join(", "),onChange:L=>_(["channels","telegram","allowedUsers"],L.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),u.jsxs(wn,{title:"Discord",children:[u.jsx(Sr,{label:"Enable Discord",checked:x.channels.discord.enabled,onChange:L=>_(["channels","discord","enabled"],L)}),x.channels.discord.enabled&&u.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[u.jsx(Ge,{label:"Bot Token",type:"password",value:x.channels.discord.token||"",onChange:L=>_(["channels","discord","token"],L.target.value)}),u.jsx(Ge,{label:"Allowed Users (comma separated)",value:(x.channels.discord.allowedUsers??[]).join(", "),onChange:L=>_(["channels","discord","allowedUsers"],L.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),D==="ui"&&u.jsxs(wn,{title:"Dashboard",children:[u.jsx(Sr,{label:"Enable Web UI",checked:x.ui.enabled,onChange:L=>_(["ui","enabled"],L)}),u.jsx(It,{label:"Port",value:x.ui.port,onChange:L=>_(["ui","port"],parseInt(L.target.value)),disabled:!0,helperText:"Port changes require daemon restart."})]}),D==="logging"&&u.jsxs(wn,{title:"Logging",children:[u.jsx(Sr,{label:"Enable Logging",checked:x.logging.enabled,onChange:L=>_(["logging","enabled"],L)}),u.jsx(mn,{label:"Log Level",value:x.logging.level,onChange:L=>_(["logging","level"],L.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),D==="chronos"&&m&&u.jsxs(wn,{title:"Chronos — Temporal Intent Engine",children:[u.jsx(mn,{label:"Timezone",value:m.timezone,onChange:L=>g({...m,timezone:L.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"}]}),u.jsx(It,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:L=>g({...m,check_interval_ms:Number(L.target.value)*1e3}),min:60}),u.jsx(It,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:L=>g({...m,max_active_jobs:Number(L.target.value)}),min:1,max:1e3})]})]})]}):u.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function XF(){const{data:e}=z5(),[t,n]=z.useState(null),{data:a,mutate:s}=j5(t),c=z.useRef(null);return z.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),z.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[a]),u.jsxs(Le.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:[u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Yv,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Logs"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"View runtime logs."})]})]}),u.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:[u.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:[u.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=>u.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:[u.jsx(Yv,{className:"w-4 h-4 shrink-0"}),u.jsxs("div",{className:"flex flex-col overflow-hidden",children:[u.jsx("span",{className:"truncate font-bold",children:l.name}),u.jsxs("span",{className:"text-xs opacity-70",children:[(l.size/1024).toFixed(1)," KB"]})]})]},l.name))]}),u.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:[u.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:[u.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=>u.jsx("option",{value:l.name,children:l.name},l.name))}),u.jsx("span",{className:"hidden md:block text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm truncate",children:t}),u.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:u.jsx(Ga,{className:"w-4 h-4"})})]}),u.jsx("div",{ref:c,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?u.jsxs("div",{children:[u.jsxs("span",{className:"hidden md:inline opacity-50",children:[h[1]," "]}),u.jsx("span",{children:h[2]})]},f):u.jsx("div",{children:l},f)}):u.jsx("span",{className:"opacity-50",children:"Select a log file to view content..."})})]})]})]})}function QF(){const[e,t]=z.useState(null),[n,a]=z.useState([]),[s,c]=z.useState(!0),[l,f]=z.useState("");if(z.useEffect(()=>{async function g(){try{const[x,b]=await Promise.all([Zp.fetchUsageStats(),Zp.fetchGroupedUsageStats()]);t(x),a(b)}catch(x){f("Failed to load usage statistics"),console.error(x)}finally{c(!1)}}g()},[]),s)return u.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 u.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 u.jsxs(Le.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs(Le.div,{variants:m,className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(sp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Usage Stats"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Resource consumption tracking and cost metrics."})]})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs(Le.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:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[u.jsx(Vl,{className:"w-5 h-5"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),u.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),u.jsxs(Le.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:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[u.jsx(Hs,{className:"w-5 h-5"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),u.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),u.jsxs(Le.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:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[u.jsx(Pl,{className:"w-5 h-5"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),u.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),u.jsxs(Le.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:[u.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:u.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[u.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:u.jsxs("tr",{children:[u.jsx("th",{className:"p-4",children:"Provider"}),u.jsx("th",{className:"p-4",children:"Model"}),u.jsx("th",{className:"p-4 text-right",children:"Messages"}),u.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),u.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),u.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),u.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),u.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),u.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?u.jsx("tr",{children:u.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,x)=>u.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[u.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),u.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),u.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}-${x}`))})]})})]})]})}const WF=()=>{const[e,t]=z.useState(""),[n,a]=z.useState(""),s=fg(),c=Nr(),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=c.state?.from?.pathname||"/";s(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return u.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:u.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:[u.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"}),u.jsxs("form",{onSubmit:l,className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),u.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&&u.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),u.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"})]}),u.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."})]})})},eq=({children:e})=>{const{isAuthenticated:t}=Dj(),n=Nr();return t?u.jsx(u.Fragment,{children:e}):u.jsx(ES,{to:"/login",state:{from:n},replace:!0})},tq=({className:e,...t})=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),nq=({...e})=>u.jsx("thead",{...e}),rq=({...e})=>u.jsx("tbody",{...e}),Qm=({...e})=>u.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}),Ds=({className:e,...t})=>u.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}),Ei=({className:e,...t})=>u.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),tS=({checked:e,onCheckedChange:t,className:n,...a})=>{const s=c=>{t&&t(c.target.checked),a.onChange&&a.onChange(c)};return u.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})},Sd=({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 u.jsx("div",{className:s,...n})},Wm=({className:e,...t})=>u.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}),nS=({className:e,...t})=>u.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),aq=({className:e,...t})=>u.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),ep=({className:e,...t})=>u.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),iq=({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 u.jsx("div",{className:s,...n})},sq=({className:e,...t})=>u.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),L2=({isOpen:e,onClose:t,title:n,children:a,size:s="md"})=>{if(!e)return null;const c={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),u.jsxs("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full ${c[s]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&u.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&u.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:u.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:u.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),u.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},oq=({isOpen:e,onClose:t,memory:n})=>n?u.jsx(L2,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vg,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),u.jsx("div",{children:u.jsx(Sd,{variant:"outline",children:n.category})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(LA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),u.jsx("div",{children:u.jsx(Sd,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx($S,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_r,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ec,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(V4,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(F4,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),u.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),u.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&&u.jsxs("div",{children:[u.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),u.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})]}),u.jsx("div",{className:"flex justify-end pt-4",children:u.jsx(hr,{onClick:t,children:"Close"})})]})}):null,P2=({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:c="Delete",cancelButtonText:l="Cancel"})=>u.jsx(L2,{isOpen:e,onClose:t,title:a,size:"md",children:u.jsxs("div",{className:"space-y-6",children:[u.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(hr,{variant:"outline",onClick:t,children:l}),u.jsx(hr,{variant:"destructive",onClick:()=>{n(),t()},children:c})]})]})}),lq=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=z.useCallback(h=>(t(!0),a(null),ge.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),c=z.useCallback((h,m)=>(t(!0),a(null),ge.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),ge.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),ge.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:s,post:c,put:l,del:f,loading:e,error:n}},cq=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(!0),[s,c]=z.useState([]),[l,f]=z.useState(""),[h,m]=z.useState("all"),[g,x]=z.useState("all"),[b,v]=z.useState(null),[j,S]=z.useState(!1),[O,T]=z.useState(null),[E,C]=z.useState(!1),[$,D]=z.useState(null),[M,Z]=z.useState(!1),{get:U,del:K,post:de}=lq();z.useEffect(()=>{ae()},[]);const ae=async()=>{try{a(!0);const _=await U("/sati/memories");t(_),v(null)}catch(_){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",_)}finally{a(!1)}},le=()=>{s.length===G.length?c([]):c(G.map(_=>_.id))},ne=_=>{s.includes(_)?c(s.filter(H=>H!==_)):c([...s,_])},oe=async()=>{if(s.length!==0)try{await de("/sati/memories/bulk-delete",{ids:s}),await ae(),c([]),S(!1)}catch(_){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",_)}},ie=_=>{D(_),Z(!0)},B=async()=>{if($)try{await K(`/sati/memories/${$}`),await ae()}catch(_){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",_)}finally{D(null),Z(!1)}},V=_=>{T(_),C(!0)},G=e.filter(_=>{const H=_.summary.toLowerCase().includes(l.toLowerCase())||_.details?.toLowerCase().includes(l.toLowerCase())||_.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||_.category===h,J=g==="all"||_.importance===g;return H&&w&&J&&!_.archived}),ce=Array.from(new Set(e.map(_=>_.category))),A=Array.from(new Set(e.map(_=>_.importance)));return n?u.jsx(Wm,{className:"w-full",children:u.jsx(ep,{className:"flex justify-center items-center h-64",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Mi,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Sati Memories"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"View and manage long-term memories stored by Sati."})]})]}),s.length>0&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[s.length," selected"]}),u.jsxs(hr,{variant:"destructive",size:"sm",onClick:()=>S(!0),disabled:s.length===0,children:[u.jsx(ha,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&u.jsx(iq,{variant:"destructive",children:u.jsx(sq,{children:b})}),u.jsxs(Wm,{children:[u.jsx(nS,{className:"border-b border-azure-border dark:border-matrix-primary",children:u.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[u.jsxs("div",{className:"flex flex-col relative w-full",children:[u.jsx(bA,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),u.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:_=>f(_.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"})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[u.jsxs("select",{value:h,onChange:_=>m(_.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:[u.jsx("option",{value:"all",children:"All Categories"}),ce.map(_=>u.jsx("option",{value:_,children:_},_))]}),u.jsxs("select",{value:g,onChange:_=>x(_.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:[u.jsx("option",{value:"all",children:"All Importance"}),A.map(_=>u.jsx("option",{value:_,children:_},_))]})]})]})}),u.jsx(ep,{className:"p-0",children:u.jsxs(tq,{children:[u.jsx(nq,{children:u.jsxs(Qm,{className:"hover:bg-transparent",children:[u.jsx(Ds,{className:"w-12",children:u.jsx(tS,{checked:G.length>0&&s.length===G.length,onCheckedChange:le})}),u.jsx(Ds,{children:"Summary"}),u.jsx(Ds,{children:"Category"}),u.jsx(Ds,{children:"Importance"}),u.jsx(Ds,{children:"Created"}),u.jsx(Ds,{className:"w-32",children:"Actions"})]})}),u.jsx(rq,{children:G.length===0?u.jsx(Qm,{children:u.jsx(Ei,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):G.map(_=>u.jsxs(Qm,{children:[u.jsx(Ei,{children:u.jsx(tS,{checked:s.includes(_.id),onCheckedChange:()=>ne(_.id)})}),u.jsx(Ei,{className:"font-medium max-w-xs truncate",children:_.summary}),u.jsx(Ei,{children:u.jsx(Sd,{variant:"outline",children:_.category})}),u.jsx(Ei,{children:u.jsx(Sd,{variant:_.importance==="critical"?"destructive":_.importance==="high"?"default":_.importance==="medium"?"secondary":"outline",children:_.importance})}),u.jsx(Ei,{children:u.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[u.jsx($S,{className:"w-4 h-4"}),new Date(_.created_at).toLocaleDateString()]})}),u.jsx(Ei,{children:u.jsxs("div",{className:"flex gap-1",children:[u.jsx(hr,{variant:"ghost",size:"sm",onClick:()=>V(_),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:u.jsx(ec,{className:"w-4 h-4"})}),u.jsx(hr,{variant:"ghost",size:"sm",onClick:()=>ie(_.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:u.jsx(ha,{className:"w-4 h-4"})})]})})]},_.id))})]})})]}),j&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsxs(Wm,{className:"w-full max-w-md mx-4",children:[u.jsx(nS,{children:u.jsx(aq,{children:"Delete Memories"})}),u.jsxs(ep,{children:[u.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",s.length," ","memory(ies)? This action cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(hr,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),u.jsx(hr,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),u.jsx(oq,{isOpen:E,onClose:()=>C(!1),memory:O}),u.jsx(P2,{isOpen:M,onClose:()=>Z(!1),onConfirm:B,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},uq=({label:e,values:t,onChange:n,placeholder:a})=>{const s=t.length>0?t:[""],c=(h,m)=>{const g=[...s];g[h]=m,n(g.filter(x=>x.trim().length>0))},l=()=>n([...s,""]),f=h=>{const m=s.filter((g,x)=>x!==h);n(m.filter(g=>g.trim().length>0))};return u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),s.map((h,m)=>u.jsxs("div",{className:"flex gap-2",children:[u.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=>c(m,g.target.value)}),u.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}`)),u.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"})]})},rS=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const c=z.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,x)=>{const b=[...c];b[m]={...b[m],[g]:x},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},f=()=>n([...c,{key:"",value:""}]),h=m=>{const g=c.filter((x,b)=>b!==m);n(g.filter(x=>x.key.trim().length>0||x.value.trim().length>0))};return u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),c.map((m,g)=>u.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[u.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:x=>l(g,"key",x.target.value)}),u.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:x=>l(g,"value",x.target.value)}),u.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}`)),u.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"})]})},dq=({transport:e,command:t,url:n,args:a,env:s,headers:c,onCommandChange:l,onUrlChange:f,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>u.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",u.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:x=>l(x.target.value),placeholder:"npx"})]}),u.jsx(uq,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",u.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:x=>f(x.target.value),placeholder:"https://example.com/mcp"})]}),u.jsx(rS,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&u.jsx(rS,{label:"Headers",values:c,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),fq=zF({name:Xm().min(1,"Name is required"),transport:R2([Xw("stdio"),Xw("http")]),command:Xm().optional(),url:Xm().optional()}),Hu=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],tp=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),hq=({open:e,mode:t,initial:n,onClose:a,onSubmit:s})=>{const[c,l]=z.useState(n?.name??""),[f,h]=z.useState(n?.config.transport??"stdio"),[m,g]=z.useState(n?.config.transport==="stdio"?n.config.command:""),[x,b]=z.useState(n?.config.transport==="http"?n.config.url:""),[v,j]=z.useState(n?.config.args??[]),[S,O]=z.useState(Hu(n?.config.env)),[T,E]=z.useState(n?.config.transport==="http"?Hu(n.config.headers):[]),[C,$]=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:""),j(n?.config.args??[]),O(Hu(n?.config.env)),E(n?.config.transport==="http"?Hu(n.config.headers):[]),$(null))},[e,n]);const D=t==="create",M=async()=>{const U=fq.safeParse({name:c,transport:f,command:m,url:x});if(!U.success){$(U.error.issues[0]?.message??"Invalid form");return}if(f==="stdio"&&(!m||m.trim().length===0)){$("Command is required for stdio transport.");return}if(f==="http"&&(!x||x.trim().length===0)){$("URL is required for http transport.");return}const K=f==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:S.length>0?tp(S):void 0}:{transport:"http",url:x.trim(),headers:T.length>0?tp(T):void 0,env:S.length>0?tp(S):void 0};$(null),await s(c.trim(),K)},Z=z.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return u.jsx(Lr,{open:e,onOpenChange:a,children:u.jsxs(to,{children:[u.jsx(Pr,{children:u.jsx(Ur,{children:Z})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",u.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:c,onChange:U=>l(U.target.value),placeholder:"coolify",disabled:!D})]}),u.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",u.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:U=>h(U.target.value),children:[u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"})]})]}),u.jsx(dq,{transport:f,command:m,url:x,args:v,env:S,headers:T,onCommandChange:g,onUrlChange:b,onArgsChange:j,onEnvChange:O,onHeadersChange:E}),C&&u.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/50 dark:text-red-400",children:C}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.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"}),u.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:M,children:"Save"})]})]})]})})};function mq({transport:e}){return e==="stdio"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium border rounded px-1.5 py-0.5 text-amber-500 bg-amber-500/10 border-amber-500/30",children:[u.jsx(Nl,{className:"w-2.5 h-2.5"}),"stdio"]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium border rounded px-1.5 py-0.5 text-cyan-500 bg-cyan-500/10 border-cyan-500/30",children:[u.jsx($4,{className:"w-2.5 h-2.5"}),"http"]})}function pq({result:e}){return e?e.ok?u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-500",children:[u.jsx(US,{className:"w-3 h-3"}),e.toolCount," tool",e.toolCount!==1?"s":""]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-red-500",children:[u.jsx(Ll,{className:"w-3 h-3"}),"failed"]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-zinc-400 dark:text-zinc-600",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-400 dark:bg-zinc-600"}),"unchecked"]})}const gq=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:s})=>{const c=t?.ok,l=t&&!t.ok,f=e.config.env?Object.entries(e.config.env):[];return u.jsxs("div",{className:`rounded-lg border flex flex-col bg-white dark:bg-black transition-all ${e.enabled?l?"border-red-400/40 dark:border-red-500/30":c?"border-emerald-400/50 dark:border-emerald-500/30":"border-azure-primary/40 dark:border-matrix-primary":"border-azure-border dark:border-matrix-primary/30"}`,children:[u.jsxs("div",{className:"p-4 flex items-start gap-3",children:[u.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${e.enabled?c?"bg-emerald-500/10":l?"bg-red-500/10":"bg-azure-primary/10 dark:bg-matrix-highlight/10":"bg-azure-surface dark:bg-zinc-900"}`,children:u.jsx(FA,{className:`w-4 h-4 ${e.enabled?c?"text-emerald-500":l?"text-red-500":"text-azure-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-tertiary"}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h3",{className:`font-semibold truncate ${e.enabled?"text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary"}`,children:e.name}),u.jsx(mq,{transport:e.config.transport}),!e.enabled&&u.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded px-1.5 py-0.5 shrink-0",children:"disabled"})]}),u.jsx("div",{className:"mt-1",children:u.jsx(pq,{result:t})})]})]}),u.jsxs("div",{className:"px-4 pb-4 space-y-2",children:[e.config.transport==="stdio"&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-1",children:"Command"}),u.jsxs("code",{className:"block text-xs font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2.5 py-1.5 break-all",children:[e.config.command,e.config.args&&e.config.args.length>0&&u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:[" ",e.config.args.join(" ")]})]})]}),e.config.transport==="http"&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-1",children:"URL"}),u.jsx("code",{className:"block text-xs font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2.5 py-1.5 break-all",children:e.config.url})]}),f.length>0&&u.jsxs("div",{children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-1",children:["Env vars (",f.length,")"]}),u.jsx("div",{className:"flex flex-wrap gap-1",children:f.map(([h])=>u.jsx("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/30 rounded px-1.5 py-0.5",children:h},h))})]}),l&&t.error&&u.jsxs("div",{className:"flex items-start gap-2 text-xs text-red-500 bg-red-500/10 border border-red-500/20 rounded p-2",children:[u.jsx(lo,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{className:"break-all line-clamp-2",title:t.error,children:t.error})]})]}),u.jsxs("div",{className:"mt-auto px-4 py-3 border-t border-azure-border dark:border-matrix-primary/30 flex items-center justify-between gap-2",children:[e.config._comment?u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary truncate min-w-0",children:e.config._comment}):u.jsx("div",{}),u.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u.jsx("button",{type:"button",onClick:()=>n(e),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"Edit",children:u.jsx(tc,{className:"w-3.5 h-3.5"})}),u.jsx("button",{type:"button",onClick:()=>s(e,!e.enabled),className:`p-1.5 rounded border transition-colors ${e.enabled?"border-emerald-300 dark:border-emerald-700/60 text-emerald-500 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20":"border-azure-border dark:border-matrix-primary/40 text-zinc-400 dark:text-zinc-600 hover:text-azure-text dark:hover:text-matrix-secondary hover:border-azure-border dark:hover:border-matrix-primary"}`,title:e.enabled?"Disable":"Enable",children:e.enabled?u.jsx(wg,{className:"w-4 h-4"}):u.jsx(kg,{className:"w-4 h-4"})}),u.jsx("button",{type:"button",onClick:()=>a(e),className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Delete",children:u.jsx(ha,{className:"w-3.5 h-3.5"})})]})]})]})},xq=()=>{const{data:e,error:t,mutate:n,isLoading:a}=We("/api/mcp/servers",()=>ur.fetchServers()),[s,c]=z.useState(""),[l,f]=z.useState("all"),[h,m]=z.useState(!1),[g,x]=z.useState(null),[b,v]=z.useState(!1),[j,S]=z.useState(null),[O,T]=z.useState(null),[E,C]=z.useState({}),[$,D]=z.useState(!1),[M,Z]=z.useState(!1),[U,K]=z.useState(null),de=e?.servers??[];z.useEffect(()=>{ur.fetchStats().then(_=>{K(_);const H={};for(const w of _.servers)H[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};C(H)}).catch(()=>{})},[]);const ae=z.useMemo(()=>de.filter(_=>{const H=_.name.toLowerCase().includes(s.toLowerCase()),w=l==="all"||_.config.transport===l;return H&&w}),[de,s,l]),le=()=>{x(null),m(!0)},ne=_=>{x(_),m(!0)},oe=async()=>{const _=await ur.fetchStats();K(_);const H={};for(const w of _.servers)H[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};return C(H),_},ie=async(_,H)=>{try{g?await ur.updateServer(g.name,H):await ur.addServer(_,H),m(!1),x(null),await n(),await ur.reloadTools();const w=await oe();T({type:"success",message:`MCP server saved. Tools reloaded: ${w.totalTools} total.`})}catch(w){T({type:"error",message:w.message||"Failed to save MCP server."})}},B=async _=>{S(_),v(!0)},V=async()=>{if(j)try{await ur.deleteServer(j.name),await n(),v(!1),S(null),await ur.reloadTools();const _=await oe();T({type:"success",message:`MCP server deleted. Tools reloaded: ${_.totalTools} total.`})}catch(_){T({type:"error",message:_.message||"Failed to delete MCP server."})}},G=async()=>{D(!0);try{const _=await oe();T({type:"success",message:`Status checked: ${_.totalTools} tools from ${_.servers.length} servers.`})}catch(_){T({type:"error",message:_.message||"Failed to check MCP status."})}finally{D(!1)}},ce=async()=>{Z(!0);try{await ur.reloadTools();const _=await oe();T({type:"success",message:`MCP tools reloaded: ${_.totalTools} tools from ${_.servers.length} servers.`})}catch(_){T({type:"error",message:_.message||"Failed to reload MCP tools."})}finally{Z(!1)}},A=async(_,H)=>{try{await ur.toggleServer(_.name,H),await n(),await ur.reloadTools();const w=await oe();T({type:"success",message:`MCP server ${H?"enabled":"disabled"}. Tools reloaded: ${w.totalTools} total.`})}catch(w){T({type:"error",message:w.message||"Failed to toggle MCP server."})}};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(id,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"MCP Servers"}),U&&U.totalTools>0&&u.jsxs("span",{className:"rounded-full bg-azure-primary/10 px-2.5 py-0.5 text-xs font-semibold text-azure-primary dark:bg-matrix-highlight/20 dark:text-matrix-highlight",children:[U.totalTools," tools cached"]})]}),u.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:["Manage MCP servers stored in mcps.json."," ",U?.lastLoadedAt&&u.jsxs("span",{className:"dark:text-matrix-tertiary",children:["Last loaded: ",new Date(U.lastLoadedAt).toLocaleTimeString()]})]})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{type:"button",disabled:$,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:G,children:$?"Checking…":"Check Status"}),u.jsx("button",{type:"button",disabled:M,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:ce,children:M?"Reloading…":"Reload MCPs"}),u.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:le,children:"Add Server"})]})]}),O&&u.jsx("div",{className:`p-4 rounded border ${O.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:O.message}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[u.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:_=>c(_.target.value),placeholder:"Search by name"}),u.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:_=>f(_.target.value),children:[u.jsx("option",{value:"all",children:"All"}),u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"})]})]}),a&&u.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&u.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&ae.length===0&&u.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."}),u.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:ae.map(_=>u.jsx(gq,{server:_,probeResult:E[_.name],onEdit:ne,onDelete:B,onToggle:A},`${_.name}-${_.enabled?"on":"off"}`))}),u.jsx(hq,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:ie}),u.jsx(Lr,{open:b,onOpenChange:v,children:u.jsxs(to,{children:[u.jsx(Pr,{children:u.jsx(Ur,{children:"Confirm Deletion"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",u.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',j?.name,'"']}),"? This action cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.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"}),u.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:V,children:"Delete"})]})]})]})})]})},np={list:()=>ge.get("/model-pricing"),upsert:e=>ge.post("/model-pricing",e),update:(e,t,n)=>ge.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>ge.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},yq={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},aS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},bq=["anthropic","openai","google","openrouter","ollama","other"],iS=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),vq=()=>{const{data:e=[],mutate:t}=We("/api/model-pricing",()=>np.list()),[n,a]=z.useState(!1),[s,c]=z.useState(null),[l,f]=z.useState(iS()),[h,m]=z.useState(null),[g,x]=z.useState(null),[b,v]=z.useState(!1),j=(C,$)=>{x({type:C,message:$}),setTimeout(()=>x(null),3e3)},S=()=>{c(null),f(iS()),a(!0)},O=C=>{c(C),f({...C}),a(!0)},T=async()=>{if(!(!l.provider.trim()||!l.model.trim())){v(!0);try{await np.upsert(l),await t(),a(!1),j("success",s?"Pricing updated.":"Pricing created.")}catch{j("error","Failed to save pricing entry.")}finally{v(!1)}}},E=async()=>{if(h)try{await np.delete(h.provider,h.model),await t(),m(null),j("success","Pricing entry deleted.")}catch{j("error","Failed to delete pricing entry.")}};return u.jsxs(Le.div,{variants:yq,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs(Le.div,{variants:aS,className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Pl,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Model Pricing"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Manage per-model pricing to estimate LLM costs in Usage Stats."})]})]}),u.jsxs("button",{onClick:S,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:[u.jsx(Ws,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&u.jsx(Le.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}),u.jsx(Le.div,{variants:aS,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(C=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:C},C))})}),u.jsx("tbody",{children:e.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:'No pricing entries. Click "Add Pricing" to get started.'})}):e.map(C=>u.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:[u.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:C.provider}),u.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:C.model}),u.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.input_price_per_1m.toFixed(4)]}),u.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",C.output_price_per_1m.toFixed(4)]}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>O(C),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:u.jsx(tc,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>m(C),className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",title:"Delete",children:u.jsx(ha,{className:"w-4 h-4"})})]})})]},`${C.provider}/${C.model}`))})]})}),u.jsx(Lr,{open:n,onOpenChange:a,children:u.jsxs(to,{children:[u.jsx(Pr,{children:u.jsx(Ur,{children:s?"Edit Pricing":"Add Pricing"})}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),s?u.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}):u.jsxs("select",{value:l.provider,onChange:C=>f({...l,provider:C.target.value}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight",children:[u.jsx("option",{value:"",children:"Select provider..."}),bq.map(C=>u.jsx("option",{value:C,children:C},C))]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),s?u.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}):u.jsx("input",{type:"text",value:l.model,onChange:C=>f({...l,model:C.target.value}),placeholder:"e.g. gpt-4o",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),u.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:C=>f({...l,input_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),u.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:C=>f({...l,output_price_per_1m:parseFloat(C.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]})]}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.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"}),u.jsx("button",{onClick:T,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"})]})]})]})}),u.jsx(Lr,{open:!!h,onOpenChange:C=>!C&&m(null),children:u.jsxs(to,{children:[u.jsx(Pr,{children:u.jsx(Ur,{children:"Delete Pricing Entry"})}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",u.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.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"}),u.jsx("button",{onClick:E,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},kq={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},sS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},wq=["ui","telegram","discord"],oS=()=>({name:"",prompt:"",notification_channels:["ui"]}),Sq=()=>{const{data:e=[],mutate:t}=We("/webhooks",()=>Fa.list(),{refreshInterval:1e4}),[n,a]=z.useState(!1),[s,c]=z.useState(null),[l,f]=z.useState(oS()),[h,m]=z.useState(null),[g,x]=z.useState(null),[b,v]=z.useState(!1),[j,S]=z.useState(null),[O,T]=z.useState(null),E=(ne,oe)=>{x({type:ne,message:oe}),setTimeout(()=>x(null),3500)},C=()=>{c(null),f(oS()),T(null),a(!0)},$=ne=>{c(ne),f({name:ne.name,prompt:ne.prompt,notification_channels:ne.notification_channels}),T(null),a(!0)},D=ne=>/^[a-z0-9-_]+$/.test(ne),M=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!D(l.name)){T("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){T("Select at least one notification channel.");return}T(null),v(!0);try{s?(await Fa.update(s.id,l),E("success","Webhook updated.")):(await Fa.create(l),E("success","Webhook created.")),await t(),a(!1)}catch(ne){const oe=ne?.message||"Failed to save webhook.";T(oe)}finally{v(!1)}}},Z=async ne=>{try{await Fa.update(ne.id,{enabled:!ne.enabled}),await t()}catch{E("error","Failed to toggle webhook.")}},U=async()=>{if(h)try{await Fa.delete(h.id),await t(),m(null),E("success","Webhook deleted.")}catch{E("error","Failed to delete webhook.")}},K=ne=>`${window.location.origin}/api/webhooks/trigger/${ne}`,de=ne=>`curl -X POST ${K(ne.name)} \\
|
|
109
|
-
-H "x-api-key: ${ne.api_key}" \\
|
|
110
|
-
-H "Content-Type: application/json" \\
|
|
111
|
-
-d '{"event":"your_payload"}'`,ae=async(ne,oe)=>{await navigator.clipboard.writeText(ne),S(oe),setTimeout(()=>S(null),2e3)},le=ne=>{const oe=l.notification_channels.includes(ne);f({...l,notification_channels:oe?l.notification_channels.filter(ie=>ie!==ne):[...l.notification_channels,ne]})};return u.jsxs(Le.div,{variants:kq,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs(Le.div,{variants:sS,className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(dp,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Webhooks"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs(Ka,{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:[u.jsx($l,{className:"w-4 h-4"}),"Notifications"]}),u.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[u.jsx(Ws,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&u.jsx(Le.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}),u.jsx(Le.div,{variants:sS,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(ne=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ne},ne))})}),u.jsx("tbody",{children:e.length===0?u.jsx("tr",{children:u.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",u.jsx("button",{onClick:C,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ne=>u.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:[u.jsx("td",{className:"px-4 py-3",children:u.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:ne.name})}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[ne.api_key.slice(0,16),"…"]}),u.jsx("button",{onClick:()=>ae(de(ne),`curl-${ne.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy curl example",children:j===`curl-${ne.id}`?u.jsx(op,{className:"w-3.5 h-3.5 text-green-500"}):u.jsx(Nl,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>ae(ne.api_key,`key-${ne.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy API key",children:j===`key-${ne.id}`?u.jsx(op,{className:"w-3.5 h-3.5 text-green-500"}):u.jsx(j4,{className:"w-3.5 h-3.5"})})]})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx("div",{className:"flex gap-1 flex-wrap",children:ne.notification_channels.map(oe=>u.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-azure-border dark:bg-matrix-primary/20 text-azure-text-secondary dark:text-matrix-secondary capitalize",children:oe},oe))})}),u.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ne.trigger_count}),u.jsx("td",{className:"px-4 py-3",children:u.jsx("button",{onClick:()=>Z(ne),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ne.enabled?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:ne.enabled?u.jsxs(u.Fragment,{children:[u.jsx(wg,{className:"w-3.5 h-3.5"})," Enabled"]}):u.jsxs(u.Fragment,{children:[u.jsx(kg,{className:"w-3.5 h-3.5"})," Disabled"]})})}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>$(ne),title:"Edit",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:u.jsx(tc,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>m(ne),title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",children:u.jsx(ha,{className:"w-4 h-4"})})]})})]},ne.id))})]})})}),u.jsxs(Lr,{open:n,onOpenChange:a,children:[u.jsx(Pr,{children:u.jsx(Ur,{className:"text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Webhook":"New Webhook"})}),u.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[u.jsxs("div",{children:[u.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",u.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),u.jsx("input",{type:"text",value:l.name,onChange:ne=>{f({...l,name:ne.target.value.toLowerCase().replace(/\s+/g,"-")}),T(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&&u.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",u.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),u.jsx("textarea",{rows:5,value:l.prompt,onChange:ne=>f({...l,prompt:ne.target.value}),placeholder:"Describe what Apoc should do when this webhook fires. The received payload will be appended automatically.",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight resize-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),u.jsx("div",{className:"flex gap-4",children:wq.map(ne=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(ne),onChange:()=>le(ne),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),u.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:ne})]},ne))})]}),O&&u.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:O}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.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"}),u.jsx("button",{onClick:M,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"})]})]})]}),u.jsxs(Lr,{open:!!h,onOpenChange:ne=>!ne&&m(null),children:[u.jsx(Pr,{children:u.jsx(Ur,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),u.jsxs("div",{className:"p-6 space-y-4",children:[u.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",u.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.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"}),u.jsx("button",{onClick:U,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},zq={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},lS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},cS=({status:e})=>e==="completed"?u.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[u.jsx(yg,{className:"w-4 h-4"}),u.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?u.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[u.jsx(Ll,{className:"w-4 h-4"}),u.jsx("span",{className:"text-xs",children:"Failed"})]}):u.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[u.jsx(_r,{className:"w-4 h-4 animate-pulse"}),u.jsx("span",{className:"text-xs",children:"Pending"})]}),Fu=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),jq=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},_q=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),{data:s=[],mutate:c}=We(["/webhooks/notifications",e],()=>Fa.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=s.filter(g=>!g.read).length,f=async g=>{g.length!==0&&(await Fa.markRead(g),await c())},h=()=>{const g=s.filter(x=>!x.read).map(x=>x.id);f(g)},m=async g=>{a(g),g.read||await f([g.id])};return u.jsxs(Le.div,{variants:zq,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs(Le.div,{variants:lS,className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:"relative w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:[u.jsx($l,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"}),l>0&&u.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})]}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Notifications"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),u.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[u.jsxs(Ka,{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:[u.jsx(QE,{className:"w-4 h-4"}),"Back to Webhooks"]}),u.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:[u.jsx(R4,{className:"w-4 h-4"}),"Unread only"]}),l>0&&u.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:[u.jsx(f4,{className:"w-4 h-4"}),"Mark all read"]})]})]}),u.jsx(Le.div,{variants:lS,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),u.jsx("tbody",{children:s.length===0?u.jsx("tr",{children:u.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=>u.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:[u.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),u.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(cS,{status:g.status})}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:Fu(g.created_at)}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?Fu(g.completed_at):"—"}),u.jsx("td",{className:"px-4 py-3",children:u.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:u.jsx(ec,{className:"w-4 h-4"})})})]},g.id))})]})})}),u.jsxs(Lr,{open:!!n,onOpenChange:g=>!g&&a(null),children:[u.jsx(Pr,{children:u.jsxs(Ur,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx($l,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&u.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[u.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[u.jsx(cS,{status:n.status}),u.jsx("span",{children:Fu(n.created_at)}),n.completed_at&&u.jsxs("span",{children:["→ ",Fu(n.completed_at)]})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),u.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:jq(n.payload)})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),u.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??u.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),u.jsx("div",{className:"flex justify-end pt-2",children:u.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"})})]})]})]})},Nq={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},qu={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},Cq={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function U2({status:e}){const t="inline-flex items-center gap-1 text-xs font-medium rounded-full px-2 py-0.5 border";return e==="completed"?u.jsxs("span",{className:`${t} text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20 border-emerald-200 dark:border-emerald-700/50`,children:[u.jsx(yg,{className:"w-3 h-3"}),"Completed"]}):e==="failed"?u.jsxs("span",{className:`${t} text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-700/50`,children:[u.jsx(Ll,{className:"w-3 h-3"}),"Failed"]}):e==="running"?u.jsxs("span",{className:`${t} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-700/50`,children:[u.jsx(VS,{className:"w-3 h-3 animate-spin"}),"Running"]}):e==="cancelled"?u.jsxs("span",{className:`${t} text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-900 border-zinc-200 dark:border-zinc-700`,children:[u.jsx(Ll,{className:"w-3 h-3"}),"Cancelled"]}):u.jsxs("span",{className:`${t} text-yellow-600 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-700/50`,children:[u.jsx(_r,{className:"w-3 h-3"}),"Pending"]})}function V2({agent:e}){return u.jsx("span",{className:"inline-flex items-center text-[10px] font-medium font-mono rounded px-1.5 py-0.5 border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary uppercase",children:e})}function B2({channel:e}){return u.jsx("span",{className:"inline-flex items-center text-[10px] font-medium rounded px-1.5 py-0.5 border border-zinc-200 dark:border-zinc-700 bg-zinc-100 dark:bg-zinc-900 text-zinc-500 dark:text-zinc-400 uppercase",children:e})}const uS=e=>e?new Date(e).toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",dS=e=>e?new Date(e).toLocaleString():"—";function Tq({task:e,onClose:t,onCancel:n,onRetry:a}){const s=e.status==="pending"||e.status==="running",c=e.status==="failed";return u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),u.jsxs("div",{className:"relative bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-azure-border dark:border-matrix-primary shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx("div",{className:"w-9 h-9 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 flex items-center justify-center shrink-0",children:u.jsx(Ul,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight",children:"Task Details"}),u.jsx(U2,{status:e.status})]}),u.jsx("p",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-tertiary mt-0.5 truncate",children:e.id})]})]}),u.jsx("button",{onClick:t,className:"p-1.5 rounded text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight hover:bg-azure-surface dark:hover:bg-zinc-900 transition-colors shrink-0",children:u.jsx(Bi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"overflow-y-auto flex-1 p-5 space-y-5",children:[u.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-sm",children:[{label:"Agent",value:u.jsx(V2,{agent:e.agent})},{label:"Channel",value:u.jsx(B2,{channel:e.origin_channel})},{label:"Attempts",value:`${e.attempt_count} / ${e.max_attempts}`},{label:"Session",value:u.jsx("span",{className:"font-mono text-xs",children:e.session_id})},{label:"Created",value:dS(e.created_at)},{label:"Finished",value:dS(e.finished_at)}].map(({label:l,value:f})=>u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:l}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary",children:f})]},l))}),u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Input"}),u.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed font-mono",children:e.input})]}),e.output&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Output"}),u.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-64 whitespace-pre-wrap leading-relaxed font-mono",children:e.output})]}),e.error&&u.jsxs("div",{children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-red-500 mb-2 flex items-center gap-1",children:[u.jsx(lo,{className:"w-3 h-3"})," Error"]}),u.jsx("pre",{className:"rounded-lg bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800/50 p-4 text-xs text-red-600 dark:text-red-400 overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed font-mono",children:e.error})]})]}),(s||c)&&u.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t border-azure-border dark:border-matrix-primary shrink-0",children:[s&&u.jsx("button",{onClick:n,className:"px-4 py-2 rounded text-sm border border-red-300 dark:border-red-700/60 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:"Cancel Task"}),c&&u.jsx("button",{onClick:a,className:"px-4 py-2 rounded text-sm 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:"Retry Task"})]})]})]})}const Eq={Pending:"text-yellow-600 dark:text-yellow-400",Running:"text-blue-600 dark:text-blue-400",Completed:"text-emerald-600 dark:text-emerald-400",Failed:"text-red-600 dark:text-red-400",Cancelled:"text-zinc-500 dark:text-zinc-400",Total:"text-azure-text dark:text-matrix-highlight"};function $s({label:e,value:t}){return u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black px-4 py-3",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary",children:e}),u.jsx("p",{className:`text-2xl font-bold mt-0.5 ${Eq[e]??"text-azure-text dark:text-matrix-secondary"}`,children:t})]})}function Aq(){const[e,t]=z.useState(""),[n,a]=z.useState(""),[s,c]=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:x}=We("/tasks/stats",()=>qa.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=We(["/tasks",g],()=>qa.list(g),{refreshInterval:3e3}),j="px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-white dark:bg-black text-azure-text dark:text-matrix-secondary text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight";return u.jsxs(Le.div,{variants:Nq,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs(Le.div,{variants:qu,className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Ul,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Tasks"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),u.jsxs(Le.div,{variants:qu,className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[u.jsx($s,{label:"Pending",value:x?.pending??0}),u.jsx($s,{label:"Running",value:x?.running??0}),u.jsx($s,{label:"Completed",value:x?.completed??0}),u.jsx($s,{label:"Failed",value:x?.failed??0}),u.jsx($s,{label:"Cancelled",value:x?.cancelled??0}),u.jsx($s,{label:"Total",value:x?.total??0})]}),u.jsxs(Le.div,{variants:qu,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-white dark:bg-black grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[u.jsxs("select",{className:j,value:e,onChange:S=>t(S.target.value||""),children:[u.jsx("option",{value:"",children:"All status"}),Object.entries(Cq).map(([S,O])=>u.jsx("option",{value:S,children:O},S))]}),u.jsxs("select",{className:j,value:n,onChange:S=>a(S.target.value||""),children:[u.jsx("option",{value:"",children:"All agents"}),u.jsx("option",{value:"apoc",children:"Apoc"}),u.jsx("option",{value:"neo",children:"Neo"}),u.jsx("option",{value:"smith",children:"Smith"}),u.jsx("option",{value:"trinit",children:"Trinity"})]}),u.jsxs("select",{className:j,value:s,onChange:S=>c(S.target.value||""),children:[u.jsx("option",{value:"",children:"All channels"}),u.jsx("option",{value:"telegram",children:"Telegram"}),u.jsx("option",{value:"discord",children:"Discord"}),u.jsx("option",{value:"ui",children:"UI"}),u.jsx("option",{value:"api",children:"API"}),u.jsx("option",{value:"webhook",children:"Webhook"}),u.jsx("option",{value:"cli",children:"CLI"})]}),u.jsx("input",{className:`${j} placeholder:text-azure-text-secondary/50 dark:placeholder:text-matrix-secondary/40`,value:l,onChange:S=>f(S.target.value),placeholder:"Filter by session ID"})]}),u.jsx(Le.div,{variants:qu,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm min-w-[820px]",children:[u.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:u.jsx("tr",{children:[{label:"ID",cls:"w-24"},{label:"Status",cls:"w-32"},{label:"Agent",cls:"w-24"},{label:"Channel",cls:"w-24"},{label:"Session",cls:"w-28"},{label:"Attempts",cls:"w-20"},{label:"Created",cls:"w-36"},{label:"Finished",cls:"w-36"},{label:"",cls:"w-16"}].map(S=>u.jsx("th",{className:`text-left px-4 py-3 text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary ${S.cls}`,children:S.label},S.label))})}),u.jsx("tbody",{children:b.length===0?u.jsx("tr",{children:u.jsxs("td",{colSpan:9,className:"px-4 py-12 text-center text-azure-text-secondary dark:text-matrix-tertiary",children:[u.jsx(Ga,{className:"w-5 h-5 mx-auto mb-2 opacity-40"}),"No tasks found."]})}):b.map(S=>u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/60 dark:hover:bg-zinc-900/50 transition-colors",children:[u.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:S.id.slice(0,8)}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(U2,{status:S.status})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(V2,{agent:S.agent})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(B2,{channel:S.origin_channel})}),u.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:S.session_id?S.session_id.slice(0,10):"—"}),u.jsxs("td",{className:"px-4 py-3 text-center text-azure-text-secondary dark:text-matrix-secondary text-xs",children:[S.attempt_count,"/",S.max_attempts]}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:uS(S.created_at)}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:uS(S.finished_at)}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{onClick:()=>m(S),className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"View details",children:u.jsx(ec,{className:"w-3.5 h-3.5"})}),(S.status==="pending"||S.status==="running")&&u.jsx("button",{onClick:async()=>{await qa.cancel(S.id),v()},className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Cancel task",children:u.jsx(n4,{className:"w-3.5 h-3.5"})})]})})]},S.id))})]})})}),h&&u.jsx(Tq,{task:h,onClose:()=>m(null),onCancel:async()=>{await qa.cancel(h.id),m(null),v()},onRetry:async()=>{await qa.retry(h.id),m(null),v()}})]})}const rp={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},fS={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},Oq={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 Mq(){return ge.get("/trinity/databases")}function Rq(){const{data:e,error:t}=We("/trinity/databases",Mq,{refreshInterval:3e4}),[n,a]=z.useState(!1),[s,c]=z.useState(null),[l,f]=z.useState(fS),[h,m]=z.useState(!1),[g,x]=z.useState(null),[b,v]=z.useState({}),[j,S]=z.useState(null),[O,T]=z.useState({}),[E,C]=z.useState(null),[$,D]=z.useState(null),[M,Z]=z.useState(null),[U,K]=z.useState(!1),de=()=>{c(null),f(fS),K(!1),x(null),a(!0)},ae=w=>{c(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}),K(!!w.connection_string),x(null),a(!0)},le=async()=>{if(m(!0),x(null),!U&&!l.database_name.trim()){x(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};U?(!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 ge.put(`/trinity/databases/${s.id}`,w):await ge.post("/trinity/databases",w),await Pn("/trinity/databases"),a(!1)}catch(w){x(w.message||"Failed to save database")}finally{m(!1)}},ne=w=>{Z(w)},oe=async()=>{if(!M)return;const w=M.id;D(w);try{await ge.delete(`/trinity/databases/${w}`),await Pn("/trinity/databases")}catch(J){alert(`Delete failed: ${J.message}`)}finally{D(null),Z(null)}},ie=async w=>{S(w);try{const J=await ge.post(`/trinity/databases/${w}/test`,{});T(he=>({...he,[w]:J.success}))}catch{T(J=>({...J,[w]:!1}))}finally{S(null)}},B=async w=>{C(w);try{await ge.post(`/trinity/databases/${w}/refresh-schema`,{}),await Pn("/trinity/databases")}catch(J){alert(`Schema refresh failed: ${J.message}`)}finally{C(null)}},V=w=>{v(J=>({...J,[w]:!J[w]}))},G=w=>{w!=="mongodb"&&K(!1),f(J=>({...J,type:w,port:rp[w]?String(rp[w]):""}))},ce=w=>{f(J=>({...J,[w]:!J[w]}))};if(t)return u.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const A="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",_="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",H=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 u.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Hs,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Trinity Databases"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Register databases for Trinity to access and query."})]})]}),u.jsxs("button",{onClick:de,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:[u.jsx(Ws,{className:"w-4 h-4"}),"Register Database"]})]}),e?e.length===0?u.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:[u.jsx(Hs,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),u.jsx("p",{className:"font-medium",children:"No databases registered"}),u.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):u.jsx("div",{className:"space-y-4",children:e.map(w=>{const J=w.schema_json?JSON.parse(w.schema_json):null,he=!!J?.databases,pe=he?J.databases.reduce((Ue,Ye)=>Ue+Ye.tables.length,0):J?.tables?.length??0,xe=he?J.databases.length:0,Pe=w.type==="mongodb"?"collection":"table",Ee=w.type==="mongodb"?"collections":"tables",xt=O[w.id],L=b[w.id],Oe=H(w);return u.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[u.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[u.jsx(Hs,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),u.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}),xt===!0&&u.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[u.jsx(Ju,{className:"w-3 h-3"})," Connected"]}),xt===!1&&u.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[u.jsx(IS,{className:"w-3 h-3"})," Failed"]}),Oe.length>0&&u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(up,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),Oe.map(Ue=>u.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:Ue},Ue))]})]}),u.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&&xe>0&&u.jsxs("span",{className:"ml-2 opacity-70",children:["· ",xe," database",xe!==1?"s":""," · ",pe," ",pe!==1?Ee:Pe]}),!he&&pe>0&&u.jsxs("span",{className:"ml-2 opacity-70",children:["· ",pe," ",pe!==1?Ee:Pe]}),w.schema_updated_at&&u.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),u.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[u.jsx("button",{onClick:()=>ie(w.id),disabled:j===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:j===w.id?u.jsx(Ju,{className:"w-4 h-4 animate-pulse"}):u.jsx(Ju,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>B(w.id),disabled:E===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:u.jsx(Ga,{className:`w-4 h-4 ${E===w.id?"animate-spin":""}`})}),u.jsx("button",{onClick:()=>ae(w),title:"Edit",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors text-xs font-medium px-2",children:"Edit"}),u.jsx("button",{onClick:()=>ne(w),disabled:$===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:u.jsx(ha,{className:"w-4 h-4"})}),J&&u.jsx("button",{onClick:()=>V(w.id),title:L?"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:L?u.jsx(LS,{className:"w-4 h-4"}):u.jsx(xg,{className:"w-4 h-4"})})]})]}),L&&J&&u.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[u.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:he?`${xe} database${xe!==1?"s":""} — ${pe} ${pe!==1?Ee:Pe} total`:`Schema — ${pe} ${pe!==1?Ee:Pe}`}),u.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:he?J.databases?.map(Ue=>u.jsxs("div",{className:"text-xs",children:[u.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[u.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:Ue.name}),u.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",Ue.tables.length," ",Ue.tables.length!==1?Ee:Pe,")"]})]}),u.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[Ue.tables.map(Ye=>u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:Ye.name}),u.jsx("div",{className:"pl-3 space-y-0.5",children:Ye.columns?.map(wt=>u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[u.jsx("span",{children:wt.name}),u.jsx("span",{className:"opacity-50 ml-2",children:wt.type}),wt.nullable===!1&&u.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},wt.name))})]},Ye.name)),Ue.tables.length===0&&u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ee]})]})]},Ue.name)):J.tables?.map(Ue=>u.jsxs("div",{className:"text-xs",children:[u.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:Ue.name}),u.jsx("div",{className:"pl-3 space-y-0.5",children:Ue.columns?.map(Ye=>u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[u.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:Ye.name}),u.jsx("span",{className:"opacity-50 ml-2",children:Ye.type}),Ye.nullable===!1&&u.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},Ye.name))})]},Ue.name))})]})]},w.id)})}):u.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),u.jsx(x_,{isOpen:!!M,onClose:()=>Z(null),onConfirm:oe,title:"Delete database",description:`Remove "${M?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),u.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:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[u.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Database":"Register Database"}),u.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:u.jsx(Bi,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:_,children:"Name *"}),u.jsx("input",{className:A,value:l.name,onChange:w=>f(J=>({...J,name:w.target.value})),placeholder:"My Production DB"})]}),u.jsxs("div",{children:[u.jsx("label",{className:_,children:"Type *"}),u.jsxs("select",{className:A,value:l.type,onChange:w=>G(w.target.value),children:[u.jsx("option",{value:"postgresql",children:"PostgreSQL"}),u.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),u.jsx("option",{value:"sqlite",children:"SQLite"}),u.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{type:"button",onClick:()=>K(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${U?"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"}),u.jsx("button",{type:"button",onClick:()=>K(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${U?"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"&&U?u.jsxs("div",{children:[u.jsxs("label",{className:_,children:["Connection String ",s&&u.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),u.jsx("input",{className:A,type:"password",value:l.connection_string,onChange:w=>f(J=>({...J,connection_string:w.target.value})),placeholder:s?"unchanged":"mongodb://user:pass@host:27017/dbname"}),u.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."})]}):u.jsxs(u.Fragment,{children:[l.type!=="sqlite"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:_,children:"Host"}),u.jsx("input",{className:A,value:l.host,onChange:w=>f(J=>({...J,host:w.target.value})),placeholder:"localhost"})]}),u.jsxs("div",{children:[u.jsx("label",{className:_,children:"Port"}),u.jsx("input",{className:A,type:"number",value:l.port,onChange:w=>f(J=>({...J,port:w.target.value})),placeholder:String(rp[l.type]||"")})]})]}),u.jsxs("div",{children:[u.jsxs("label",{className:_,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),u.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(J=>({...J,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:_,children:"Username"}),u.jsx("input",{className:A,value:l.username,onChange:w=>f(J=>({...J,username:w.target.value})),placeholder:"postgres"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:_,children:["Password ",s&&u.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),u.jsx("input",{className:A,type:"password",value:l.password,onChange:w=>f(J=>({...J,password:w.target.value})),placeholder:s?"unchanged":"••••••••"}),u.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."})]})]})]}),u.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(up,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),u.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),u.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."}),u.jsx("div",{className:"space-y-2",children:Oq[l.type]?.map(({key:w,label:J,description:he})=>u.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[u.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[u.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>ce(w),className:"sr-only"}),u.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]&&u.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:u.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:J}),u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:he})]})]},w))})]}),g&&u.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),u.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[u.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"}),u.jsx("button",{onClick:le,disabled:h||!l.name,className:"px-4 py-2 text-sm font-medium bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors disabled:opacity-50",children:h?"Saving...":s?"Update":"Register"})]})]})]})]})}const Dq={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 $q({jobId:e}){const{data:t,isLoading:n}=FL(e,50);return n?u.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?u.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary italic",children:"No executions yet."}):u.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary dark:bg-zinc-900 overflow-hidden",children:u.jsxs("table",{className:"w-full text-xs font-mono",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary",children:[u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Triggered At"}),u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Completed At"}),u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Status"}),u.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Error"})]})}),u.jsx("tbody",{children:t.map(a=>u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0",children:[u.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:new Date(a.triggered_at).toLocaleString()}),u.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:a.completed_at?new Date(a.completed_at).toLocaleString():"—"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold uppercase ${Dq[a.status]}`,children:a.status})}),u.jsx("td",{className:"px-3 py-2 dark:text-red-400 max-w-xs truncate",children:a.error??"—"})]},a.id))})]})})}function Lq({enabled:e}){return u.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 hS(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function mS(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function Pq({onEdit:e}){const{data:t,isLoading:n}=HL(),[a,s]=z.useState(null),[c,l]=z.useState(null),[f,h]=z.useState(null),m=async x=>{l(x.id);try{x.enabled?await Li.disableJob(x.id):await Li.enableJob(x.id),await Pn(b=>typeof b=="string"&&b.startsWith("/chronos"))}finally{l(null)}},g=async()=>{if(f){l(f.id);try{await Li.deleteJob(f.id),await Pn(x=>typeof x=="string"&&x.startsWith("/chronos"))}finally{l(null),h(null)}}};return n?u.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?u.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 ",u.jsx("strong",{className:"dark:text-matrix-highlight",children:"New Job"})," to get started."]}):u.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary overflow-hidden",children:[u.jsxs("table",{className:"w-full text-sm font-mono",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900",children:[u.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Prompt"}),u.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"}),u.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"}),u.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"}),u.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Status"}),u.jsx("th",{className:"px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium text-right",children:"Actions"})]})}),u.jsx("tbody",{children:t.map(x=>u.jsxs(u.Fragment,{children:[u.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:[u.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary max-w-xs",children:[u.jsx("span",{title:x.prompt,children:hS(x.prompt,50)}),u.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:x.created_by})]}),u.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden md:table-cell text-xs",children:[u.jsx("div",{className:"capitalize",children:x.schedule_type}),u.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:x.schedule_expression,children:x.schedule_expression})]}),u.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:mS(x.next_run_at)}),u.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:mS(x.last_run_at)}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(Lq,{enabled:x.enabled})}),u.jsx("td",{className:"px-4 py-3",children:u.jsxs("div",{className:"flex items-center justify-end gap-1",children:[u.jsx("button",{title:a===x.id?"Hide history":"View history",onClick:()=>s(a===x.id?null:x.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===x.id?u.jsx(PS,{className:"w-4 h-4"}):u.jsx(Z4,{className:"w-4 h-4"})}),u.jsx("button",{title:"Edit",onClick:()=>e(x),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:u.jsx(cA,{className:"w-4 h-4"})}),u.jsx("button",{title:x.enabled?"Disable":"Enable",onClick:()=>m(x),disabled:c===x.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:x.enabled?u.jsx(oA,{className:"w-4 h-4"}):u.jsx(fA,{className:"w-4 h-4"})}),u.jsx("button",{title:"Delete",onClick:()=>h(x),disabled:c===x.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:u.jsx(ha,{className:"w-4 h-4"})})]})})]},x.id),a===x.id&&u.jsx("tr",{className:"bg-azure-surface dark:bg-zinc-900/50",children:u.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[u.jsx("div",{className:"text-xs font-bold dark:text-matrix-highlight mb-2",children:"Execution History"}),u.jsx($q,{jobId:x.id})]})},`${x.id}-history`)]}))})]}),u.jsx(P2,{isOpen:!!f,onClose:()=>h(null),onConfirm:g,title:"Delete Chronos Job",message:f?`Delete job "${hS(f.prompt,60)}"? This action cannot be undone.`:""})]})}function Uq({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=z.useState(null),[c,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 Li.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 u.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:c?u.jsxs("p",{className:"text-red-500 dark:text-red-400 flex items-center gap-1.5",children:[u.jsx("span",{children:"⚠"})," ",c]}):a?u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-azure-text-secondary dark:text-matrix-secondary",children:[u.jsx(_r,{className:"w-3.5 h-3.5 text-azure-primary dark:text-matrix-highlight shrink-0"}),u.jsx("span",{className:"font-medium dark:text-matrix-highlight",children:"Next run:"}),u.jsx("span",{children:h(a.next_run_at,n||"UTC")})]}),a.human_readable&&u.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary/70 pl-5",children:a.human_readable}),a.next_occurrences.length>0&&u.jsx("div",{className:"pl-5 space-y-0.5",children:a.next_occurrences.map((m,g)=>u.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",g+2,": ",m]},g))})]}):u.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})})}const Vq=["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"],Bq=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],Iq=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],Zq={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 Hq({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:c}=y_(),[l,f]=z.useState(""),[h,m]=z.useState("once"),[g,x]=z.useState(""),[b,v]=z.useState("UTC"),[j,S]=z.useState([]),[O,T]=z.useState(null),[E,C]=z.useState(!1),$=M=>{S(Z=>Z.includes(M)?Z.filter(U=>U!==M):[...Z,M])};z.useEffect(()=>{a?(f(a.prompt),m(a.schedule_type),x(a.schedule_expression),v(a.timezone),S(a.notify_channels??[])):(f(""),m("once"),x(""),v(c?.timezone??"UTC"),S([])),T(null)},[a,e,c?.timezone]);const D=async()=>{if(T(null),!l.trim()){T("Prompt is required");return}if(!g.trim()){T("Schedule expression is required");return}C(!0);try{if(s&&a){const M={prompt:l,schedule_expression:g,timezone:b,notify_channels:j};await Li.updateJob(a.id,M)}else{const M={prompt:l,schedule_type:h,schedule_expression:g,timezone:b,notify_channels:j};await Li.createJob(M)}await Pn(M=>typeof M=="string"&&M.startsWith("/chronos")),n(),t()}catch(M){T(M.message??"Failed to save job")}finally{C(!1)}};return e?u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[u.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),u.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:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[u.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"}),u.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:u.jsx(Bi,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Ge,{label:"Prompt",value:l,onChange:M=>f(M.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&u.jsx(mn,{label:"Schedule Type",value:h,onChange:M=>m(M.target.value),options:Iq}),u.jsxs("div",{children:[u.jsx(Ge,{label:"Schedule Expression",value:g,onChange:M=>x(M.target.value),placeholder:Zq[h]}),u.jsx(Uq,{scheduleExpression:g,scheduleType:h,timezone:b})]}),u.jsx(mn,{label:"Timezone",value:b,onChange:M=>v(M.target.value),options:Vq.map(M=>({value:M,label:M}))}),u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:["Notify Channels ",u.jsx("span",{className:"text-xs font-normal opacity-60",children:"(empty = all active channels)"})]}),u.jsx("div",{className:"flex gap-4",children:Bq.map(({value:M,label:Z})=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:j.includes(M),onChange:()=>$(M),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),u.jsx("span",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary capitalize",children:Z})]},M))})]}),O&&u.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:O})]}),u.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-azure-border dark:border-matrix-primary",children:[u.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"}),u.jsx("button",{onClick:D,disabled:E,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:E?"Saving…":s?"Update":"Create"})]})]})]}):null}function Fq(){const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=f=>{a(f),t(!0)},c=()=>{t(!1),a(null)},l=()=>{Pn(f=>typeof f=="string"&&f.startsWith("/chronos"))};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(_r,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Chronos"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:"Temporal Intent Engine — schedule prompts for the Oracle."})]})]}),u.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:[u.jsx(Ws,{className:"w-4 h-4"}),"New Job"]})]}),u.jsx(Pq,{onEdit:s}),u.jsx(Hq,{isOpen:e,onClose:c,onCreated:l,editJob:n})]})}const pS={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},rd={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function qq({skill:e,onToggle:t,onView:n}){return u.jsxs(Le.div,{variants:rd,className:`rounded-lg border flex flex-col transition-all ${e.enabled?"border-azure-primary/50 dark:border-matrix-primary bg-white dark:bg-black":"border-azure-border dark:border-matrix-primary/30 bg-azure-surface/50 dark:bg-black"}`,children:[u.jsxs("div",{className:"p-4 flex items-start gap-3 flex-1",children:[u.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${e.enabled?"bg-azure-primary/10 dark:bg-matrix-highlight/10":"bg-azure-surface dark:bg-zinc-900"}`,children:u.jsx(Pi,{className:`w-4 h-4 ${e.enabled?"text-azure-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-tertiary"}`})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h3",{className:`font-semibold truncate ${e.enabled?"text-azure-text dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary"}`,children:e.name}),e.version&&u.jsxs("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-1.5 py-0.5 shrink-0",children:["v",e.version]}),!e.enabled&&u.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded px-1.5 py-0.5 shrink-0",children:"disabled"})]}),u.jsx("p",{className:`text-sm mt-1.5 line-clamp-2 leading-relaxed ${e.enabled?"text-azure-text-secondary dark:text-matrix-secondary":"text-azure-text-secondary/70 dark:text-matrix-tertiary"}`,children:e.description}),e.tags&&e.tags.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:e.tags.map(a=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary",children:[u.jsx(vg,{className:"w-2.5 h-2.5"}),a]},a))})]})]}),u.jsxs("div",{className:"px-4 py-3 border-t border-azure-border dark:border-matrix-primary/30 flex items-center justify-between gap-2",children:[e.author?u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-azure-text-secondary dark:text-matrix-tertiary min-w-0",children:[u.jsx(Sg,{className:"w-3 h-3 shrink-0"}),u.jsx("span",{className:"truncate",children:e.author})]}):u.jsx("div",{}),u.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u.jsx("button",{onClick:n,className:"p-1.5 rounded border border-azure-border dark:border-matrix-primary/50 text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-primary dark:hover:text-matrix-highlight hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"View details",children:u.jsx(ec,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:t,className:`p-1.5 rounded border transition-colors ${e.enabled?"border-emerald-300 dark:border-emerald-700/60 text-emerald-500 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20":"border-azure-border dark:border-matrix-primary/40 text-zinc-400 dark:text-zinc-600 hover:text-azure-text dark:hover:text-matrix-secondary hover:border-azure-border dark:hover:border-matrix-primary"}`,title:e.enabled?"Disable skill":"Enable skill",children:e.enabled?u.jsx(wg,{className:"w-4 h-4"}):u.jsx(kg,{className:"w-4 h-4"})})]})]})]})}function Gq({skill:e,open:t,onOpenChange:n}){return!t||!e?null:u.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>n(!1)}),u.jsxs("div",{className:"relative bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4 border-b border-azure-border dark:border-matrix-primary shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx("div",{className:"w-9 h-9 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 flex items-center justify-center shrink-0",children:u.jsx(Pi,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight truncate",children:e.name}),e.version&&u.jsxs("span",{className:"text-[10px] font-mono text-azure-text-secondary dark:text-matrix-tertiary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-1.5 py-0.5 shrink-0",children:["v",e.version]})]}),e.author&&u.jsxs("div",{className:"flex items-center gap-1 mt-0.5 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:[u.jsx(Sg,{className:"w-3 h-3 shrink-0"}),e.author]})]})]}),u.jsx("button",{onClick:()=>n(!1),className:"p-1.5 rounded text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight hover:bg-azure-surface dark:hover:bg-zinc-900 transition-colors shrink-0",children:u.jsx(Bi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"overflow-y-auto flex-1 p-5 space-y-5",children:[e.description&&u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary leading-relaxed",children:e.description}),u.jsx("div",{className:"flex flex-col gap-2",children:u.jsxs("div",{className:"flex items-start gap-2 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:[u.jsx(O4,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{className:"break-all font-mono text-azure-text dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 rounded px-2 py-0.5",children:e.path})]})}),e.tags&&e.tags.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Tags"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.tags.map(a=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded border border-azure-primary/20 dark:border-matrix-primary/40 bg-azure-primary/5 dark:bg-matrix-primary/10 text-azure-primary dark:text-matrix-secondary",children:[u.jsx(vg,{className:"w-2.5 h-2.5"}),a]},a))})]}),e.examples&&e.examples.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"Examples"}),u.jsx("ul",{className:"space-y-1.5",children:e.examples.map((a,s)=>u.jsxs("li",{className:"flex items-start gap-2 text-sm text-azure-text-secondary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/30 rounded px-3 py-2",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary font-mono text-xs mt-0.5 shrink-0",children:[s+1,"."]}),a]},s))})]}),e.content&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-azure-text-secondary dark:text-matrix-tertiary mb-2",children:"SKILL.md"}),u.jsx("pre",{className:"rounded-lg bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary/40 p-4 text-xs text-azure-text-secondary dark:text-matrix-secondary overflow-auto max-h-72 whitespace-pre-wrap leading-relaxed font-mono",children:e.content})]})]})]})]})}function Yq(){const[e,t]=z.useState(null),[n,a]=z.useState(!1),[s,c]=z.useState(!1),[l,f]=z.useState(!1),[h,m]=z.useState(null),[g,x]=z.useState(null),b=z.useRef(null),{data:v,mutate:j,isLoading:S}=We("/skills",()=>Oi.fetchSkills(),{refreshInterval:1e4}),O=v?.skills??[],T=v?.enabled??0,E=async()=>{await Oi.reloadSkills(),j()},C=async Z=>{Z.enabled?await Oi.disableSkill(Z.name):await Oi.enableSkill(Z.name),j()},$=async Z=>{a(!0);try{const U=await Oi.fetchSkill(Z.name);t(U)}finally{a(!1)}},D=async Z=>{const U=Z.target.files?.[0];if(U){m(null),x(null),f(!0);try{const K=await Oi.uploadSkill(U);x(`Skill "${K.skill.name}" uploaded successfully!`),j(),b.current&&(b.current.value="")}catch(K){m({error:K.message||"Upload failed",details:K.details})}finally{f(!1)}}},M=()=>{m(null),x(null),c(!0)};return u.jsxs(Le.div,{variants:pS,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs(Le.div,{variants:rd,className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Pi,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Skills"}),u.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:[O.length," skill",O.length!==1?"s":"",", ",T," enabled"]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:M,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:[u.jsx(_u,{className:"w-4 h-4"}),"Upload"]}),u.jsxs("button",{onClick:E,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:[u.jsx(Ga,{className:"w-4 h-4"}),"Reload"]})]})]}),S?u.jsxs(Le.div,{variants:rd,className:"text-center py-12",children:[u.jsx(Ga,{className:"w-8 h-8 animate-spin mx-auto text-azure-text-secondary dark:text-matrix-dim"}),u.jsx("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-dim",children:"Loading skills..."})]}):O.length===0?u.jsxs(Le.div,{variants:rd,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[u.jsx(Pi,{className:"w-12 h-12 mx-auto text-azure-text-tertiary dark:text-matrix-dim"}),u.jsx("h3",{className:"mt-4 text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:"No skills found"}),u.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"," ",u.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"~/.morpheus/skills/"}),". Each skill folder must contain a"," ",u.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file with frontmatter."]}),u.jsxs("button",{onClick:M,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:[u.jsx(_u,{className:"w-4 h-4"}),"Upload Skill"]})]}):u.jsx(Le.div,{variants:pS,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:O.map(Z=>u.jsx(qq,{skill:Z,onToggle:()=>C(Z),onView:()=>$(Z)},Z.name))}),u.jsx(Gq,{skill:e,open:!!e,onOpenChange:Z=>!Z&&t(null)}),u.jsxs(Lr,{open:s,onOpenChange:c,children:[u.jsx(Pr,{children:u.jsx(Ur,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_u,{className:"w-5 h-5"}),"Upload Skill"]})})}),u.jsxs("div",{className:"space-y-4",children:[u.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 ",u.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file."]}),u.jsxs("div",{className:"border-2 border-dashed border-azure-border dark:border-matrix-primary rounded-lg p-6",children:[u.jsx("input",{ref:b,type:"file",accept:".zip,application/zip,application/x-zip-compressed",onChange:D,disabled:l,className:"hidden",id:"skill-upload-input"}),u.jsxs("label",{htmlFor:"skill-upload-input",className:`flex flex-col items-center gap-2 cursor-pointer ${l?"opacity-50 cursor-not-allowed":""}`,children:[l?u.jsx(Ga,{className:"w-8 h-8 animate-spin text-azure-primary dark:text-matrix-primary"}):u.jsx(_u,{className:"w-8 h-8 text-azure-text-tertiary dark:text-matrix-dim"}),u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:l?"Uploading...":"Click to select ZIP file"})]})]}),h&&u.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:[u.jsx(lo,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:h.error}),h.details&&u.jsx("p",{className:"text-xs text-red-600 dark:text-red-300 mt-1",children:h.details})]})]}),g&&u.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:[u.jsx(US,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),u.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:g})]}),u.jsxs("div",{className:"rounded-lg bg-azure-hover dark:bg-zinc-900 p-3",children:[u.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"ZIP Structure Example"}),u.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&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsx(Ga,{className:"w-8 h-8 animate-spin text-white"})})]})}const Jq={name:"",host:"",port:7900,auth_token:"",tls:!1};function Kq(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),a=Math.floor(e%3600/60);return t>0?`${t}d ${n}h`:n>0?`${n}h ${a}m`:`${a}m`}function Xq(e,t){const n=e>=1024?`${(e/1024).toFixed(1)}GB`:`${Math.round(e)}MB`,a=t>=1024?`${(t/1024).toFixed(1)}GB`:`${Math.round(t)}MB`;return`${n} / ${a}`}function Qq({state:e}){return e==="online"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-emerald-500 bg-emerald-500/10 border border-emerald-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),"online"]}):e==="connecting"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-amber-500 bg-amber-500/10 border border-amber-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),"connecting"]}):e==="error"?u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-500 bg-red-500/10 border border-red-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),"error"]}):u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-zinc-500 bg-zinc-500/10 border border-zinc-500/30 rounded-full px-2 py-0.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-500"}),"offline"]})}function Wq({cap:e}){const n={filesystem:"text-blue-400 bg-blue-400/10 border-blue-400/30",shell:"text-yellow-400 bg-yellow-400/10 border-yellow-400/30",git:"text-orange-400 bg-orange-400/10 border-orange-400/30",browser:"text-purple-400 bg-purple-400/10 border-purple-400/30",network:"text-cyan-400 bg-cyan-400/10 border-cyan-400/30",packages:"text-green-400 bg-green-400/10 border-green-400/30",processes:"text-pink-400 bg-pink-400/10 border-pink-400/30",system:"text-indigo-400 bg-indigo-400/10 border-indigo-400/30"}[e]??"text-zinc-400 bg-zinc-400/10 border-zinc-400/30";return u.jsx("span",{className:`text-[10px] font-medium border rounded px-1.5 py-0.5 ${n}`,children:e})}function eG({status:e,entry:t,onPing:n,onEdit:a,onDelete:s}){const[c,l]=z.useState(!1),f=e.state==="online";return u.jsxs("div",{className:`rounded-lg border bg-white dark:bg-black transition-all ${f?"border-emerald-500/40 dark:border-emerald-500/30":e.state==="error"?"border-red-500/40 dark:border-red-500/30":e.state==="connecting"?"border-amber-500/40 dark:border-amber-500/30":"border-azure-border dark:border-matrix-primary"}`,children:[u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center shrink-0 ${f?"bg-emerald-500/10":"bg-zinc-100 dark:bg-zinc-900"}`,children:u.jsx(SA,{className:`w-4 h-4 ${f?"text-emerald-500":"text-zinc-400 dark:text-matrix-tertiary"}`})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"font-semibold text-azure-text dark:text-matrix-highlight truncate",children:e.name}),u.jsx(Qq,{state:e.state}),t?.tls&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-500 bg-emerald-500/10 border border-emerald-500/30 rounded px-1.5 py-0.5",children:[u.jsx(K4,{className:"w-2.5 h-2.5"}),"TLS"]})]}),u.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary mt-0.5",children:[e.host,":",e.port]})]})]}),u.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u.jsx("button",{onClick:()=>n(e.name),className:"p-1.5 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 hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"Ping",children:u.jsx(BS,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>a(t??{name:e.name,host:e.host,port:e.port,auth_token:"",tls:!1}),className:"p-1.5 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 hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",title:"Edit",children:u.jsx(tc,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>s(e.name),className:"p-1.5 rounded border border-red-200 dark:border-red-800/50 text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-500 transition-colors",title:"Remove",children:u.jsx(ha,{className:"w-3.5 h-3.5"})})]})]}),e.error&&u.jsxs("div",{className:"mt-3 flex items-start gap-2 text-xs text-red-500 bg-red-500/10 border border-red-500/20 rounded p-2",children:[u.jsx(lo,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{children:e.error})]}),f&&e.stats&&u.jsx("div",{className:"mt-3 space-y-2",children:u.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"OS"}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:e.stats.os})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"Hostname"}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono truncate max-w-[120px]",children:e.stats.hostname})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary flex items-center gap-1",children:[u.jsx(bg,{className:"w-3 h-3"})," CPU"]}),u.jsxs("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:[e.stats.cpu_percent.toFixed(1),"%"]})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary flex items-center gap-1",children:[u.jsx(P4,{className:"w-3 h-3"})," RAM"]}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:Xq(e.stats.memory_used_mb,e.stats.memory_total_mb)})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsxs("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary flex items-center gap-1",children:[u.jsx(_r,{className:"w-3 h-3"})," Uptime"]}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:Kq(e.stats.uptime_seconds)})]}),e.config?.sandbox_dir&&u.jsxs("div",{className:"flex justify-between col-span-2",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary shrink-0",children:"Sandbox"}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono truncate text-right ml-2",children:e.config.sandbox_dir})]}),e.config&&u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"Read-only"}),u.jsx("span",{className:`font-medium ${e.config.readonly_mode?"text-amber-500":"text-emerald-500"}`,children:e.config.readonly_mode?"yes":"no"})]})]})}),!f&&e.lastSeen&&u.jsxs("div",{className:"mt-2 text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:["Last seen: ",new Date(e.lastSeen).toLocaleString()]})]}),e.capabilities.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:()=>l(!c),className:"w-full flex items-center justify-between px-4 py-2 border-t border-azure-border dark:border-matrix-primary/30 text-xs text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-secondary hover:bg-azure-surface/50 dark:hover:bg-zinc-900/50 transition-colors",children:[u.jsxs("span",{children:["Capabilities (",e.capabilities.length,")"]}),c?u.jsx(PS,{className:"w-3.5 h-3.5"}):u.jsx(LS,{className:"w-3.5 h-3.5"})]}),c&&u.jsxs("div",{className:"px-4 pb-4 pt-3 border-t border-azure-border dark:border-matrix-primary/30 bg-azure-surface/30 dark:bg-zinc-900/30",children:[u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.capabilities.map(h=>u.jsx(Wq,{cap:h},h))}),e.lastSeen&&u.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-tertiary mt-3",children:["Last seen: ",new Date(e.lastSeen).toLocaleString()]})]})]})]})}function gS({title:e,initial:t,isEdit:n,onSave:a,onClose:s,saving:c,error:l}){const[f,h]=z.useState(t),[m,g]=z.useState(null),x=()=>{if(!f.name.trim()){g("Name is required.");return}if(!f.host.trim()){g("Host is required.");return}if(!n&&!f.auth_token.trim()){g("Auth token is required.");return}g(null),a(f)};return u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:u.jsxs("div",{className:"bg-white dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-md",children:[u.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-azure-border dark:border-matrix-primary",children:[u.jsxs("h2",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Qs,{className:"w-4 h-4"}),e]}),u.jsx("button",{onClick:s,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text dark:hover:text-matrix-highlight transition-colors",children:u.jsx(Bi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"p-5 space-y-3",children:[(m||l)&&u.jsxs("div",{className:"flex items-start gap-2 text-sm text-red-500 bg-red-500/10 border border-red-500/20 rounded p-3",children:[u.jsx(lo,{className:"w-4 h-4 shrink-0 mt-0.5"}),u.jsx("span",{children:m||l})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx("div",{className:"col-span-2",children:u.jsx(Ge,{label:"Name",value:f.name,onChange:b=>h({...f,name:b.target.value}),disabled:n,helperText:n?"Name cannot be changed after creation.":"Unique identifier (lowercase, hyphens ok)."})}),u.jsx(Ge,{label:"Host",value:f.host,onChange:b=>h({...f,host:b.target.value}),placeholder:"localhost"}),u.jsx(It,{label:"Port",value:f.port,onChange:b=>h({...f,port:Number(b.target.value)}),min:1,max:65535}),u.jsx("div",{className:"col-span-2",children:u.jsx(Ge,{label:"Auth Token",value:f.auth_token,onChange:b=>h({...f,auth_token:b.target.value}),placeholder:n?"Leave blank to keep existing token":"Shared secret",helperText:n?"Leave blank to keep the current token.":void 0})})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx("input",{type:"checkbox",id:"smith-tls",checked:f.tls??!1,onChange:b=>h({...f,tls:b.target.checked}),className:"w-4 h-4 accent-azure-primary dark:accent-matrix-highlight"}),u.jsxs("label",{htmlFor:"smith-tls",className:"text-sm text-azure-text-secondary dark:text-matrix-secondary cursor-pointer",children:["Use TLS (",u.jsx("code",{className:"text-xs font-mono",children:"wss://"}),")"]})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t border-azure-border dark:border-matrix-primary",children:[u.jsx("button",{onClick:s,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"}),u.jsx("button",{onClick:x,disabled:c,className:"px-4 py-2 rounded text-sm 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:c?"Saving…":n?"Update Smith":"Add Smith"})]})]})})}function tG(){const{data:e,mutate:t}=We("/api/smiths",en.getSmithsList,{refreshInterval:1e4}),{data:n,mutate:a}=We("/api/smiths/config",en.getSmithsConfig),[s,c]=z.useState(null),[l,f]=z.useState(!1),[h,m]=z.useState(!1),[g,x]=z.useState(!1),[b,v]=z.useState(null),[j,S]=z.useState(!1),[O,T]=z.useState(null),[E,C]=z.useState(null),[$,D]=z.useState(!1);n&&!s&&c(n);const M=(V,G)=>{C({type:V,message:G}),setTimeout(()=>C(null),4e3)},Z=async V=>{try{const G=await en.pingSmith(V);M("success",`Ping ${V}: ${G.latency_ms}ms`)}catch(G){M("error",`Ping failed: ${G.message}`)}},U=async V=>{if(confirm(`Remove Smith "${V}" from the registry?`))try{await en.removeSmith(V),t(),a(),c(null),M("success",`Smith "${V}" removed.`)}catch(G){M("error",`Failed to remove: ${G.message}`)}},K=async V=>{if(s){if(s.entries.some(G=>G.name===V.name)){T(`Smith "${V.name}" already exists.`);return}S(!0),T(null);try{const G={...s,entries:[...s.entries,V]};await en.updateSmithsConfig(G),x(!1),c(null),t(),a(),M("success",`Smith "${V.name}" added.`)}catch(G){T(G.message)}finally{S(!1)}}},de=async V=>{if(s){S(!0),T(null);try{const G={...s,entries:s.entries.map(ce=>ce.name===V.name?V:ce)};await en.updateSmithsConfig(G),v(null),c(null),t(),a(),M("success",`Smith "${V.name}" updated.`)}catch(G){T(G.message)}finally{S(!1)}}},ae=async()=>{if(s){m(!0);try{await en.updateSmithsConfig(s),t(),a(),M("success","Settings saved."),f(!1)}catch(V){M("error",V.message)}finally{m(!1)}}},le=e?.smiths??[],ne=le.filter(V=>V.state==="online").length,oe=le.filter(V=>V.state==="offline"||V.state==="error").length,ie=le.filter(V=>V.state==="connecting").length,B={};return(s??n)?.entries?.forEach(V=>{B[V.name]=V}),u.jsxs("div",{className:"space-y-6",children:[E&&u.jsxs("div",{className:`fixed top-4 right-4 z-50 flex items-center gap-2 px-4 py-3 rounded-lg shadow-xl text-sm border ${E.type==="success"?"bg-emerald-50 dark:bg-emerald-900/30 border-emerald-300 dark:border-emerald-500/50 text-emerald-700 dark:text-emerald-400":"bg-red-50 dark:bg-red-900/30 border-red-300 dark:border-red-500/50 text-red-700 dark:text-red-400"}`,children:[E.type==="success"?u.jsx(up,{className:"w-4 h-4"}):u.jsx(lo,{className:"w-4 h-4"}),E.message]}),u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-azure-primary/10 dark:bg-matrix-highlight/10 border border-azure-primary/20 dark:border-matrix-highlight/30 flex items-center justify-center",children:u.jsx(Qs,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-bold text-azure-text dark:text-matrix-highlight",children:"Smiths"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary",children:"Remote DevKit agents via WebSocket"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:async()=>{D(!0),await Promise.all([t(),a(),new Promise(V=>setTimeout(V,500))]),D(!1)},className:"p-2 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:"Refresh",children:u.jsx(Ga,{className:`w-4 h-4 transition-transform ${$?"animate-spin":""}`})}),u.jsxs("button",{onClick:()=>{f(!l),!s&&n&&c(n)},className:`flex items-center gap-1.5 px-3 py-2 rounded border text-sm transition-colors ${l?"bg-azure-primary/10 border-azure-primary dark:bg-matrix-highlight/10 dark:border-matrix-highlight text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight"}`,children:[u.jsx(Qv,{className:"w-4 h-4"}),"Settings"]}),u.jsxs("button",{onClick:()=>{x(!0),T(null)},className:"flex items-center gap-1.5 px-3 py-2 rounded bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 text-sm font-medium transition-colors",children:[u.jsx(Ws,{className:"w-4 h-4"}),"Add Smith"]})]})]}),e&&u.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary",children:"Total"}),u.jsx("span",{className:"font-semibold text-azure-text dark:text-matrix-secondary",children:e.total})]}),ne>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(Ju,{className:"w-3.5 h-3.5 text-emerald-500"}),u.jsxs("span",{className:"font-semibold text-emerald-500",children:[ne," online"]})]}),ie>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(BS,{className:"w-3.5 h-3.5 text-amber-500"}),u.jsxs("span",{className:"font-semibold text-amber-500",children:[ie," connecting"]})]}),oe>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(IS,{className:"w-3.5 h-3.5 text-zinc-400 dark:text-matrix-tertiary"}),u.jsxs("span",{className:"font-semibold text-zinc-500 dark:text-matrix-tertiary",children:[oe," offline"]})]}),!e.enabled&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-amber-500 bg-amber-500/10 border border-amber-500/30 rounded-full px-2.5 py-0.5",children:[u.jsx(CA,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"Smiths subsystem disabled"})]})]}),l&&s&&u.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black p-5 space-y-4",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("h2",{className:"text-sm font-semibold text-azure-text dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(Qv,{className:"w-4 h-4"}),"Global Settings"]})}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsx("div",{className:"sm:col-span-2",children:u.jsx(Sr,{label:"Enable Smiths",checked:s.enabled,onChange:V=>c({...s,enabled:V}),helperText:"Master switch — disabling stops all Smith connections."})}),u.jsx(mn,{label:"Execution Mode",value:s.execution_mode,onChange:V=>c({...s,execution_mode:V.target.value}),options:[{label:"Sync — inline result",value:"sync"},{label:"Async — background task",value:"async"}]}),u.jsx(It,{label:"Heartbeat Interval (s)",value:Math.round(s.heartbeat_interval_ms/1e3),onChange:V=>c({...s,heartbeat_interval_ms:Number(V.target.value)*1e3}),min:5}),u.jsx(It,{label:"Connection Timeout (s)",value:Math.round(s.connection_timeout_ms/1e3),onChange:V=>c({...s,connection_timeout_ms:Number(V.target.value)*1e3}),min:1}),u.jsx(It,{label:"Task Timeout (s)",value:Math.round(s.task_timeout_ms/1e3),onChange:V=>c({...s,task_timeout_ms:Number(V.target.value)*1e3}),min:5})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx("button",{onClick:ae,disabled:h,className:"px-4 py-2 rounded text-sm 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:h?"Saving…":"Save Settings"})})]}),le.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-full bg-azure-surface dark:bg-zinc-900 border border-azure-border dark:border-matrix-primary flex items-center justify-center mb-4",children:u.jsx(Qs,{className:"w-7 h-7 text-azure-text-secondary dark:text-matrix-tertiary"})}),u.jsx("h3",{className:"text-base font-semibold text-azure-text dark:text-matrix-highlight mb-1",children:"No Smiths configured"}),u.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-tertiary mb-4",children:"Add a remote agent to delegate DevKit tasks to isolated environments."}),u.jsxs("button",{onClick:()=>{x(!0),T(null)},className:"flex items-center gap-2 px-4 py-2 rounded bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black text-sm font-medium transition-colors",children:[u.jsx(Ws,{className:"w-4 h-4"}),"Add First Smith"]})]}):u.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:le.map(V=>u.jsx(eG,{status:V,entry:B[V.name],onPing:Z,onEdit:G=>{v({...G,auth_token:""}),T(null)},onDelete:U},V.name))}),g&&u.jsx(gS,{title:"Add Smith",initial:Jq,onSave:K,onClose:()=>x(!1),saving:j,error:O}),b&&u.jsx(gS,{title:"Edit Smith",initial:b,isEdit:!0,onSave:de,onClose:()=>v(null),saving:j,error:O})]})}function nG(){return u.jsx(AE,{children:u.jsxs(Hv,{children:[u.jsx(Qt,{path:"/login",element:u.jsx(WF,{})}),u.jsx(Qt,{path:"/*",element:u.jsx(eq,{children:u.jsx(pD,{children:u.jsxs(Hv,{children:[u.jsx(Qt,{path:"/",element:u.jsx(bD,{})}),u.jsx(Qt,{path:"/chat",element:u.jsx(ZL,{})}),u.jsx(Qt,{path:"/zaion",element:u.jsx(KF,{})}),u.jsx(Qt,{path:"/logs",element:u.jsx(XF,{})}),u.jsx(Qt,{path:"/stats",element:u.jsx(QF,{})}),u.jsx(Qt,{path:"/sati-memories",element:u.jsx(cq,{})}),u.jsx(Qt,{path:"/mcp-servers",element:u.jsx(xq,{})}),u.jsx(Qt,{path:"/model-pricing",element:u.jsx(vq,{})}),u.jsx(Qt,{path:"/webhooks",element:u.jsx(Sq,{})}),u.jsx(Qt,{path:"/notifications",element:u.jsx(_q,{})}),u.jsx(Qt,{path:"/tasks",element:u.jsx(Aq,{})}),u.jsx(Qt,{path:"/trinity-databases",element:u.jsx(Rq,{})}),u.jsx(Qt,{path:"/chronos",element:u.jsx(Fq,{})}),u.jsx(Qt,{path:"/skills",element:u.jsx(Yq,{})}),u.jsx(Qt,{path:"/smiths",element:u.jsx(tG,{})}),u.jsx(Qt,{path:"*",element:u.jsx(ES,{to:"/",replace:!0})})]})})})})]})})}dT.createRoot(document.getElementById("root")).render(u.jsx(z.StrictMode,{children:u.jsx(nG,{})}));
|