morpheus-cli 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/config/manager.js +3 -1
  2. package/dist/config/schemas.js +2 -0
  3. package/dist/http/api.js +21 -0
  4. package/dist/runtime/memory/sati/index.js +22 -1
  5. package/dist/runtime/memory/sati/repository.js +2 -1
  6. package/dist/runtime/oracle.js +37 -13
  7. package/dist/runtime/tools/time-verify-tools.js +15 -8
  8. package/dist/types/config.js +2 -0
  9. package/dist/ui/assets/Chat-CO15OnaY.js +38 -0
  10. package/dist/ui/assets/Chronos-CUZDQLh2.js +1 -0
  11. package/dist/ui/assets/ConfirmationModal-Bx-GtD9B.js +1 -0
  12. package/dist/ui/assets/Dashboard-DDyN_X-J.js +1 -0
  13. package/dist/ui/assets/DeleteConfirmationModal-DIXbckY8.js +1 -0
  14. package/dist/ui/assets/Logs-dzPLW45U.js +1 -0
  15. package/dist/ui/assets/MCPManager-CRHWR4S7.js +1 -0
  16. package/dist/ui/assets/ModelPricing-TRBesy0r.js +1 -0
  17. package/dist/ui/assets/Notifications-DMke7Dr7.js +1 -0
  18. package/dist/ui/assets/SatiMemories-CaLrgdZV.js +1 -0
  19. package/dist/ui/assets/SelectInput-KVLsnfra.js +1 -0
  20. package/dist/ui/assets/SessionAudit-DedGO5XK.js +9 -0
  21. package/dist/ui/assets/Settings-DNDe62-H.js +41 -0
  22. package/dist/ui/assets/Skills-KUhW7UXP.js +7 -0
  23. package/dist/ui/assets/Smiths-Btoqw4Ex.js +1 -0
  24. package/dist/ui/assets/Tasks-cwA25Hq2.js +1 -0
  25. package/dist/ui/assets/TrinityDatabases-CQhettEJ.js +1 -0
  26. package/dist/ui/assets/UsageStats-doBLB7Lc.js +1 -0
  27. package/dist/ui/assets/WebhookManager-D3A5pdjC.js +4 -0
  28. package/dist/ui/assets/chronos-DlDM2UBT.js +1 -0
  29. package/dist/ui/assets/config-DX3Xb0XE.js +1 -0
  30. package/dist/ui/assets/index-CQIUjucB.js +10 -0
  31. package/dist/ui/assets/{index-QQyZIsmH.css → index-DAh3q_hR.css} +1 -1
  32. package/dist/ui/assets/mcp-DfhJYN14.js +1 -0
  33. package/dist/ui/assets/skills-BPjq0qV7.js +1 -0
  34. package/dist/ui/assets/stats-DHCRNkJp.js +1 -0
  35. package/dist/ui/assets/vendor-icons-DLvvGkeN.js +1 -0
  36. package/dist/ui/assets/vendor-markdown-BN_Np5Ta.js +29 -0
  37. package/dist/ui/assets/vendor-motion-C3CZ8ZlO.js +9 -0
  38. package/dist/ui/assets/vendor-react-DikRIOlj.js +3 -0
  39. package/dist/ui/assets/vendor-utils-D4NnWbOU.js +39 -0
  40. package/dist/ui/index.html +6 -2
  41. package/dist/ui/sw.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/ui/assets/index-BgSiRONc.js +0 -177
@@ -1,177 +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 o of c.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).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 Px(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vm={exports:{}},wl={};var l1;function mT(){if(l1)return wl;l1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,c){var o=null;if(c!==void 0&&(o=""+c),s.key!==void 0&&(o=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:e,type:a,key:o,ref:s!==void 0?s:null,props:c}}return wl.Fragment=t,wl.jsx=n,wl.jsxs=n,wl}var c1;function pT(){return c1||(c1=1,vm.exports=mT()),vm.exports}var u=pT(),km={exports:{}},Ae={};var u1;function xT(){if(u1)return Ae;u1=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"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(C){return C===null||typeof C!="object"?null:(C=b&&C[b]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,E={};function _(C,H,w){this.props=C,this.context=H,this.refs=E,this.updater=w||S}_.prototype.isReactComponent={},_.prototype.setState=function(C,H){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,H,"setState")},_.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function A(){}A.prototype=_.prototype;function N(C,H,w){this.props=C,this.context=H,this.refs=E,this.updater=w||S}var P=N.prototype=new A;P.constructor=N,z(P,_.prototype),P.isPureReactComponent=!0;var D=Array.isArray;function M(){}var V={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function K(C,H,w){var X=w.ref;return{$$typeof:e,type:C,key:H,ref:X!==void 0?X:null,props:w}}function I(C,H){return K(C.type,H,C.props)}function te(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function le(C){var H={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(w){return H[w]})}var ne=/\/+/g;function oe(C,H){return typeof C=="object"&&C!==null&&C.key!=null?le(""+C.key):H.toString(36)}function se(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(M,M):(C.status="pending",C.then(function(H){C.status==="pending"&&(C.status="fulfilled",C.value=H)},function(H){C.status==="pending"&&(C.status="rejected",C.reason=H)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function Z(C,H,w,X,me){var pe=typeof C;(pe==="undefined"||pe==="boolean")&&(C=null);var ge=!1;if(C===null)ge=!0;else switch(pe){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(C.$$typeof){case e:case t:ge=!0;break;case x:return ge=C._init,Z(ge(C._payload),H,w,X,me)}}if(ge)return me=me(C),ge=X===""?"."+oe(C,0):X,D(me)?(w="",ge!=null&&(w=ge.replace(ne,"$&/")+"/"),Z(me,H,w,"",function(yt){return yt})):me!=null&&(te(me)&&(me=I(me,w+(me.key==null||C&&C.key===me.key?"":(""+me.key).replace(ne,"$&/")+"/")+ge)),H.push(me)),1;ge=0;var Pe=X===""?".":X+":";if(D(C))for(var Ee=0;Ee<C.length;Ee++)X=C[Ee],pe=Pe+oe(X,Ee),ge+=Z(X,H,w,pe,me);else if(Ee=v(C),typeof Ee=="function")for(C=Ee.call(C),Ee=0;!(X=C.next()).done;)X=X.value,pe=Pe+oe(X,Ee++),ge+=Z(X,H,w,pe,me);else if(pe==="object"){if(typeof C.then=="function")return Z(se(C),H,w,X,me);throw H=String(C),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ge}function B(C,H,w){if(C==null)return C;var X=[],me=0;return Z(C,X,"","",function(pe){return H.call(w,pe,me++)}),X}function Y(C){if(C._status===-1){var H=C._result;H=H(),H.then(function(w){(C._status===0||C._status===-1)&&(C._status=1,C._result=w)},function(w){(C._status===0||C._status===-1)&&(C._status=2,C._result=w)}),C._status===-1&&(C._status=0,C._result=H)}if(C._status===1)return C._result.default;throw C._result}var ue=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},O={map:B,forEach:function(C,H,w){B(C,function(){H.apply(this,arguments)},w)},count:function(C){var H=0;return B(C,function(){H++}),H},toArray:function(C){return B(C,function(H){return H})||[]},only:function(C){if(!te(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ae.Activity=p,Ae.Children=O,Ae.Component=_,Ae.Fragment=n,Ae.Profiler=s,Ae.PureComponent=N,Ae.StrictMode=a,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(C){return V.H.useMemoCache(C)}},Ae.cache=function(C){return function(){return C.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(C,H,w){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var X=z({},C.props),me=C.key;if(H!=null)for(pe in H.key!==void 0&&(me=""+H.key),H)!U.call(H,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&H.ref===void 0||(X[pe]=H[pe]);var pe=arguments.length-2;if(pe===1)X.children=w;else if(1<pe){for(var ge=Array(pe),Pe=0;Pe<pe;Pe++)ge[Pe]=arguments[Pe+2];X.children=ge}return K(C.type,me,X)},Ae.createContext=function(C){return C={$$typeof:o,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},Ae.createElement=function(C,H,w){var X,me={},pe=null;if(H!=null)for(X in H.key!==void 0&&(pe=""+H.key),H)U.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(me[X]=H[X]);var ge=arguments.length-2;if(ge===1)me.children=w;else if(1<ge){for(var Pe=Array(ge),Ee=0;Ee<ge;Ee++)Pe[Ee]=arguments[Ee+2];me.children=Pe}if(C&&C.defaultProps)for(X in ge=C.defaultProps,ge)me[X]===void 0&&(me[X]=ge[X]);return K(C,pe,me)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(C){return{$$typeof:d,render:C}},Ae.isValidElement=te,Ae.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:Y}},Ae.memo=function(C,H){return{$$typeof:m,type:C,compare:H===void 0?null:H}},Ae.startTransition=function(C){var H=V.T,w={};V.T=w;try{var X=C(),me=V.S;me!==null&&me(w,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(M,ue)}catch(pe){ue(pe)}finally{H!==null&&w.types!==null&&(H.types=w.types),V.T=H}},Ae.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Ae.use=function(C){return V.H.use(C)},Ae.useActionState=function(C,H,w){return V.H.useActionState(C,H,w)},Ae.useCallback=function(C,H){return V.H.useCallback(C,H)},Ae.useContext=function(C){return V.H.useContext(C)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(C,H){return V.H.useDeferredValue(C,H)},Ae.useEffect=function(C,H){return V.H.useEffect(C,H)},Ae.useEffectEvent=function(C){return V.H.useEffectEvent(C)},Ae.useId=function(){return V.H.useId()},Ae.useImperativeHandle=function(C,H,w){return V.H.useImperativeHandle(C,H,w)},Ae.useInsertionEffect=function(C,H){return V.H.useInsertionEffect(C,H)},Ae.useLayoutEffect=function(C,H){return V.H.useLayoutEffect(C,H)},Ae.useMemo=function(C,H){return V.H.useMemo(C,H)},Ae.useOptimistic=function(C,H){return V.H.useOptimistic(C,H)},Ae.useReducer=function(C,H,w){return V.H.useReducer(C,H,w)},Ae.useRef=function(C){return V.H.useRef(C)},Ae.useState=function(C){return V.H.useState(C)},Ae.useSyncExternalStore=function(C,H,w){return V.H.useSyncExternalStore(C,H,w)},Ae.useTransition=function(){return V.H.useTransition()},Ae.version="19.2.4",Ae}var d1;function Bd(){return d1||(d1=1,km.exports=xT()),km.exports}var j=Bd();const Ux=Px(j);var wm={exports:{}},Sl={},Sm={exports:{}},zm={};var f1;function gT(){return f1||(f1=1,(function(e){function t(Z,B){var Y=Z.length;Z.push(B);e:for(;0<Y;){var ue=Y-1>>>1,O=Z[ue];if(0<s(O,B))Z[ue]=B,Z[Y]=O,Y=ue;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var B=Z[0],Y=Z.pop();if(Y!==B){Z[0]=Y;e:for(var ue=0,O=Z.length,C=O>>>1;ue<C;){var H=2*(ue+1)-1,w=Z[H],X=H+1,me=Z[X];if(0>s(w,Y))X<O&&0>s(me,w)?(Z[ue]=me,Z[X]=Y,ue=X):(Z[ue]=w,Z[H]=Y,ue=H);else if(X<O&&0>s(me,Y))Z[ue]=me,Z[X]=Y,ue=X;else break e}}return B}function s(Z,B){var Y=Z.sortIndex-B.sortIndex;return Y!==0?Y:Z.id-B.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 o=Date,d=o.now();e.unstable_now=function(){return o.now()-d}}var h=[],m=[],x=1,p=null,b=3,v=!1,S=!1,z=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function P(Z){for(var B=n(m);B!==null;){if(B.callback===null)a(m);else if(B.startTime<=Z)a(m),B.sortIndex=B.expirationTime,t(h,B);else break;B=n(m)}}function D(Z){if(z=!1,P(Z),!S)if(n(h)!==null)S=!0,M||(M=!0,le());else{var B=n(m);B!==null&&se(D,B.startTime-Z)}}var M=!1,V=-1,U=5,K=-1;function I(){return E?!0:!(e.unstable_now()-K<U)}function te(){if(E=!1,M){var Z=e.unstable_now();K=Z;var B=!0;try{e:{S=!1,z&&(z=!1,A(V),V=-1),v=!0;var Y=b;try{t:{for(P(Z),p=n(h);p!==null&&!(p.expirationTime>Z&&I());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,b=p.priorityLevel;var O=ue(p.expirationTime<=Z);if(Z=e.unstable_now(),typeof O=="function"){p.callback=O,P(Z),B=!0;break t}p===n(h)&&a(h),P(Z)}else a(h);p=n(h)}if(p!==null)B=!0;else{var C=n(m);C!==null&&se(D,C.startTime-Z),B=!1}}break e}finally{p=null,b=Y,v=!1}B=void 0}}finally{B?le():M=!1}}}var le;if(typeof N=="function")le=function(){N(te)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,oe=ne.port2;ne.port1.onmessage=te,le=function(){oe.postMessage(null)}}else le=function(){_(te,0)};function se(Z,B){V=_(function(){Z(e.unstable_now())},B)}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(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var B=3;break;default:B=b}var Y=b;b=B;try{return Z()}finally{b=Y}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(Z,B){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var Y=b;b=Z;try{return B()}finally{b=Y}},e.unstable_scheduleCallback=function(Z,B,Y){var ue=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ue+Y:ue):Y=ue,Z){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Y+O,Z={id:x++,callback:B,priorityLevel:Z,startTime:Y,expirationTime:O,sortIndex:-1},Y>ue?(Z.sortIndex=Y,t(m,Z),n(h)===null&&Z===n(m)&&(z?(A(V),V=-1):z=!0,se(D,Y-ue))):(Z.sortIndex=O,t(h,Z),S||v||(S=!0,M||(M=!0,le()))),Z},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(Z){var B=b;return function(){var Y=b;b=B;try{return Z.apply(this,arguments)}finally{b=Y}}}})(zm)),zm}var h1;function yT(){return h1||(h1=1,Sm.exports=gT()),Sm.exports}var jm={exports:{}},mn={};var m1;function bT(){if(m1)return mn;m1=1;var e=Bd();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}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,x){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:m,implementation:x}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,mn.createPortal=function(h,m){var x=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,x)},mn.flushSync=function(h){var m=o.T,x=a.p;try{if(o.T=null,a.p=2,h)return h()}finally{o.T=m,a.p=x,a.d.f()}},mn.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))},mn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},mn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var x=m.as,p=d(x,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):x==="script"&&a.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},mn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:x,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)},mn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,p=d(x,m.crossOrigin);a.d.L(h,x,{crossOrigin:p,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})}},mn.preloadModule=function(h,m){if(typeof h=="string")if(m){var x=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},mn.requestFormReset=function(h){a.d.r(h)},mn.unstable_batchedUpdates=function(h,m){return h(m)},mn.useFormState=function(h,m,x){return o.H.useFormState(h,m,x)},mn.useFormStatus=function(){return o.H.useHostTransitionStatus()},mn.version="19.2.4",mn}var p1;function vT(){if(p1)return jm.exports;p1=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(),jm.exports=bT(),jm.exports}var x1;function kT(){if(x1)return Sl;x1=1;var e=yT(),t=Bd(),n=vT();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}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,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function o(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(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 l=r,f=i;;){var g=l.return;if(g===null)break;var y=g.alternate;if(y===null){if(f=g.return,f!==null){l=f;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===l)return h(g),r;if(y===f)return h(g),i;y=y.sibling}throw Error(a(188))}if(l.return!==f.return)l=g,f=y;else{for(var k=!1,T=g.child;T;){if(T===l){k=!0,l=g,f=y;break}if(T===f){k=!0,f=g,l=y;break}T=T.sibling}if(!k){for(T=y.child;T;){if(T===l){k=!0,l=y,f=g;break}if(T===f){k=!0,f=y,l=g;break}T=T.sibling}if(!k)throw Error(a(189))}}if(l.alternate!==f)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function x(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=x(r),i!==null)return i;r=r.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=te&&r[te]||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 z:return"Fragment";case _:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case V: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 se=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ue=[],O=-1;function C(r){return{current:r}}function H(r){0>O||(r.current=ue[O],ue[O]=null,O--)}function w(r,i){O++,ue[O]=r.current,r.current=i}var X=C(null),me=C(null),pe=C(null),ge=C(null);function Pe(r,i){switch(w(pe,i),w(me,r),w(X,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Av(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Av(i),r=Ov(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}H(X),w(X,r)}function Ee(){H(X),H(me),H(pe)}function yt(r){r.memoizedState!==null&&w(ge,r);var i=X.current,l=Ov(i,r.type);i!==l&&(w(me,r),w(X,l))}function $(r){me.current===r&&(H(X),H(me)),ge.current===r&&(H(ge),yl._currentValue=Y)}var Oe,Ue;function Je(r){if(Oe===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);Oe=i&&i[1]||"",Ue=-1<l.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Oe+r+Ue}var St=!1;function Ze(r,i){if(!r||St)return"";St=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Q){var J=Q}Reflect.construct(r,[],ie)}else{try{ie.call()}catch(Q){J=Q}r.call(ie.prototype)}}else{try{throw Error()}catch(Q){J=Q}(ie=r())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Q){if(Q&&J&&typeof Q.stack=="string")return[Q.stack,J.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),k=y[0],T=y[1];if(k&&T){var R=k.split(`
4
- `),G=T.split(`
5
- `);for(g=f=0;f<R.length&&!R[f].includes("DetermineComponentFrameRoot");)f++;for(;g<G.length&&!G[g].includes("DetermineComponentFrameRoot");)g++;if(f===R.length||g===G.length)for(f=R.length-1,g=G.length-1;1<=f&&0<=g&&R[f]!==G[g];)g--;for(;1<=f&&0<=g;f--,g--)if(R[f]!==G[g]){if(f!==1||g!==1)do if(f--,g--,0>g||R[f]!==G[g]){var W=`
6
- `+R[f].replace(" at new "," at ");return r.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",r.displayName)),W}while(1<=f&&0<=g);break}}}finally{St=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?Je(l):""}function rt(r,i){switch(r.tag){case 26:case 27:case 5:return Je(r.type);case 16:return Je("Lazy");case 13:return r.child!==i&&i!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Ze(r.type,!1);case 11:return Ze(r.type.render,!1);case 1:return Ze(r.type,!0);case 31:return Je("Activity");default:return""}}function ft(r){try{var i="",l=null;do i+=rt(r,l),l=r,r=r.return;while(r);return i}catch(f){return`
7
- Error generating stack: `+f.message+`
8
- `+f.stack}}var lt=Object.prototype.hasOwnProperty,rn=e.unstable_scheduleCallback,nr=e.unstable_cancelCallback,$t=e.unstable_shouldYield,Kt=e.unstable_requestPaint,bt=e.unstable_now,Qi=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Ke=e.unstable_IdlePriority,kn=e.log,Fn=e.unstable_setDisableYieldValue,wn=null,Xt=null;function An(r){if(typeof kn=="function"&&Fn(r),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(wn,r)}catch{}}var ht=Math.clz32?Math.clz32:eC,va=Math.log,wr=Math.LN2;function eC(r){return r>>>=0,r===0?32:31-(va(r)/wr|0)|0}var vc=256,kc=262144,wc=4194304;function mi(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 Sc(r,i,l){var f=r.pendingLanes;if(f===0)return 0;var g=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var T=f&134217727;return T!==0?(f=T&~y,f!==0?g=mi(f):(k&=T,k!==0?g=mi(k):l||(l=T&~r,l!==0&&(g=mi(l))))):(T=f&~y,T!==0?g=mi(T):k!==0?g=mi(k):l||(l=f&~r,l!==0&&(g=mi(l)))),g===0?0:i!==0&&i!==g&&(i&y)===0&&(y=g&-g,l=i&-i,y>=l||y===32&&(l&4194048)!==0)?i:g}function Ao(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function tC(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 fy(){var r=wc;return wc<<=1,(wc&62914560)===0&&(wc=4194304),r}function lf(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Oo(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function nC(r,i,l,f,g,y){var k=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var T=r.entanglements,R=r.expirationTimes,G=r.hiddenUpdates;for(l=k&~l;0<l;){var W=31-ht(l),ie=1<<W;T[W]=0,R[W]=-1;var J=G[W];if(J!==null)for(G[W]=null,W=0;W<J.length;W++){var Q=J[W];Q!==null&&(Q.lane&=-536870913)}l&=~ie}f!==0&&hy(r,f,0),y!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function hy(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var f=31-ht(i);r.entangledLanes|=i,r.entanglements[f]=r.entanglements[f]|1073741824|l&261930}function my(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var f=31-ht(l),g=1<<f;g&i|r[f]&i&&(r[f]|=i),l&=~g}}function py(r,i){var l=i&-i;return l=(l&42)!==0?1:cf(l),(l&(r.suspendedLanes|i))!==0?0:l}function cf(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 uf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function xy(){var r=B.p;return r!==0?r:(r=window.event,r===void 0?32:t1(r.type))}function gy(r,i){var l=B.p;try{return B.p=r,i()}finally{B.p=l}}var ka=Math.random().toString(36).slice(2),on="__reactFiber$"+ka,On="__reactProps$"+ka,Wi="__reactContainer$"+ka,df="__reactEvents$"+ka,rC="__reactListeners$"+ka,aC="__reactHandles$"+ka,yy="__reactResources$"+ka,Mo="__reactMarker$"+ka;function ff(r){delete r[on],delete r[On],delete r[df],delete r[rC],delete r[aC]}function es(r){var i=r[on];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Wi]||l[on]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=Uv(r);r!==null;){if(l=r[on])return l;r=Uv(r)}return i}r=l,l=r.parentNode}return null}function ts(r){if(r=r[on]||r[Wi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Do(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function ns(r){var i=r[yy];return i||(i=r[yy]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function an(r){r[Mo]=!0}var by=new Set,vy={};function pi(r,i){rs(r,i),rs(r+"Capture",i)}function rs(r,i){for(vy[r]=i,r=0;r<i.length;r++)by.add(i[r])}var iC=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]*$"),ky={},wy={};function sC(r){return lt.call(wy,r)?!0:lt.call(ky,r)?!1:iC.test(r)?wy[r]=!0:(ky[r]=!0,!1)}function zc(r,i,l){if(sC(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function jc(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function Hr(r,i,l,f){if(f===null)r.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+f)}}function rr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Sy(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function oC(r,i,l){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,y=f.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return g.call(this)},set:function(k){l=""+k,y.call(this,k)}}),Object.defineProperty(r,i,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(k){l=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function hf(r){if(!r._valueTracker){var i=Sy(r)?"checked":"value";r._valueTracker=oC(r,i,""+r[i])}}function zy(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),f="";return r&&(f=Sy(r)?r.checked?"true":"false":r.value),r=f,r!==l?(i.setValue(r),!0):!1}function _c(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 lC=/[\n"\\]/g;function ar(r){return r.replace(lC,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function mf(r,i,l,f,g,y,k,T){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=""+rr(i)):r.value!==""+rr(i)&&(r.value=""+rr(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?pf(r,k,rr(i)):l!=null?pf(r,k,rr(l)):f!=null&&r.removeAttribute("value"),g==null&&y!=null&&(r.defaultChecked=!!y),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.name=""+rr(T):r.removeAttribute("name")}function jy(r,i,l,f,g,y,k,T){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){hf(r);return}l=l!=null?""+rr(l):"",i=i!=null?""+rr(i):l,T||i===r.value||(r.value=i),r.defaultValue=i}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=T?r.checked:!!f,r.defaultChecked=!!f,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),hf(r)}function pf(r,i,l){i==="number"&&_c(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function as(r,i,l,f){if(r=r.options,i){i={};for(var g=0;g<l.length;g++)i["$"+l[g]]=!0;for(l=0;l<r.length;l++)g=i.hasOwnProperty("$"+r[l].value),r[l].selected!==g&&(r[l].selected=g),g&&f&&(r[l].defaultSelected=!0)}else{for(l=""+rr(l),i=null,g=0;g<r.length;g++){if(r[g].value===l){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}i!==null||r[g].disabled||(i=r[g])}i!==null&&(i.selected=!0)}}function _y(r,i,l){if(i!=null&&(i=""+rr(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+rr(l):""}function Ny(r,i,l,f){if(i==null){if(f!=null){if(l!=null)throw Error(a(92));if(se(f)){if(1<f.length)throw Error(a(93));f=f[0]}l=f}l==null&&(l=""),i=l}l=rr(i),r.defaultValue=l,f=r.textContent,f===l&&f!==""&&f!==null&&(r.value=f),hf(r)}function is(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var cC=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 Cy(r,i,l){var f=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?f?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":f?r.setProperty(i,l):typeof l!="number"||l===0||cC.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function Ty(r,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,l!=null){for(var f in l)!l.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var g in i)f=i[g],i.hasOwnProperty(g)&&l[g]!==f&&Cy(r,g,f)}else for(var y in i)i.hasOwnProperty(y)&&Cy(r,y,i[y])}function xf(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 uC=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"]]),dC=/^[\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 Nc(r){return dC.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function qr(){}var gf=null;function yf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ss=null,os=null;function Ey(r){var i=ts(r);if(i&&(r=i.stateNode)){var l=r[On]||null;e:switch(r=i.stateNode,i.type){case"input":if(mf(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ar(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var f=l[i];if(f!==r&&f.form===r.form){var g=f[On]||null;if(!g)throw Error(a(90));mf(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<l.length;i++)f=l[i],f.form===r.form&&zy(f)}break e;case"textarea":_y(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&as(r,!!l.multiple,i,!1)}}}var bf=!1;function Ay(r,i,l){if(bf)return r(i,l);bf=!0;try{var f=r(i);return f}finally{if(bf=!1,(ss!==null||os!==null)&&(mu(),ss&&(i=ss,r=os,os=ss=null,Ey(i),r)))for(i=0;i<r.length;i++)Ey(r[i])}}function Ro(r,i){var l=r.stateNode;if(l===null)return null;var f=l[On]||null;if(f===null)return null;l=f[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":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vf=!1;if(Gr)try{var $o={};Object.defineProperty($o,"passive",{get:function(){vf=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{vf=!1}var wa=null,kf=null,Cc=null;function Oy(){if(Cc)return Cc;var r,i=kf,l=i.length,f,g="value"in wa?wa.value:wa.textContent,y=g.length;for(r=0;r<l&&i[r]===g[r];r++);var k=l-r;for(f=1;f<=k&&i[l-f]===g[y-f];f++);return Cc=g.slice(r,1<f?1-f:void 0)}function Tc(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 Ec(){return!0}function My(){return!1}function Mn(r){function i(l,f,g,y,k){this._reactName=l,this._targetInst=g,this.type=f,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(l=r[T],this[T]=l?l(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ec:My,this.isPropagationStopped=My,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ec)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ec)},persist:function(){},isPersistent:Ec}),i}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ac=Mn(xi),Lo=p({},xi,{view:0,detail:0}),fC=Mn(Lo),wf,Sf,Po,Oc=p({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jf,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!==Po&&(Po&&r.type==="mousemove"?(wf=r.screenX-Po.screenX,Sf=r.screenY-Po.screenY):Sf=wf=0,Po=r),wf)},movementY:function(r){return"movementY"in r?r.movementY:Sf}}),Dy=Mn(Oc),hC=p({},Oc,{dataTransfer:0}),mC=Mn(hC),pC=p({},Lo,{relatedTarget:0}),zf=Mn(pC),xC=p({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),gC=Mn(xC),yC=p({},xi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),bC=Mn(yC),vC=p({},xi,{data:0}),Ry=Mn(vC),kC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wC={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"},SC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zC(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=SC[r])?!!i[r]:!1}function jf(){return zC}var jC=p({},Lo,{key:function(r){if(r.key){var i=kC[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Tc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?wC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jf,charCode:function(r){return r.type==="keypress"?Tc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Tc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),_C=Mn(jC),NC=p({},Oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$y=Mn(NC),CC=p({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jf}),TC=Mn(CC),EC=p({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),AC=Mn(EC),OC=p({},Oc,{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}),MC=Mn(OC),DC=p({},xi,{newState:0,oldState:0}),RC=Mn(DC),$C=[9,13,27,32],_f=Gr&&"CompositionEvent"in window,Uo=null;Gr&&"documentMode"in document&&(Uo=document.documentMode);var LC=Gr&&"TextEvent"in window&&!Uo,Ly=Gr&&(!_f||Uo&&8<Uo&&11>=Uo),Py=" ",Uy=!1;function Iy(r,i){switch(r){case"keyup":return $C.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function By(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ls=!1;function PC(r,i){switch(r){case"compositionend":return By(i);case"keypress":return i.which!==32?null:(Uy=!0,Py);case"textInput":return r=i.data,r===Py&&Uy?null:r;default:return null}}function UC(r,i){if(ls)return r==="compositionend"||!_f&&Iy(r,i)?(r=Oy(),Cc=kf=wa=null,ls=!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 Ly&&i.locale!=="ko"?null:i.data;default:return null}}var IC={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!IC[r.type]:i==="textarea"}function Zy(r,i,l,f){ss?os?os.push(f):os=[f]:ss=f,i=ku(i,"onChange"),0<i.length&&(l=new Ac("onChange","change",null,l,f),r.push({event:l,listeners:i}))}var Io=null,Bo=null;function BC(r){jv(r,0)}function Mc(r){var i=Do(r);if(zy(i))return r}function Fy(r,i){if(r==="change")return i}var Hy=!1;if(Gr){var Nf;if(Gr){var Cf="oninput"in document;if(!Cf){var qy=document.createElement("div");qy.setAttribute("oninput","return;"),Cf=typeof qy.oninput=="function"}Nf=Cf}else Nf=!1;Hy=Nf&&(!document.documentMode||9<document.documentMode)}function Gy(){Io&&(Io.detachEvent("onpropertychange",Yy),Bo=Io=null)}function Yy(r){if(r.propertyName==="value"&&Mc(Bo)){var i=[];Zy(i,Bo,r,yf(r)),Ay(BC,i)}}function VC(r,i,l){r==="focusin"?(Gy(),Io=i,Bo=l,Io.attachEvent("onpropertychange",Yy)):r==="focusout"&&Gy()}function ZC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Mc(Bo)}function FC(r,i){if(r==="click")return Mc(i)}function HC(r,i){if(r==="input"||r==="change")return Mc(i)}function qC(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Hn=typeof Object.is=="function"?Object.is:qC;function Vo(r,i){if(Hn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var g=l[f];if(!lt.call(i,g)||!Hn(r[g],i[g]))return!1}return!0}function Jy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Ky(r,i){var l=Jy(r);r=0;for(var f;l;){if(l.nodeType===3){if(f=r+l.textContent.length,r<=i&&f>=i)return{node:l,offset:i-r};r=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Jy(l)}}function Xy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Xy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Qy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=_c(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=_c(r.document)}return i}function Tf(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 GC=Gr&&"documentMode"in document&&11>=document.documentMode,cs=null,Ef=null,Zo=null,Af=!1;function Wy(r,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Af||cs==null||cs!==_c(f)||(f=cs,"selectionStart"in f&&Tf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Zo&&Vo(Zo,f)||(Zo=f,f=ku(Ef,"onSelect"),0<f.length&&(i=new Ac("onSelect","select",null,i,l),r.push({event:i,listeners:f}),i.target=cs)))}function gi(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var us={animationend:gi("Animation","AnimationEnd"),animationiteration:gi("Animation","AnimationIteration"),animationstart:gi("Animation","AnimationStart"),transitionrun:gi("Transition","TransitionRun"),transitionstart:gi("Transition","TransitionStart"),transitioncancel:gi("Transition","TransitionCancel"),transitionend:gi("Transition","TransitionEnd")},Of={},eb={};Gr&&(eb=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function yi(r){if(Of[r])return Of[r];if(!us[r])return r;var i=us[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in eb)return Of[r]=i[l];return r}var tb=yi("animationend"),nb=yi("animationiteration"),rb=yi("animationstart"),YC=yi("transitionrun"),JC=yi("transitionstart"),KC=yi("transitioncancel"),ab=yi("transitionend"),ib=new Map,Mf="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(" ");Mf.push("scrollEnd");function Sr(r,i){ib.set(r,i),pi(i,[r])}var Dc=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)},ir=[],ds=0,Df=0;function Rc(){for(var r=ds,i=Df=ds=0;i<r;){var l=ir[i];ir[i++]=null;var f=ir[i];ir[i++]=null;var g=ir[i];ir[i++]=null;var y=ir[i];if(ir[i++]=null,f!==null&&g!==null){var k=f.pending;k===null?g.next=g:(g.next=k.next,k.next=g),f.pending=g}y!==0&&sb(l,g,y)}}function $c(r,i,l,f){ir[ds++]=r,ir[ds++]=i,ir[ds++]=l,ir[ds++]=f,Df|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Rf(r,i,l,f){return $c(r,i,l,f),Lc(r)}function bi(r,i){return $c(r,null,null,i),Lc(r)}function sb(r,i,l){r.lanes|=l;var f=r.alternate;f!==null&&(f.lanes|=l);for(var g=!1,y=r.return;y!==null;)y.childLanes|=l,f=y.alternate,f!==null&&(f.childLanes|=l),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(g=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,g&&i!==null&&(g=31-ht(l),r=y.hiddenUpdates,f=r[g],f===null?r[g]=[i]:f.push(i),i.lane=l|536870912),y):null}function Lc(r){if(50<dl)throw dl=0,Fh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var fs={};function XC(r,i,l,f){this.tag=r,this.key=l,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=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(r,i,l,f){return new XC(r,i,l,f)}function $f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Yr(r,i){var l=r.alternate;return l===null?(l=qn(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function ob(r,i){r.flags&=65011714;var l=r.alternate;return l===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=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Pc(r,i,l,f,g,y){var k=0;if(f=r,typeof r=="function")$f(r)&&(k=1);else if(typeof r=="string")k=nT(r,l,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case K:return r=qn(31,l,i,g),r.elementType=K,r.lanes=y,r;case z:return vi(l.children,g,y,i);case E:k=8,g|=24;break;case _:return r=qn(12,l,i,g|2),r.elementType=_,r.lanes=y,r;case D:return r=qn(13,l,i,g),r.elementType=D,r.lanes=y,r;case M:return r=qn(19,l,i,g),r.elementType=M,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:k=10;break e;case A:k=9;break e;case P:k=11;break e;case V:k=14;break e;case U:k=16,f=null;break e}k=29,l=Error(a(130,r===null?"null":typeof r,"")),f=null}return i=qn(k,l,i,g),i.elementType=r,i.type=f,i.lanes=y,i}function vi(r,i,l,f){return r=qn(7,r,f,i),r.lanes=l,r}function Lf(r,i,l){return r=qn(6,r,null,i),r.lanes=l,r}function lb(r){var i=qn(18,null,null,0);return i.stateNode=r,i}function Pf(r,i,l){return i=qn(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var cb=new WeakMap;function sr(r,i){if(typeof r=="object"&&r!==null){var l=cb.get(r);return l!==void 0?l:(i={value:r,source:i,stack:ft(i)},cb.set(r,i),i)}return{value:r,source:i,stack:ft(i)}}var hs=[],ms=0,Uc=null,Fo=0,or=[],lr=0,Sa=null,Or=1,Mr="";function Jr(r,i){hs[ms++]=Fo,hs[ms++]=Uc,Uc=r,Fo=i}function ub(r,i,l){or[lr++]=Or,or[lr++]=Mr,or[lr++]=Sa,Sa=r;var f=Or;r=Mr;var g=32-ht(f)-1;f&=~(1<<g),l+=1;var y=32-ht(i)+g;if(30<y){var k=g-g%5;y=(f&(1<<k)-1).toString(32),f>>=k,g-=k,Or=1<<32-ht(i)+g|l<<g|f,Mr=y+r}else Or=1<<y|l<<g|f,Mr=r}function Uf(r){r.return!==null&&(Jr(r,1),ub(r,1,0))}function If(r){for(;r===Uc;)Uc=hs[--ms],hs[ms]=null,Fo=hs[--ms],hs[ms]=null;for(;r===Sa;)Sa=or[--lr],or[lr]=null,Mr=or[--lr],or[lr]=null,Or=or[--lr],or[lr]=null}function db(r,i){or[lr++]=Or,or[lr++]=Mr,or[lr++]=Sa,Or=i.id,Mr=i.overflow,Sa=r}var ln=null,vt=null,Ge=!1,za=null,cr=!1,Bf=Error(a(519));function ja(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ho(sr(i,r)),Bf}function fb(r){var i=r.stateNode,l=r.type,f=r.memoizedProps;switch(i[on]=r,i[On]=f,l){case"dialog":Be("cancel",i),Be("close",i);break;case"iframe":case"object":case"embed":Be("load",i);break;case"video":case"audio":for(l=0;l<hl.length;l++)Be(hl[l],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),jy(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Be("invalid",i);break;case"textarea":Be("invalid",i),Ny(i,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||f.suppressHydrationWarning===!0||Tv(i.textContent,l)?(f.popover!=null&&(Be("beforetoggle",i),Be("toggle",i)),f.onScroll!=null&&Be("scroll",i),f.onScrollEnd!=null&&Be("scrollend",i),f.onClick!=null&&(i.onclick=qr),i=!0):i=!1,i||ja(r,!0)}function hb(r){for(ln=r.return;ln;)switch(ln.tag){case 5:case 31:case 13:cr=!1;return;case 27:case 3:cr=!0;return;default:ln=ln.return}}function ps(r){if(r!==ln)return!1;if(!Ge)return hb(r),Ge=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||im(r.type,r.memoizedProps)),l=!l),l&&vt&&ja(r),hb(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vt=Pv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vt=Pv(r)}else i===27?(i=vt,Ua(r.type)?(r=um,um=null,vt=r):vt=i):vt=ln?dr(r.stateNode.nextSibling):null;return!0}function ki(){vt=ln=null,Ge=!1}function Vf(){var r=za;return r!==null&&(Ln===null?Ln=r:Ln.push.apply(Ln,r),za=null),r}function Ho(r){za===null?za=[r]:za.push(r)}var Zf=C(null),wi=null,Kr=null;function _a(r,i,l){w(Zf,i._currentValue),i._currentValue=l}function Xr(r){r._currentValue=Zf.current,H(Zf)}function Ff(r,i,l){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===l)break;r=r.return}}function Hf(r,i,l,f){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var y=g.dependencies;if(y!==null){var k=g.child;y=y.firstContext;e:for(;y!==null;){var T=y;y=g;for(var R=0;R<i.length;R++)if(T.context===i[R]){y.lanes|=l,T=y.alternate,T!==null&&(T.lanes|=l),Ff(y.return,l,r),f||(k=null);break e}y=T.next}}else if(g.tag===18){if(k=g.return,k===null)throw Error(a(341));k.lanes|=l,y=k.alternate,y!==null&&(y.lanes|=l),Ff(k,l,r),k=null}else k=g.child;if(k!==null)k.return=g;else for(k=g;k!==null;){if(k===r){k=null;break}if(g=k.sibling,g!==null){g.return=k.return,k=g;break}k=k.return}g=k}}function xs(r,i,l,f){r=null;for(var g=i,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var k=g.alternate;if(k===null)throw Error(a(387));if(k=k.memoizedProps,k!==null){var T=g.type;Hn(g.pendingProps.value,k.value)||(r!==null?r.push(T):r=[T])}}else if(g===ge.current){if(k=g.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(yl):r=[yl])}g=g.return}r!==null&&Hf(i,r,l,f),i.flags|=262144}function Ic(r){for(r=r.firstContext;r!==null;){if(!Hn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Si(r){wi=r,Kr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function cn(r){return mb(wi,r)}function Bc(r,i){return wi===null&&Si(r),mb(r,i)}function mb(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Kr===null){if(r===null)throw Error(a(308));Kr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Kr=Kr.next=i;return l}var QC=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,f){r.push(f)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},WC=e.unstable_scheduleCallback,e4=e.unstable_NormalPriority,Ut={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qf(){return{controller:new QC,data:new Map,refCount:0}}function qo(r){r.refCount--,r.refCount===0&&WC(e4,function(){r.controller.abort()})}var Go=null,Gf=0,gs=0,ys=null;function t4(r,i){if(Go===null){var l=Go=[];Gf=0,gs=Kh(),ys={status:"pending",value:void 0,then:function(f){l.push(f)}}}return Gf++,i.then(pb,pb),i}function pb(){if(--Gf===0&&Go!==null){ys!==null&&(ys.status="fulfilled");var r=Go;Go=null,gs=0,ys=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function n4(r,i){var l=[],f={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return r.then(function(){f.status="fulfilled",f.value=i;for(var g=0;g<l.length;g++)(0,l[g])(i)},function(g){for(f.status="rejected",f.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),f}var xb=Z.S;Z.S=function(r,i){W0=bt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&t4(r,i),xb!==null&&xb(r,i)};var zi=C(null);function Yf(){var r=zi.current;return r!==null?r:mt.pooledCache}function Vc(r,i){i===null?w(zi,zi.current):w(zi,i.pool)}function gb(){var r=Yf();return r===null?null:{parent:Ut._currentValue,pool:r}}var bs=Error(a(460)),Jf=Error(a(474)),Zc=Error(a(542)),Fc={then:function(){}};function yb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function bb(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then(qr,qr),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,kb(r),r;default:if(typeof i.status=="string")i.then(qr,qr);else{if(r=mt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(f){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=f}},function(f){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,kb(r),r}throw _i=i,bs}}function ji(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(_i=l,bs):l}}var _i=null;function vb(){if(_i===null)throw Error(a(459));var r=_i;return _i=null,r}function kb(r){if(r===bs||r===Zc)throw Error(a(483))}var vs=null,Yo=0;function Hc(r){var i=Yo;return Yo+=1,vs===null&&(vs=[]),bb(vs,r,i)}function Jo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function qc(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 wb(r){function i(F,L){if(r){var q=F.deletions;q===null?(F.deletions=[L],F.flags|=16):q.push(L)}}function l(F,L){if(!r)return null;for(;L!==null;)i(F,L),L=L.sibling;return null}function f(F){for(var L=new Map;F!==null;)F.key!==null?L.set(F.key,F):L.set(F.index,F),F=F.sibling;return L}function g(F,L){return F=Yr(F,L),F.index=0,F.sibling=null,F}function y(F,L,q){return F.index=q,r?(q=F.alternate,q!==null?(q=q.index,q<L?(F.flags|=67108866,L):q):(F.flags|=67108866,L)):(F.flags|=1048576,L)}function k(F){return r&&F.alternate===null&&(F.flags|=67108866),F}function T(F,L,q,ae){return L===null||L.tag!==6?(L=Lf(q,F.mode,ae),L.return=F,L):(L=g(L,q),L.return=F,L)}function R(F,L,q,ae){var je=q.type;return je===z?W(F,L,q.props.children,ae,q.key):L!==null&&(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===U&&ji(je)===L.type)?(L=g(L,q.props),Jo(L,q),L.return=F,L):(L=Pc(q.type,q.key,q.props,null,F.mode,ae),Jo(L,q),L.return=F,L)}function G(F,L,q,ae){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=Pf(q,F.mode,ae),L.return=F,L):(L=g(L,q.children||[]),L.return=F,L)}function W(F,L,q,ae,je){return L===null||L.tag!==7?(L=vi(q,F.mode,ae,je),L.return=F,L):(L=g(L,q),L.return=F,L)}function ie(F,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Lf(""+L,F.mode,q),L.return=F,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case v:return q=Pc(L.type,L.key,L.props,null,F.mode,q),Jo(q,L),q.return=F,q;case S:return L=Pf(L,F.mode,q),L.return=F,L;case U:return L=ji(L),ie(F,L,q)}if(se(L)||le(L))return L=vi(L,F.mode,q,null),L.return=F,L;if(typeof L.then=="function")return ie(F,Hc(L),q);if(L.$$typeof===N)return ie(F,Bc(F,L),q);qc(F,L)}return null}function J(F,L,q,ae){var je=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:T(F,L,""+q,ae);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return q.key===je?R(F,L,q,ae):null;case S:return q.key===je?G(F,L,q,ae):null;case U:return q=ji(q),J(F,L,q,ae)}if(se(q)||le(q))return je!==null?null:W(F,L,q,ae,null);if(typeof q.then=="function")return J(F,L,Hc(q),ae);if(q.$$typeof===N)return J(F,L,Bc(F,q),ae);qc(F,q)}return null}function Q(F,L,q,ae,je){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return F=F.get(q)||null,T(L,F,""+ae,je);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:return F=F.get(ae.key===null?q:ae.key)||null,R(L,F,ae,je);case S:return F=F.get(ae.key===null?q:ae.key)||null,G(L,F,ae,je);case U:return ae=ji(ae),Q(F,L,q,ae,je)}if(se(ae)||le(ae))return F=F.get(q)||null,W(L,F,ae,je,null);if(typeof ae.then=="function")return Q(F,L,q,Hc(ae),je);if(ae.$$typeof===N)return Q(F,L,q,Bc(L,ae),je);qc(L,ae)}return null}function ye(F,L,q,ae){for(var je=null,et=null,Se=L,De=L=0,He=null;Se!==null&&De<q.length;De++){Se.index>De?(He=Se,Se=null):He=Se.sibling;var tt=J(F,Se,q[De],ae);if(tt===null){Se===null&&(Se=He);break}r&&Se&&tt.alternate===null&&i(F,Se),L=y(tt,L,De),et===null?je=tt:et.sibling=tt,et=tt,Se=He}if(De===q.length)return l(F,Se),Ge&&Jr(F,De),je;if(Se===null){for(;De<q.length;De++)Se=ie(F,q[De],ae),Se!==null&&(L=y(Se,L,De),et===null?je=Se:et.sibling=Se,et=Se);return Ge&&Jr(F,De),je}for(Se=f(Se);De<q.length;De++)He=Q(Se,F,De,q[De],ae),He!==null&&(r&&He.alternate!==null&&Se.delete(He.key===null?De:He.key),L=y(He,L,De),et===null?je=He:et.sibling=He,et=He);return r&&Se.forEach(function(Fa){return i(F,Fa)}),Ge&&Jr(F,De),je}function Ne(F,L,q,ae){if(q==null)throw Error(a(151));for(var je=null,et=null,Se=L,De=L=0,He=null,tt=q.next();Se!==null&&!tt.done;De++,tt=q.next()){Se.index>De?(He=Se,Se=null):He=Se.sibling;var Fa=J(F,Se,tt.value,ae);if(Fa===null){Se===null&&(Se=He);break}r&&Se&&Fa.alternate===null&&i(F,Se),L=y(Fa,L,De),et===null?je=Fa:et.sibling=Fa,et=Fa,Se=He}if(tt.done)return l(F,Se),Ge&&Jr(F,De),je;if(Se===null){for(;!tt.done;De++,tt=q.next())tt=ie(F,tt.value,ae),tt!==null&&(L=y(tt,L,De),et===null?je=tt:et.sibling=tt,et=tt);return Ge&&Jr(F,De),je}for(Se=f(Se);!tt.done;De++,tt=q.next())tt=Q(Se,F,De,tt.value,ae),tt!==null&&(r&&tt.alternate!==null&&Se.delete(tt.key===null?De:tt.key),L=y(tt,L,De),et===null?je=tt:et.sibling=tt,et=tt);return r&&Se.forEach(function(hT){return i(F,hT)}),Ge&&Jr(F,De),je}function dt(F,L,q,ae){if(typeof q=="object"&&q!==null&&q.type===z&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case v:e:{for(var je=q.key;L!==null;){if(L.key===je){if(je=q.type,je===z){if(L.tag===7){l(F,L.sibling),ae=g(L,q.props.children),ae.return=F,F=ae;break e}}else if(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===U&&ji(je)===L.type){l(F,L.sibling),ae=g(L,q.props),Jo(ae,q),ae.return=F,F=ae;break e}l(F,L);break}else i(F,L);L=L.sibling}q.type===z?(ae=vi(q.props.children,F.mode,ae,q.key),ae.return=F,F=ae):(ae=Pc(q.type,q.key,q.props,null,F.mode,ae),Jo(ae,q),ae.return=F,F=ae)}return k(F);case S:e:{for(je=q.key;L!==null;){if(L.key===je)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){l(F,L.sibling),ae=g(L,q.children||[]),ae.return=F,F=ae;break e}else{l(F,L);break}else i(F,L);L=L.sibling}ae=Pf(q,F.mode,ae),ae.return=F,F=ae}return k(F);case U:return q=ji(q),dt(F,L,q,ae)}if(se(q))return ye(F,L,q,ae);if(le(q)){if(je=le(q),typeof je!="function")throw Error(a(150));return q=je.call(q),Ne(F,L,q,ae)}if(typeof q.then=="function")return dt(F,L,Hc(q),ae);if(q.$$typeof===N)return dt(F,L,Bc(F,q),ae);qc(F,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(l(F,L.sibling),ae=g(L,q),ae.return=F,F=ae):(l(F,L),ae=Lf(q,F.mode,ae),ae.return=F,F=ae),k(F)):l(F,L)}return function(F,L,q,ae){try{Yo=0;var je=dt(F,L,q,ae);return vs=null,je}catch(Se){if(Se===bs||Se===Zc)throw Se;var et=qn(29,Se,null,F.mode);return et.lanes=ae,et.return=F,et}}}var Ni=wb(!0),Sb=wb(!1),Na=!1;function Kf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xf(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 Ca(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ta(r,i,l){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(nt&2)!==0){var g=f.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),f.pending=i,i=Lc(r),sb(r,null,l),i}return $c(r,f,i,l),Lc(r)}function Ko(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,my(r,l)}}function Qf(r,i){var l=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var g=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var k={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?g=y=k:y=y.next=k,l=l.next}while(l!==null);y===null?g=y=i:y=y.next=i}else g=y=i;l={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var Wf=!1;function Xo(){if(Wf){var r=ys;if(r!==null)throw r}}function Qo(r,i,l,f){Wf=!1;var g=r.updateQueue;Na=!1;var y=g.firstBaseUpdate,k=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var R=T,G=R.next;R.next=null,k===null?y=G:k.next=G,k=R;var W=r.alternate;W!==null&&(W=W.updateQueue,T=W.lastBaseUpdate,T!==k&&(T===null?W.firstBaseUpdate=G:T.next=G,W.lastBaseUpdate=R))}if(y!==null){var ie=g.baseState;k=0,W=G=R=null,T=y;do{var J=T.lane&-536870913,Q=J!==T.lane;if(Q?(Fe&J)===J:(f&J)===J){J!==0&&J===gs&&(Wf=!0),W!==null&&(W=W.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ye=r,Ne=T;J=i;var dt=l;switch(Ne.tag){case 1:if(ye=Ne.payload,typeof ye=="function"){ie=ye.call(dt,ie,J);break e}ie=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ne.payload,J=typeof ye=="function"?ye.call(dt,ie,J):ye,J==null)break e;ie=p({},ie,J);break e;case 2:Na=!0}}J=T.callback,J!==null&&(r.flags|=64,Q&&(r.flags|=8192),Q=g.callbacks,Q===null?g.callbacks=[J]:Q.push(J))}else Q={lane:J,tag:T.tag,payload:T.payload,callback:T.callback,next:null},W===null?(G=W=Q,R=ie):W=W.next=Q,k|=J;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;Q=T,T=Q.next,Q.next=null,g.lastBaseUpdate=Q,g.shared.pending=null}}while(!0);W===null&&(R=ie),g.baseState=R,g.firstBaseUpdate=G,g.lastBaseUpdate=W,y===null&&(g.shared.lanes=0),Da|=k,r.lanes=k,r.memoizedState=ie}}function zb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function jb(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)zb(l[r],i)}var ks=C(null),Gc=C(0);function _b(r,i){r=sa,w(Gc,r),w(ks,i),sa=r|i.baseLanes}function eh(){w(Gc,sa),w(ks,ks.current)}function th(){sa=Gc.current,H(ks),H(Gc)}var Gn=C(null),ur=null;function Ea(r){var i=r.alternate;w(Lt,Lt.current&1),w(Gn,r),ur===null&&(i===null||ks.current!==null||i.memoizedState!==null)&&(ur=r)}function nh(r){w(Lt,Lt.current),w(Gn,r),ur===null&&(ur=r)}function Nb(r){r.tag===22?(w(Lt,Lt.current),w(Gn,r),ur===null&&(ur=r)):Aa()}function Aa(){w(Lt,Lt.current),w(Gn,Gn.current)}function Yn(r){H(Gn),ur===r&&(ur=null),H(Lt)}var Lt=C(0);function Yc(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||lm(l)||cm(l)))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 Qr=0,Me=null,ct=null,It=null,Jc=!1,ws=!1,Ci=!1,Kc=0,Wo=0,Ss=null,r4=0;function Mt(){throw Error(a(321))}function rh(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Hn(r[l],i[l]))return!1;return!0}function ah(r,i,l,f,g,y){return Qr=y,Me=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?u0:bh,Ci=!1,y=l(f,g),Ci=!1,ws&&(y=Tb(i,l,f,g)),Cb(r),y}function Cb(r){Z.H=nl;var i=ct!==null&&ct.next!==null;if(Qr=0,It=ct=Me=null,Jc=!1,Wo=0,Ss=null,i)throw Error(a(300));r===null||Bt||(r=r.dependencies,r!==null&&Ic(r)&&(Bt=!0))}function Tb(r,i,l,f){Me=r;var g=0;do{if(ws&&(Ss=null),Wo=0,ws=!1,25<=g)throw Error(a(301));if(g+=1,It=ct=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}Z.H=d0,y=i(l,f)}while(ws);return y}function a4(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?el(i):i,r=r.useState()[0],(ct!==null?ct.memoizedState:null)!==r&&(Me.flags|=1024),i}function ih(){var r=Kc!==0;return Kc=0,r}function sh(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function oh(r){if(Jc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Jc=!1}Qr=0,It=ct=Me=null,ws=!1,Wo=Kc=0,Ss=null}function Sn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Me.memoizedState=It=r:It=It.next=r,It}function Pt(){if(ct===null){var r=Me.alternate;r=r!==null?r.memoizedState:null}else r=ct.next;var i=It===null?Me.memoizedState:It.next;if(i!==null)It=i,ct=r;else{if(r===null)throw Me.alternate===null?Error(a(467)):Error(a(310));ct=r,r={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},It===null?Me.memoizedState=It=r:It=It.next=r}return It}function Xc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function el(r){var i=Wo;return Wo+=1,Ss===null&&(Ss=[]),r=bb(Ss,r,i),i=Me,(It===null?i.memoizedState:It.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?u0:bh),r}function Qc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return el(r);if(r.$$typeof===N)return cn(r)}throw Error(a(438,String(r)))}function lh(r){var i=null,l=Me.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var f=Me.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Xc(),Me.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),f=0;f<r;f++)l[f]=I;return i.index++,l}function Wr(r,i){return typeof i=="function"?i(r):i}function Wc(r){var i=Pt();return ch(i,ct,r)}function ch(r,i,l){var f=r.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=l;var g=r.baseQueue,y=f.pending;if(y!==null){if(g!==null){var k=g.next;g.next=y.next,y.next=k}i.baseQueue=g=y,f.pending=null}if(y=r.baseState,g===null)r.memoizedState=y;else{i=g.next;var T=k=null,R=null,G=i,W=!1;do{var ie=G.lane&-536870913;if(ie!==G.lane?(Fe&ie)===ie:(Qr&ie)===ie){var J=G.revertLane;if(J===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ie===gs&&(W=!0);else if((Qr&J)===J){G=G.next,J===gs&&(W=!0);continue}else ie={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(T=R=ie,k=y):R=R.next=ie,Me.lanes|=J,Da|=J;ie=G.action,Ci&&l(y,ie),y=G.hasEagerState?G.eagerState:l(y,ie)}else J={lane:ie,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(T=R=J,k=y):R=R.next=J,Me.lanes|=ie,Da|=ie;G=G.next}while(G!==null&&G!==i);if(R===null?k=y:R.next=T,!Hn(y,r.memoizedState)&&(Bt=!0,W&&(l=ys,l!==null)))throw l;r.memoizedState=y,r.baseState=k,r.baseQueue=R,f.lastRenderedState=y}return g===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function uh(r){var i=Pt(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var f=l.dispatch,g=l.pending,y=i.memoizedState;if(g!==null){l.pending=null;var k=g=g.next;do y=r(y,k.action),k=k.next;while(k!==g);Hn(y,i.memoizedState)||(Bt=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),l.lastRenderedState=y}return[y,f]}function Eb(r,i,l){var f=Me,g=Pt(),y=Ge;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=i();var k=!Hn((ct||g).memoizedState,l);if(k&&(g.memoizedState=l,Bt=!0),g=g.queue,hh(Mb.bind(null,f,g,r),[r]),g.getSnapshot!==i||k||It!==null&&It.memoizedState.tag&1){if(f.flags|=2048,zs(9,{destroy:void 0},Ob.bind(null,f,g,l,i),null),mt===null)throw Error(a(349));y||(Qr&127)!==0||Ab(f,i,l)}return l}function Ab(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=Me.updateQueue,i===null?(i=Xc(),Me.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function Ob(r,i,l,f){i.value=l,i.getSnapshot=f,Db(i)&&Rb(r)}function Mb(r,i,l){return l(function(){Db(i)&&Rb(r)})}function Db(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Hn(r,l)}catch{return!0}}function Rb(r){var i=bi(r,2);i!==null&&Pn(i,r,2)}function dh(r){var i=Sn();if(typeof r=="function"){var l=r;if(r=l(),Ci){An(!0);try{l()}finally{An(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:r},i}function $b(r,i,l,f){return r.baseState=l,ch(r,ct,typeof f=="function"?f:Wr)}function i4(r,i,l,f,g){if(nu(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};Z.T!==null?l(!0):y.isTransition=!1,f(y),l=i.pending,l===null?(y.next=i.pending=y,Lb(i,y)):(y.next=l.next,i.pending=l.next=y)}}function Lb(r,i){var l=i.action,f=i.payload,g=r.state;if(i.isTransition){var y=Z.T,k={};Z.T=k;try{var T=l(g,f),R=Z.S;R!==null&&R(k,T),Pb(r,i,T)}catch(G){fh(r,i,G)}finally{y!==null&&k.types!==null&&(y.types=k.types),Z.T=y}}else try{y=l(g,f),Pb(r,i,y)}catch(G){fh(r,i,G)}}function Pb(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(f){Ub(r,i,f)},function(f){return fh(r,i,f)}):Ub(r,i,l)}function Ub(r,i,l){i.status="fulfilled",i.value=l,Ib(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,Lb(r,l)))}function fh(r,i,l){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=l,Ib(i),i=i.next;while(i!==f)}r.action=null}function Ib(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Bb(r,i){return i}function Vb(r,i){if(Ge){var l=mt.formState;if(l!==null){e:{var f=Me;if(Ge){if(vt){t:{for(var g=vt,y=cr;g.nodeType!==8;){if(!y){g=null;break t}if(g=dr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){vt=dr(g.nextSibling),f=g.data==="F!";break e}}ja(f)}f=!1}f&&(i=l[0])}}return l=Sn(),l.memoizedState=l.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bb,lastRenderedState:i},l.queue=f,l=o0.bind(null,Me,f),f.dispatch=l,f=dh(!1),y=yh.bind(null,Me,!1,f.queue),f=Sn(),g={state:i,dispatch:null,action:r,pending:null},f.queue=g,l=i4.bind(null,Me,g,y,l),g.dispatch=l,f.memoizedState=r,[i,l,!1]}function Zb(r){var i=Pt();return Fb(i,ct,r)}function Fb(r,i,l){if(i=ch(r,i,Bb)[0],r=Wc(Wr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=el(i)}catch(k){throw k===bs?Zc:k}else f=i;i=Pt();var g=i.queue,y=g.dispatch;return l!==i.memoizedState&&(Me.flags|=2048,zs(9,{destroy:void 0},s4.bind(null,g,l),null)),[f,y,r]}function s4(r,i){r.action=i}function Hb(r){var i=Pt(),l=ct;if(l!==null)return Fb(i,l,r);Pt(),i=i.memoizedState,l=Pt();var f=l.queue.dispatch;return l.memoizedState=r,[i,f,!1]}function zs(r,i,l,f){return r={tag:r,create:l,deps:f,inst:i,next:null},i=Me.updateQueue,i===null&&(i=Xc(),Me.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(f=l.next,l.next=r,r.next=f,i.lastEffect=r),r}function qb(){return Pt().memoizedState}function eu(r,i,l,f){var g=Sn();Me.flags|=r,g.memoizedState=zs(1|i,{destroy:void 0},l,f===void 0?null:f)}function tu(r,i,l,f){var g=Pt();f=f===void 0?null:f;var y=g.memoizedState.inst;ct!==null&&f!==null&&rh(f,ct.memoizedState.deps)?g.memoizedState=zs(i,y,l,f):(Me.flags|=r,g.memoizedState=zs(1|i,y,l,f))}function Gb(r,i){eu(8390656,8,r,i)}function hh(r,i){tu(2048,8,r,i)}function o4(r){Me.flags|=4;var i=Me.updateQueue;if(i===null)i=Xc(),Me.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function Yb(r){var i=Pt().memoizedState;return o4({ref:i,nextImpl:r}),function(){if((nt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Jb(r,i){return tu(4,2,r,i)}function Kb(r,i){return tu(4,4,r,i)}function Xb(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Qb(r,i,l){l=l!=null?l.concat([r]):null,tu(4,4,Xb.bind(null,i,r),l)}function mh(){}function Wb(r,i){var l=Pt();i=i===void 0?null:i;var f=l.memoizedState;return i!==null&&rh(i,f[1])?f[0]:(l.memoizedState=[r,i],r)}function e0(r,i){var l=Pt();i=i===void 0?null:i;var f=l.memoizedState;if(i!==null&&rh(i,f[1]))return f[0];if(f=r(),Ci){An(!0);try{r()}finally{An(!1)}}return l.memoizedState=[f,i],f}function ph(r,i,l){return l===void 0||(Qr&1073741824)!==0&&(Fe&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=tv(),Me.lanes|=r,Da|=r,l)}function t0(r,i,l,f){return Hn(l,i)?l:ks.current!==null?(r=ph(r,l,f),Hn(r,i)||(Bt=!0),r):(Qr&42)===0||(Qr&1073741824)!==0&&(Fe&261930)===0?(Bt=!0,r.memoizedState=l):(r=tv(),Me.lanes|=r,Da|=r,i)}function n0(r,i,l,f,g){var y=B.p;B.p=y!==0&&8>y?y:8;var k=Z.T,T={};Z.T=T,yh(r,!1,i,l);try{var R=g(),G=Z.S;if(G!==null&&G(T,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var W=n4(R,f);tl(r,i,W,Xn(r))}else tl(r,i,f,Xn(r))}catch(ie){tl(r,i,{then:function(){},status:"rejected",reason:ie},Xn())}finally{B.p=y,k!==null&&T.types!==null&&(k.types=T.types),Z.T=k}}function l4(){}function xh(r,i,l,f){if(r.tag!==5)throw Error(a(476));var g=r0(r).queue;n0(r,g,i,Y,l===null?l4:function(){return a0(r),l(f)})}function r0(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:Y},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function a0(r){var i=r0(r);i.next===null&&(i=r.alternate.memoizedState),tl(r,i.next.queue,{},Xn())}function gh(){return cn(yl)}function i0(){return Pt().memoizedState}function s0(){return Pt().memoizedState}function c4(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Xn();r=Ca(l);var f=Ta(i,r,l);f!==null&&(Pn(f,i,l),Ko(f,i,l)),i={cache:qf()},r.payload=i;return}i=i.return}}function u4(r,i,l){var f=Xn();l={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},nu(r)?l0(i,l):(l=Rf(r,i,l,f),l!==null&&(Pn(l,r,f),c0(l,i,f)))}function o0(r,i,l){var f=Xn();tl(r,i,l,f)}function tl(r,i,l,f){var g={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(nu(r))l0(i,g);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var k=i.lastRenderedState,T=y(k,l);if(g.hasEagerState=!0,g.eagerState=T,Hn(T,k))return $c(r,i,g,0),mt===null&&Rc(),!1}catch{}if(l=Rf(r,i,g,f),l!==null)return Pn(l,r,f),c0(l,i,f),!0}return!1}function yh(r,i,l,f){if(f={lane:2,revertLane:Kh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},nu(r)){if(i)throw Error(a(479))}else i=Rf(r,l,f,2),i!==null&&Pn(i,r,2)}function nu(r){var i=r.alternate;return r===Me||i!==null&&i===Me}function l0(r,i){ws=Jc=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function c0(r,i,l){if((l&4194048)!==0){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,my(r,l)}}var nl={readContext:cn,use:Qc,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};nl.useEffectEvent=Mt;var u0={readContext:cn,use:Qc,useCallback:function(r,i){return Sn().memoizedState=[r,i===void 0?null:i],r},useContext:cn,useEffect:Gb,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,eu(4194308,4,Xb.bind(null,i,r),l)},useLayoutEffect:function(r,i){return eu(4194308,4,r,i)},useInsertionEffect:function(r,i){eu(4,2,r,i)},useMemo:function(r,i){var l=Sn();i=i===void 0?null:i;var f=r();if(Ci){An(!0);try{r()}finally{An(!1)}}return l.memoizedState=[f,i],f},useReducer:function(r,i,l){var f=Sn();if(l!==void 0){var g=l(i);if(Ci){An(!0);try{l(i)}finally{An(!1)}}}else g=i;return f.memoizedState=f.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},f.queue=r,r=r.dispatch=u4.bind(null,Me,r),[f.memoizedState,r]},useRef:function(r){var i=Sn();return r={current:r},i.memoizedState=r},useState:function(r){r=dh(r);var i=r.queue,l=o0.bind(null,Me,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:mh,useDeferredValue:function(r,i){var l=Sn();return ph(l,r,i)},useTransition:function(){var r=dh(!1);return r=n0.bind(null,Me,r.queue,!0,!1),Sn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var f=Me,g=Sn();if(Ge){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),mt===null)throw Error(a(349));(Fe&127)!==0||Ab(f,i,l)}g.memoizedState=l;var y={value:l,getSnapshot:i};return g.queue=y,Gb(Mb.bind(null,f,y,r),[r]),f.flags|=2048,zs(9,{destroy:void 0},Ob.bind(null,f,y,l,i),null),l},useId:function(){var r=Sn(),i=mt.identifierPrefix;if(Ge){var l=Mr,f=Or;l=(f&~(1<<32-ht(f)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Kc++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=r4++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:gh,useFormState:Vb,useActionState:Vb,useOptimistic:function(r){var i=Sn();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=yh.bind(null,Me,!0,l),l.dispatch=i,[r,i]},useMemoCache:lh,useCacheRefresh:function(){return Sn().memoizedState=c4.bind(null,Me)},useEffectEvent:function(r){var i=Sn(),l={impl:r};return i.memoizedState=l,function(){if((nt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},bh={readContext:cn,use:Qc,useCallback:Wb,useContext:cn,useEffect:hh,useImperativeHandle:Qb,useInsertionEffect:Jb,useLayoutEffect:Kb,useMemo:e0,useReducer:Wc,useRef:qb,useState:function(){return Wc(Wr)},useDebugValue:mh,useDeferredValue:function(r,i){var l=Pt();return t0(l,ct.memoizedState,r,i)},useTransition:function(){var r=Wc(Wr)[0],i=Pt().memoizedState;return[typeof r=="boolean"?r:el(r),i]},useSyncExternalStore:Eb,useId:i0,useHostTransitionStatus:gh,useFormState:Zb,useActionState:Zb,useOptimistic:function(r,i){var l=Pt();return $b(l,ct,r,i)},useMemoCache:lh,useCacheRefresh:s0};bh.useEffectEvent=Yb;var d0={readContext:cn,use:Qc,useCallback:Wb,useContext:cn,useEffect:hh,useImperativeHandle:Qb,useInsertionEffect:Jb,useLayoutEffect:Kb,useMemo:e0,useReducer:uh,useRef:qb,useState:function(){return uh(Wr)},useDebugValue:mh,useDeferredValue:function(r,i){var l=Pt();return ct===null?ph(l,r,i):t0(l,ct.memoizedState,r,i)},useTransition:function(){var r=uh(Wr)[0],i=Pt().memoizedState;return[typeof r=="boolean"?r:el(r),i]},useSyncExternalStore:Eb,useId:i0,useHostTransitionStatus:gh,useFormState:Hb,useActionState:Hb,useOptimistic:function(r,i){var l=Pt();return ct!==null?$b(l,ct,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:lh,useCacheRefresh:s0};d0.useEffectEvent=Yb;function vh(r,i,l,f){i=r.memoizedState,l=l(f,i),l=l==null?i:p({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var kh={enqueueSetState:function(r,i,l){r=r._reactInternals;var f=Xn(),g=Ca(f);g.payload=i,l!=null&&(g.callback=l),i=Ta(r,g,f),i!==null&&(Pn(i,r,f),Ko(i,r,f))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var f=Xn(),g=Ca(f);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=Ta(r,g,f),i!==null&&(Pn(i,r,f),Ko(i,r,f))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Xn(),f=Ca(l);f.tag=2,i!=null&&(f.callback=i),i=Ta(r,f,l),i!==null&&(Pn(i,r,l),Ko(i,r,l))}};function f0(r,i,l,f,g,y,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,y,k):i.prototype&&i.prototype.isPureReactComponent?!Vo(l,f)||!Vo(g,y):!0}function h0(r,i,l,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==r&&kh.enqueueReplaceState(i,i.state,null)}function Ti(r,i){var l=i;if("ref"in i){l={};for(var f in i)f!=="ref"&&(l[f]=i[f])}if(r=r.defaultProps){l===i&&(l=p({},l));for(var g in r)l[g]===void 0&&(l[g]=r[g])}return l}function m0(r){Dc(r)}function p0(r){console.error(r)}function x0(r){Dc(r)}function ru(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function g0(r,i,l){try{var f=r.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function wh(r,i,l){return l=Ca(l),l.tag=3,l.payload={element:null},l.callback=function(){ru(r,i)},l}function y0(r){return r=Ca(r),r.tag=3,r}function b0(r,i,l,f){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var y=f.value;r.payload=function(){return g(y)},r.callback=function(){g0(i,l,f)}}var k=l.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){g0(i,l,f),typeof g!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var T=f.stack;this.componentDidCatch(f.value,{componentStack:T!==null?T:""})})}function d4(r,i,l,f,g){if(l.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=l.alternate,i!==null&&xs(i,l,g,!0),l=Gn.current,l!==null){switch(l.tag){case 31:case 13:return ur===null?pu():l.alternate===null&&Dt===0&&(Dt=3),l.flags&=-257,l.flags|=65536,l.lanes=g,f===Fc?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([f]):i.add(f),Gh(r,f,g)),!1;case 22:return l.flags|=65536,f===Fc?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([f]):l.add(f)),Gh(r,f,g)),!1}throw Error(a(435,l.tag))}return Gh(r,f,g),pu(),!1}if(Ge)return i=Gn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,f!==Bf&&(r=Error(a(422),{cause:f}),Ho(sr(r,l)))):(f!==Bf&&(i=Error(a(423),{cause:f}),Ho(sr(i,l))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,f=sr(f,l),g=wh(r.stateNode,f,g),Qf(r,g),Dt!==4&&(Dt=2)),!1;var y=Error(a(520),{cause:f});if(y=sr(y,l),ul===null?ul=[y]:ul.push(y),Dt!==4&&(Dt=2),i===null)return!0;f=sr(f,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=g&-g,l.lanes|=r,r=wh(l.stateNode,f,r),Qf(l,r),!1;case 1:if(i=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ra===null||!Ra.has(y))))return l.flags|=65536,g&=-g,l.lanes|=g,g=y0(g),b0(g,r,l,f),Qf(l,g),!1}l=l.return}while(l!==null);return!1}var Sh=Error(a(461)),Bt=!1;function un(r,i,l,f){i.child=r===null?Sb(i,null,l,f):Ni(i,r.child,l,f)}function v0(r,i,l,f,g){l=l.render;var y=i.ref;if("ref"in f){var k={};for(var T in f)T!=="ref"&&(k[T]=f[T])}else k=f;return Si(i),f=ah(r,i,l,k,y,g),T=ih(),r!==null&&!Bt?(sh(r,i,g),ea(r,i,g)):(Ge&&T&&Uf(i),i.flags|=1,un(r,i,f,g),i.child)}function k0(r,i,l,f,g){if(r===null){var y=l.type;return typeof y=="function"&&!$f(y)&&y.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=y,w0(r,i,y,f,g)):(r=Pc(l.type,null,f,i,i.mode,g),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Ah(r,g)){var k=y.memoizedProps;if(l=l.compare,l=l!==null?l:Vo,l(k,f)&&r.ref===i.ref)return ea(r,i,g)}return i.flags|=1,r=Yr(y,f),r.ref=i.ref,r.return=i,i.child=r}function w0(r,i,l,f,g){if(r!==null){var y=r.memoizedProps;if(Vo(y,f)&&r.ref===i.ref)if(Bt=!1,i.pendingProps=f=y,Ah(r,g))(r.flags&131072)!==0&&(Bt=!0);else return i.lanes=r.lanes,ea(r,i,g)}return zh(r,i,l,f,g)}function S0(r,i,l,f){var g=f.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,r!==null){for(f=i.child=r.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~y}else f=0,i.child=null;return z0(r,i,y,l,f)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Vc(i,y!==null?y.cachePool:null),y!==null?_b(i,y):eh(),Nb(i);else return f=i.lanes=536870912,z0(r,i,y!==null?y.baseLanes|l:l,l,f)}else y!==null?(Vc(i,y.cachePool),_b(i,y),Aa(),i.memoizedState=null):(r!==null&&Vc(i,null),eh(),Aa());return un(r,i,g,l),i.child}function rl(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function z0(r,i,l,f,g){var y=Yf();return y=y===null?null:{parent:Ut._currentValue,pool:y},i.memoizedState={baseLanes:l,cachePool:y},r!==null&&Vc(i,null),eh(),Nb(i),r!==null&&xs(r,i,f,!0),i.childLanes=g,null}function au(r,i){return i=su({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function j0(r,i,l){return Ni(i,r.child,null,l),r=au(i,i.pendingProps),r.flags|=2,Yn(i),i.memoizedState=null,r}function f4(r,i,l){var f=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ge){if(f.mode==="hidden")return r=au(i,f),i.lanes=536870912,rl(null,r);if(nh(i),(r=vt)?(r=Lv(r,cr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Sa!==null?{id:Or,overflow:Mr}:null,retryLane:536870912,hydrationErrors:null},l=lb(r),l.return=i,i.child=l,ln=i,vt=null)):r=null,r===null)throw ja(i);return i.lanes=536870912,null}return au(i,f)}var y=r.memoizedState;if(y!==null){var k=y.dehydrated;if(nh(i),g)if(i.flags&256)i.flags&=-257,i=j0(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Bt||xs(r,i,l,!1),g=(l&r.childLanes)!==0,Bt||g){if(f=mt,f!==null&&(k=py(f,l),k!==0&&k!==y.retryLane))throw y.retryLane=k,bi(r,k),Pn(f,r,k),Sh;pu(),i=j0(r,i,l)}else r=y.treeContext,vt=dr(k.nextSibling),ln=i,Ge=!0,za=null,cr=!1,r!==null&&db(i,r),i=au(i,f),i.flags|=4096;return i}return r=Yr(r.child,{mode:f.mode,children:f.children}),r.ref=i.ref,i.child=r,r.return=i,r}function iu(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function zh(r,i,l,f,g){return Si(i),l=ah(r,i,l,f,void 0,g),f=ih(),r!==null&&!Bt?(sh(r,i,g),ea(r,i,g)):(Ge&&f&&Uf(i),i.flags|=1,un(r,i,l,g),i.child)}function _0(r,i,l,f,g,y){return Si(i),i.updateQueue=null,l=Tb(i,f,l,g),Cb(r),f=ih(),r!==null&&!Bt?(sh(r,i,y),ea(r,i,y)):(Ge&&f&&Uf(i),i.flags|=1,un(r,i,l,y),i.child)}function N0(r,i,l,f,g){if(Si(i),i.stateNode===null){var y=fs,k=l.contextType;typeof k=="object"&&k!==null&&(y=cn(k)),y=new l(f,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=kh,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=f,y.state=i.memoizedState,y.refs={},Kf(i),k=l.contextType,y.context=typeof k=="object"&&k!==null?cn(k):fs,y.state=i.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(vh(i,l,k,f),y.state=i.memoizedState),typeof l.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&&kh.enqueueReplaceState(y,y.state,null),Qo(i,f,y,g),Xo(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(r===null){y=i.stateNode;var T=i.memoizedProps,R=Ti(l,T);y.props=R;var G=y.context,W=l.contextType;k=fs,typeof W=="object"&&W!==null&&(k=cn(W));var ie=l.getDerivedStateFromProps;W=typeof ie=="function"||typeof y.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,W||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T||G!==k)&&h0(i,y,f,k),Na=!1;var J=i.memoizedState;y.state=J,Qo(i,f,y,g),Xo(),G=i.memoizedState,T||J!==G||Na?(typeof ie=="function"&&(vh(i,l,ie,f),G=i.memoizedState),(R=Na||f0(i,l,R,f,J,G,k))?(W||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=f,i.memoizedState=G),y.props=f,y.state=G,y.context=k,f=R):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{y=i.stateNode,Xf(r,i),k=i.memoizedProps,W=Ti(l,k),y.props=W,ie=i.pendingProps,J=y.context,G=l.contextType,R=fs,typeof G=="object"&&G!==null&&(R=cn(G)),T=l.getDerivedStateFromProps,(G=typeof T=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==ie||J!==R)&&h0(i,y,f,R),Na=!1,J=i.memoizedState,y.state=J,Qo(i,f,y,g),Xo();var Q=i.memoizedState;k!==ie||J!==Q||Na||r!==null&&r.dependencies!==null&&Ic(r.dependencies)?(typeof T=="function"&&(vh(i,l,T,f),Q=i.memoizedState),(W=Na||f0(i,l,W,f,J,Q,R)||r!==null&&r.dependencies!==null&&Ic(r.dependencies))?(G||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,Q,R),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,Q,R)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=Q),y.props=f,y.state=Q,y.context=R,f=W):(typeof y.componentDidUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),f=!1)}return y=f,iu(r,i),f=(i.flags&128)!==0,y||f?(y=i.stateNode,l=f&&typeof l.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&f?(i.child=Ni(i,r.child,null,g),i.child=Ni(i,null,l,g)):un(r,i,l,g),i.memoizedState=y.state,r=i.child):r=ea(r,i,g),r}function C0(r,i,l,f){return ki(),i.flags|=256,un(r,i,l,f),i.child}var jh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _h(r){return{baseLanes:r,cachePool:gb()}}function Nh(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=Kn),r}function T0(r,i,l){var f=i.pendingProps,g=!1,y=(i.flags&128)!==0,k;if((k=y)||(k=r!==null&&r.memoizedState===null?!1:(Lt.current&2)!==0),k&&(g=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ge){if(g?Ea(i):Aa(),(r=vt)?(r=Lv(r,cr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Sa!==null?{id:Or,overflow:Mr}:null,retryLane:536870912,hydrationErrors:null},l=lb(r),l.return=i,i.child=l,ln=i,vt=null)):r=null,r===null)throw ja(i);return cm(r)?i.lanes=32:i.lanes=536870912,null}var T=f.children;return f=f.fallback,g?(Aa(),g=i.mode,T=su({mode:"hidden",children:T},g),f=vi(f,g,l,null),T.return=i,f.return=i,T.sibling=f,i.child=T,f=i.child,f.memoizedState=_h(l),f.childLanes=Nh(r,k,l),i.memoizedState=jh,rl(null,f)):(Ea(i),Ch(i,T))}var R=r.memoizedState;if(R!==null&&(T=R.dehydrated,T!==null)){if(y)i.flags&256?(Ea(i),i.flags&=-257,i=Th(r,i,l)):i.memoizedState!==null?(Aa(),i.child=r.child,i.flags|=128,i=null):(Aa(),T=f.fallback,g=i.mode,f=su({mode:"visible",children:f.children},g),T=vi(T,g,l,null),T.flags|=2,f.return=i,T.return=i,f.sibling=T,i.child=f,Ni(i,r.child,null,l),f=i.child,f.memoizedState=_h(l),f.childLanes=Nh(r,k,l),i.memoizedState=jh,i=rl(null,f));else if(Ea(i),cm(T)){if(k=T.nextSibling&&T.nextSibling.dataset,k)var G=k.dgst;k=G,f=Error(a(419)),f.stack="",f.digest=k,Ho({value:f,source:null,stack:null}),i=Th(r,i,l)}else if(Bt||xs(r,i,l,!1),k=(l&r.childLanes)!==0,Bt||k){if(k=mt,k!==null&&(f=py(k,l),f!==0&&f!==R.retryLane))throw R.retryLane=f,bi(r,f),Pn(k,r,f),Sh;lm(T)||pu(),i=Th(r,i,l)}else lm(T)?(i.flags|=192,i.child=r.child,i=null):(r=R.treeContext,vt=dr(T.nextSibling),ln=i,Ge=!0,za=null,cr=!1,r!==null&&db(i,r),i=Ch(i,f.children),i.flags|=4096);return i}return g?(Aa(),T=f.fallback,g=i.mode,R=r.child,G=R.sibling,f=Yr(R,{mode:"hidden",children:f.children}),f.subtreeFlags=R.subtreeFlags&65011712,G!==null?T=Yr(G,T):(T=vi(T,g,l,null),T.flags|=2),T.return=i,f.return=i,f.sibling=T,i.child=f,rl(null,f),f=i.child,T=r.child.memoizedState,T===null?T=_h(l):(g=T.cachePool,g!==null?(R=Ut._currentValue,g=g.parent!==R?{parent:R,pool:R}:g):g=gb(),T={baseLanes:T.baseLanes|l,cachePool:g}),f.memoizedState=T,f.childLanes=Nh(r,k,l),i.memoizedState=jh,rl(r.child,f)):(Ea(i),l=r.child,r=l.sibling,l=Yr(l,{mode:"visible",children:f.children}),l.return=i,l.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=l,i.memoizedState=null,l)}function Ch(r,i){return i=su({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function su(r,i){return r=qn(22,r,null,i),r.lanes=0,r}function Th(r,i,l){return Ni(i,r.child,null,l),r=Ch(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function E0(r,i,l){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),Ff(r.return,i,l)}function Eh(r,i,l,f,g,y){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:g,treeForkCount:y}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=f,k.tail=l,k.tailMode=g,k.treeForkCount=y)}function A0(r,i,l){var f=i.pendingProps,g=f.revealOrder,y=f.tail;f=f.children;var k=Lt.current,T=(k&2)!==0;if(T?(k=k&1|2,i.flags|=128):k&=1,w(Lt,k),un(r,i,f,l),f=Ge?Fo:0,!T&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&E0(r,l,i);else if(r.tag===19)E0(r,l,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(g){case"forwards":for(l=i.child,g=null;l!==null;)r=l.alternate,r!==null&&Yc(r)===null&&(g=l),l=l.sibling;l=g,l===null?(g=i.child,i.child=null):(g=l.sibling,l.sibling=null),Eh(i,!1,g,l,y,f);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=i.child,i.child=null;g!==null;){if(r=g.alternate,r!==null&&Yc(r)===null){i.child=g;break}r=g.sibling,g.sibling=l,l=g,g=r}Eh(i,!0,l,null,y,f);break;case"together":Eh(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function ea(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Da|=i.lanes,(l&i.childLanes)===0)if(r!==null){if(xs(r,i,l,!1),(l&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,l=Yr(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=Yr(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function Ah(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Ic(r)))}function h4(r,i,l){switch(i.tag){case 3:Pe(i,i.stateNode.containerInfo),_a(i,Ut,r.memoizedState.cache),ki();break;case 27:case 5:yt(i);break;case 4:Pe(i,i.stateNode.containerInfo);break;case 10:_a(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,nh(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Ea(i),i.flags|=128,null):(l&i.child.childLanes)!==0?T0(r,i,l):(Ea(i),r=ea(r,i,l),r!==null?r.sibling:null);Ea(i);break;case 19:var g=(r.flags&128)!==0;if(f=(l&i.childLanes)!==0,f||(xs(r,i,l,!1),f=(l&i.childLanes)!==0),g){if(f)return A0(r,i,l);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),w(Lt,Lt.current),f)break;return null;case 22:return i.lanes=0,S0(r,i,l,i.pendingProps);case 24:_a(i,Ut,r.memoizedState.cache)}return ea(r,i,l)}function O0(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)Bt=!0;else{if(!Ah(r,l)&&(i.flags&128)===0)return Bt=!1,h4(r,i,l);Bt=(r.flags&131072)!==0}else Bt=!1,Ge&&(i.flags&1048576)!==0&&ub(i,Fo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(r=ji(i.elementType),i.type=r,typeof r=="function")$f(r)?(f=Ti(r,f),i.tag=1,i=N0(null,i,r,f,l)):(i.tag=0,i=zh(null,i,r,f,l));else{if(r!=null){var g=r.$$typeof;if(g===P){i.tag=11,i=v0(null,i,r,f,l);break e}else if(g===V){i.tag=14,i=k0(null,i,r,f,l);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return zh(r,i,i.type,i.pendingProps,l);case 1:return f=i.type,g=Ti(f,i.pendingProps),N0(r,i,f,g,l);case 3:e:{if(Pe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));f=i.pendingProps;var y=i.memoizedState;g=y.element,Xf(r,i),Qo(i,f,null,l);var k=i.memoizedState;if(f=k.cache,_a(i,Ut,f),f!==y.cache&&Hf(i,[Ut],l,!0),Xo(),f=k.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=C0(r,i,f,l);break e}else if(f!==g){g=sr(Error(a(424)),i),Ho(g),i=C0(r,i,f,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,vt=dr(r.firstChild),ln=i,Ge=!0,za=null,cr=!0,l=Sb(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ki(),f===g){i=ea(r,i,l);break e}un(r,i,f,l)}i=i.child}return i;case 26:return iu(r,i),r===null?(l=Zv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ge||(l=i.type,r=i.pendingProps,f=wu(pe.current).createElement(l),f[on]=i,f[On]=r,dn(f,l,r),an(f),i.stateNode=f):i.memoizedState=Zv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return yt(i),r===null&&Ge&&(f=i.stateNode=Iv(i.type,i.pendingProps,pe.current),ln=i,cr=!0,g=vt,Ua(i.type)?(um=g,vt=dr(f.firstChild)):vt=g),un(r,i,i.pendingProps.children,l),iu(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ge&&((g=f=vt)&&(f=Z4(f,i.type,i.pendingProps,cr),f!==null?(i.stateNode=f,ln=i,vt=dr(f.firstChild),cr=!1,g=!0):g=!1),g||ja(i)),yt(i),g=i.type,y=i.pendingProps,k=r!==null?r.memoizedProps:null,f=y.children,im(g,y)?f=null:k!==null&&im(g,k)&&(i.flags|=32),i.memoizedState!==null&&(g=ah(r,i,a4,null,null,l),yl._currentValue=g),iu(r,i),un(r,i,f,l),i.child;case 6:return r===null&&Ge&&((r=l=vt)&&(l=F4(l,i.pendingProps,cr),l!==null?(i.stateNode=l,ln=i,vt=null,r=!0):r=!1),r||ja(i)),null;case 13:return T0(r,i,l);case 4:return Pe(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=Ni(i,null,f,l):un(r,i,f,l),i.child;case 11:return v0(r,i,i.type,i.pendingProps,l);case 7:return un(r,i,i.pendingProps,l),i.child;case 8:return un(r,i,i.pendingProps.children,l),i.child;case 12:return un(r,i,i.pendingProps.children,l),i.child;case 10:return f=i.pendingProps,_a(i,i.type,f.value),un(r,i,f.children,l),i.child;case 9:return g=i.type._context,f=i.pendingProps.children,Si(i),g=cn(g),f=f(g),i.flags|=1,un(r,i,f,l),i.child;case 14:return k0(r,i,i.type,i.pendingProps,l);case 15:return w0(r,i,i.type,i.pendingProps,l);case 19:return A0(r,i,l);case 31:return f4(r,i,l);case 22:return S0(r,i,l,i.pendingProps);case 24:return Si(i),f=cn(Ut),r===null?(g=Yf(),g===null&&(g=mt,y=qf(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=l),g=y),i.memoizedState={parent:f,cache:g},Kf(i),_a(i,Ut,g)):((r.lanes&l)!==0&&(Xf(r,i),Qo(i,null,null,l),Xo()),g=r.memoizedState,y=i.memoizedState,g.parent!==f?(g={parent:f,cache:f},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),_a(i,Ut,f)):(f=y.cache,_a(i,Ut,f),f!==g.cache&&Hf(i,[Ut],l,!0))),un(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ta(r){r.flags|=4}function Oh(r,i,l,f,g){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(g&335544128)===g)if(r.stateNode.complete)r.flags|=8192;else if(iv())r.flags|=8192;else throw _i=Fc,Jf}else r.flags&=-16777217}function M0(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Yv(i))if(iv())r.flags|=8192;else throw _i=Fc,Jf}function ou(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?fy():536870912,r.lanes|=i,Cs|=i)}function al(r,i){if(!Ge)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function kt(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,f=0;if(i)for(var g=r.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=l,i}function m4(r,i,l){var f=i.pendingProps;switch(If(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return l=i.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Xr(Ut),Ee(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(ps(i)?ta(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Vf())),kt(i),null;case 26:var g=i.type,y=i.memoizedState;return r===null?(ta(i),y!==null?(kt(i),M0(i,y)):(kt(i),Oh(i,g,null,f,l))):y?y!==r.memoizedState?(ta(i),kt(i),M0(i,y)):(kt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==f&&ta(i),kt(i),Oh(i,g,r,f,l)),null;case 27:if($(i),l=pe.current,g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&ta(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return kt(i),null}r=X.current,ps(i)?fb(i):(r=Iv(g,f,l),i.stateNode=r,ta(i))}return kt(i),null;case 5:if($(i),g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&ta(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return kt(i),null}if(y=X.current,ps(i))fb(i);else{var k=wu(pe.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?k.createElement("select",{is:f.is}):k.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?k.createElement(g,{is:f.is}):k.createElement(g)}}y[on]=i,y[On]=f;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(dn(y,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ta(i)}}return kt(i),Oh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==f&&ta(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(a(166));if(r=pe.current,ps(i)){if(r=i.stateNode,l=i.memoizedProps,f=null,g=ln,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}r[on]=i,r=!!(r.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||Tv(r.nodeValue,l)),r||ja(i,!0)}else r=wu(r).createTextNode(f),r[on]=i,i.stateNode=r}return kt(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(f=ps(i),l!==null){if(r===null){if(!f)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[on]=i}else ki(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),r=!1}else l=Vf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(Yn(i),i):(Yn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return kt(i),null;case 13:if(f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=ps(i),f!==null&&f.dehydrated!==null){if(r===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[on]=i}else ki(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),g=!1}else g=Vf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Yn(i),i):(Yn(i),null)}return Yn(i),(i.flags&128)!==0?(i.lanes=l,i):(l=f!==null,r=r!==null&&r.memoizedState!==null,l&&(f=i.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==g&&(f.flags|=2048)),l!==r&&l&&(i.child.flags|=8192),ou(i,i.updateQueue),kt(i),null);case 4:return Ee(),r===null&&em(i.stateNode.containerInfo),kt(i),null;case 10:return Xr(i.type),kt(i),null;case 19:if(H(Lt),f=i.memoizedState,f===null)return kt(i),null;if(g=(i.flags&128)!==0,y=f.rendering,y===null)if(g)al(f,!1);else{if(Dt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=Yc(r),y!==null){for(i.flags|=128,al(f,!1),r=y.updateQueue,i.updateQueue=r,ou(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)ob(l,r),l=l.sibling;return w(Lt,Lt.current&1|2),Ge&&Jr(i,f.treeForkCount),i.child}r=r.sibling}f.tail!==null&&bt()>fu&&(i.flags|=128,g=!0,al(f,!1),i.lanes=4194304)}else{if(!g)if(r=Yc(y),r!==null){if(i.flags|=128,g=!0,r=r.updateQueue,i.updateQueue=r,ou(i,r),al(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Ge)return kt(i),null}else 2*bt()-f.renderingStartTime>fu&&l!==536870912&&(i.flags|=128,g=!0,al(f,!1),i.lanes=4194304);f.isBackwards?(y.sibling=i.child,i.child=y):(r=f.last,r!==null?r.sibling=y:i.child=y,f.last=y)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=bt(),r.sibling=null,l=Lt.current,w(Lt,g?l&1|2:l&1),Ge&&Jr(i,f.treeForkCount),r):(kt(i),null);case 22:case 23:return Yn(i),th(),f=i.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(l&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),l=i.updateQueue,l!==null&&ou(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==l&&(i.flags|=2048),r!==null&&H(zi),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Xr(Ut),kt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function p4(r,i){switch(If(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Xr(Ut),Ee(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return $(i),null;case 31:if(i.memoizedState!==null){if(Yn(i),i.alternate===null)throw Error(a(340));ki()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Yn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ki()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return H(Lt),null;case 4:return Ee(),null;case 10:return Xr(i.type),null;case 22:case 23:return Yn(i),th(),r!==null&&H(zi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Xr(Ut),null;case 25:return null;default:return null}}function D0(r,i){switch(If(i),i.tag){case 3:Xr(Ut),Ee();break;case 26:case 27:case 5:$(i);break;case 4:Ee();break;case 31:i.memoizedState!==null&&Yn(i);break;case 13:Yn(i);break;case 19:H(Lt);break;case 10:Xr(i.type);break;case 22:case 23:Yn(i),th(),r!==null&&H(zi);break;case 24:Xr(Ut)}}function il(r,i){try{var l=i.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var g=f.next;l=g;do{if((l.tag&r)===r){f=void 0;var y=l.create,k=l.inst;f=y(),k.destroy=f}l=l.next}while(l!==g)}}catch(T){st(i,i.return,T)}}function Oa(r,i,l){try{var f=i.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var y=g.next;f=y;do{if((f.tag&r)===r){var k=f.inst,T=k.destroy;if(T!==void 0){k.destroy=void 0,g=i;var R=l,G=T;try{G()}catch(W){st(g,R,W)}}}f=f.next}while(f!==y)}}catch(W){st(i,i.return,W)}}function R0(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{jb(i,l)}catch(f){st(r,r.return,f)}}}function $0(r,i,l){l.props=Ti(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(f){st(r,i,f)}}function sl(r,i){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof l=="function"?r.refCleanup=l(f):l.current=f}}catch(g){st(r,i,g)}}function Dr(r,i){var l=r.ref,f=r.refCleanup;if(l!==null)if(typeof f=="function")try{f()}catch(g){st(r,i,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){st(r,i,g)}else l.current=null}function L0(r){var i=r.type,l=r.memoizedProps,f=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&f.focus();break e;case"img":l.src?f.src=l.src:l.srcSet&&(f.srcset=l.srcSet)}}catch(g){st(r,r.return,g)}}function Mh(r,i,l){try{var f=r.stateNode;L4(f,r.type,l,i),f[On]=i}catch(g){st(r,r.return,g)}}function P0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ua(r.type)||r.tag===4}function Dh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||P0(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&&Ua(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Rh(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=qr));else if(f!==4&&(f===27&&Ua(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(Rh(r,i,l),r=r.sibling;r!==null;)Rh(r,i,l),r=r.sibling}function lu(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(f!==4&&(f===27&&Ua(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(lu(r,i,l),r=r.sibling;r!==null;)lu(r,i,l),r=r.sibling}function U0(r){var i=r.stateNode,l=r.memoizedProps;try{for(var f=r.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);dn(i,f,l),i[on]=r,i[On]=l}catch(y){st(r,r.return,y)}}var na=!1,Vt=!1,$h=!1,I0=typeof WeakSet=="function"?WeakSet:Set,sn=null;function x4(r,i){if(r=r.containerInfo,rm=Tu,r=Qy(r),Tf(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var g=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var k=0,T=-1,R=-1,G=0,W=0,ie=r,J=null;t:for(;;){for(var Q;ie!==l||g!==0&&ie.nodeType!==3||(T=k+g),ie!==y||f!==0&&ie.nodeType!==3||(R=k+f),ie.nodeType===3&&(k+=ie.nodeValue.length),(Q=ie.firstChild)!==null;)J=ie,ie=Q;for(;;){if(ie===r)break t;if(J===l&&++G===g&&(T=k),J===y&&++W===f&&(R=k),(Q=ie.nextSibling)!==null)break;ie=J,J=ie.parentNode}ie=Q}l=T===-1||R===-1?null:{start:T,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(am={focusedElem:r,selectionRange:l},Tu=!1,sn=i;sn!==null;)if(i=sn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,sn=r;else for(;sn!==null;){switch(i=sn,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(l=0;l<r.length;l++)g=r[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,l=i,g=y.memoizedProps,y=y.memoizedState,f=l.stateNode;try{var ye=Ti(l.type,g);r=f.getSnapshotBeforeUpdate(ye,y),f.__reactInternalSnapshotBeforeUpdate=r}catch(Ne){st(l,l.return,Ne)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)om(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":om(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,sn=r;break}sn=i.return}}function B0(r,i,l){var f=l.flags;switch(l.tag){case 0:case 11:case 15:aa(r,l),f&4&&il(5,l);break;case 1:if(aa(r,l),f&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(k){st(l,l.return,k)}else{var g=Ti(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(g,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){st(l,l.return,k)}}f&64&&R0(l),f&512&&sl(l,l.return);break;case 3:if(aa(r,l),f&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{jb(r,i)}catch(k){st(l,l.return,k)}}break;case 27:i===null&&f&4&&U0(l);case 26:case 5:aa(r,l),i===null&&f&4&&L0(l),f&512&&sl(l,l.return);break;case 12:aa(r,l);break;case 31:aa(r,l),f&4&&F0(r,l);break;case 13:aa(r,l),f&4&&H0(r,l),f&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=j4.bind(null,l),H4(r,l))));break;case 22:if(f=l.memoizedState!==null||na,!f){i=i!==null&&i.memoizedState!==null||Vt,g=na;var y=Vt;na=f,(Vt=i)&&!y?ia(r,l,(l.subtreeFlags&8772)!==0):aa(r,l),na=g,Vt=y}break;case 30:break;default:aa(r,l)}}function V0(r){var i=r.alternate;i!==null&&(r.alternate=null,V0(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&ff(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 zt=null,Dn=!1;function ra(r,i,l){for(l=l.child;l!==null;)Z0(r,i,l),l=l.sibling}function Z0(r,i,l){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(wn,l)}catch{}switch(l.tag){case 26:Vt||Dr(l,i),ra(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Vt||Dr(l,i);var f=zt,g=Dn;Ua(l.type)&&(zt=l.stateNode,Dn=!1),ra(r,i,l),pl(l.stateNode),zt=f,Dn=g;break;case 5:Vt||Dr(l,i);case 6:if(f=zt,g=Dn,zt=null,ra(r,i,l),zt=f,Dn=g,zt!==null)if(Dn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(l.stateNode)}catch(y){st(l,i,y)}else try{zt.removeChild(l.stateNode)}catch(y){st(l,i,y)}break;case 18:zt!==null&&(Dn?(r=zt,Rv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),$s(r)):Rv(zt,l.stateNode));break;case 4:f=zt,g=Dn,zt=l.stateNode.containerInfo,Dn=!0,ra(r,i,l),zt=f,Dn=g;break;case 0:case 11:case 14:case 15:Oa(2,l,i),Vt||Oa(4,l,i),ra(r,i,l);break;case 1:Vt||(Dr(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"&&$0(l,i,f)),ra(r,i,l);break;case 21:ra(r,i,l);break;case 22:Vt=(f=Vt)||l.memoizedState!==null,ra(r,i,l),Vt=f;break;default:ra(r,i,l)}}function F0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{$s(r)}catch(l){st(i,i.return,l)}}}function H0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{$s(r)}catch(l){st(i,i.return,l)}}function g4(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new I0),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new I0),i;default:throw Error(a(435,r.tag))}}function cu(r,i){var l=g4(r);i.forEach(function(f){if(!l.has(f)){l.add(f);var g=_4.bind(null,r,f);f.then(g,g)}})}function Rn(r,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var g=l[f],y=r,k=i,T=k;e:for(;T!==null;){switch(T.tag){case 27:if(Ua(T.type)){zt=T.stateNode,Dn=!1;break e}break;case 5:zt=T.stateNode,Dn=!1;break e;case 3:case 4:zt=T.stateNode.containerInfo,Dn=!0;break e}T=T.return}if(zt===null)throw Error(a(160));Z0(y,k,g),zt=null,Dn=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)q0(i,r),i=i.sibling}var zr=null;function q0(r,i){var l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Rn(i,r),$n(r),f&4&&(Oa(3,r,r.return),il(3,r),Oa(5,r,r.return));break;case 1:Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),f&64&&na&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?f:l.concat(f))));break;case 26:var g=zr;if(Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),f&4){var y=l!==null?l.memoizedState:null;if(f=r.memoizedState,l===null)if(f===null)if(r.stateNode===null){e:{f=r.type,l=r.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Mo]||y[on]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(f),g.head.insertBefore(y,g.querySelector("head > title"))),dn(y,f,l),y[on]=r,an(y),f=y;break e;case"link":var k=qv("link","href",g).get(f+(l.href||""));if(k){for(var T=0;T<k.length;T++)if(y=k[T],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){k.splice(T,1);break t}}y=g.createElement(f),dn(y,f,l),g.head.appendChild(y);break;case"meta":if(k=qv("meta","content",g).get(f+(l.content||""))){for(T=0;T<k.length;T++)if(y=k[T],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){k.splice(T,1);break t}}y=g.createElement(f),dn(y,f,l),g.head.appendChild(y);break;default:throw Error(a(468,f))}y[on]=r,an(y),f=y}r.stateNode=f}else Gv(g,r.type,r.stateNode);else r.stateNode=Hv(g,f,r.memoizedProps);else y!==f?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,f===null?Gv(g,r.type,r.stateNode):Hv(g,f,r.memoizedProps)):f===null&&r.stateNode!==null&&Mh(r,r.memoizedProps,l.memoizedProps)}break;case 27:Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),l!==null&&f&4&&Mh(r,r.memoizedProps,l.memoizedProps);break;case 5:if(Rn(i,r),$n(r),f&512&&(Vt||l===null||Dr(l,l.return)),r.flags&32){g=r.stateNode;try{is(g,"")}catch(ye){st(r,r.return,ye)}}f&4&&r.stateNode!=null&&(g=r.memoizedProps,Mh(r,g,l!==null?l.memoizedProps:g)),f&1024&&($h=!0);break;case 6:if(Rn(i,r),$n(r),f&4){if(r.stateNode===null)throw Error(a(162));f=r.memoizedProps,l=r.stateNode;try{l.nodeValue=f}catch(ye){st(r,r.return,ye)}}break;case 3:if(ju=null,g=zr,zr=Su(i.containerInfo),Rn(i,r),zr=g,$n(r),f&4&&l!==null&&l.memoizedState.isDehydrated)try{$s(i.containerInfo)}catch(ye){st(r,r.return,ye)}$h&&($h=!1,G0(r));break;case 4:f=zr,zr=Su(r.stateNode.containerInfo),Rn(i,r),$n(r),zr=f;break;case 12:Rn(i,r),$n(r);break;case 31:Rn(i,r),$n(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,cu(r,f)));break;case 13:Rn(i,r),$n(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(du=bt()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,cu(r,f)));break;case 22:g=r.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,G=na,W=Vt;if(na=G||g,Vt=W||R,Rn(i,r),Vt=W,na=G,$n(r),f&8192)e:for(i=r.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(l===null||R||na||Vt||Ei(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){R=l=i;try{if(y=R.stateNode,g)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{T=R.stateNode;var ie=R.memoizedProps.style,J=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;T.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ye){st(R,R.return,ye)}}}else if(i.tag===6){if(l===null){R=i;try{R.stateNode.nodeValue=g?"":R.memoizedProps}catch(ye){st(R,R.return,ye)}}}else if(i.tag===18){if(l===null){R=i;try{var Q=R.stateNode;g?$v(Q,!0):$v(R.stateNode,!1)}catch(ye){st(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;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=r.updateQueue,f!==null&&(l=f.retryQueue,l!==null&&(f.retryQueue=null,cu(r,l))));break;case 19:Rn(i,r),$n(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,cu(r,f)));break;case 30:break;case 21:break;default:Rn(i,r),$n(r)}}function $n(r){var i=r.flags;if(i&2){try{for(var l,f=r.return;f!==null;){if(P0(f)){l=f;break}f=f.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var g=l.stateNode,y=Dh(r);lu(r,y,g);break;case 5:var k=l.stateNode;l.flags&32&&(is(k,""),l.flags&=-33);var T=Dh(r);lu(r,T,k);break;case 3:case 4:var R=l.stateNode.containerInfo,G=Dh(r);Rh(r,G,R);break;default:throw Error(a(161))}}catch(W){st(r,r.return,W)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function G0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;G0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function aa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)B0(r,i.alternate,i),i=i.sibling}function Ei(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Oa(4,i,i.return),Ei(i);break;case 1:Dr(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&$0(i,i.return,l),Ei(i);break;case 27:pl(i.stateNode);case 26:case 5:Dr(i,i.return),Ei(i);break;case 22:i.memoizedState===null&&Ei(i);break;case 30:Ei(i);break;default:Ei(i)}r=r.sibling}}function ia(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,g=r,y=i,k=y.flags;switch(y.tag){case 0:case 11:case 15:ia(g,y,l),il(4,y);break;case 1:if(ia(g,y,l),f=y,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(G){st(f,f.return,G)}if(f=y,g=f.updateQueue,g!==null){var T=f.stateNode;try{var R=g.shared.hiddenCallbacks;if(R!==null)for(g.shared.hiddenCallbacks=null,g=0;g<R.length;g++)zb(R[g],T)}catch(G){st(f,f.return,G)}}l&&k&64&&R0(y),sl(y,y.return);break;case 27:U0(y);case 26:case 5:ia(g,y,l),l&&f===null&&k&4&&L0(y),sl(y,y.return);break;case 12:ia(g,y,l);break;case 31:ia(g,y,l),l&&k&4&&F0(g,y);break;case 13:ia(g,y,l),l&&k&4&&H0(g,y);break;case 22:y.memoizedState===null&&ia(g,y,l),sl(y,y.return);break;case 30:break;default:ia(g,y,l)}i=i.sibling}}function Lh(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&qo(l))}function Ph(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&qo(r))}function jr(r,i,l,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Y0(r,i,l,f),i=i.sibling}function Y0(r,i,l,f){var g=i.flags;switch(i.tag){case 0:case 11:case 15:jr(r,i,l,f),g&2048&&il(9,i);break;case 1:jr(r,i,l,f);break;case 3:jr(r,i,l,f),g&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&qo(r)));break;case 12:if(g&2048){jr(r,i,l,f),r=i.stateNode;try{var y=i.memoizedProps,k=y.id,T=y.onPostCommit;typeof T=="function"&&T(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){st(i,i.return,R)}}else jr(r,i,l,f);break;case 31:jr(r,i,l,f);break;case 13:jr(r,i,l,f);break;case 23:break;case 22:y=i.stateNode,k=i.alternate,i.memoizedState!==null?y._visibility&2?jr(r,i,l,f):ol(r,i):y._visibility&2?jr(r,i,l,f):(y._visibility|=2,js(r,i,l,f,(i.subtreeFlags&10256)!==0||!1)),g&2048&&Lh(k,i);break;case 24:jr(r,i,l,f),g&2048&&Ph(i.alternate,i);break;default:jr(r,i,l,f)}}function js(r,i,l,f,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,k=i,T=l,R=f,G=k.flags;switch(k.tag){case 0:case 11:case 15:js(y,k,T,R,g),il(8,k);break;case 23:break;case 22:var W=k.stateNode;k.memoizedState!==null?W._visibility&2?js(y,k,T,R,g):ol(y,k):(W._visibility|=2,js(y,k,T,R,g)),g&&G&2048&&Lh(k.alternate,k);break;case 24:js(y,k,T,R,g),g&&G&2048&&Ph(k.alternate,k);break;default:js(y,k,T,R,g)}i=i.sibling}}function ol(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,f=i,g=f.flags;switch(f.tag){case 22:ol(l,f),g&2048&&Lh(f.alternate,f);break;case 24:ol(l,f),g&2048&&Ph(f.alternate,f);break;default:ol(l,f)}i=i.sibling}}var ll=8192;function _s(r,i,l){if(r.subtreeFlags&ll)for(r=r.child;r!==null;)J0(r,i,l),r=r.sibling}function J0(r,i,l){switch(r.tag){case 26:_s(r,i,l),r.flags&ll&&r.memoizedState!==null&&rT(l,zr,r.memoizedState,r.memoizedProps);break;case 5:_s(r,i,l);break;case 3:case 4:var f=zr;zr=Su(r.stateNode.containerInfo),_s(r,i,l),zr=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=ll,ll=16777216,_s(r,i,l),ll=f):_s(r,i,l));break;default:_s(r,i,l)}}function K0(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 cl(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];sn=f,Q0(f,r)}K0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)X0(r),r=r.sibling}function X0(r){switch(r.tag){case 0:case 11:case 15:cl(r),r.flags&2048&&Oa(9,r,r.return);break;case 3:cl(r);break;case 12:cl(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,uu(r)):cl(r);break;default:cl(r)}}function uu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];sn=f,Q0(f,r)}K0(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Oa(8,i,i.return),uu(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,uu(i));break;default:uu(i)}r=r.sibling}}function Q0(r,i){for(;sn!==null;){var l=sn;switch(l.tag){case 0:case 11:case 15:Oa(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var f=l.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:qo(l.memoizedState.cache)}if(f=l.child,f!==null)f.return=l,sn=f;else e:for(l=r;sn!==null;){f=sn;var g=f.sibling,y=f.return;if(V0(f),f===l){sn=null;break e}if(g!==null){g.return=y,sn=g;break e}sn=y}}}var y4={getCacheForType:function(r){var i=cn(Ut),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return cn(Ut).controller.signal}},b4=typeof WeakMap=="function"?WeakMap:Map,nt=0,mt=null,Ie=null,Fe=0,it=0,Jn=null,Ma=!1,Ns=!1,Uh=!1,sa=0,Dt=0,Da=0,Ai=0,Ih=0,Kn=0,Cs=0,ul=null,Ln=null,Bh=!1,du=0,W0=0,fu=1/0,hu=null,Ra=null,Qt=0,$a=null,Ts=null,oa=0,Vh=0,Zh=null,ev=null,dl=0,Fh=null;function Xn(){return(nt&2)!==0&&Fe!==0?Fe&-Fe:Z.T!==null?Kh():xy()}function tv(){if(Kn===0)if((Fe&536870912)===0||Ge){var r=kc;kc<<=1,(kc&3932160)===0&&(kc=262144),Kn=r}else Kn=536870912;return r=Gn.current,r!==null&&(r.flags|=32),Kn}function Pn(r,i,l){(r===mt&&(it===2||it===9)||r.cancelPendingCommit!==null)&&(Es(r,0),La(r,Fe,Kn,!1)),Oo(r,l),((nt&2)===0||r!==mt)&&(r===mt&&((nt&2)===0&&(Ai|=l),Dt===4&&La(r,Fe,Kn,!1)),Rr(r))}function nv(r,i,l){if((nt&6)!==0)throw Error(a(327));var f=!l&&(i&127)===0&&(i&r.expiredLanes)===0||Ao(r,i),g=f?w4(r,i):qh(r,i,!0),y=f;do{if(g===0){Ns&&!f&&La(r,i,0,!1);break}else{if(l=r.current.alternate,y&&!v4(l)){g=qh(r,i,!1),y=!1;continue}if(g===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 T=r;g=ul;var R=T.current.memoizedState.isDehydrated;if(R&&(Es(T,k).flags|=256),k=qh(T,k,!1),k!==2){if(Uh&&!R){T.errorRecoveryDisabledLanes|=y,Ai|=y,g=4;break e}y=Ln,Ln=g,y!==null&&(Ln===null?Ln=y:Ln.push.apply(Ln,y))}g=k}if(y=!1,g!==2)continue}}if(g===1){Es(r,0),La(r,i,0,!0);break}e:{switch(f=r,y=g,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:La(f,i,Kn,!Ma);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(g=du+300-bt(),10<g)){if(La(f,i,Kn,!Ma),Sc(f,0,!0)!==0)break e;oa=i,f.timeoutHandle=Mv(rv.bind(null,f,l,Ln,hu,Bh,i,Kn,Ai,Cs,Ma,y,"Throttled",-0,0),g);break e}rv(f,l,Ln,hu,Bh,i,Kn,Ai,Cs,Ma,y,null,-0,0)}}break}while(!0);Rr(r)}function rv(r,i,l,f,g,y,k,T,R,G,W,ie,J,Q){if(r.timeoutHandle=-1,ie=i.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},J0(i,y,ie);var ye=(y&62914560)===y?du-bt():(y&4194048)===y?W0-bt():0;if(ye=aT(ie,ye),ye!==null){oa=y,r.cancelPendingCommit=ye(dv.bind(null,r,i,y,l,f,g,k,T,R,W,ie,null,J,Q)),La(r,y,k,!G);return}}dv(r,i,y,l,f,g,k,T,R)}function v4(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var g=l[f],y=g.getSnapshot;g=g.value;try{if(!Hn(y(),g))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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 La(r,i,l,f){i&=~Ih,i&=~Ai,r.suspendedLanes|=i,r.pingedLanes&=~i,f&&(r.warmLanes|=i),f=r.expirationTimes;for(var g=i;0<g;){var y=31-ht(g),k=1<<y;f[y]=-1,g&=~k}l!==0&&hy(r,l,i)}function mu(){return(nt&6)===0?(fl(0),!1):!0}function Hh(){if(Ie!==null){if(it===0)var r=Ie.return;else r=Ie,Kr=wi=null,oh(r),vs=null,Yo=0,r=Ie;for(;r!==null;)D0(r.alternate,r),r=r.return;Ie=null}}function Es(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,I4(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),oa=0,Hh(),mt=r,Ie=l=Yr(r.current,null),Fe=i,it=0,Jn=null,Ma=!1,Ns=Ao(r,i),Uh=!1,Cs=Kn=Ih=Ai=Da=Dt=0,Ln=ul=null,Bh=!1,(i&8)!==0&&(i|=i&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=i;0<f;){var g=31-ht(f),y=1<<g;i|=r[g],f&=~y}return sa=i,Rc(),l}function av(r,i){Me=null,Z.H=nl,i===bs||i===Zc?(i=vb(),it=3):i===Jf?(i=vb(),it=4):it=i===Sh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Jn=i,Ie===null&&(Dt=1,ru(r,sr(i,r.current)))}function iv(){var r=Gn.current;return r===null?!0:(Fe&4194048)===Fe?ur===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?r===ur:!1}function sv(){var r=Z.H;return Z.H=nl,r===null?nl:r}function ov(){var r=Z.A;return Z.A=y4,r}function pu(){Dt=4,Ma||(Fe&4194048)!==Fe&&Gn.current!==null||(Ns=!0),(Da&134217727)===0&&(Ai&134217727)===0||mt===null||La(mt,Fe,Kn,!1)}function qh(r,i,l){var f=nt;nt|=2;var g=sv(),y=ov();(mt!==r||Fe!==i)&&(hu=null,Es(r,i)),i=!1;var k=Dt;e:do try{if(it!==0&&Ie!==null){var T=Ie,R=Jn;switch(it){case 8:Hh(),k=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(i=!0);var G=it;if(it=0,Jn=null,As(r,T,R,G),l&&Ns){k=0;break e}break;default:G=it,it=0,Jn=null,As(r,T,R,G)}}k4(),k=Dt;break}catch(W){av(r,W)}while(!0);return i&&r.shellSuspendCounter++,Kr=wi=null,nt=f,Z.H=g,Z.A=y,Ie===null&&(mt=null,Fe=0,Rc()),k}function k4(){for(;Ie!==null;)lv(Ie)}function w4(r,i){var l=nt;nt|=2;var f=sv(),g=ov();mt!==r||Fe!==i?(hu=null,fu=bt()+500,Es(r,i)):Ns=Ao(r,i);e:do try{if(it!==0&&Ie!==null){i=Ie;var y=Jn;t:switch(it){case 1:it=0,Jn=null,As(r,i,y,1);break;case 2:case 9:if(yb(y)){it=0,Jn=null,cv(i);break}i=function(){it!==2&&it!==9||mt!==r||(it=7),Rr(r)},y.then(i,i);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:yb(y)?(it=0,Jn=null,cv(i)):(it=0,Jn=null,As(r,i,y,7));break;case 5:var k=null;switch(Ie.tag){case 26:k=Ie.memoizedState;case 5:case 27:var T=Ie;if(k?Yv(k):T.stateNode.complete){it=0,Jn=null;var R=T.sibling;if(R!==null)Ie=R;else{var G=T.return;G!==null?(Ie=G,xu(G)):Ie=null}break t}}it=0,Jn=null,As(r,i,y,5);break;case 6:it=0,Jn=null,As(r,i,y,6);break;case 8:Hh(),Dt=6;break e;default:throw Error(a(462))}}S4();break}catch(W){av(r,W)}while(!0);return Kr=wi=null,Z.H=f,Z.A=g,nt=l,Ie!==null?0:(mt=null,Fe=0,Rc(),Dt)}function S4(){for(;Ie!==null&&!$t();)lv(Ie)}function lv(r){var i=O0(r.alternate,r,sa);r.memoizedProps=r.pendingProps,i===null?xu(r):Ie=i}function cv(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=_0(l,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=_0(l,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:oh(i);default:D0(l,i),i=Ie=ob(i,sa),i=O0(l,i,sa)}r.memoizedProps=r.pendingProps,i===null?xu(r):Ie=i}function As(r,i,l,f){Kr=wi=null,oh(i),vs=null,Yo=0;var g=i.return;try{if(d4(r,g,i,l,Fe)){Dt=1,ru(r,sr(l,r.current)),Ie=null;return}}catch(y){if(g!==null)throw Ie=g,y;Dt=1,ru(r,sr(l,r.current)),Ie=null;return}i.flags&32768?(Ge||f===1?r=!0:Ns||(Fe&536870912)!==0?r=!1:(Ma=r=!0,(f===2||f===9||f===3||f===6)&&(f=Gn.current,f!==null&&f.tag===13&&(f.flags|=16384))),uv(i,r)):xu(i)}function xu(r){var i=r;do{if((i.flags&32768)!==0){uv(i,Ma);return}r=i.return;var l=m4(i.alternate,i,sa);if(l!==null){Ie=l;return}if(i=i.sibling,i!==null){Ie=i;return}Ie=i=r}while(i!==null);Dt===0&&(Dt=5)}function uv(r,i){do{var l=p4(r.alternate,r);if(l!==null){l.flags&=32767,Ie=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){Ie=r;return}Ie=r=l}while(r!==null);Dt=6,Ie=null}function dv(r,i,l,f,g,y,k,T,R){r.cancelPendingCommit=null;do gu();while(Qt!==0);if((nt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Df,nC(r,l,y,k,T,R),r===mt&&(Ie=mt=null,Fe=0),Ts=i,$a=r,oa=l,Vh=y,Zh=g,ev=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,N4(we,function(){return xv(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=Z.T,Z.T=null,g=B.p,B.p=2,k=nt,nt|=4;try{x4(r,i,l)}finally{nt=k,B.p=g,Z.T=f}}Qt=1,fv(),hv(),mv()}}function fv(){if(Qt===1){Qt=0;var r=$a,i=Ts,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=Z.T,Z.T=null;var f=B.p;B.p=2;var g=nt;nt|=4;try{q0(i,r);var y=am,k=Qy(r.containerInfo),T=y.focusedElem,R=y.selectionRange;if(k!==T&&T&&T.ownerDocument&&Xy(T.ownerDocument.documentElement,T)){if(R!==null&&Tf(T)){var G=R.start,W=R.end;if(W===void 0&&(W=G),"selectionStart"in T)T.selectionStart=G,T.selectionEnd=Math.min(W,T.value.length);else{var ie=T.ownerDocument||document,J=ie&&ie.defaultView||window;if(J.getSelection){var Q=J.getSelection(),ye=T.textContent.length,Ne=Math.min(R.start,ye),dt=R.end===void 0?Ne:Math.min(R.end,ye);!Q.extend&&Ne>dt&&(k=dt,dt=Ne,Ne=k);var F=Ky(T,Ne),L=Ky(T,dt);if(F&&L&&(Q.rangeCount!==1||Q.anchorNode!==F.node||Q.anchorOffset!==F.offset||Q.focusNode!==L.node||Q.focusOffset!==L.offset)){var q=ie.createRange();q.setStart(F.node,F.offset),Q.removeAllRanges(),Ne>dt?(Q.addRange(q),Q.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),Q.addRange(q))}}}}for(ie=[],Q=T;Q=Q.parentNode;)Q.nodeType===1&&ie.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ie.length;T++){var ae=ie[T];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Tu=!!rm,am=rm=null}finally{nt=g,B.p=f,Z.T=l}}r.current=i,Qt=2}}function hv(){if(Qt===2){Qt=0;var r=$a,i=Ts,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=Z.T,Z.T=null;var f=B.p;B.p=2;var g=nt;nt|=4;try{B0(r,i.alternate,i)}finally{nt=g,B.p=f,Z.T=l}}Qt=3}}function mv(){if(Qt===4||Qt===3){Qt=0,Kt();var r=$a,i=Ts,l=oa,f=ev;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Qt=5:(Qt=0,Ts=$a=null,pv(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(Ra=null),uf(l),i=i.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(wn,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=Z.T,g=B.p,B.p=2,Z.T=null;try{for(var y=r.onRecoverableError,k=0;k<f.length;k++){var T=f[k];y(T.value,{componentStack:T.stack})}}finally{Z.T=i,B.p=g}}(oa&3)!==0&&gu(),Rr(r),g=r.pendingLanes,(l&261930)!==0&&(g&42)!==0?r===Fh?dl++:(dl=0,Fh=r):dl=0,fl(0)}}function pv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,qo(i)))}function gu(){return fv(),hv(),mv(),xv()}function xv(){if(Qt!==5)return!1;var r=$a,i=Vh;Vh=0;var l=uf(oa),f=Z.T,g=B.p;try{B.p=32>l?32:l,Z.T=null,l=Zh,Zh=null;var y=$a,k=oa;if(Qt=0,Ts=$a=null,oa=0,(nt&6)!==0)throw Error(a(331));var T=nt;if(nt|=4,X0(y.current),Y0(y,y.current,k,l),nt=T,fl(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(wn,y)}catch{}return!0}finally{B.p=g,Z.T=f,pv(r,i)}}function gv(r,i,l){i=sr(l,i),i=wh(r.stateNode,i,2),r=Ta(r,i,2),r!==null&&(Oo(r,2),Rr(r))}function st(r,i,l){if(r.tag===3)gv(r,r,l);else for(;i!==null;){if(i.tag===3){gv(i,r,l);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ra===null||!Ra.has(f))){r=sr(l,r),l=y0(2),f=Ta(i,l,2),f!==null&&(b0(l,f,i,r),Oo(f,2),Rr(f));break}}i=i.return}}function Gh(r,i,l){var f=r.pingCache;if(f===null){f=r.pingCache=new b4;var g=new Set;f.set(i,g)}else g=f.get(i),g===void 0&&(g=new Set,f.set(i,g));g.has(l)||(Uh=!0,g.add(l),r=z4.bind(null,r,i,l),i.then(r,r))}function z4(r,i,l){var f=r.pingCache;f!==null&&f.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,mt===r&&(Fe&l)===l&&(Dt===4||Dt===3&&(Fe&62914560)===Fe&&300>bt()-du?(nt&2)===0&&Es(r,0):Ih|=l,Cs===Fe&&(Cs=0)),Rr(r)}function yv(r,i){i===0&&(i=fy()),r=bi(r,i),r!==null&&(Oo(r,i),Rr(r))}function j4(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),yv(r,l)}function _4(r,i){var l=0;switch(r.tag){case 31:case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(l=g.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(i),yv(r,l)}function N4(r,i){return rn(r,i)}var yu=null,Os=null,Yh=!1,bu=!1,Jh=!1,Pa=0;function Rr(r){r!==Os&&r.next===null&&(Os===null?yu=Os=r:Os=Os.next=r),bu=!0,Yh||(Yh=!0,T4())}function fl(r,i){if(!Jh&&bu){Jh=!0;do for(var l=!1,f=yu;f!==null;){if(r!==0){var g=f.pendingLanes;if(g===0)var y=0;else{var k=f.suspendedLanes,T=f.pingedLanes;y=(1<<31-ht(42|r)+1)-1,y&=g&~(k&~T),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,wv(f,y))}else y=Fe,y=Sc(f,f===mt?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Ao(f,y)||(l=!0,wv(f,y));f=f.next}while(l);Jh=!1}}function C4(){bv()}function bv(){bu=Yh=!1;var r=0;Pa!==0&&U4()&&(r=Pa);for(var i=bt(),l=null,f=yu;f!==null;){var g=f.next,y=vv(f,i);y===0?(f.next=null,l===null?yu=g:l.next=g,g===null&&(Os=l)):(l=f,(r!==0||(y&3)!==0)&&(bu=!0)),f=g}Qt!==0&&Qt!==5||fl(r),Pa!==0&&(Pa=0)}function vv(r,i){for(var l=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var k=31-ht(y),T=1<<k,R=g[k];R===-1?((T&l)===0||(T&f)!==0)&&(g[k]=tC(T,i)):R<=i&&(r.expiredLanes|=T),y&=~T}if(i=mt,l=Fe,l=Sc(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,l===0||r===i&&(it===2||it===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&nr(f),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Ao(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(f!==null&&nr(f),uf(l)){case 2:case 8:l=fe;break;case 32:l=we;break;case 268435456:l=Ke;break;default:l=we}return f=kv.bind(null,r),l=rn(l,f),r.callbackPriority=i,r.callbackNode=l,i}return f!==null&&f!==null&&nr(f),r.callbackPriority=2,r.callbackNode=null,2}function kv(r,i){if(Qt!==0&&Qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(gu()&&r.callbackNode!==l)return null;var f=Fe;return f=Sc(r,r===mt?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(nv(r,f,i),vv(r,bt()),r.callbackNode!=null&&r.callbackNode===l?kv.bind(null,r):null)}function wv(r,i){if(gu())return null;nv(r,i,!0)}function T4(){B4(function(){(nt&6)!==0?rn(ee,C4):bv()})}function Kh(){if(Pa===0){var r=gs;r===0&&(r=vc,vc<<=1,(vc&261888)===0&&(vc=256)),Pa=r}return Pa}function Sv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Nc(""+r)}function zv(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function E4(r,i,l,f,g){if(i==="submit"&&l&&l.stateNode===g){var y=Sv((g[On]||null).action),k=f.submitter;k&&(i=(i=k[On]||null)?Sv(i.formAction):k.getAttribute("formAction"),i!==null&&(y=i,k=null));var T=new Ac("action","action",null,f,g);r.push({event:T,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Pa!==0){var R=k?zv(g,k):new FormData(g);xh(l,{pending:!0,data:R,method:g.method,action:y},null,R)}}else typeof y=="function"&&(T.preventDefault(),R=k?zv(g,k):new FormData(g),xh(l,{pending:!0,data:R,method:g.method,action:y},y,R))},currentTarget:g}]})}}for(var Xh=0;Xh<Mf.length;Xh++){var Qh=Mf[Xh],A4=Qh.toLowerCase(),O4=Qh[0].toUpperCase()+Qh.slice(1);Sr(A4,"on"+O4)}Sr(tb,"onAnimationEnd"),Sr(nb,"onAnimationIteration"),Sr(rb,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(YC,"onTransitionRun"),Sr(JC,"onTransitionStart"),Sr(KC,"onTransitionCancel"),Sr(ab,"onTransitionEnd"),rs("onMouseEnter",["mouseout","mouseover"]),rs("onMouseLeave",["mouseout","mouseover"]),rs("onPointerEnter",["pointerout","pointerover"]),rs("onPointerLeave",["pointerout","pointerover"]),pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),M4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function jv(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var f=r[l],g=f.event;f=f.listeners;e:{var y=void 0;if(i)for(var k=f.length-1;0<=k;k--){var T=f[k],R=T.instance,G=T.currentTarget;if(T=T.listener,R!==y&&g.isPropagationStopped())break e;y=T,g.currentTarget=G;try{y(g)}catch(W){Dc(W)}g.currentTarget=null,y=R}else for(k=0;k<f.length;k++){if(T=f[k],R=T.instance,G=T.currentTarget,T=T.listener,R!==y&&g.isPropagationStopped())break e;y=T,g.currentTarget=G;try{y(g)}catch(W){Dc(W)}g.currentTarget=null,y=R}}}}function Be(r,i){var l=i[df];l===void 0&&(l=i[df]=new Set);var f=r+"__bubble";l.has(f)||(_v(i,r,2,!1),l.add(f))}function Wh(r,i,l){var f=0;i&&(f|=4),_v(l,r,f,i)}var vu="_reactListening"+Math.random().toString(36).slice(2);function em(r){if(!r[vu]){r[vu]=!0,by.forEach(function(l){l!=="selectionchange"&&(M4.has(l)||Wh(l,!1,r),Wh(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[vu]||(i[vu]=!0,Wh("selectionchange",!1,i))}}function _v(r,i,l,f){switch(t1(i)){case 2:var g=oT;break;case 8:g=lT;break;default:g=pm}l=g.bind(null,i,l,r),g=void 0,!vf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(i,l,{capture:!0,passive:g}):r.addEventListener(i,l,!0):g!==void 0?r.addEventListener(i,l,{passive:g}):r.addEventListener(i,l,!1)}function tm(r,i,l,f,g){var y=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var k=f.tag;if(k===3||k===4){var T=f.stateNode.containerInfo;if(T===g)break;if(k===4)for(k=f.return;k!==null;){var R=k.tag;if((R===3||R===4)&&k.stateNode.containerInfo===g)return;k=k.return}for(;T!==null;){if(k=es(T),k===null)return;if(R=k.tag,R===5||R===6||R===26||R===27){f=y=k;continue e}T=T.parentNode}}f=f.return}Ay(function(){var G=y,W=yf(l),ie=[];e:{var J=ib.get(r);if(J!==void 0){var Q=Ac,ye=r;switch(r){case"keypress":if(Tc(l)===0)break e;case"keydown":case"keyup":Q=_C;break;case"focusin":ye="focus",Q=zf;break;case"focusout":ye="blur",Q=zf;break;case"beforeblur":case"afterblur":Q=zf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Dy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=mC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=TC;break;case tb:case nb:case rb:Q=gC;break;case ab:Q=AC;break;case"scroll":case"scrollend":Q=fC;break;case"wheel":Q=MC;break;case"copy":case"cut":case"paste":Q=bC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=$y;break;case"toggle":case"beforetoggle":Q=RC}var Ne=(i&4)!==0,dt=!Ne&&(r==="scroll"||r==="scrollend"),F=Ne?J!==null?J+"Capture":null:J;Ne=[];for(var L=G,q;L!==null;){var ae=L;if(q=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||q===null||F===null||(ae=Ro(L,F),ae!=null&&Ne.push(ml(L,ae,q))),dt)break;L=L.return}0<Ne.length&&(J=new Q(J,ye,null,l,W),ie.push({event:J,listeners:Ne}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",Q=r==="mouseout"||r==="pointerout",J&&l!==gf&&(ye=l.relatedTarget||l.fromElement)&&(es(ye)||ye[Wi]))break e;if((Q||J)&&(J=W.window===W?W:(J=W.ownerDocument)?J.defaultView||J.parentWindow:window,Q?(ye=l.relatedTarget||l.toElement,Q=G,ye=ye?es(ye):null,ye!==null&&(dt=c(ye),Ne=ye.tag,ye!==dt||Ne!==5&&Ne!==27&&Ne!==6)&&(ye=null)):(Q=null,ye=G),Q!==ye)){if(Ne=Dy,ae="onMouseLeave",F="onMouseEnter",L="mouse",(r==="pointerout"||r==="pointerover")&&(Ne=$y,ae="onPointerLeave",F="onPointerEnter",L="pointer"),dt=Q==null?J:Do(Q),q=ye==null?J:Do(ye),J=new Ne(ae,L+"leave",Q,l,W),J.target=dt,J.relatedTarget=q,ae=null,es(W)===G&&(Ne=new Ne(F,L+"enter",ye,l,W),Ne.target=q,Ne.relatedTarget=dt,ae=Ne),dt=ae,Q&&ye)t:{for(Ne=D4,F=Q,L=ye,q=0,ae=F;ae;ae=Ne(ae))q++;ae=0;for(var je=L;je;je=Ne(je))ae++;for(;0<q-ae;)F=Ne(F),q--;for(;0<ae-q;)L=Ne(L),ae--;for(;q--;){if(F===L||L!==null&&F===L.alternate){Ne=F;break t}F=Ne(F),L=Ne(L)}Ne=null}else Ne=null;Q!==null&&Nv(ie,J,Q,Ne,!1),ye!==null&&dt!==null&&Nv(ie,dt,ye,Ne,!0)}}e:{if(J=G?Do(G):window,Q=J.nodeName&&J.nodeName.toLowerCase(),Q==="select"||Q==="input"&&J.type==="file")var et=Fy;else if(Vy(J))if(Hy)et=HC;else{et=ZC;var Se=VC}else Q=J.nodeName,!Q||Q.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?G&&xf(G.elementType)&&(et=Fy):et=FC;if(et&&(et=et(r,G))){Zy(ie,et,l,W);break e}Se&&Se(r,J,G),r==="focusout"&&G&&J.type==="number"&&G.memoizedProps.value!=null&&pf(J,"number",J.value)}switch(Se=G?Do(G):window,r){case"focusin":(Vy(Se)||Se.contentEditable==="true")&&(cs=Se,Ef=G,Zo=null);break;case"focusout":Zo=Ef=cs=null;break;case"mousedown":Af=!0;break;case"contextmenu":case"mouseup":case"dragend":Af=!1,Wy(ie,l,W);break;case"selectionchange":if(GC)break;case"keydown":case"keyup":Wy(ie,l,W)}var De;if(_f)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 ls?Iy(r,l)&&(He="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(He="onCompositionStart");He&&(Ly&&l.locale!=="ko"&&(ls||He!=="onCompositionStart"?He==="onCompositionEnd"&&ls&&(De=Oy()):(wa=W,kf="value"in wa?wa.value:wa.textContent,ls=!0)),Se=ku(G,He),0<Se.length&&(He=new Ry(He,r,null,l,W),ie.push({event:He,listeners:Se}),De?He.data=De:(De=By(l),De!==null&&(He.data=De)))),(De=LC?PC(r,l):UC(r,l))&&(He=ku(G,"onBeforeInput"),0<He.length&&(Se=new Ry("onBeforeInput","beforeinput",null,l,W),ie.push({event:Se,listeners:He}),Se.data=De)),E4(ie,r,G,l,W)}jv(ie,i)})}function ml(r,i,l){return{instance:r,listener:i,currentTarget:l}}function ku(r,i){for(var l=i+"Capture",f=[];r!==null;){var g=r,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Ro(r,l),g!=null&&f.unshift(ml(r,g,y)),g=Ro(r,i),g!=null&&f.push(ml(r,g,y))),r.tag===3)return f;r=r.return}return[]}function D4(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Nv(r,i,l,f,g){for(var y=i._reactName,k=[];l!==null&&l!==f;){var T=l,R=T.alternate,G=T.stateNode;if(T=T.tag,R!==null&&R===f)break;T!==5&&T!==26&&T!==27||G===null||(R=G,g?(G=Ro(l,y),G!=null&&k.unshift(ml(l,G,R))):g||(G=Ro(l,y),G!=null&&k.push(ml(l,G,R)))),l=l.return}k.length!==0&&r.push({event:i,listeners:k})}var R4=/\r\n?/g,$4=/\u0000|\uFFFD/g;function Cv(r){return(typeof r=="string"?r:""+r).replace(R4,`
9
- `).replace($4,"")}function Tv(r,i){return i=Cv(i),Cv(r)===i}function ut(r,i,l,f,g,y){switch(l){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||is(r,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&is(r,""+f);break;case"className":jc(r,"class",f);break;case"tabIndex":jc(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":jc(r,l,f);break;case"style":Ty(r,f,y);break;case"data":if(i!=="object"){jc(r,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=Nc(""+f),r.setAttribute(l,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(l,"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"&&(l==="formAction"?(i!=="input"&&ut(r,i,"name",g.name,g,null),ut(r,i,"formEncType",g.formEncType,g,null),ut(r,i,"formMethod",g.formMethod,g,null),ut(r,i,"formTarget",g.formTarget,g,null)):(ut(r,i,"encType",g.encType,g,null),ut(r,i,"method",g.method,g,null),ut(r,i,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=Nc(""+f),r.setAttribute(l,f);break;case"onClick":f!=null&&(r.onclick=qr);break;case"onScroll":f!=null&&Be("scroll",r);break;case"onScrollEnd":f!=null&&Be("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}l=Nc(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""+f):r.removeAttribute(l);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":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":f===!0?r.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,f):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(l,f):r.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(l):r.setAttribute(l,f);break;case"popover":Be("beforetoggle",r),Be("toggle",r),zc(r,"popover",f);break;case"xlinkActuate":Hr(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Hr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Hr(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Hr(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Hr(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Hr(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Hr(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Hr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Hr(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":zc(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=uC.get(l)||l,zc(r,l,f))}}function nm(r,i,l,f,g,y){switch(l){case"style":Ty(r,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof f=="string"?is(r,f):(typeof f=="number"||typeof f=="bigint")&&is(r,""+f);break;case"onScroll":f!=null&&Be("scroll",r);break;case"onScrollEnd":f!=null&&Be("scrollend",r);break;case"onClick":f!=null&&(r.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vy.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),i=l.slice(2,g?l.length-7:void 0),y=r[On]||null,y=y!=null?y[l]:null,typeof y=="function"&&r.removeEventListener(i,y,g),typeof f=="function")){typeof y!="function"&&y!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,f,g);break e}l in r?r[l]=f:f===!0?r.setAttribute(l,""):zc(r,l,f)}}}function dn(r,i,l){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 f=!1,g=!1,y;for(y in l)if(l.hasOwnProperty(y)){var k=l[y];if(k!=null)switch(y){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ut(r,i,y,k,l,null)}}g&&ut(r,i,"srcSet",l.srcSet,l,null),f&&ut(r,i,"src",l.src,l,null);return;case"input":Be("invalid",r);var T=y=k=g=null,R=null,G=null;for(f in l)if(l.hasOwnProperty(f)){var W=l[f];if(W!=null)switch(f){case"name":g=W;break;case"type":k=W;break;case"checked":R=W;break;case"defaultChecked":G=W;break;case"value":y=W;break;case"defaultValue":T=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:ut(r,i,f,W,l,null)}}jy(r,y,T,R,G,k,g,!1);return;case"select":Be("invalid",r),f=k=y=null;for(g in l)if(l.hasOwnProperty(g)&&(T=l[g],T!=null))switch(g){case"value":y=T;break;case"defaultValue":k=T;break;case"multiple":f=T;default:ut(r,i,g,T,l,null)}i=y,l=k,r.multiple=!!f,i!=null?as(r,!!f,i,!1):l!=null&&as(r,!!f,l,!0);return;case"textarea":Be("invalid",r),y=g=f=null;for(k in l)if(l.hasOwnProperty(k)&&(T=l[k],T!=null))switch(k){case"value":f=T;break;case"defaultValue":g=T;break;case"children":y=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:ut(r,i,k,T,l,null)}Ny(r,f,g,y);return;case"option":for(R in l)l.hasOwnProperty(R)&&(f=l[R],f!=null)&&(R==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":ut(r,i,R,f,l,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(f=0;f<hl.length;f++)Be(hl[f],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(G in l)if(l.hasOwnProperty(G)&&(f=l[G],f!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ut(r,i,G,f,l,null)}return;default:if(xf(i)){for(W in l)l.hasOwnProperty(W)&&(f=l[W],f!==void 0&&nm(r,i,W,f,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(f=l[T],f!=null&&ut(r,i,T,f,l,null))}function L4(r,i,l,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,k=null,T=null,R=null,G=null,W=null;for(Q in l){var ie=l[Q];if(l.hasOwnProperty(Q)&&ie!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":R=ie;default:f.hasOwnProperty(Q)||ut(r,i,Q,null,f,ie)}}for(var J in f){var Q=f[J];if(ie=l[J],f.hasOwnProperty(J)&&(Q!=null||ie!=null))switch(J){case"type":y=Q;break;case"name":g=Q;break;case"checked":G=Q;break;case"defaultChecked":W=Q;break;case"value":k=Q;break;case"defaultValue":T=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:Q!==ie&&ut(r,i,J,Q,f,ie)}}mf(r,k,T,R,G,W,y,g);return;case"select":Q=k=T=J=null;for(y in l)if(R=l[y],l.hasOwnProperty(y)&&R!=null)switch(y){case"value":break;case"multiple":Q=R;default:f.hasOwnProperty(y)||ut(r,i,y,null,f,R)}for(g in f)if(y=f[g],R=l[g],f.hasOwnProperty(g)&&(y!=null||R!=null))switch(g){case"value":J=y;break;case"defaultValue":T=y;break;case"multiple":k=y;default:y!==R&&ut(r,i,g,y,f,R)}i=T,l=k,f=Q,J!=null?as(r,!!l,J,!1):!!f!=!!l&&(i!=null?as(r,!!l,i,!0):as(r,!!l,l?[]:"",!1));return;case"textarea":Q=J=null;for(T in l)if(g=l[T],l.hasOwnProperty(T)&&g!=null&&!f.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ut(r,i,T,null,f,g)}for(k in f)if(g=f[k],y=l[k],f.hasOwnProperty(k)&&(g!=null||y!=null))switch(k){case"value":J=g;break;case"defaultValue":Q=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==y&&ut(r,i,k,g,f,y)}_y(r,J,Q);return;case"option":for(var ye in l)J=l[ye],l.hasOwnProperty(ye)&&J!=null&&!f.hasOwnProperty(ye)&&(ye==="selected"?r.selected=!1:ut(r,i,ye,null,f,J));for(R in f)J=f[R],Q=l[R],f.hasOwnProperty(R)&&J!==Q&&(J!=null||Q!=null)&&(R==="selected"?r.selected=J&&typeof J!="function"&&typeof J!="symbol":ut(r,i,R,J,f,Q));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 Ne in l)J=l[Ne],l.hasOwnProperty(Ne)&&J!=null&&!f.hasOwnProperty(Ne)&&ut(r,i,Ne,null,f,J);for(G in f)if(J=f[G],Q=l[G],f.hasOwnProperty(G)&&J!==Q&&(J!=null||Q!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:ut(r,i,G,J,f,Q)}return;default:if(xf(i)){for(var dt in l)J=l[dt],l.hasOwnProperty(dt)&&J!==void 0&&!f.hasOwnProperty(dt)&&nm(r,i,dt,void 0,f,J);for(W in f)J=f[W],Q=l[W],!f.hasOwnProperty(W)||J===Q||J===void 0&&Q===void 0||nm(r,i,W,J,f,Q);return}}for(var F in l)J=l[F],l.hasOwnProperty(F)&&J!=null&&!f.hasOwnProperty(F)&&ut(r,i,F,null,f,J);for(ie in f)J=f[ie],Q=l[ie],!f.hasOwnProperty(ie)||J===Q||J==null&&Q==null||ut(r,i,ie,J,f,Q)}function Ev(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function P4(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var g=l[f],y=g.transferSize,k=g.initiatorType,T=g.duration;if(y&&T&&Ev(k)){for(k=0,T=g.responseEnd,f+=1;f<l.length;f++){var R=l[f],G=R.startTime;if(G>T)break;var W=R.transferSize,ie=R.initiatorType;W&&Ev(ie)&&(R=R.responseEnd,k+=W*(R<T?1:(T-G)/(R-G)))}if(--f,i+=8*(y+k)/(g.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 rm=null,am=null;function wu(r){return r.nodeType===9?r:r.ownerDocument}function Av(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 Ov(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 im(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 sm=null;function U4(){var r=window.event;return r&&r.type==="popstate"?r===sm?!1:(sm=r,!0):(sm=null,!1)}var Mv=typeof setTimeout=="function"?setTimeout:void 0,I4=typeof clearTimeout=="function"?clearTimeout:void 0,Dv=typeof Promise=="function"?Promise:void 0,B4=typeof queueMicrotask=="function"?queueMicrotask:typeof Dv<"u"?function(r){return Dv.resolve(null).then(r).catch(V4)}:Mv;function V4(r){setTimeout(function(){throw r})}function Ua(r){return r==="head"}function Rv(r,i){var l=i,f=0;do{var g=l.nextSibling;if(r.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(f===0){r.removeChild(g),$s(i);return}f--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")f++;else if(l==="html")pl(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,pl(l);for(var y=l.firstChild;y;){var k=y.nextSibling,T=y.nodeName;y[Mo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=k}}else l==="body"&&pl(r.ownerDocument.body);l=g}while(l);$s(i)}function $v(r,i){var l=r;r=0;do{var f=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=f}while(l)}function om(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":om(l),ff(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function Z4(r,i,l,f){for(;r.nodeType===1;){var g=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Mo])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!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=dr(r.nextSibling),r===null)break}return null}function F4(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=dr(r.nextSibling),r===null))return null;return r}function Lv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=dr(r.nextSibling),r===null))return null;return r}function lm(r){return r.data==="$?"||r.data==="$~"}function cm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function H4(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var f=function(){i(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function dr(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 um=null;function Pv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return dr(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function Uv(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function Iv(r,i,l){switch(i=wu(l),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 pl(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);ff(r)}var fr=new Map,Bv=new Set;function Su(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var la=B.d;B.d={f:q4,r:G4,D:Y4,C:J4,L:K4,m:X4,X:W4,S:Q4,M:eT};function q4(){var r=la.f(),i=mu();return r||i}function G4(r){var i=ts(r);i!==null&&i.tag===5&&i.type==="form"?a0(i):la.r(r)}var Ms=typeof document>"u"?null:document;function Vv(r,i,l){var f=Ms;if(f&&typeof i=="string"&&i){var g=ar(i);g='link[rel="'+r+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),Bv.has(g)||(Bv.add(g),r={rel:r,crossOrigin:l,href:i},f.querySelector(g)===null&&(i=f.createElement("link"),dn(i,"link",r),an(i),f.head.appendChild(i)))}}function Y4(r){la.D(r),Vv("dns-prefetch",r,null)}function J4(r,i){la.C(r,i),Vv("preconnect",r,i)}function K4(r,i,l){la.L(r,i,l);var f=Ms;if(f&&r&&i){var g='link[rel="preload"][as="'+ar(i)+'"]';i==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+ar(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+ar(l.imageSizes)+'"]')):g+='[href="'+ar(r)+'"]';var y=g;switch(i){case"style":y=Ds(r);break;case"script":y=Rs(r)}fr.has(y)||(r=p({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),fr.set(y,r),f.querySelector(g)!==null||i==="style"&&f.querySelector(xl(y))||i==="script"&&f.querySelector(gl(y))||(i=f.createElement("link"),dn(i,"link",r),an(i),f.head.appendChild(i)))}}function X4(r,i){la.m(r,i);var l=Ms;if(l&&r){var f=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+ar(f)+'"][href="'+ar(r)+'"]',y=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Rs(r)}if(!fr.has(y)&&(r=p({rel:"modulepreload",href:r},i),fr.set(y,r),l.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gl(y)))return}f=l.createElement("link"),dn(f,"link",r),an(f),l.head.appendChild(f)}}}function Q4(r,i,l){la.S(r,i,l);var f=Ms;if(f&&r){var g=ns(f).hoistableStyles,y=Ds(r);i=i||"default";var k=g.get(y);if(!k){var T={loading:0,preload:null};if(k=f.querySelector(xl(y)))T.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},l),(l=fr.get(y))&&dm(r,l);var R=k=f.createElement("link");an(R),dn(R,"link",r),R._p=new Promise(function(G,W){R.onload=G,R.onerror=W}),R.addEventListener("load",function(){T.loading|=1}),R.addEventListener("error",function(){T.loading|=2}),T.loading|=4,zu(k,i,f)}k={type:"stylesheet",instance:k,count:1,state:T},g.set(y,k)}}}function W4(r,i){la.X(r,i);var l=Ms;if(l&&r){var f=ns(l).hoistableScripts,g=Rs(r),y=f.get(g);y||(y=l.querySelector(gl(g)),y||(r=p({src:r,async:!0},i),(i=fr.get(g))&&fm(r,i),y=l.createElement("script"),an(y),dn(y,"link",r),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function eT(r,i){la.M(r,i);var l=Ms;if(l&&r){var f=ns(l).hoistableScripts,g=Rs(r),y=f.get(g);y||(y=l.querySelector(gl(g)),y||(r=p({src:r,async:!0,type:"module"},i),(i=fr.get(g))&&fm(r,i),y=l.createElement("script"),an(y),dn(y,"link",r),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function Zv(r,i,l,f){var g=(g=pe.current)?Su(g):null;if(!g)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Ds(l.href),l=ns(g).hoistableStyles,f=l.get(i),f||(f={type:"style",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=Ds(l.href);var y=ns(g).hoistableStyles,k=y.get(r);if(k||(g=g.ownerDocument||g,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,k),(y=g.querySelector(xl(r)))&&!y._p&&(k.instance=y,k.state.loading=5),fr.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},fr.set(r,l),y||tT(g,r,l,k.state))),i&&f===null)throw Error(a(528,""));return k}if(i&&f!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Rs(l),l=ns(g).hoistableScripts,f=l.get(i),f||(f={type:"script",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Ds(r){return'href="'+ar(r)+'"'}function xl(r){return'link[rel="stylesheet"]['+r+"]"}function Fv(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function tT(r,i,l,f){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=r.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),dn(i,"link",l),an(i),r.head.appendChild(i))}function Rs(r){return'[src="'+ar(r)+'"]'}function gl(r){return"script[async]"+r}function Hv(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var f=r.querySelector('style[data-href~="'+ar(l.href)+'"]');if(f)return i.instance=f,an(f),f;var g=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),an(f),dn(f,"style",g),zu(f,l.precedence,r),i.instance=f;case"stylesheet":g=Ds(l.href);var y=r.querySelector(xl(g));if(y)return i.state.loading|=4,i.instance=y,an(y),y;f=Fv(l),(g=fr.get(g))&&dm(f,g),y=(r.ownerDocument||r).createElement("link"),an(y);var k=y;return k._p=new Promise(function(T,R){k.onload=T,k.onerror=R}),dn(y,"link",f),i.state.loading|=4,zu(y,l.precedence,r),i.instance=y;case"script":return y=Rs(l.src),(g=r.querySelector(gl(y)))?(i.instance=g,an(g),g):(f=l,(g=fr.get(y))&&(f=p({},l),fm(f,g)),r=r.ownerDocument||r,g=r.createElement("script"),an(g),dn(g,"link",f),r.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,zu(f,l.precedence,r));return i.instance}function zu(r,i,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,y=g,k=0;k<f.length;k++){var T=f[k];if(T.dataset.precedence===i)y=T;else if(y!==g)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function dm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function fm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var ju=null;function qv(r,i,l){if(ju===null){var f=new Map,g=ju=new Map;g.set(l,f)}else g=ju,f=g.get(l),f||(f=new Map,g.set(l,f));if(f.has(r))return f;for(f.set(r,null),l=l.getElementsByTagName(r),g=0;g<l.length;g++){var y=l[g];if(!(y[Mo]||y[on]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(i)||"";k=r+k;var T=f.get(k);T?T.push(y):f.set(k,[y])}}return f}function Gv(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function nT(r,i,l){if(l===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 Yv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function rT(r,i,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=Ds(f.href),y=i.querySelector(xl(g));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=_u.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=y,an(y);return}y=i.ownerDocument||i,f=Fv(f),(g=fr.get(g))&&dm(f,g),y=y.createElement("link"),an(y);var k=y;k._p=new Promise(function(T,R){k.onload=T,k.onerror=R}),dn(y,"link",f),l.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=_u.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var hm=0;function aT(r,i){return r.stylesheets&&r.count===0&&Cu(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var f=setTimeout(function(){if(r.stylesheets&&Cu(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&hm===0&&(hm=62500*P4());var g=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Cu(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>hm?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function _u(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Nu=null;function Cu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Nu=new Map,i.forEach(iT,r),Nu=null,_u.call(r))}function iT(r,i){if(!(i.state.loading&4)){var l=Nu.get(r);if(l)var f=l.get(null);else{l=new Map,Nu.set(r,l);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var k=g[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(l.set(k.dataset.precedence,k),f=k)}f&&l.set(null,f)}g=i.instance,k=g.getAttribute("data-precedence"),y=l.get(k)||f,y===f&&l.set(null,g),l.set(k,g),this.count++,f=_u.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),y?y.parentNode.insertBefore(g,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),i.state.loading|=4}}var yl={$$typeof:N,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function sT(r,i,l,f,g,y,k,T,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=lf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lf(0),this.hiddenUpdates=lf(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Jv(r,i,l,f,g,y,k,T,R,G,W,ie){return r=new sT(r,i,l,k,R,G,W,ie,T),i=1,y===!0&&(i|=24),y=qn(3,null,null,i),r.current=y,y.stateNode=r,i=qf(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:f,isDehydrated:l,cache:i},Kf(y),r}function Kv(r){return r?(r=fs,r):fs}function Xv(r,i,l,f,g,y){g=Kv(g),f.context===null?f.context=g:f.pendingContext=g,f=Ca(i),f.payload={element:l},y=y===void 0?null:y,y!==null&&(f.callback=y),l=Ta(r,f,i),l!==null&&(Pn(l,r,i),Ko(l,r,i))}function Qv(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function mm(r,i){Qv(r,i),(r=r.alternate)&&Qv(r,i)}function Wv(r){if(r.tag===13||r.tag===31){var i=bi(r,67108864);i!==null&&Pn(i,r,67108864),mm(r,67108864)}}function e1(r){if(r.tag===13||r.tag===31){var i=Xn();i=cf(i);var l=bi(r,i);l!==null&&Pn(l,r,i),mm(r,i)}}var Tu=!0;function oT(r,i,l,f){var g=Z.T;Z.T=null;var y=B.p;try{B.p=2,pm(r,i,l,f)}finally{B.p=y,Z.T=g}}function lT(r,i,l,f){var g=Z.T;Z.T=null;var y=B.p;try{B.p=8,pm(r,i,l,f)}finally{B.p=y,Z.T=g}}function pm(r,i,l,f){if(Tu){var g=xm(f);if(g===null)tm(r,i,f,Eu,l),n1(r,f);else if(uT(g,r,i,l,f))f.stopPropagation();else if(n1(r,f),i&4&&-1<cT.indexOf(r)){for(;g!==null;){var y=ts(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=mi(y.pendingLanes);if(k!==0){var T=y;for(T.pendingLanes|=2,T.entangledLanes|=2;k;){var R=1<<31-ht(k);T.entanglements[1]|=R,k&=~R}Rr(y),(nt&6)===0&&(fu=bt()+500,fl(0))}}break;case 31:case 13:T=bi(y,2),T!==null&&Pn(T,y,2),mu(),mm(y,2)}if(y=xm(f),y===null&&tm(r,i,f,Eu,l),y===g)break;g=y}g!==null&&f.stopPropagation()}else tm(r,i,f,null,l)}}function xm(r){return r=yf(r),gm(r)}var Eu=null;function gm(r){if(Eu=null,r=es(r),r!==null){var i=c(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=o(i),r!==null)return r;r=null}else if(l===31){if(r=d(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Eu=r,null}function t1(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(Qi()){case ee:return 2;case fe:return 8;case we:case Ce:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var ym=!1,Ia=null,Ba=null,Va=null,bl=new Map,vl=new Map,Za=[],cT="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 n1(r,i){switch(r){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Va=null;break;case"pointerover":case"pointerout":bl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":vl.delete(i.pointerId)}}function kl(r,i,l,f,g,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:y,targetContainers:[g]},i!==null&&(i=ts(i),i!==null&&Wv(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),r)}function uT(r,i,l,f,g){switch(i){case"focusin":return Ia=kl(Ia,r,i,l,f,g),!0;case"dragenter":return Ba=kl(Ba,r,i,l,f,g),!0;case"mouseover":return Va=kl(Va,r,i,l,f,g),!0;case"pointerover":var y=g.pointerId;return bl.set(y,kl(bl.get(y)||null,r,i,l,f,g)),!0;case"gotpointercapture":return y=g.pointerId,vl.set(y,kl(vl.get(y)||null,r,i,l,f,g)),!0}return!1}function r1(r){var i=es(r.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=o(l),i!==null){r.blockedOn=i,gy(r.priority,function(){e1(l)});return}}else if(i===31){if(i=d(l),i!==null){r.blockedOn=i,gy(r.priority,function(){e1(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Au(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=xm(r.nativeEvent);if(l===null){l=r.nativeEvent;var f=new l.constructor(l.type,l);gf=f,l.target.dispatchEvent(f),gf=null}else return i=ts(l),i!==null&&Wv(i),r.blockedOn=l,!1;i.shift()}return!0}function a1(r,i,l){Au(r)&&l.delete(i)}function dT(){ym=!1,Ia!==null&&Au(Ia)&&(Ia=null),Ba!==null&&Au(Ba)&&(Ba=null),Va!==null&&Au(Va)&&(Va=null),bl.forEach(a1),vl.forEach(a1)}function Ou(r,i){r.blockedOn===i&&(r.blockedOn=null,ym||(ym=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,dT)))}var Mu=null;function i1(r){Mu!==r&&(Mu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Mu===r&&(Mu=null);for(var i=0;i<r.length;i+=3){var l=r[i],f=r[i+1],g=r[i+2];if(typeof f!="function"){if(gm(f||l)===null)continue;break}var y=ts(l);y!==null&&(r.splice(i,3),i-=3,xh(y,{pending:!0,data:g,method:l.method,action:f},f,g))}}))}function $s(r){function i(R){return Ou(R,r)}Ia!==null&&Ou(Ia,r),Ba!==null&&Ou(Ba,r),Va!==null&&Ou(Va,r),bl.forEach(i),vl.forEach(i);for(var l=0;l<Za.length;l++){var f=Za[l];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Za.length&&(l=Za[0],l.blockedOn===null);)r1(l),l.blockedOn===null&&Za.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var g=l[f],y=l[f+1],k=g[On]||null;if(typeof y=="function")k||i1(l);else if(k){var T=null;if(y&&y.hasAttribute("formAction")){if(g=y,k=y[On]||null)T=k.formAction;else if(gm(g)!==null)continue}else T=k.action;typeof T=="function"?l[f+1]=T:(l.splice(f,3),f-=3),i1(l)}}}function s1(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return g=k})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),f||setTimeout(l,20)}function l(){if(!f&&!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 f=!1,g=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function bm(r){this._internalRoot=r}Du.prototype.render=bm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,f=Xn();Xv(l,f,r,i,null,null)},Du.prototype.unmount=bm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Xv(r.current,2,null,r,null,null),mu(),i[Wi]=null}};function Du(r){this._internalRoot=r}Du.prototype.unstable_scheduleHydration=function(r){if(r){var i=xy();r={blockedOn:null,target:r,priority:i};for(var l=0;l<Za.length&&i!==0&&i<Za[l].priority;l++);Za.splice(l,0,r),l===0&&r1(r)}};var o1=t.version;if(o1!=="19.2.4")throw Error(a(527,o1,"19.2.4"));B.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?x(r):null,r=r===null?null:r.stateNode,r};var fT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ru.isDisabled&&Ru.supportsFiber)try{wn=Ru.inject(fT),Xt=Ru}catch{}}return Sl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var l=!1,f="",g=m0,y=p0,k=x0;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=Jv(r,1,!1,null,null,l,f,null,g,y,k,s1),r[Wi]=i.current,em(r),new bm(i)},Sl.hydrateRoot=function(r,i,l){if(!s(r))throw Error(a(299));var f=!1,g="",y=m0,k=p0,T=x0,R=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(k=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),i=Jv(r,1,!0,i,l??null,f,g,R,y,k,T,s1),i.context=Kv(null),l=i.current,f=Xn(),f=cf(f),g=Ca(f),g.callback=null,Ta(l,g,f),l=f,i.current.lanes=l,Oo(i,l),Rr(i),r[Wi]=i.current,em(r),new Du(i)},Sl.version="19.2.4",Sl}var g1;function wT(){if(g1)return wm.exports;g1=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(),wm.exports=kT(),wm.exports}var ST=wT();var y1="popstate";function zT(e={}){function t(a,s){let{pathname:c,search:o,hash:d}=a.location;return Op("",{pathname:c,search:o,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:Hl(s)}return _T(t,n,null,e)}function jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Er(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jT(){return Math.random().toString(36).substring(2,10)}function b1(e,t){return{usr:e.state,key:e.key,idx:t}}function Op(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?po(t):t,state:n,key:t&&t.key||a||jT()}}function Hl({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 po(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 _T(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:c=!1}=a,o=s.history,d="POP",h=null,m=x();m==null&&(m=0,o.replaceState({...o.state,idx:m},""));function x(){return(o.state||{idx:null}).idx}function p(){d="POP";let E=x(),_=E==null?null:E-m;m=E,h&&h({action:d,location:z.location,delta:_})}function b(E,_){d="PUSH";let A=Op(z.location,E,_);m=x()+1;let N=b1(A,m),P=z.createHref(A);try{o.pushState(N,"",P)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(P)}c&&h&&h({action:d,location:z.location,delta:1})}function v(E,_){d="REPLACE";let A=Op(z.location,E,_);m=x();let N=b1(A,m),P=z.createHref(A);o.replaceState(N,"",P),c&&h&&h({action:d,location:z.location,delta:0})}function S(E){return NT(E)}let z={get action(){return d},get location(){return e(s,o)},listen(E){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(y1,p),h=E,()=>{s.removeEventListener(y1,p),h=null}},createHref(E){return t(s,E)},createURL:S,encodeLocation(E){let _=S(E);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:b,replace:v,go(E){return o.go(E)}};return z}function NT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),jt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Hl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function rz(e,t,n="/"){return CT(e,t,n,!1)}function CT(e,t,n,a){let s=typeof t=="string"?po(t):t,c=xa(s.pathname||"/",n);if(c==null)return null;let o=az(e);TT(o);let d=null;for(let h=0;d==null&&h<o.length;++h){let m=IT(c);d=PT(o[h],m,a)}return d}function az(e,t=[],n=[],a="",s=!1){let c=(o,d,h=s,m)=>{let x={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:d,route:o};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(a)&&h)return;jt(x.relativePath.startsWith(a),`Absolute route path "${x.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(a.length)}let p=ma([a,x.relativePath]),b=n.concat(x);o.children&&o.children.length>0&&(jt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),az(o.children,t,b,p,h)),!(o.path==null&&!o.index)&&t.push({path:p,score:$T(p,o.index),routesMeta:b})};return e.forEach((o,d)=>{if(o.path===""||!o.path?.includes("?"))c(o,d);else for(let h of iz(o.path))c(o,d,!0,h)}),t}function iz(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 o=iz(a.join("/")),d=[];return d.push(...o.map(h=>h===""?c:[c,h].join("/"))),s&&d.push(...o),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function TT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var ET=/^:[\w-]+$/,AT=3,OT=2,MT=1,DT=10,RT=-2,v1=e=>e==="*";function $T(e,t){let n=e.split("/"),a=n.length;return n.some(v1)&&(a+=RT),t&&(a+=OT),n.filter(s=>!v1(s)).reduce((s,c)=>s+(ET.test(c)?AT:c===""?MT:DT),a)}function LT(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function PT(e,t,n=!1){let{routesMeta:a}=e,s={},c="/",o=[];for(let d=0;d<a.length;++d){let h=a[d],m=d===a.length-1,x=c==="/"?t:t.slice(c.length)||"/",p=yd({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},x),b=h.route;if(!p&&m&&n&&!a[a.length-1].route.index&&(p=yd({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},x)),!p)return null;Object.assign(s,p.params),o.push({params:s,pathname:ma([c,p.pathname]),pathnameBase:FT(ma([c,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(c=ma([c,p.pathnameBase]))}return o}function yd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=UT(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let c=s[0],o=c.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:a.reduce((m,{paramName:x,isOptional:p},b)=>{if(x==="*"){let S=d[b]||"";o=c.slice(0,c.length-S.length).replace(/(.)\/+$/,"$1")}const v=d[b];return p&&!v?m[x]=void 0:m[x]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:o,pattern:e}}function UT(e,t=!1,n=!0){Er(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,(o,d,h)=>(a.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function IT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Er(!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 xa(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 BT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function VT(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?po(e):e,c;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?c=k1(n.substring(1),"/"):c=k1(n,t)):c=t,{pathname:c,search:HT(a),hash:qT(s)}}function k1(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 _m(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 ZT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ix(e){let t=ZT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Bx(e,t,n,a=!1){let s;typeof e=="string"?s=po(e):(s={...e},jt(!s.pathname||!s.pathname.includes("?"),_m("?","pathname","search",s)),jt(!s.pathname||!s.pathname.includes("#"),_m("#","pathname","hash",s)),jt(!s.search||!s.search.includes("#"),_m("#","search","hash",s)));let c=e===""||s.pathname==="",o=c?"/":s.pathname,d;if(o==null)d=n;else{let p=t.length-1;if(!a&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),p-=1;s.pathname=b.join("/")}d=p>=0?t[p]:"/"}let h=VT(s,d),m=o&&o!=="/"&&o.endsWith("/"),x=(c||o===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||x)&&(h.pathname+="/"),h}var ma=e=>e.join("/").replace(/\/\/+/g,"/"),FT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),HT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,GT=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 YT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function JT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var sz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function oz(e,t){let n=e;if(typeof n!="string"||!BT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(sz)try{let c=new URL(window.location.href),o=n.startsWith("//")?new URL(c.protocol+n):new URL(n),d=xa(o.pathname,t);o.origin===c.origin&&d!=null?n=d+o.search+o.hash:s=!0}catch{Er(!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 lz=["POST","PUT","PATCH","DELETE"];new Set(lz);var KT=["GET",...lz];new Set(KT);var xo=j.createContext(null);xo.displayName="DataRouter";var Vd=j.createContext(null);Vd.displayName="DataRouterState";var XT=j.createContext(!1),cz=j.createContext({isTransitioning:!1});cz.displayName="ViewTransition";var QT=j.createContext(new Map);QT.displayName="Fetchers";var WT=j.createContext(null);WT.displayName="Await";var tr=j.createContext(null);tr.displayName="Navigation";var sc=j.createContext(null);sc.displayName="Location";var Ar=j.createContext({outlet:null,matches:[],isDataRoute:!1});Ar.displayName="Route";var Vx=j.createContext(null);Vx.displayName="RouteError";var uz="REACT_ROUTER_ERROR",eE="REDIRECT",tE="ROUTE_ERROR_RESPONSE";function nE(e){if(e.startsWith(`${uz}:${eE}:{`))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 rE(e){if(e.startsWith(`${uz}:${tE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new GT(t.status,t.statusText,t.data)}catch{}}function aE(e,{relative:t}={}){jt(go(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=j.useContext(tr),{hash:s,pathname:c,search:o}=oc(e,{relative:t}),d=c;return n!=="/"&&(d=c==="/"?n:ma([n,c])),a.createHref({pathname:d,search:o,hash:s})}function go(){return j.useContext(sc)!=null}function br(){return jt(go(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(sc).location}var dz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fz(e){j.useContext(tr).static||j.useLayoutEffect(e)}function yo(){let{isDataRoute:e}=j.useContext(Ar);return e?yE():iE()}function iE(){jt(go(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(xo),{basename:t,navigator:n}=j.useContext(tr),{matches:a}=j.useContext(Ar),{pathname:s}=br(),c=JSON.stringify(Ix(a)),o=j.useRef(!1);return fz(()=>{o.current=!0}),j.useCallback((h,m={})=>{if(Er(o.current,dz),!o.current)return;if(typeof h=="number"){n.go(h);return}let x=Bx(h,JSON.parse(c),s,m.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:ma([t,x.pathname])),(m.replace?n.replace:n.push)(x,m.state,m)},[t,n,c,s,e])}j.createContext(null);function sE(){let{matches:e}=j.useContext(Ar),t=e[e.length-1];return t?t.params:{}}function oc(e,{relative:t}={}){let{matches:n}=j.useContext(Ar),{pathname:a}=br(),s=JSON.stringify(Ix(n));return j.useMemo(()=>Bx(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function oE(e,t){return hz(e,t)}function hz(e,t,n,a,s){jt(go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=j.useContext(tr),{matches:o}=j.useContext(Ar),d=o[o.length-1],h=d?d.params:{},m=d?d.pathname:"/",x=d?d.pathnameBase:"/",p=d&&d.route;{let A=p&&p.path||"";pz(m,!p||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=br(),v;if(t){let A=typeof t=="string"?po(t):t;jt(x==="/"||A.pathname?.startsWith(x),`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 "${x}" but pathname "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=b;let S=v.pathname||"/",z=S;if(x!=="/"){let A=x.replace(/^\//,"").split("/");z="/"+S.replace(/^\//,"").split("/").slice(A.length).join("/")}let E=rz(e,{pathname:z});Er(p||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Er(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=fE(E&&E.map(A=>Object.assign({},A,{params:Object.assign({},h,A.params),pathname:ma([x,c.encodeLocation?c.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?x:ma([x,c.encodeLocation?c.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),o,n,a,s);return t&&_?j.createElement(sc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},_):_}function lE(){let e=gE(),t=YT(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},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:c},"ErrorBoundary")," or"," ",j.createElement("code",{style:c},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:s},n):null,o)}var cE=j.createElement(lE,null),mz=class extends j.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=rE(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Ar.Provider,{value:this.props.routeContext},j.createElement(Vx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(uE,{error:e},t):t}};mz.contextType=XT;var Nm=new WeakMap;function uE({children:e,error:t}){let{basename:n}=j.useContext(tr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=nE(t.digest);if(a){let s=Nm.get(t);if(s)throw s;let c=oz(a.location,n);if(sz&&!Nm.get(t))if(c.isExternal||a.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:a.replace}));throw Nm.set(t,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function dE({routeContext:e,match:t,children:n}){let a=j.useContext(xo);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Ar.Provider,{value:e},n)}function fE(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,o=n?.errors;if(o!=null){let x=c.findIndex(p=>p.route.id&&o?.[p.route.id]!==void 0);jt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let d=!1,h=-1;if(n)for(let x=0;x<c.length;x++){let p=c[x];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=x),p.route.id){let{loaderData:b,errors:v}=n,S=p.route.loader&&!b.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||S){d=!0,h>=0?c=c.slice(0,h+1):c=[c[0]];break}}}let m=n&&a?(x,p)=>{a(x,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:JT(n.matches),errorInfo:p})}:void 0;return c.reduceRight((x,p,b)=>{let v,S=!1,z=null,E=null;n&&(v=o&&p.route.id?o[p.route.id]:void 0,z=p.route.errorElement||cE,d&&(h<0&&b===0?(pz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):h===b&&(S=!0,E=p.route.hydrateFallbackElement||null)));let _=t.concat(c.slice(0,b+1)),A=()=>{let N;return v?N=z:S?N=E:p.route.Component?N=j.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=x,j.createElement(dE,{match:p,routeContext:{outlet:x,matches:_,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?j.createElement(mz,{location:n.location,revalidation:n.revalidation,component:z,error:v,children:A(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:m}):A()},null)}function Zx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hE(e){let t=j.useContext(xo);return jt(t,Zx(e)),t}function mE(e){let t=j.useContext(Vd);return jt(t,Zx(e)),t}function pE(e){let t=j.useContext(Ar);return jt(t,Zx(e)),t}function Fx(e){let t=pE(e),n=t.matches[t.matches.length-1];return jt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xE(){return Fx("useRouteId")}function gE(){let e=j.useContext(Vx),t=mE("useRouteError"),n=Fx("useRouteError");return e!==void 0?e:t.errors?.[n]}function yE(){let{router:e}=hE("useNavigate"),t=Fx("useNavigate"),n=j.useRef(!1);return fz(()=>{n.current=!0}),j.useCallback(async(s,c={})=>{Er(n.current,dz),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...c}))},[e,t])}var w1={};function pz(e,t,n){!t&&!w1[e]&&(w1[e]=!0,Er(!1,n))}j.memo(bE);function bE({routes:e,future:t,state:n,onError:a}){return hz(e,void 0,n,a,t)}function xz({to:e,replace:t,state:n,relative:a}){jt(go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=j.useContext(tr);Er(!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}=j.useContext(Ar),{pathname:o}=br(),d=yo(),h=Bx(e,Ix(c),o,a==="path"),m=JSON.stringify(h);return j.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:a})},[d,m,a,t,n]),null}function Zt(e){jt(!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 vE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:c=!1,unstable_useTransitions:o}){jt(!go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=j.useMemo(()=>({basename:d,navigator:s,static:c,unstable_useTransitions:o,future:{}}),[d,s,c,o]);typeof n=="string"&&(n=po(n));let{pathname:m="/",search:x="",hash:p="",state:b=null,key:v="default"}=n,S=j.useMemo(()=>{let z=xa(m,d);return z==null?null:{location:{pathname:z,search:x,hash:p,state:b,key:v},navigationType:a}},[d,m,x,p,b,v,a]);return Er(S!=null,`<Router basename="${d}"> is not able to match the URL "${m}${x}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:j.createElement(tr.Provider,{value:h},j.createElement(sc.Provider,{children:t,value:S}))}function S1({children:e,location:t}){return oE(Mp(e),t)}function Mp(e,t=[]){let n=[];return j.Children.forEach(e,(a,s)=>{if(!j.isValidElement(a))return;let c=[...t,s];if(a.type===j.Fragment){n.push.apply(n,Mp(a.props.children,c));return}jt(a.type===Zt,`[${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>`),jt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let o={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&&(o.children=Mp(a.props.children,c)),n.push(o)}),n}var sd="get",od="application/x-www-form-urlencoded";function Zd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function kE(e){return Zd(e)&&e.tagName.toLowerCase()==="button"}function wE(e){return Zd(e)&&e.tagName.toLowerCase()==="form"}function SE(e){return Zd(e)&&e.tagName.toLowerCase()==="input"}function zE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jE(e,t){return e.button===0&&(!t||t==="_self")&&!zE(e)}var $u=null;function _E(){if($u===null)try{new FormData(document.createElement("form"),0),$u=!1}catch{$u=!0}return $u}var NE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cm(e){return e!=null&&!NE.has(e)?(Er(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${od}"`),null):e}function CE(e,t){let n,a,s,c,o;if(wE(e)){let d=e.getAttribute("action");a=d?xa(d,t):null,n=e.getAttribute("method")||sd,s=Cm(e.getAttribute("enctype"))||od,c=new FormData(e)}else if(kE(e)||SE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?xa(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||sd,s=Cm(e.getAttribute("formenctype"))||Cm(d.getAttribute("enctype"))||od,c=new FormData(d,e),!_E()){let{name:m,type:x,value:p}=e;if(x==="image"){let b=m?`${m}.`:"";c.append(`${b}x`,"0"),c.append(`${b}y`,"0")}else m&&c.append(m,p)}}else{if(Zd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sd,a=null,s=od,o=e}return c&&s==="text/plain"&&(o=c,c=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:c,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function TE(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&&xa(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function EE(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function AE(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 OE(e,t,n){let a=await Promise.all(e.map(async s=>{let c=t.routes[s.route.id];if(c){let o=await EE(c,n);return o.links?o.links():[]}return[]}));return $E(a.flat(1).filter(AE).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function z1(e,t,n,a,s,c){let o=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return c==="assets"?t.filter((h,m)=>o(h,m)||d(h,m)):c==="data"?t.filter((h,m)=>{let x=a.routes[h.route.id];if(!x||!x.hasLoader)return!1;if(o(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let p=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 p=="boolean")return p}return!0}):[]}function ME(e,t,{includeHydrateFallback:n}={}){return DE(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 DE(e){return[...new Set(e)]}function RE(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function $E(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let c=JSON.stringify(RE(s));return n.has(c)||(n.add(c),a.push({key:c,link:s})),a},[])}function gz(){let e=j.useContext(xo);return Hx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function LE(){let e=j.useContext(Vd);return Hx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qx=j.createContext(void 0);qx.displayName="FrameworkContext";function yz(){let e=j.useContext(qx);return Hx(e,"You must render this element inside a <HydratedRouter> element"),e}function PE(e,t){let n=j.useContext(qx),[a,s]=j.useState(!1),[c,o]=j.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:x,onTouchStart:p}=t,b=j.useRef(null);j.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let z=_=>{_.forEach(A=>{o(A.isIntersecting)})},E=new IntersectionObserver(z,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),j.useEffect(()=>{if(a){let z=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(z)}}},[a]);let v=()=>{s(!0)},S=()=>{s(!1),o(!1)};return n?e!=="intent"?[c,b,{}]:[c,b,{onFocus:zl(d,v),onBlur:zl(h,S),onMouseEnter:zl(m,v),onMouseLeave:zl(x,S),onTouchStart:zl(p,v)}]:[!1,b,{}]}function zl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function UE({page:e,...t}){let{router:n}=gz(),a=j.useMemo(()=>rz(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?j.createElement(BE,{page:e,matches:a,...t}):null}function IE(e){let{manifest:t,routeModules:n}=yz(),[a,s]=j.useState([]);return j.useEffect(()=>{let c=!1;return OE(e,t,n).then(o=>{c||s(o)}),()=>{c=!0}},[e,t,n]),a}function BE({page:e,matches:t,...n}){let a=br(),{future:s,manifest:c,routeModules:o}=yz(),{basename:d}=gz(),{loaderData:h,matches:m}=LE(),x=j.useMemo(()=>z1(e,t,m,c,a,"data"),[e,t,m,c,a]),p=j.useMemo(()=>z1(e,t,m,c,a,"assets"),[e,t,m,c,a]),b=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let z=new Set,E=!1;if(t.forEach(A=>{let N=c.routes[A.route.id];!N||!N.hasLoader||(!x.some(P=>P.route.id===A.route.id)&&A.route.id in h&&o[A.route.id]?.shouldRevalidate||N.hasClientLoader?E=!0:z.add(A.route.id))}),z.size===0)return[];let _=TE(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return E&&z.size>0&&_.searchParams.set("_routes",t.filter(A=>z.has(A.route.id)).map(A=>A.route.id).join(",")),[_.pathname+_.search]},[d,s.unstable_trailingSlashAwareDataRequests,h,a,c,x,t,e,o]),v=j.useMemo(()=>ME(p,c),[p,c]),S=IE(p);return j.createElement(j.Fragment,null,b.map(z=>j.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...n})),v.map(z=>j.createElement("link",{key:z,rel:"modulepreload",href:z,...n})),S.map(({key:z,link:E})=>j.createElement("link",{key:z,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function VE(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ZE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ZE&&(window.__reactRouterVersion="7.13.0")}catch{}function FE({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=j.useRef();s.current==null&&(s.current=zT({window:a,v5Compat:!0}));let c=s.current,[o,d]=j.useState({action:c.action,location:c.location}),h=j.useCallback(m=>{n===!1?d(m):j.startTransition(()=>d(m))},[n]);return j.useLayoutEffect(()=>c.listen(h),[c,h]),j.createElement(vE,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:c,unstable_useTransitions:n})}var bz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wa=j.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:c,replace:o,state:d,target:h,to:m,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},S){let{basename:z,unstable_useTransitions:E}=j.useContext(tr),_=typeof m=="string"&&bz.test(m),A=oz(m,z);m=A.to;let N=aE(m,{relative:s}),[P,D,M]=PE(a,v),V=YE(m,{replace:o,state:d,target:h,preventScrollReset:x,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function U(I){t&&t(I),I.defaultPrevented||V(I)}let K=j.createElement("a",{...v,...M,href:A.absoluteURL||N,onClick:A.isExternal||c?t:U,ref:VE(S,D),target:h,"data-discover":!_&&n==="render"?"true":void 0});return P&&!_?j.createElement(j.Fragment,null,K,j.createElement(UE,{page:N})):K});Wa.displayName="Link";var HE=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:c,to:o,viewTransition:d,children:h,...m},x){let p=oc(o,{relative:m.relative}),b=br(),v=j.useContext(Vd),{navigator:S,basename:z}=j.useContext(tr),E=v!=null&&WE(p)&&d===!0,_=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,A=b.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),N=N?N.toLowerCase():null,_=_.toLowerCase()),N&&z&&(N=xa(N,z)||N);const P=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let D=A===_||!s&&A.startsWith(_)&&A.charAt(P)==="/",M=N!=null&&(N===_||!s&&N.startsWith(_)&&N.charAt(_.length)==="/"),V={isActive:D,isPending:M,isTransitioning:E},U=D?t:void 0,K;typeof a=="function"?K=a(V):K=[a,D?"active":null,M?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let I=typeof c=="function"?c(V):c;return j.createElement(Wa,{...m,"aria-current":U,className:K,ref:x,style:I,to:o,viewTransition:d},typeof h=="function"?h(V):h)});HE.displayName="NavLink";var qE=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:c,method:o=sd,action:d,onSubmit:h,relative:m,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},S)=>{let{unstable_useTransitions:z}=j.useContext(tr),E=XE(),_=QE(d,{relative:m}),A=o.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&bz.test(d),P=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let M=D.nativeEvent.submitter,V=M?.getAttribute("formmethod")||o,U=()=>E(M||D.currentTarget,{fetcherKey:t,method:V,navigate:n,replace:s,state:c,relative:m,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b});z&&n!==!1?j.startTransition(()=>U()):U()};return j.createElement("form",{ref:S,method:A,action:_,onSubmit:a?h:P,...v,"data-discover":!N&&e==="render"?"true":void 0})});qE.displayName="Form";function GE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vz(e){let t=j.useContext(xo);return jt(t,GE(e)),t}function YE(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:c,viewTransition:o,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let m=yo(),x=br(),p=oc(e,{relative:c});return j.useCallback(b=>{if(jE(b,t)){b.preventDefault();let v=n!==void 0?n:Hl(x)===Hl(p),S=()=>m(e,{replace:v,state:a,preventScrollReset:s,relative:c,viewTransition:o,unstable_defaultShouldRevalidate:d});h?j.startTransition(()=>S()):S()}},[x,m,p,n,a,t,e,s,c,o,d,h])}var JE=0,KE=()=>`__${String(++JE)}__`;function XE(){let{router:e}=vz("useSubmit"),{basename:t}=j.useContext(tr),n=xE(),a=e.fetch,s=e.navigate;return j.useCallback(async(c,o={})=>{let{action:d,method:h,encType:m,formData:x,body:p}=CE(c,t);if(o.navigate===!1){let b=o.fetcherKey||KE();await a(b,n,o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:x,body:p,formMethod:o.method||h,formEncType:o.encType||m,flushSync:o.flushSync})}else await s(o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:x,body:p,formMethod:o.method||h,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[a,s,t,n])}function QE(e,{relative:t}={}){let{basename:n}=j.useContext(tr),a=j.useContext(Ar);jt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),c={...oc(e||".",{relative:t})},o=br();if(e==null){c.search=o.search;let d=new URLSearchParams(c.search),h=d.getAll("index");if(h.some(x=>x==="")){d.delete("index"),h.filter(p=>p).forEach(p=>d.append("index",p));let x=d.toString();c.search=x?`?${x}`:""}}return(!e||e===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(c.pathname=c.pathname==="/"?n:ma([n,c.pathname])),Hl(c)}function WE(e,{relative:t}={}){let n=j.useContext(cz);jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=vz("useViewTransitionState"),s=oc(e,{relative:t});if(!n.isTransitioning)return!1;let c=xa(n.currentLocation.pathname,a)||n.currentLocation.pathname,o=xa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return yd(s.pathname,o)!=null||yd(s.pathname,c)!=null}const kz=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const eA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const tA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const j1=e=>{const t=tA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var nA={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 rA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const aA=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:c,iconNode:o,...d},h)=>j.createElement("svg",{ref:h,...nA,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:kz("lucide",s),...!c&&!rA(d)&&{"aria-hidden":"true"},...d},[...o.map(([m,x])=>j.createElement(m,x)),...Array.isArray(c)?c:[c]]));const he=(e,t)=>{const n=j.forwardRef(({className:a,...s},c)=>j.createElement(aA,{ref:c,iconNode:t,className:kz(`lucide-${eA(j1(e))}`,`lucide-${e}`,a),...s}));return n.displayName=j1(e),n};const iA=[["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"}]],Pi=he("activity",iA);const sA=[["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"}]],oA=he("archive",sA);const lA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],wz=he("arrow-left",lA);const cA=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],uA=he("ban",cA);const dA=[["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"}]],ql=he("bell",dA);const fA=[["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"}]],ld=he("bot",fA);const hA=[["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"}]],mA=he("box",hA);const pA=[["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"}]],xA=he("brain",pA);const gA=[["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"}]],Sz=he("calendar",gA);const yA=[["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"}]],Dp=he("chart-column",yA);const bA=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],vA=he("chart-no-axes-column",bA);const kA=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],wA=he("check-check",kA);const SA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Rp=he("check",SA);const zA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bo=he("chevron-down",zA);const jA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_A=he("chevron-left",jA);const NA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fd=he("chevron-right",NA);const CA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zz=he("chevron-up",CA);const TA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Gi=he("circle-alert",TA);const EA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],vo=he("circle-check-big",EA);const AA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gx=he("circle-check",AA);const OA=[["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"}]],ei=he("circle-x",OA);const MA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],er=he("clock",MA);const DA=[["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"}]],RA=he("cloud-moon",DA);const $A=[["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"}]],LA=he("copy",$A);const PA=[["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"}]],jz=he("cpu",PA);const UA=[["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"}]],Qs=he("database",UA);const IA=[["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"}]],io=he("dollar-sign",IA);const BA=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],VA=he("download",BA);const ZA=[["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"}]],lc=he("eye",ZA);const FA=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],HA=he("file-braces",FA);const qA=[["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"}]],$p=he("file-text",qA);const GA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],YA=he("folder-open",GA);const JA=[["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"}]],KA=he("funnel",JA);const XA=[["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"}]],_z=he("globe",XA);const QA=[["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"}]],WA=he("hard-drive",QA);const e5=[["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"}]],t5=he("hash",e5);const n5=[["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"}]],so=he("hat-glasses",n5);const r5=[["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"}]],a5=he("history",r5);const i5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],s5=he("info",i5);const o5=[["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=he("layout-dashboard",o5);const l5=[["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"}]],Gl=he("list-checks",l5);const c5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cc=he("loader-circle",c5);const u5=[["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"}]],d5=he("lock",u5);const f5=[["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"}]],_1=he("log-out",f5);const h5=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Nz=he("menu",h5);const m5=[["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"}]],N1=he("message-square-plus",m5);const p5=[["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"}]],Pp=he("message-square",p5);const x5=[["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"}]],g5=he("moon-star",x5);const y5=[["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"}]],b5=he("monitor",y5);const v5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],k5=he("panel-left-close",v5);const w5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],S5=he("panel-left",w5);const z5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],j5=he("panel-right",z5);const _5=[["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"}]],N5=he("pause",_5);const C5=[["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"}]],T5=he("pen",C5);const E5=[["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"}]],uc=he("pencil",E5);const A5=[["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"}]],Cz=he("play",A5);const O5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oo=he("plus",O5);const M5=[["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"}]],bd=he("puzzle",M5);const D5=[["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"}]],Tz=he("radio",D5);const R5=[["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"}]],Ka=he("refresh-cw",R5);const $5=[["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"}]],C1=he("rotate-ccw",$5);const L5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],P5=he("search",L5);const U5=[["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"}]],I5=he("send",U5);const B5=[["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"}]],V5=he("server",B5);const Z5=[["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"}]],T1=he("settings-2",Z5);const F5=[["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"}]],Up=he("settings",F5);const H5=[["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"}]],Ip=he("shield-check",H5);const q5=[["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"}]],G5=he("shield-off",q5);const Y5=[["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"}]],J5=he("sun",Y5);const K5=[["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"}]],Yx=he("tag",K5);const X5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],vd=he("terminal",X5);const Q5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Jx=he("toggle-left",Q5);const W5=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Kx=he("toggle-right",W5);const e3=[["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"}]],ga=he("trash-2",e3);const t3=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],n3=he("trending-up",t3);const r3=[["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"}]],Lu=he("upload",r3);const a3=[["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"}]],Xx=he("user",a3);const i3=[["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"}]],Zi=he("wand-sparkles",i3);const s3=[["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"}]],Bp=he("webhook",s3);const o3=[["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"}]],Ez=he("wifi-off",o3);const l3=[["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"}]],cd=he("wifi",l3);const c3=[["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"}]],dc=he("wrench",c3);const u3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yi=he("x",u3);const d3=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Az=he("zap",d3);var Tm={exports:{}},Em={};var E1;function f3(){if(E1)return Em;E1=1;var e=Bd();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,c=e.useLayoutEffect,o=e.useDebugValue;function d(p,b){var v=b(),S=a({inst:{value:v,getSnapshot:b}}),z=S[0].inst,E=S[1];return c(function(){z.value=v,z.getSnapshot=b,h(z)&&E({inst:z})},[p,v,b]),s(function(){return h(z)&&E({inst:z}),p(function(){h(z)&&E({inst:z})})},[p]),o(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!n(p,v)}catch{return!0}}function m(p,b){return b()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Em.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,Em}var A1;function h3(){return A1||(A1=1,Tm.exports=f3()),Tm.exports}var O1=h3();const Oz=0,Mz=1,Dz=2,M1=3;var D1=Object.prototype.hasOwnProperty;function Vp(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--&&Vp(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(D1.call(e,n)&&++a&&!D1.call(t,n)||!(n in t)||!Vp(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const da=new WeakMap,ha=()=>{},xn=ha(),Zp=Object,Qe=e=>e===xn,Lr=e=>typeof e=="function",ti=(e,t)=>({...e,...t}),Rz=e=>Lr(e.then),Am={},Pu={},Qx="undefined",fc=typeof window!=Qx,Fp=typeof document!=Qx,m3=fc&&"Deno"in window,p3=()=>fc&&typeof window.requestAnimationFrame!=Qx,$z=(e,t)=>{const n=da.get(e);return[()=>!Qe(t)&&e.get(t)||Am,a=>{if(!Qe(t)){const s=e.get(t);t in Pu||(Pu[t]=s),n[5](t,ti(s,a),s||Am)}},n[6],()=>!Qe(t)&&t in Pu?Pu[t]:!Qe(t)&&e.get(t)||Am]};let Hp=!0;const x3=()=>Hp,[qp,Gp]=fc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ha,ha],g3=()=>{const e=Fp&&document.visibilityState;return Qe(e)||e!=="hidden"},y3=e=>(Fp&&document.addEventListener("visibilitychange",e),qp("focus",e),()=>{Fp&&document.removeEventListener("visibilitychange",e),Gp("focus",e)}),b3=e=>{const t=()=>{Hp=!0,e()},n=()=>{Hp=!1};return qp("online",t),qp("offline",n),()=>{Gp("online",t),Gp("offline",n)}},v3={isOnline:x3,isVisible:g3},k3={initFocus:y3,initReconnect:b3},R1=!Ux.useId,Ws=!fc||m3,w3=e=>p3()?window.requestAnimationFrame(e):setTimeout(e,1),Om=Ws?j.useEffect:j.useLayoutEffect,Mm=typeof navigator<"u"&&navigator.connection,$1=!Ws&&Mm&&(["slow-2g","2g"].includes(Mm.effectiveType)||Mm.saveData),Uu=new WeakMap,S3=e=>Zp.prototype.toString.call(e),Dm=(e,t)=>e===`[object ${t}]`;let z3=0;const Yp=e=>{const t=typeof e,n=S3(e),a=Dm(n,"Date"),s=Dm(n,"RegExp"),c=Dm(n,"Object");let o,d;if(Zp(e)===e&&!a&&!s){if(o=Uu.get(e),o)return o;if(o=++z3+"~",Uu.set(e,o),Array.isArray(e)){for(o="@",d=0;d<e.length;d++)o+=Yp(e[d])+",";Uu.set(e,o)}if(c){o="#";const h=Zp.keys(e).sort();for(;!Qe(d=h.pop());)Qe(e[d])||(o+=d+":"+Yp(e[d])+",");Uu.set(e,o)}}else o=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Wx=e=>{if(Lr(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 j3=0;const Jp=()=>++j3;async function Lz(...e){const[t,n,a,s]=e,c=ti({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=c.populateCache;const d=c.rollbackOnError;let h=c.optimisticData;const m=b=>typeof d=="function"?d(b):d!==!1,x=c.throwOnError;if(Lr(n)){const b=n,v=[],S=t.keys();for(const z of S)!/^\$(inf|sub)\$/.test(z)&&b(t.get(z)._k)&&v.push(z);return Promise.all(v.map(p))}return p(n);async function p(b){const[v]=Wx(b);if(!v)return;const[S,z]=$z(t,v),[E,_,A,N]=da.get(t),P=()=>{const oe=E[v];return(Lr(c.revalidate)?c.revalidate(S().data,b):c.revalidate!==!1)&&(delete A[v],delete N[v],oe&&oe[0])?oe[0](Dz).then(()=>S().data):S().data};if(e.length<3)return P();let D=a,M,V=!1;const U=Jp();_[v]=[U,0];const K=!Qe(h),I=S(),te=I.data,le=I._c,ne=Qe(le)?te:le;if(K&&(h=Lr(h)?h(ne,te):h,z({data:h,_c:ne})),Lr(D))try{D=D(ne)}catch(oe){M=oe,V=!0}if(D&&Rz(D))if(D=await D.catch(oe=>{M=oe,V=!0}),U!==_[v][0]){if(V)throw M;return D}else V&&K&&m(M)&&(o=!0,z({data:ne,_c:xn}));if(o&&!V)if(Lr(o)){const oe=o(D,ne);z({data:oe,error:xn,_c:xn})}else z({data:D,error:xn,_c:xn});if(_[v][1]=Jp(),Promise.resolve(P()).then(()=>{z({_c:xn})}),V){if(x)throw M;return}return D}}const L1=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},_3=(e,t)=>{if(!da.has(e)){const n=ti(k3,t),a=Object.create(null),s=Lz.bind(xn,e);let c=ha;const o=Object.create(null),d=(x,p)=>{const b=o[x]||[];return o[x]=b,b.push(p),()=>b.splice(b.indexOf(p),1)},h=(x,p,b)=>{e.set(x,p);const v=o[x];if(v)for(const S of v)S(p,b)},m=()=>{if(!da.has(e)&&(da.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,d]),!Ws)){const x=n.initFocus(setTimeout.bind(xn,L1.bind(xn,a,Oz))),p=n.initReconnect(setTimeout.bind(xn,L1.bind(xn,a,Mz)));c=()=>{x&&x(),p&&p(),da.delete(e)}}};return m(),[e,s,m,c]}return[e,da.get(e)[4]]},N3=(e,t,n,a,s)=>{const c=n.errorRetryCount,o=s.retryCount,d=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Qe(c)&&o>c||setTimeout(a,d,s)},C3=Vp,[Pz,Bn]=_3(new Map),T3=ti({onLoadingSlow:ha,onSuccess:ha,onError:ha,onErrorRetry:N3,onDiscarded:ha,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:$1?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:$1?5e3:3e3,compare:C3,isPaused:()=>!1,cache:Pz,mutate:Bn,fallback:{}},v3),E3=(e,t)=>{const n=ti(e,t);if(t){const{use:a,fallback:s}=e,{use:c,fallback:o}=t;a&&c&&(n.use=a.concat(c)),s&&o&&(n.fallback=ti(s,o))}return n},A3=j.createContext({}),O3="$inf$",Uz=fc&&window.__SWR_DEVTOOLS_USE__,M3=Uz?window.__SWR_DEVTOOLS_USE__:[],D3=()=>{Uz&&(window.__SWR_DEVTOOLS_REACT__=Ux)},R3=e=>Lr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],$3=()=>{const e=j.useContext(A3);return j.useMemo(()=>ti(T3,e),[e])},L3=e=>(t,n,a)=>e(t,n&&((...c)=>{const[o]=Wx(t),[,,,d]=da.get(Pz);if(o.startsWith(O3))return n(...c);const h=d[o];return Qe(h)?n(...c):(delete d[o],h)}),a),P3=M3.concat(L3),U3=e=>function(...n){const a=$3(),[s,c,o]=R3(n),d=E3(a,o);let h=e;const{use:m}=d,x=(m||[]).concat(P3);for(let p=x.length;p--;)h=x[p](h);return h(s,c||d.fetcher||null,d)},I3=(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())}};D3();const Rm=Ux.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}}),$m={dedupe:!0},P1=Promise.resolve(xn),B3=(e,t,n)=>{const{cache:a,compare:s,suspense:c,fallbackData:o,revalidateOnMount:d,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:x,refreshWhenOffline:p,keepPreviousData:b,strictServerPrefetchWarning:v}=n,[S,z,E,_]=da.get(a),[A,N]=Wx(e),P=j.useRef(!1),D=j.useRef(!1),M=j.useRef(A),V=j.useRef(t),U=j.useRef(n),K=()=>U.current,I=()=>K().isVisible()&&K().isOnline(),[te,le,ne,oe]=$z(a,A),se=j.useRef({}).current,Z=Qe(o)?Qe(n.fallback)?xn:n.fallback[A]:o,B=(Ze,rt)=>{for(const ft in se){const lt=ft;if(lt==="data"){if(!s(Ze[lt],rt[lt])&&(!Qe(Ze[lt])||!s(pe,rt[lt])))return!1}else if(rt[lt]!==Ze[lt])return!1}return!0},Y=j.useMemo(()=>{const Ze=!A||!t?!1:Qe(d)?K().isPaused()||c?!1:h!==!1:d,rt=Kt=>{const bt=ti(Kt);return delete bt._k,Ze?{isValidating:!0,isLoading:!0,...bt}:bt},ft=te(),lt=oe(),rn=rt(ft),nr=ft===lt?rn:rt(lt);let $t=rn;return[()=>{const Kt=rt(te());return B(Kt,$t)?($t.data=Kt.data,$t.isLoading=Kt.isLoading,$t.isValidating=Kt.isValidating,$t.error=Kt.error,$t):($t=Kt,Kt)},()=>nr]},[a,A]),ue=O1.useSyncExternalStore(j.useCallback(Ze=>ne(A,(rt,ft)=>{B(ft,rt)||Ze()}),[a,A]),Y[0],Y[1]),O=!P.current,C=S[A]&&S[A].length>0,H=ue.data,w=Qe(H)?Z&&Rz(Z)?Rm(Z):Z:H,X=ue.error,me=j.useRef(w),pe=b?Qe(H)?Qe(me.current)?w:me.current:H:w,ge=A&&Qe(w),Pe=!Ws&&O1.useSyncExternalStore(()=>ha,()=>!1,()=>!0);v&&Pe&&!c&&ge&&console.warn(`Missing pre-initiated data for serialized key "${A}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ee=C&&!Qe(X)?!1:O&&!Qe(d)?d:K().isPaused()?!1:c?Qe(w)?!1:h:Qe(w)||h,yt=!!(A&&t&&O&&Ee),$=Qe(ue.isValidating)?yt:ue.isValidating,Oe=Qe(ue.isLoading)?yt:ue.isLoading,Ue=j.useCallback(async Ze=>{const rt=V.current;if(!A||!rt||D.current||K().isPaused())return!1;let ft,lt,rn=!0;const nr=Ze||{},$t=!E[A]||!nr.dedupe,Kt=()=>R1?!D.current&&A===M.current&&P.current:A===M.current,bt={isValidating:!1,isLoading:!1},Qi=()=>{le(bt)},ee=()=>{const we=E[A];we&&we[1]===lt&&delete E[A]},fe={isValidating:!0};Qe(te().data)&&(fe.isLoading=!0);try{if($t&&(le(fe),n.loadingTimeout&&Qe(te().data)&&setTimeout(()=>{rn&&Kt()&&K().onLoadingSlow(A,n)},n.loadingTimeout),E[A]=[rt(N),Jp()]),[ft,lt]=E[A],ft=await ft,$t&&setTimeout(ee,n.dedupingInterval),!E[A]||E[A][1]!==lt)return $t&&Kt()&&K().onDiscarded(A),!1;bt.error=xn;const we=z[A];if(!Qe(we)&&(lt<=we[0]||lt<=we[1]||we[1]===0))return Qi(),$t&&Kt()&&K().onDiscarded(A),!1;const Ce=te().data;bt.data=s(Ce,ft)?Ce:ft,$t&&Kt()&&K().onSuccess(ft,A,n)}catch(we){ee();const Ce=K(),{shouldRetryOnError:Ke}=Ce;Ce.isPaused()||(bt.error=we,$t&&Kt()&&(Ce.onError(we,A,Ce),(Ke===!0||Lr(Ke)&&Ke(we))&&(!K().revalidateOnFocus||!K().revalidateOnReconnect||I())&&Ce.onErrorRetry(we,A,Ce,kn=>{const Fn=S[A];Fn&&Fn[0]&&Fn[0](M1,kn)},{retryCount:(nr.retryCount||0)+1,dedupe:!0})))}return rn=!1,Qi(),!0},[A,a]),Je=j.useCallback((...Ze)=>Lz(a,M.current,...Ze),[]);if(Om(()=>{V.current=t,U.current=n,Qe(H)||(me.current=H)}),Om(()=>{if(!A)return;const Ze=Ue.bind(xn,$m);let rt=0;K().revalidateOnFocus&&(rt=Date.now()+K().focusThrottleInterval);const lt=I3(A,S,(rn,nr={})=>{if(rn==Oz){const $t=Date.now();K().revalidateOnFocus&&$t>rt&&I()&&(rt=$t+K().focusThrottleInterval,Ze())}else if(rn==Mz)K().revalidateOnReconnect&&I()&&Ze();else{if(rn==Dz)return Ue();if(rn==M1)return Ue(nr)}});return D.current=!1,M.current=A,P.current=!0,le({_k:N}),Ee&&(E[A]||(Qe(w)||Ws?Ze():w3(Ze))),()=>{D.current=!0,lt()}},[A]),Om(()=>{let Ze;function rt(){const lt=Lr(m)?m(te().data):m;lt&&Ze!==-1&&(Ze=setTimeout(ft,lt))}function ft(){!te().error&&(x||K().isVisible())&&(p||K().isOnline())?Ue($m).then(rt):rt()}return rt(),()=>{Ze&&(clearTimeout(Ze),Ze=-1)}},[m,x,p,A]),j.useDebugValue(pe),c){if(!R1&&Ws&&ge)throw new Error("Fallback data is required when using Suspense in SSR.");ge&&(V.current=t,U.current=n,D.current=!1);const Ze=_[A],rt=!Qe(Ze)&&ge?Je(Ze):P1;if(Rm(rt),!Qe(X)&&ge)throw X;const ft=ge?Ue($m):P1;!Qe(pe)&&ge&&(ft.status="fulfilled",ft.value=!0),Rm(ft)}return{mutate:Je,get data(){return se.data=!0,pe},get error(){return se.error=!0,X},get isValidating(){return se.isValidating=!0,$},get isLoading(){return se.isLoading=!0,Oe}}},We=U3(B3),V3="x-architect-pass",Ls="/api";class Xa{static instance;constructor(){}static getInstance(){return Xa.instance||(Xa.instance=new Xa),Xa.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[V3]=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(`${Ls}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${Ls}${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(`${Ls}${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(`${Ls}${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(`${Ls}${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(`${Ls}${t}`,{method:"POST",headers:this.getHeaders(),body:s});return this.handleResponse(c)}}const xe=Xa.getInstance(),Yl="/api",eg=e=>{const t=e.startsWith(Yl)?e.substring(Yl.length):e;return xe.get(t)};function Iz(){return We(`${Yl}/status`,eg,{refreshInterval:5e3})}function Z3(){return We(`${Yl}/logs`,eg)}function F3(e){return We(e?`${Yl}/logs/${e}?limit=1000`:null,eg,{refreshInterval:2e3})}function Bz(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 H3(){const{data:e}=Iz();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?Bz(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 tg=j.createContext({});function ng(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const Vz=typeof window<"u",Zz=Vz?j.useLayoutEffect:j.useEffect,Hd=j.createContext(null);function rg(e,t){e.indexOf(t)===-1&&e.push(t)}function ag(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ur=(e,t,n)=>n>t?t:n<e?e:n;let ig=()=>{};const ya={},Fz=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Hz(e){return typeof e=="object"&&e!==null}const qz=e=>/^0[^.\s]+$/u.test(e);function sg(e){let t;return()=>(t===void 0&&(t=e()),t)}const yr=e=>e,q3=(e,t)=>n=>t(e(n)),hc=(...e)=>e.reduce(q3),Jl=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class og{constructor(){this.subscriptions=[]}add(t){return rg(this.subscriptions,t),()=>ag(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 o=this.subscriptions[c];o&&o(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const pa=e=>e*1e3,gr=e=>e/1e3;function Gz(e,t){return t?e*(1e3/t):0}const Yz=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,G3=1e-7,Y3=12;function J3(e,t,n,a,s){let c,o,d=0;do o=t+(n-t)/2,c=Yz(o,a,s)-e,c>0?n=o:t=o;while(Math.abs(c)>G3&&++d<Y3);return o}function mc(e,t,n,a){if(e===t&&n===a)return yr;const s=c=>J3(c,0,1,e,n);return c=>c===0||c===1?c:Yz(s(c),t,a)}const Jz=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Kz=e=>t=>1-e(1-t),Xz=mc(.33,1.53,.69,.99),lg=Kz(Xz),Qz=Jz(lg),Wz=e=>(e*=2)<1?.5*lg(e):.5*(2-Math.pow(2,-10*(e-1))),cg=e=>1-Math.sin(Math.acos(e)),ej=Kz(cg),tj=Jz(cg),K3=mc(.42,0,1,1),X3=mc(0,0,.58,1),nj=mc(.42,0,.58,1),Q3=e=>Array.isArray(e)&&typeof e[0]!="number",rj=e=>Array.isArray(e)&&typeof e[0]=="number",W3={linear:yr,easeIn:K3,easeInOut:nj,easeOut:X3,circIn:cg,circInOut:tj,circOut:ej,backIn:lg,backInOut:Qz,backOut:Xz,anticipate:Wz},eO=e=>typeof e=="string",U1=e=>{if(rj(e)){ig(e.length===4);const[t,n,a,s]=e;return mc(t,n,a,s)}else if(eO(e))return W3[e];return e},Iu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tO(e,t){let n=new Set,a=new Set,s=!1,c=!1;const o=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(x){o.has(x)&&(m.schedule(x),e()),x(d)}const m={schedule:(x,p=!1,b=!1)=>{const S=b&&s?n:a;return p&&o.add(x),S.has(x)||S.add(x),x},cancel:x=>{a.delete(x),o.delete(x)},process:x=>{if(d=x,s){c=!0;return}s=!0,[n,a]=[a,n],n.forEach(h),n.clear(),s=!1,c&&(c=!1,m.process(x))}};return m}const nO=40;function aj(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},c=()=>n=!0,o=Iu.reduce((N,P)=>(N[P]=tO(c),N),{}),{setup:d,read:h,resolveKeyframes:m,preUpdate:x,update:p,preRender:b,render:v,postRender:S}=o,z=()=>{const N=ya.useManualTiming?s.timestamp:performance.now();n=!1,ya.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(N-s.timestamp,nO),1)),s.timestamp=N,s.isProcessing=!0,d.process(s),h.process(s),m.process(s),x.process(s),p.process(s),b.process(s),v.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(z))},E=()=>{n=!0,a=!0,s.isProcessing||e(z)};return{schedule:Iu.reduce((N,P)=>{const D=o[P];return N[P]=(M,V=!1,U=!1)=>(n||E(),D.schedule(M,V,U)),N},{}),cancel:N=>{for(let P=0;P<Iu.length;P++)o[Iu[P]].cancel(N)},state:s,steps:o}}const{schedule:wt,cancel:ni,state:fn,steps:Lm}=aj(typeof requestAnimationFrame<"u"?requestAnimationFrame:yr,!0);let ud;function rO(){ud=void 0}const Cn={now:()=>(ud===void 0&&Cn.set(fn.isProcessing||ya.useManualTiming?fn.timestamp:performance.now()),ud),set:e=>{ud=e,queueMicrotask(rO)}},ij=e=>t=>typeof t=="string"&&t.startsWith(e),sj=ij("--"),aO=ij("var(--"),ug=e=>aO(e)?iO.test(e.split("/*")[0].trim()):!1,iO=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function I1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ko={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Kl={...ko,transform:e=>Ur(0,1,e)},Bu={...ko,default:1},Pl=e=>Math.round(e*1e5)/1e5,dg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sO(e){return e==null}const oO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fg=(e,t)=>n=>!!(typeof n=="string"&&oO.test(n)&&n.startsWith(e)||t&&!sO(n)&&Object.prototype.hasOwnProperty.call(n,t)),oj=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,c,o,d]=a.match(dg);return{[e]:parseFloat(s),[t]:parseFloat(c),[n]:parseFloat(o),alpha:d!==void 0?parseFloat(d):1}},lO=e=>Ur(0,255,e),Pm={...ko,transform:e=>Math.round(lO(e))},Ui={test:fg("rgb","red"),parse:oj("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Pm.transform(e)+", "+Pm.transform(t)+", "+Pm.transform(n)+", "+Pl(Kl.transform(a))+")"};function cO(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 Kp={test:fg("#"),parse:cO,transform:Ui.transform},pc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ya=pc("deg"),Pr=pc("%"),ke=pc("px"),uO=pc("vh"),dO=pc("vw"),B1={...Pr,parse:e=>Pr.parse(e)/100,transform:e=>Pr.transform(e*100)},Hs={test:fg("hsl","hue"),parse:oj("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Pr.transform(Pl(t))+", "+Pr.transform(Pl(n))+", "+Pl(Kl.transform(a))+")"},qt={test:e=>Ui.test(e)||Kp.test(e)||Hs.test(e),parse:e=>Ui.test(e)?Ui.parse(e):Hs.test(e)?Hs.parse(e):Kp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ui.transform(e):Hs.transform(e),getAnimatableNone:e=>{const t=qt.parse(e);return t.alpha=0,qt.transform(t)}},fO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function hO(e){return isNaN(e)&&typeof e=="string"&&(e.match(dg)?.length||0)+(e.match(fO)?.length||0)>0}const lj="number",cj="color",mO="var",pO="var(",V1="${}",xO=/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 Xl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let c=0;const d=t.replace(xO,h=>(qt.test(h)?(a.color.push(c),s.push(cj),n.push(qt.parse(h))):h.startsWith(pO)?(a.var.push(c),s.push(mO),n.push(h)):(a.number.push(c),s.push(lj),n.push(parseFloat(h))),++c,V1)).split(V1);return{values:n,split:d,indexes:a,types:s}}function uj(e){return Xl(e).values}function dj(e){const{split:t,types:n}=Xl(e),a=t.length;return s=>{let c="";for(let o=0;o<a;o++)if(c+=t[o],s[o]!==void 0){const d=n[o];d===lj?c+=Pl(s[o]):d===cj?c+=qt.transform(s[o]):c+=s[o]}return c}}const gO=e=>typeof e=="number"?0:qt.test(e)?qt.getAnimatableNone(e):e;function yO(e){const t=uj(e);return dj(e)(t.map(gO))}const ri={test:hO,parse:uj,createTransformer:dj,getAnimatableNone:yO};function Um(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 bO({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,c=0,o=0;if(!t)s=c=o=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;s=Um(h,d,e+1/3),c=Um(h,d,e),o=Um(h,d,e-1/3)}return{red:Math.round(s*255),green:Math.round(c*255),blue:Math.round(o*255),alpha:a}}function kd(e,t){return n=>n>0?t:e}const Ct=(e,t,n)=>e+(t-e)*n,Im=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},vO=[Kp,Ui,Hs],kO=e=>vO.find(t=>t.test(e));function Z1(e){const t=kO(e);if(!t)return!1;let n=t.parse(e);return t===Hs&&(n=bO(n)),n}const F1=(e,t)=>{const n=Z1(e),a=Z1(t);if(!n||!a)return kd(e,t);const s={...n};return c=>(s.red=Im(n.red,a.red,c),s.green=Im(n.green,a.green,c),s.blue=Im(n.blue,a.blue,c),s.alpha=Ct(n.alpha,a.alpha,c),Ui.transform(s))},Xp=new Set(["none","hidden"]);function wO(e,t){return Xp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function SO(e,t){return n=>Ct(e,t,n)}function hg(e){return typeof e=="number"?SO:typeof e=="string"?ug(e)?kd:qt.test(e)?F1:_O:Array.isArray(e)?fj:typeof e=="object"?qt.test(e)?F1:zO:kd}function fj(e,t){const n=[...e],a=n.length,s=e.map((c,o)=>hg(c)(c,t[o]));return c=>{for(let o=0;o<a;o++)n[o]=s[o](c);return n}}function zO(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=hg(e[s])(e[s],t[s]));return s=>{for(const c in a)n[c]=a[c](s);return n}}function jO(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],o=e.indexes[c][a[c]],d=e.values[o]??0;n[s]=d,a[c]++}return n}const _O=(e,t)=>{const n=ri.createTransformer(t),a=Xl(e),s=Xl(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?Xp.has(e)&&!s.values.length||Xp.has(t)&&!a.values.length?wO(e,t):hc(fj(jO(a,s),s.values),n):kd(e,t)};function hj(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ct(e,t,n):hg(e)(e,t)}const NO=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>wt.update(t,n),stop:()=>ni(t),now:()=>fn.isProcessing?fn.timestamp:Cn.now()}},mj=(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)})`},wd=2e4;function mg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<wd;)t+=n,a=e.next(t);return t>=wd?1/0:t}function CO(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(mg(a),wd);return{type:"keyframes",ease:c=>a.next(s*c).value/t,duration:gr(s)}}const TO=5;function pj(e,t,n){const a=Math.max(t-TO,0);return Gz(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},Bm=.001;function EO({duration:e=Rt.duration,bounce:t=Rt.bounce,velocity:n=Rt.velocity,mass:a=Rt.mass}){let s,c,o=1-t;o=Ur(Rt.minDamping,Rt.maxDamping,o),e=Ur(Rt.minDuration,Rt.maxDuration,gr(e)),o<1?(s=m=>{const x=m*o,p=x*e,b=x-n,v=Qp(m,o),S=Math.exp(-p);return Bm-b/v*S},c=m=>{const p=m*o*e,b=p*n+n,v=Math.pow(o,2)*Math.pow(m,2)*e,S=Math.exp(-p),z=Qp(Math.pow(m,2),o);return(-s(m)+Bm>0?-1:1)*((b-v)*S)/z}):(s=m=>{const x=Math.exp(-m*e),p=(m-n)*e+1;return-Bm+x*p},c=m=>{const x=Math.exp(-m*e),p=(n-m)*(e*e);return x*p});const d=5/e,h=OO(s,c,d);if(e=pa(e),isNaN(h))return{stiffness:Rt.stiffness,damping:Rt.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:o*2*Math.sqrt(a*m),duration:e}}}const AO=12;function OO(e,t,n){let a=n;for(let s=1;s<AO;s++)a=a-e(a)/t(a);return a}function Qp(e,t){return e*Math.sqrt(1-t*t)}const MO=["duration","bounce"],DO=["stiffness","damping","mass"];function H1(e,t){return t.some(n=>e[n]!==void 0)}function RO(e){let t={velocity:Rt.velocity,stiffness:Rt.stiffness,damping:Rt.damping,mass:Rt.mass,isResolvedFromDuration:!1,...e};if(!H1(e,DO)&&H1(e,MO))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,c=2*Ur(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Rt.mass,stiffness:s,damping:c}}else{const n=EO(e);t={...t,...n,mass:Rt.mass},t.isResolvedFromDuration=!0}return t}function Sd(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],o=n.keyframes[n.keyframes.length-1],d={done:!1,value:c},{stiffness:h,damping:m,mass:x,duration:p,velocity:b,isResolvedFromDuration:v}=RO({...n,velocity:-gr(n.velocity||0)}),S=b||0,z=m/(2*Math.sqrt(h*x)),E=o-c,_=gr(Math.sqrt(h/x)),A=Math.abs(E)<5;a||(a=A?Rt.restSpeed.granular:Rt.restSpeed.default),s||(s=A?Rt.restDelta.granular:Rt.restDelta.default);let N;if(z<1){const D=Qp(_,z);N=M=>{const V=Math.exp(-z*_*M);return o-V*((S+z*_*E)/D*Math.sin(D*M)+E*Math.cos(D*M))}}else if(z===1)N=D=>o-Math.exp(-_*D)*(E+(S+_*E)*D);else{const D=_*Math.sqrt(z*z-1);N=M=>{const V=Math.exp(-z*_*M),U=Math.min(D*M,300);return o-V*((S+z*_*E)*Math.sinh(U)+D*E*Math.cosh(U))/D}}const P={calculatedDuration:v&&p||null,next:D=>{const M=N(D);if(v)d.done=D>=p;else{let V=D===0?S:0;z<1&&(V=D===0?pa(S):pj(N,D,M));const U=Math.abs(V)<=a,K=Math.abs(o-M)<=s;d.done=U&&K}return d.value=d.done?o:M,d},toString:()=>{const D=Math.min(mg(P),wd),M=mj(V=>P.next(D*V).value,D,30);return D+"ms "+M},toTransition:()=>{}};return P}Sd.applyToOptions=e=>{const t=CO(e,100,Sd);return e.ease=t.ease,e.duration=pa(t.duration),e.type="keyframes",e};function Wp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:c=500,modifyTarget:o,min:d,max:h,restDelta:m=.5,restSpeed:x}){const p=e[0],b={done:!1,value:p},v=U=>d!==void 0&&U<d||h!==void 0&&U>h,S=U=>d===void 0?h:h===void 0||Math.abs(d-U)<Math.abs(h-U)?d:h;let z=n*t;const E=p+z,_=o===void 0?E:o(E);_!==E&&(z=_-p);const A=U=>-z*Math.exp(-U/a),N=U=>_+A(U),P=U=>{const K=A(U),I=N(U);b.done=Math.abs(K)<=m,b.value=b.done?_:I};let D,M;const V=U=>{v(b.value)&&(D=U,M=Sd({keyframes:[b.value,S(b.value)],velocity:pj(N,U,b.value),damping:s,stiffness:c,restDelta:m,restSpeed:x}))};return V(0),{calculatedDuration:null,next:U=>{let K=!1;return!M&&D===void 0&&(K=!0,P(U),V(U)),D!==void 0&&U>=D?M.next(U-D):(!K&&P(U),b)}}}function $O(e,t,n){const a=[],s=n||ya.mix||hj,c=e.length-1;for(let o=0;o<c;o++){let d=s(e[o],e[o+1]);if(t){const h=Array.isArray(t)?t[o]||yr:t;d=hc(h,d)}a.push(d)}return a}function LO(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const c=e.length;if(ig(c===t.length),c===1)return()=>t[0];if(c===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[c-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=$O(t,a,s),h=d.length,m=x=>{if(o&&x<e[0])return t[0];let p=0;if(h>1)for(;p<e.length-2&&!(x<e[p+1]);p++);const b=Jl(e[p],e[p+1],x);return d[p](b)};return n?x=>m(Ur(e[0],e[c-1],x)):m}function PO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Jl(0,t,a);e.push(Ct(n,1,s))}}function UO(e){const t=[0];return PO(t,e.length-1),t}function IO(e,t){return e.map(n=>n*t)}function BO(e,t){return e.map(()=>t||nj).splice(0,e.length-1)}function Ul({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=Q3(a)?a.map(U1):U1(a),c={done:!1,value:t[0]},o=IO(n&&n.length===t.length?n:UO(t),e),d=LO(o,t,{ease:Array.isArray(s)?s:BO(t,s)});return{calculatedDuration:e,next:h=>(c.value=d(h),c.done=h>=e,c)}}const VO=e=>e!==null;function pg(e,{repeat:t,repeatType:n="loop"},a,s=1){const c=e.filter(VO),d=s<0||t&&n!=="loop"&&t%2===1?0:c.length-1;return!d||a===void 0?c[d]:a}const ZO={decay:Wp,inertia:Wp,tween:Ul,keyframes:Ul,spring:Sd};function xj(e){typeof e.type=="string"&&(e.type=ZO[e.type])}class xg{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 FO=e=>e/100;class gg extends xg{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!==Cn.now()&&this.tick(Cn.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;xj(t);const{type:n=Ul,repeat:a=0,repeatDelay:s=0,repeatType:c,velocity:o=0}=t;let{keyframes:d}=t;const h=n||Ul;h!==Ul&&typeof d[0]!="number"&&(this.mixKeyframes=hc(FO,hj(d[0],d[1])),d=[0,100]);const m=h({...t,keyframes:d});c==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-o})),m.calculatedDuration===null&&(m.calculatedDuration=mg(m));const{calculatedDuration:x}=m;this.calculatedDuration=x,this.resolvedDuration=x+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:o,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:x,repeat:p,repeatType:b,repeatDelay:v,type:S,onUpdate:z,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-m*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?_<0:_>s;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,P=a;if(p){const U=Math.min(this.currentTime,s)/d;let K=Math.floor(U),I=U%1;!I&&U>=1&&(I=1),I===1&&K--,K=Math.min(K,p+1),K%2&&(b==="reverse"?(I=1-I,v&&(I-=v/d)):b==="mirror"&&(P=o)),N=Ur(0,1,I)*d}const D=A?{done:!1,value:x[0]}:P.next(N);c&&(D.value=c(D.value));let{done:M}=D;!A&&h!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return V&&S!==Wp&&(D.value=pg(x,this.options,E,this.speed)),z&&z(D.value),V&&this.finish(),D}then(t,n){return this.finished.then(t,n)}get duration(){return gr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+gr(t)}get time(){return gr(this.currentTime)}set time(t){t=pa(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(Cn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=gr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=NO,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(Cn.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 HO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ii=e=>e*180/Math.PI,ex=e=>{const t=Ii(Math.atan2(e[1],e[0]));return tx(t)},qO={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ex,rotateZ:ex,skewX:e=>Ii(Math.atan(e[1])),skewY:e=>Ii(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},tx=e=>(e=e%360,e<0&&(e+=360),e),q1=ex,G1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Y1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),GO={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:G1,scaleY:Y1,scale:e=>(G1(e)+Y1(e))/2,rotateX:e=>tx(Ii(Math.atan2(e[6],e[5]))),rotateY:e=>tx(Ii(Math.atan2(-e[2],e[0]))),rotateZ:q1,rotate:q1,skewX:e=>Ii(Math.atan(e[4])),skewY:e=>Ii(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function nx(e){return e.includes("scale")?1:0}function rx(e,t){if(!e||e==="none")return nx(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=GO,s=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=qO,s=d}if(!s)return nx(t);const c=a[t],o=s[1].split(",").map(JO);return typeof c=="function"?c(o):o[c]}const YO=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return rx(n,t)};function JO(e){return parseFloat(e.trim())}const wo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],So=new Set(wo),J1=e=>e===ko||e===ke,KO=new Set(["x","y","z"]),XO=wo.filter(e=>!KO.has(e));function QO(e){const t=[];return XO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Qa={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>rx(t,"x"),y:(e,{transform:t})=>rx(t,"y")};Qa.translateX=Qa.x;Qa.translateY=Qa.y;const Bi=new Set;let ax=!1,ix=!1,sx=!1;function gj(){if(ix){const e=Array.from(Bi).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=QO(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,o])=>{a.getValue(c)?.set(o)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}ix=!1,ax=!1,Bi.forEach(e=>e.complete(sx)),Bi.clear()}function yj(){Bi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ix=!0)})}function WO(){sx=!0,yj(),gj(),sx=!1}class yg{constructor(t,n,a,s,c,o=!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=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Bi.add(this),ax||(ax=!0,wt.read(yj),wt.resolveKeyframes(gj))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const c=s?.get(),o=t[t.length-1];if(c!==void 0)t[0]=c;else if(a&&n){const d=a.readValue(n,o);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=o),s&&c===void 0&&s.set(t[0])}HO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Bi.delete(this)}cancel(){this.state==="scheduled"&&(Bi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const eM=e=>e.startsWith("--");function tM(e,t,n){eM(t)?e.style.setProperty(t,n):e.style[t]=n}const nM=sg(()=>window.ScrollTimeline!==void 0),rM={};function aM(e,t){const n=sg(e);return()=>rM[t]??n()}const bj=aM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dl=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,K1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dl([0,.65,.55,1]),circOut:Dl([.55,0,1,.45]),backIn:Dl([.31,.01,.66,-.59]),backOut:Dl([.33,1.53,.69,.99])};function vj(e,t){if(e)return typeof e=="function"?bj()?mj(e,t):"ease-out":rj(e)?Dl(e):Array.isArray(e)?e.map(n=>vj(n,t)||K1.easeOut):K1[e]}function iM(e,t,n,{delay:a=0,duration:s=300,repeat:c=0,repeatType:o="loop",ease:d="easeOut",times:h}={},m=void 0){const x={[t]:n};h&&(x.offset=h);const p=vj(d,s);Array.isArray(p)&&(x.easing=p);const b={delay:a,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:c+1,direction:o==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(x,b)}function kj(e){return typeof e=="function"&&"applyToOptions"in e}function sM({type:e,...t}){return kj(e)&&bj()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class oM extends xg{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:o=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!c,this.allowFlatten=o,this.options=t,ig(typeof t.type!="string");const m=sM(t);this.animation=iM(n,a,s,m,c),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const x=pg(s,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(x):tM(n,a,x),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 gr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+gr(t)}get time(){return gr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=pa(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&&nM()?(this.animation.timeline=t,yr):n(this)}}const wj={anticipate:Wz,backInOut:Qz,circInOut:tj};function lM(e){return e in wj}function cM(e){typeof e.ease=="string"&&lM(e.ease)&&(e.ease=wj[e.ease])}const Vm=10;class uM extends oM{constructor(t){cM(t),xj(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,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new gg({...o,autoplay:!1}),h=Math.max(Vm,Cn.now()-this.startTime),m=Ur(0,Vm,h-Vm);n.setWithVelocity(d.sample(Math.max(0,h-m)).value,d.sample(h).value,m),d.stop()}}const X1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ri.test(e)||e==="0")&&!e.startsWith("url("));function dM(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 fM(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],o=X1(s,t),d=X1(c,t);return!o||!d?!1:dM(e)||(n==="spring"||kj(n))&&a}function ox(e){e.duration=0,e.type="keyframes"}const hM=new Set(["opacity","clipPath","filter","transform"]),mM=sg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function pM(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:c,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return mM()&&n&&hM.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&c!==0&&o!=="inertia"}const xM=40;class gM extends xg{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:o="loop",keyframes:d,name:h,motionValue:m,element:x,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Cn.now();const b={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:c,repeatType:o,name:h,motionValue:m,element:x,...p},v=x?.KeyframeResolver||yg;this.keyframeResolver=new v(d,(S,z,E)=>this.onKeyframesResolved(S,z,b,!E),h,m,x),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:c,type:o,velocity:d,delay:h,isHandoff:m,onUpdate:x}=a;this.resolvedAt=Cn.now(),fM(t,c,o,d)||((ya.instantAnimations||!h)&&x?.(pg(t,a,n)),t[0]=t[t.length-1],ox(a),a.repeat=0);const b={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>xM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},v=!m&&pM(b),S=b.motionValue?.owner?.current,z=v?new uM({...b,element:S}):new gg(b);z.finished.then(()=>{this.notifyFinished()}).catch(yr),this.pendingTimeline&&(this.stopTimeline=z.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=z}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(),WO()),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 Sj(e,t,n,a=0,s=1){const c=Array.from(e).sort((m,x)=>m.sortNodePosition(x)).indexOf(t),o=e.size,d=(o-1)*a;return typeof n=="function"?n(c,o):s===1?c*a:d-c*a}const yM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bM(e){const t=yM.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function zj(e,t,n=1){const[a,s]=bM(e);if(!a)return;const c=window.getComputedStyle(t).getPropertyValue(a);if(c){const o=c.trim();return Fz(o)?parseFloat(o):o}return ug(s)?zj(s,t,n+1):s}const vM={type:"spring",stiffness:500,damping:25,restSpeed:10},kM=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wM={type:"keyframes",duration:.8},SM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zM=(e,{keyframes:t})=>t.length>2?wM:So.has(e)?e.startsWith("scale")?kM(t[1]):vM:SM,jM=e=>e!==null;function _M(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(jM),c=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[c]}function bg(e,t){return e?.[t]??e?.default??e}function NM({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:s,repeat:c,repeatType:o,repeatDelay:d,from:h,elapsed:m,...x}){return!!Object.keys(x).length}const vg=(e,t,n,a={},s,c)=>o=>{const d=bg(a,e)||{},h=d.delay||a.delay||0;let{elapsed:m=0}=a;m=m-pa(h);const x={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:b=>{t.set(b),d.onUpdate&&d.onUpdate(b)},onComplete:()=>{o(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:c?void 0:s};NM(d)||Object.assign(x,zM(e,x)),x.duration&&(x.duration=pa(x.duration)),x.repeatDelay&&(x.repeatDelay=pa(x.repeatDelay)),x.from!==void 0&&(x.keyframes[0]=x.from);let p=!1;if((x.type===!1||x.duration===0&&!x.repeatDelay)&&(ox(x),x.delay===0&&(p=!0)),(ya.instantAnimations||ya.skipAnimations)&&(p=!0,ox(x),x.delay=0),x.allowFlatten=!d.type&&!d.ease,p&&!c&&t.get()!==void 0){const b=_M(x.keyframes,d);if(b!==void 0){wt.update(()=>{x.onUpdate(b),x.onComplete()});return}}return d.isSync?new gg(x):new gM(x)};function Q1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function kg(e,t,n,a){if(typeof t=="function"){const[s,c]=Q1(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]=Q1(a);t=t(n!==void 0?n:e.custom,s,c)}return t}function eo(e,t,n){const a=e.getProps();return kg(a,t,n!==void 0?n:a.custom,e)}const jj=new Set(["width","height","top","left","right","bottom",...wo]),W1=30,CM=e=>!isNaN(parseFloat(e));class TM{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=Cn.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=Cn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=CM(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 og);const a=this.events[t].add(n);return t==="change"?()=>{a(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Cn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>W1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,W1);return Gz(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 lo(e,t){return new TM(e,t)}const lx=e=>Array.isArray(e);function EM(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,lo(n))}function AM(e){return lx(e)?e[e.length-1]||0:e}function OM(e,t){const n=eo(e,t);let{transitionEnd:a={},transition:s={},...c}=n||{};c={...c,...a};for(const o in c){const d=AM(c[o]);EM(e,o,d)}}const yn=e=>!!(e&&e.getVelocity);function MM(e){return!!(yn(e)&&e.add)}function cx(e,t){const n=e.getValue("willChange");if(MM(n))return n.add(t);if(!n&&ya.WillChange){const a=new ya.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function wg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const DM="framerAppearId",_j="data-"+wg(DM);function Nj(e){return e.props[_j]}function RM({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Cj(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:c=e.getDefaultTransition(),transitionEnd:o,...d}=t;const h=c?.reduceMotion;a&&(c=a);const m=[],x=s&&e.animationState&&e.animationState.getState()[s];for(const p in d){const b=e.getValue(p,e.latestValues[p]??null),v=d[p];if(v===void 0||x&&RM(x,p))continue;const S={delay:n,...bg(c||{},p)},z=b.get();if(z!==void 0&&!b.isAnimating&&!Array.isArray(v)&&v===z&&!S.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const N=Nj(e);if(N){const P=window.MotionHandoffAnimation(N,p,wt);P!==null&&(S.startTime=P,E=!0)}}cx(e,p);const _=h??e.shouldReduceMotion;b.start(vg(p,b,v,_&&jj.has(p)?{type:!1}:S,e,E));const A=b.animation;A&&m.push(A)}return o&&Promise.all(m).then(()=>{wt.update(()=>{o&&OM(e,o)})}),m}function ux(e,t,n={}){const a=eo(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(Cj(e,a,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:x,staggerDirection:p}=s;return $M(e,t,h,m,x,p,n)}:()=>Promise.resolve(),{when:d}=s;if(d){const[h,m]=d==="beforeChildren"?[c,o]:[o,c];return h().then(()=>m())}else return Promise.all([c(),o(n.delay)])}function $M(e,t,n=0,a=0,s=0,c=1,o){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(ux(h,t,{...o,delay:n+(typeof a=="function"?0:a)+Sj(e.variantChildren,h,a,s,c)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function LM(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(c=>ux(e,c,n));a=Promise.all(s)}else if(typeof t=="string")a=ux(e,t,n);else{const s=typeof t=="function"?eo(e,t,n.custom):t;a=Promise.all(Cj(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const PM={test:e=>e==="auto",parse:e=>e},Tj=e=>t=>t.test(e),Ej=[ko,ke,Pr,Ya,dO,uO,PM],ek=e=>Ej.find(Tj(e));function UM(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qz(e):!0}const IM=new Set(["brightness","contrast","saturate","opacity"]);function BM(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(dg)||[];if(!a)return e;const s=n.replace(a,"");let c=IM.has(t)?1:0;return a!==n&&(c*=100),t+"("+c+s+")"}const VM=/\b([a-z-]*)\(.*?\)/gu,dx={...ri,getAnimatableNone:e=>{const t=e.match(VM);return t?t.map(BM).join(" "):e}},tk={...ko,transform:Math.round},ZM={rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:Bu,scaleX:Bu,scaleY:Bu,scaleZ:Bu,skew:Ya,skewX:Ya,skewY:Ya,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Kl,originX:B1,originY:B1,originZ:ke},Sg={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,...ZM,zIndex:tk,fillOpacity:Kl,strokeOpacity:Kl,numOctaves:tk},FM={...Sg,color:qt,backgroundColor:qt,outlineColor:qt,fill:qt,stroke:qt,borderColor:qt,borderTopColor:qt,borderRightColor:qt,borderBottomColor:qt,borderLeftColor:qt,filter:dx,WebkitFilter:dx},Aj=e=>FM[e];function Oj(e,t){let n=Aj(e);return n!==dx&&(n=ri),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const HM=new Set(["auto","none","0"]);function qM(e,t,n){let a=0,s;for(;a<e.length&&!s;){const c=e[a];typeof c=="string"&&!HM.has(c)&&Xl(c).values.length&&(s=e[a]),a++}if(s&&n)for(const c of t)e[c]=Oj(n,s)}class GM extends yg{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 x=0;x<t.length;x++){let p=t[x];if(typeof p=="string"&&(p=p.trim(),ug(p))){const b=zj(p,n.current);b!==void 0&&(t[x]=b),x===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!jj.has(a)||t.length!==2)return;const[s,c]=t,o=ek(s),d=ek(c),h=I1(s),m=I1(c);if(h!==m&&Qa[a]){this.needsMeasurement=!0;return}if(o!==d)if(J1(o)&&J1(d))for(let x=0;x<t.length;x++){const p=t[x];typeof p=="string"&&(t[x]=parseFloat(p))}else Qa[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||UM(t[s]))&&a.push(s);a.length&&qM(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qa[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(a,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const c=a.length-1,o=a[c];a[c]=Qa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function YM(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 Mj=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function fx(e){return Hz(e)&&"offsetHeight"in e}const{schedule:zg}=aj(queueMicrotask,!1),Cr={x:!1,y:!1};function Dj(){return Cr.x||Cr.y}function JM(e){return e==="x"||e==="y"?Cr[e]?null:(Cr[e]=!0,()=>{Cr[e]=!1}):Cr.x||Cr.y?null:(Cr.x=Cr.y=!0,()=>{Cr.x=Cr.y=!1})}function Rj(e,t){const n=YM(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function nk(e){return!(e.pointerType==="touch"||Dj())}function KM(e,t,n={}){const[a,s,c]=Rj(e,n),o=d=>{if(!nk(d))return;const{target:h}=d,m=t(h,d);if(typeof m!="function"||!h)return;const x=p=>{nk(p)&&(m(p),h.removeEventListener("pointerleave",x))};h.addEventListener("pointerleave",x,s)};return a.forEach(d=>{d.addEventListener("pointerenter",o,s)}),c}const $j=(e,t)=>t?e===t?!0:$j(e,t.parentElement):!1,jg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,XM=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Lj(e){return XM.has(e.tagName)||e.isContentEditable===!0}const dd=new WeakSet;function rk(e){return t=>{t.key==="Enter"&&e(t)}}function Zm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const QM=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=rk(()=>{if(dd.has(n))return;Zm(n,"down");const s=rk(()=>{Zm(n,"up")}),c=()=>Zm(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 ak(e){return jg(e)&&!Dj()}function WM(e,t,n={}){const[a,s,c]=Rj(e,n),o=d=>{const h=d.currentTarget;if(!ak(d))return;dd.add(h);const m=t(h,d),x=(v,S)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",b),dd.has(h)&&dd.delete(h),ak(v)&&typeof m=="function"&&m(v,{success:S})},p=v=>{x(v,h===window||h===document||n.useGlobalTarget||$j(h,v.target))},b=v=>{x(v,!1)};window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",b,s)};return a.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",o,s),fx(d)&&(d.addEventListener("focus",m=>QM(m,s)),!Lj(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),c}function Pj(e){return Hz(e)&&"ownerSVGElement"in e}function eD(e){return Pj(e)&&e.tagName==="svg"}const tD=[...Ej,qt,ri],nD=e=>tD.find(Tj(e)),ik=()=>({translate:0,scale:1,origin:0,originPoint:0}),qs=()=>({x:ik(),y:ik()}),sk=()=>({min:0,max:0}),en=()=>({x:sk(),y:sk()}),hx={current:null},Uj={current:!1},rD=typeof window<"u";function aD(){if(Uj.current=!0,!!rD)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>hx.current=e.matches;e.addEventListener("change",t),t()}else hx.current=!1}const iD=new WeakMap;function qd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ql(e){return typeof e=="string"||Array.isArray(e)}const _g=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ng=["initial",..._g];function Gd(e){return qd(e.animate)||Ng.some(t=>Ql(e[t]))}function Ij(e){return!!(Gd(e)||e.variants)}function sD(e,t,n){for(const a in t){const s=t[a],c=n[a];if(yn(s))e.addValue(a,s);else if(yn(c))e.addValue(a,lo(s,{owner:e}));else if(c!==s)if(e.hasValue(a)){const o=e.getValue(a);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(a);e.addValue(a,lo(o!==void 0?o:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const ok=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let zd={};function Bj(e){zd=e}function oD(){return zd}class lD{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:c,visualState:o},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yg,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=Cn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,wt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=o;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=d,this.blockInitialAnimation=!!c,this.isControllingVariants=Gd(n),this.isVariantNode=Ij(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in p){const v=p[b];h[b]!==void 0&&yn(v)&&v.set(h[b])}}mount(t){this.current=t,iD.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:(Uj.current||aD(),this.shouldReduceMotion=hx.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ni(this.notifyUpdate),ni(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const a=So.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&wt.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 zd){const n=zd[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):en()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<ok.length;a++){const s=ok[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const c="on"+s,o=t[c];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=sD(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=lo(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"&&(Fz(a)||qz(a))?a=parseFloat(a):!nD(a)&&ri.test(n)&&(a=Oj(t,n)),this.setBaseTarget(t,yn(a)?a.get():a)),yn(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=kg(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&&!yn(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 og),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zg.render(this.render)}}class Vj extends lD{constructor(){super(...arguments),this.KeyframeResolver=GM}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;yn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class oi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Zj({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function cD({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function uD(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 Fm(e){return e===void 0||e===1}function mx({scale:e,scaleX:t,scaleY:n}){return!Fm(e)||!Fm(t)||!Fm(n)}function $i(e){return mx(e)||Fj(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fj(e){return lk(e.x)||lk(e.y)}function lk(e){return e&&e!=="0%"}function jd(e,t,n){const a=e-n,s=t*a;return n+s}function ck(e,t,n,a,s){return s!==void 0&&(e=jd(e,s,a)),jd(e,n,a)+t}function px(e,t=0,n=1,a,s){e.min=ck(e.min,t,n,a,s),e.max=ck(e.max,t,n,a,s)}function Hj(e,{x:t,y:n}){px(e.x,t.translate,t.scale,t.originPoint),px(e.y,n.translate,n.scale,n.originPoint)}const uk=.999999999999,dk=1.0000000000001;function dD(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let c,o;for(let d=0;d<s;d++){c=n[d],o=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&&Ys(e,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Hj(e,o)),a&&$i(c.latestValues)&&Ys(e,c.latestValues))}t.x<dk&&t.x>uk&&(t.x=1),t.y<dk&&t.y>uk&&(t.y=1)}function Gs(e,t){e.min=e.min+t,e.max=e.max+t}function fk(e,t,n,a,s=.5){const c=Ct(e.min,e.max,s);px(e,t,n,c,a)}function Ys(e,t){fk(e.x,t.x,t.scaleX,t.scale,t.originX),fk(e.y,t.y,t.scaleY,t.scale,t.originY)}function qj(e,t){return Zj(uD(e.getBoundingClientRect(),t))}function fD(e,t,n){const a=qj(e,n),{scroll:s}=t;return s&&(Gs(a.x,s.offset.x),Gs(a.y,s.offset.y)),a}const hD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mD=wo.length;function pD(e,t,n){let a="",s=!0;for(let c=0;c<mD;c++){const o=wo[c],d=e[o];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(o.startsWith("scale")?1:0);else{const m=parseFloat(d);h=o.startsWith("scale")?m===1:m===0}if(!h||n){const m=Mj(d,Sg[o]);if(!h){s=!1;const x=hD[o]||o;a+=`${x}(${m}) `}n&&(t[o]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function Cg(e,t,n){const{style:a,vars:s,transformOrigin:c}=e;let o=!1,d=!1;for(const h in t){const m=t[h];if(So.has(h)){o=!0;continue}else if(sj(h)){s[h]=m;continue}else{const x=Mj(m,Sg[h]);h.startsWith("origin")?(d=!0,c[h]=x):a[h]=x}}if(t.transform||(o||n?a.transform=pD(t,e.transform,n):a.transform&&(a.transform="none")),d){const{originX:h="50%",originY:m="50%",originZ:x=0}=c;a.transformOrigin=`${h} ${m} ${x}`}}function Gj(e,{style:t,vars:n},a,s){const c=e.style;let o;for(o in t)c[o]=t[o];s?.applyProjectionStyles(c,a);for(o in n)c.setProperty(o,n[o])}function hk(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const jl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=hk(e,t.target.x),a=hk(e,t.target.y);return`${n}% ${a}%`}},xD={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=ri.parse(e);if(s.length>5)return a;const c=ri.createTransformer(e),o=typeof s[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;s[0+o]/=d,s[1+o]/=h;const m=Ct(d,h,.5);return typeof s[2+o]=="number"&&(s[2+o]/=m),typeof s[3+o]=="number"&&(s[3+o]/=m),c(s)}},xx={borderRadius:{...jl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:jl,borderTopRightRadius:jl,borderBottomLeftRadius:jl,borderBottomRightRadius:jl,boxShadow:xD};function Yj(e,{layout:t,layoutId:n}){return So.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xx[e]||e==="opacity")}function Tg(e,t,n){const a=e.style,s=t?.style,c={};if(!a)return c;for(const o in a)(yn(a[o])||s&&yn(s[o])||Yj(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(c[o]=a[o]);return c}function gD(e){return window.getComputedStyle(e)}class yD extends Vj{constructor(){super(...arguments),this.type="html",this.renderInstance=Gj}readValueFromInstance(t,n){if(So.has(n))return this.projection?.isProjecting?nx(n):YO(t,n);{const a=gD(t),s=(sj(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return qj(t,n)}build(t,n,a){Cg(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Tg(t,n,a)}}const bD={offset:"stroke-dashoffset",array:"stroke-dasharray"},vD={offset:"strokeDashoffset",array:"strokeDasharray"};function kD(e,t,n=1,a=0,s=!0){e.pathLength=1;const c=s?bD:vD;e[c.offset]=`${-a}`,e[c.array]=`${t} ${n}`}const wD=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Jj(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:c=1,pathOffset:o=0,...d},h,m,x){if(Cg(e,d,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:b}=e;p.transform&&(b.transform=p.transform,delete p.transform),(b.transform||p.transformOrigin)&&(b.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),b.transform&&(b.transformBox=x?.transformBox??"fill-box",delete p.transformBox);for(const v of wD)p[v]!==void 0&&(b[v]=p[v],delete p[v]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),a!==void 0&&(p.scale=a),s!==void 0&&kD(p,s,c,o,!1)}const Kj=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"]),Xj=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SD(e,t,n,a){Gj(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(Kj.has(s)?s:wg(s),t.attrs[s])}function Qj(e,t,n){const a=Tg(e,t,n);for(const s in e)if(yn(e[s])||yn(t[s])){const c=wo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[c]=e[s]}return a}class zD extends Vj{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=en}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(So.has(n)){const a=Aj(n);return a&&a.default||0}return n=Kj.has(n)?n:wg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Qj(t,n,a)}build(t,n,a){Jj(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){SD(t,n,a,s)}mount(t){this.isSVGTag=Xj(t.tagName),super.mount(t)}}const jD=Ng.length;function Wj(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Wj(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<jD;n++){const a=Ng[n],s=e.props[a];(Ql(s)||s===!1)&&(t[a]=s)}return t}function e_(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 _D=[..._g].reverse(),ND=_g.length;function CD(e){return t=>Promise.all(t.map(({animation:n,options:a})=>LM(e,n,a)))}function TD(e){let t=CD(e),n=mk(),a=!0;const s=h=>(m,x)=>{const p=eo(e,x,h==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:b,transitionEnd:v,...S}=p;m={...m,...S,...v}}return m};function c(h){t=h(e)}function o(h){const{props:m}=e,x=Wj(e.parent)||{},p=[],b=new Set;let v={},S=1/0;for(let E=0;E<ND;E++){const _=_D[E],A=n[_],N=m[_]!==void 0?m[_]:x[_],P=Ql(N),D=_===h?A.isActive:null;D===!1&&(S=E);let M=N===x[_]&&N!==m[_]&&P;if(M&&a&&e.manuallyAnimateOnMount&&(M=!1),A.protectedKeys={...v},!A.isActive&&D===null||!N&&!A.prevProp||qd(N)||typeof N=="boolean")continue;const V=ED(A.prevProp,N);let U=V||_===h&&A.isActive&&!M&&P||E>S&&P,K=!1;const I=Array.isArray(N)?N:[N];let te=I.reduce(s(_),{});D===!1&&(te={});const{prevResolvedValues:le={}}=A,ne={...le,...te},oe=B=>{U=!0,b.has(B)&&(K=!0,b.delete(B)),A.needsAnimating[B]=!0;const Y=e.getValue(B);Y&&(Y.liveStyle=!1)};for(const B in ne){const Y=te[B],ue=le[B];if(v.hasOwnProperty(B))continue;let O=!1;lx(Y)&&lx(ue)?O=!e_(Y,ue):O=Y!==ue,O?Y!=null?oe(B):b.add(B):Y!==void 0&&b.has(B)?oe(B):A.protectedKeys[B]=!0}A.prevProp=N,A.prevResolvedValues=te,A.isActive&&(v={...v,...te}),a&&e.blockInitialAnimation&&(U=!1);const se=M&&V;U&&(!se||K)&&p.push(...I.map(B=>{const Y={type:_};if(typeof B=="string"&&a&&!se&&e.manuallyAnimateOnMount&&e.parent){const{parent:ue}=e,O=eo(ue,B);if(ue.enteringChildren&&O){const{delayChildren:C}=O.transition||{};Y.delay=Sj(ue.enteringChildren,e,C)}}return{animation:B,options:Y}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const _=eo(e,Array.isArray(m.initial)?m.initial[0]:m.initial);_&&_.transition&&(E.transition=_.transition)}b.forEach(_=>{const A=e.getBaseTarget(_),N=e.getValue(_);N&&(N.liveStyle=!0),E[_]=A??null}),p.push({animation:E})}let z=!!p.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(z=!1),a=!1,z?t(p):Promise.resolve()}function d(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(h,m)),n[h].isActive=m;const x=o(h);for(const p in n)n[p].protectedKeys={};return x}return{animateChanges:o,setActive:d,setAnimateFunction:c,getState:()=>n,reset:()=>{n=mk()}}}function ED(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!e_(t,e):!1}function Oi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mk(){return{animate:Oi(!0),whileInView:Oi(),whileHover:Oi(),whileTap:Oi(),whileDrag:Oi(),whileFocus:Oi(),exit:Oi()}}function pk(e,t){e.min=t.min,e.max=t.max}function _r(e,t){pk(e.x,t.x),pk(e.y,t.y)}function xk(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const t_=1e-4,AD=1-t_,OD=1+t_,n_=.01,MD=0-n_,DD=0+n_;function Tn(e){return e.max-e.min}function RD(e,t,n){return Math.abs(e-t)<=n}function gk(e,t,n,a=.5){e.origin=a,e.originPoint=Ct(t.min,t.max,e.origin),e.scale=Tn(n)/Tn(t),e.translate=Ct(n.min,n.max,e.origin)-e.originPoint,(e.scale>=AD&&e.scale<=OD||isNaN(e.scale))&&(e.scale=1),(e.translate>=MD&&e.translate<=DD||isNaN(e.translate))&&(e.translate=0)}function Il(e,t,n,a){gk(e.x,t.x,n.x,a?a.originX:void 0),gk(e.y,t.y,n.y,a?a.originY:void 0)}function yk(e,t,n){e.min=n.min+t.min,e.max=e.min+Tn(t)}function $D(e,t,n){yk(e.x,t.x,n.x),yk(e.y,t.y,n.y)}function bk(e,t,n){e.min=t.min-n.min,e.max=e.min+Tn(t)}function _d(e,t,n){bk(e.x,t.x,n.x),bk(e.y,t.y,n.y)}function vk(e,t,n,a,s){return e-=t,e=jd(e,1/n,a),s!==void 0&&(e=jd(e,1/s,a)),e}function LD(e,t=0,n=1,a=.5,s,c=e,o=e){if(Pr.test(t)&&(t=parseFloat(t),t=Ct(o.min,o.max,t/100)-o.min),typeof t!="number")return;let d=Ct(c.min,c.max,a);e===c&&(d-=t),e.min=vk(e.min,t,n,d,s),e.max=vk(e.max,t,n,d,s)}function kk(e,t,[n,a,s],c,o){LD(e,t[n],t[a],t[s],t.scale,c,o)}const PD=["x","scaleX","originX"],UD=["y","scaleY","originY"];function wk(e,t,n,a){kk(e.x,t,PD,n?n.x:void 0,a?a.x:void 0),kk(e.y,t,UD,n?n.y:void 0,a?a.y:void 0)}function Sk(e){return e.translate===0&&e.scale===1}function r_(e){return Sk(e.x)&&Sk(e.y)}function zk(e,t){return e.min===t.min&&e.max===t.max}function ID(e,t){return zk(e.x,t.x)&&zk(e.y,t.y)}function jk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function a_(e,t){return jk(e.x,t.x)&&jk(e.y,t.y)}function _k(e){return Tn(e.x)/Tn(e.y)}function Nk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function mr(e){return[e("x"),e("y")]}function BD(e,t,n){let a="";const s=e.x.translate/t.x,c=e.y.translate/t.y,o=n?.z||0;if((s||c||o)&&(a=`translate3d(${s}px, ${c}px, ${o}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:x,rotateX:p,rotateY:b,skewX:v,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),x&&(a+=`rotate(${x}deg) `),p&&(a+=`rotateX(${p}deg) `),b&&(a+=`rotateY(${b}deg) `),v&&(a+=`skewX(${v}deg) `),S&&(a+=`skewY(${S}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(a+=`scale(${d}, ${h})`),a||"none"}const i_=["TopLeft","TopRight","BottomLeft","BottomRight"],VD=i_.length,Ck=e=>typeof e=="string"?parseFloat(e):e,Tk=e=>typeof e=="number"||ke.test(e);function ZD(e,t,n,a,s,c){s?(e.opacity=Ct(0,n.opacity??1,FD(a)),e.opacityExit=Ct(t.opacity??1,0,HD(a))):c&&(e.opacity=Ct(t.opacity??1,n.opacity??1,a));for(let o=0;o<VD;o++){const d=`border${i_[o]}Radius`;let h=Ek(t,d),m=Ek(n,d);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||Tk(h)===Tk(m)?(e[d]=Math.max(Ct(Ck(h),Ck(m),a),0),(Pr.test(m)||Pr.test(h))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=Ct(t.rotate||0,n.rotate||0,a))}function Ek(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const FD=s_(0,.5,ej),HD=s_(.5,.95,yr);function s_(e,t,n){return a=>a<e?0:a>t?1:n(Jl(e,t,a))}function qD(e,t,n){const a=yn(e)?e:lo(e);return a.start(vg("",a,t,n)),a.animation}function Wl(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const GD=(e,t)=>e.depth-t.depth;class YD{constructor(){this.children=[],this.isDirty=!1}add(t){rg(this.children,t),this.isDirty=!0}remove(t){ag(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(GD),this.isDirty=!1,this.children.forEach(t)}}function JD(e,t){const n=Cn.now(),a=({timestamp:s})=>{const c=s-n;c>=t&&(ni(a),e(c-t))};return wt.setup(a,!0),()=>ni(a)}function fd(e){return yn(e)?e.get():e}class KD{constructor(){this.members=[]}add(t){rg(this.members,t),t.scheduleRender()}remove(t){if(ag(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:d}=t.options;d===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:a}=t;n.onExitComplete&&n.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const hd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Hm=["","X","Y","Z"],XD=1e3;let QD=0;function qm(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function o_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Nj(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(s||c))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&o_(a)}function l_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(o={},d=t?.()){this.id=QD++,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(tR),this.nodes.forEach(iR),this.nodes.forEach(sR),this.nodes.forEach(nR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new YD)}addEventListener(o,d){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new og),this.eventHandlers.get(o).add(d)}notifyListeners(o,...d){const h=this.eventHandlers.get(o);h&&h.notify(...d)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Pj(o)&&!eD(o),this.instance=o;const{layoutId:d,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let x,p=0;const b=()=>this.root.updateBlockedByResize=!1;wt.read(()=>{p=window.innerWidth}),e(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,x&&x(),x=JD(b,250),hd.hasAnimatedSinceResize&&(hd.hasAnimatedSinceResize=!1,this.nodes.forEach(Mk)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||h)&&this.addEventListener("didUpdate",({delta:x,hasLayoutChanged:p,hasRelativeLayoutChanged:b,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||dR,{onLayoutAnimationStart:z,onLayoutAnimationComplete:E}=m.getProps(),_=!this.targetLayout||!a_(this.targetLayout,v),A=!p&&b;if(this.options.layoutRoot||this.resumeFrom||A||p&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...bg(S,"layout"),onPlay:z,onComplete:E};(m.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(x,A)}else p||Mk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ni(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(oR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&o_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let x=0;x<this.path.length;x++){const p=this.path[x];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ak);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ok);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aR),this.nodes.forEach(WD),this.nodes.forEach(eR)):this.nodes.forEach(Ok),this.clearAllSnapshots();const d=Cn.now();fn.delta=Ur(0,1e3/60,d-fn.timestamp),fn.timestamp=d,fn.isProcessing=!0,Lm.update.process(fn),Lm.preRender.process(fn),Lm.render.process(fn),fn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rR),this.sharedNodes.forEach(lR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Tn(this.snapshot.measuredBox.x)&&!Tn(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 o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=en(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(d=!1),d&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!r_(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,x=m!==this.prevTransformTemplateValue;o&&this.instance&&(d||$i(this.latestValues)||x)&&(s(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return o&&(h=this.removeTransform(h)),fR(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return en();const d=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(hR))){const{scroll:m}=this.root;m&&(Gs(d.x,m.offset.x),Gs(d.y,m.offset.y))}return d}removeElementScroll(o){const d=en();if(_r(d,o),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:x,options:p}=m;m!==this.root&&x&&p.layoutScroll&&(x.wasRoot&&_r(d,o),Gs(d.x,x.offset.x),Gs(d.y,x.offset.y))}return d}applyTransform(o,d=!1){const h=en();_r(h,o);for(let m=0;m<this.path.length;m++){const x=this.path[m];!d&&x.options.layoutScroll&&x.scroll&&x!==x.root&&Ys(h,{x:-x.scroll.offset.x,y:-x.scroll.offset.y}),$i(x.latestValues)&&Ys(h,x.latestValues)}return $i(this.latestValues)&&Ys(h,this.latestValues),h}removeTransform(o){const d=en();_r(d,o);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!$i(m.latestValues))continue;mx(m.latestValues)&&m.updateSnapshot();const x=en(),p=m.measurePageBox();_r(x,p),wk(d,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,x)}return $i(this.latestValues)&&wk(d,this.latestValues),d}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==fn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(o||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:x,layoutId:p}=this.options;if(!this.layout||!(x||p))return;this.resolvedRelativeTargetAt=fn.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=en(),this.targetWithTransforms=en()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$D(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_r(this.target,this.layout.layoutBox),Hj(this.target,this.targetDelta)):_r(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||mx(this.parent.latestValues)||Fj(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,d,h){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=en(),this.relativeTargetOrigin=en(),_d(this.relativeTargetOrigin,d,h),_r(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),d=!!this.resumingFrom||this!==o;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===fn.timestamp&&(h=!1),h)return;const{layout:m,layoutId:x}=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||x))return;_r(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,b=this.treeScale.y;dD(this.layoutCorrected,this.treeScale,this.path,d),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=en());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xk(this.prevProjectionDelta.x,this.projectionDelta.x),xk(this.prevProjectionDelta.y,this.projectionDelta.y)),Il(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==b||!Nk(this.projectionDelta.x,this.prevProjectionDelta.x)||!Nk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qs(),this.projectionDelta=qs(),this.projectionDeltaWithTransform=qs()}setAnimationOrigin(o,d=!1){const h=this.snapshot,m=h?h.latestValues:{},x={...this.latestValues},p=qs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const b=en(),v=h?h.source:void 0,S=this.layout?this.layout.source:void 0,z=v!==S,E=this.getStack(),_=!E||E.members.length<=1,A=!!(z&&!_&&this.options.crossfade===!0&&!this.path.some(uR));this.animationProgress=0;let N;this.mixTargetDelta=P=>{const D=P/1e3;Dk(p.x,o.x,D),Dk(p.y,o.y,D),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_d(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),cR(this.relativeTarget,this.relativeTargetOrigin,b,D),N&&ID(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=en()),_r(N,this.relativeTarget)),z&&(this.animationValues=x,ZD(x,m,this.latestValues,D,A,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ni(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{hd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=lo(0)),this.currentAnimation=qD(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(XD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:d,target:h,layout:m,latestValues:x}=o;if(!(!d||!h||!m)){if(this!==o&&this.layout&&m&&c_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||en();const p=Tn(this.layout.layoutBox.x);h.x.min=o.target.x.min,h.x.max=h.x.min+p;const b=Tn(this.layout.layoutBox.y);h.y.min=o.target.y.min,h.y.max=h.y.min+b}_r(d,h),Ys(d,x),Il(this.projectionDeltaWithTransform,this.layoutCorrected,d,x)}}registerSharedNode(o,d){this.sharedNodes.has(o)||this.sharedNodes.set(o,new KD),this.sharedNodes.get(o).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:d,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),o&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let d=!1;const{latestValues:h}=o;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const m={};h.z&&qm("z",o,m,this.animationValues);for(let x=0;x<Hm.length;x++)qm(`rotate${Hm[x]}`,o,m,this.animationValues),qm(`skew${Hm[x]}`,o,m,this.animationValues);o.render();for(const x in m)o.setStaticValue(x,m[x]),this.animationValues&&(this.animationValues[x]=m[x]);o.scheduleRender()}applyProjectionStyles(o,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=fd(d?.pointerEvents)||"",o.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=fd(d?.pointerEvents)||""),this.hasProjected&&!$i(this.latestValues)&&(o.transform=h?h({},""):"none",this.hasProjected=!1);return}o.visibility="";const x=m.animationValues||m.latestValues;this.applyTransformsToTarget();let p=BD(this.projectionDeltaWithTransform,this.treeScale,x);h&&(p=h(x,p)),o.transform=p;const{x:b,y:v}=this.projectionDelta;o.transformOrigin=`${b.origin*100}% ${v.origin*100}% 0`,m.animationValues?o.opacity=m===this?x.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:o.opacity=m===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const S in xx){if(x[S]===void 0)continue;const{correct:z,applyTo:E,isCSSVariable:_}=xx[S],A=p==="none"?x[S]:z(x[S],m);if(E){const N=E.length;for(let P=0;P<N;P++)o[E[P]]=A}else _?this.options.visualElement.renderState.vars[S]=A:o[S]=A}this.options.layoutId&&(o.pointerEvents=m===this?fd(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Ak),this.root.sharedNodes.clear()}}}function WD(e){e.updateLayout()}function eR(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"?mr(x=>{const p=c?t.measuredBox[x]:t.layoutBox[x],b=Tn(p);p.min=n[x].min,p.max=p.min+b}):c_(s,t.layoutBox,n)&&mr(x=>{const p=c?t.measuredBox[x]:t.layoutBox[x],b=Tn(n[x]);p.max=p.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[x].max=e.relativeTarget[x].min+b)});const o=qs();Il(o,n,t.layoutBox);const d=qs();c?Il(d,e.applyTransform(a,!0),t.measuredBox):Il(d,n,t.layoutBox);const h=!r_(o);let m=!1;if(!e.resumeFrom){const x=e.getClosestProjectingParent();if(x&&!x.resumeFrom){const{snapshot:p,layout:b}=x;if(p&&b){const v=en();_d(v,t.layoutBox,p.layoutBox);const S=en();_d(S,n,b.layoutBox),a_(v,S)||(m=!0),x.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=v,e.relativeParent=x)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:o,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function tR(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 nR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rR(e){e.clearSnapshot()}function Ak(e){e.clearMeasurements()}function Ok(e){e.isLayoutDirty=!1}function aR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iR(e){e.resolveTargetDelta()}function sR(e){e.calcProjection()}function oR(e){e.resetSkewAndRotation()}function lR(e){e.removeLeadSnapshot()}function Dk(e,t,n){e.translate=Ct(t.translate,0,n),e.scale=Ct(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Rk(e,t,n,a){e.min=Ct(t.min,n.min,a),e.max=Ct(t.max,n.max,a)}function cR(e,t,n,a){Rk(e.x,t.x,n.x,a),Rk(e.y,t.y,n.y,a)}function uR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const dR={duration:.45,ease:[.4,0,.1,1]},$k=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Lk=$k("applewebkit/")&&!$k("chrome/")?Math.round:yr;function Pk(e){e.min=Lk(e.min),e.max=Lk(e.max)}function fR(e){Pk(e.x),Pk(e.y)}function c_(e,t,n){return e==="position"||e==="preserve-aspect"&&!RD(_k(t),_k(n),.2)}function hR(e){return e!==e.root&&e.scroll?.wasRoot}const mR=l_({attachResizeListener:(e,t)=>Wl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Gm={current:void 0},u_=l_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Gm.current){const e=new mR({});e.mount(window),e.setOptions({layoutScroll:!0}),Gm.current=e}return Gm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Eg=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Uk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pR(...e){return t=>{let n=!1;const a=e.map(s=>{const c=Uk(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():Uk(e[s],null)}}}}function xR(...e){return j.useCallback(pR(...e),e)}class gR extends j.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=fx(a)&&a.offsetWidth||0,c=fx(a)&&a.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left,o.bottom=c-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function yR({children:e,isPresent:t,anchorX:n,anchorY:a,root:s}){const c=j.useId(),o=j.useRef(null),d=j.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=j.useContext(Eg),m=e.props?.ref??e?.ref,x=xR(o,m);return j.useInsertionEffect(()=>{const{width:p,height:b,top:v,left:S,right:z,bottom:E}=d.current;if(t||!o.current||!p||!b)return;const _=n==="left"?`left: ${S}`:`right: ${z}`,A=a==="bottom"?`bottom: ${E}`:`top: ${v}`;o.current.dataset.motionPopId=c;const N=document.createElement("style");h&&(N.nonce=h);const P=s??document.head;return P.appendChild(N),N.sheet&&N.sheet.insertRule(`
12
- [data-motion-pop-id="${c}"] {
13
- position: absolute !important;
14
- width: ${p}px !important;
15
- height: ${b}px !important;
16
- ${_}px !important;
17
- ${A}px !important;
18
- }
19
- `),()=>{P.contains(N)&&P.removeChild(N)}},[t]),u.jsx(gR,{isPresent:t,childRef:o,sizeRef:d,children:j.cloneElement(e,{ref:x})})}const bR=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:c,mode:o,anchorX:d,anchorY:h,root:m})=>{const x=ng(vR),p=j.useId();let b=!0,v=j.useMemo(()=>(b=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:S=>{x.set(S,!0);for(const z of x.values())if(!z)return;a&&a()},register:S=>(x.set(S,!1),()=>x.delete(S))}),[n,x,a]);return c&&b&&(v={...v}),j.useMemo(()=>{x.forEach((S,z)=>x.set(z,!1))},[n]),j.useEffect(()=>{!n&&!x.size&&a&&a()},[n]),o==="popLayout"&&(e=u.jsx(yR,{isPresent:n,anchorX:d,anchorY:h,root:m,children:e})),u.jsx(Hd.Provider,{value:v,children:e})};function vR(){return new Map}function d_(e=!0){const t=j.useContext(Hd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,c=j.useId();j.useEffect(()=>{if(e)return s(c)},[e]);const o=j.useCallback(()=>e&&a&&a(c),[c,a,e]);return!n&&a?[!1,o]:[!0]}const Vu=e=>e.key||"";function Ik(e){const t=[];return j.Children.forEach(e,n=>{j.isValidElement(n)&&t.push(n)}),t}const Ag=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:c="sync",propagate:o=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[x,p]=d_(o),b=j.useMemo(()=>Ik(e),[e]),v=o&&!x?[]:b.map(Vu),S=j.useRef(!0),z=j.useRef(b),E=ng(()=>new Map),_=j.useRef(new Set),[A,N]=j.useState(b),[P,D]=j.useState(b);Zz(()=>{S.current=!1,z.current=b;for(let U=0;U<P.length;U++){const K=Vu(P[U]);v.includes(K)?(E.delete(K),_.current.delete(K)):E.get(K)!==!0&&E.set(K,!1)}},[P,v.length,v.join("-")]);const M=[];if(b!==A){let U=[...b];for(let K=0;K<P.length;K++){const I=P[K],te=Vu(I);v.includes(te)||(U.splice(K,0,I),M.push(I))}return c==="wait"&&M.length&&(U=M),D(Ik(U)),N(b),null}const{forceRender:V}=j.useContext(tg);return u.jsx(u.Fragment,{children:P.map(U=>{const K=Vu(U),I=o&&!x?!1:b===P||v.includes(K),te=()=>{if(_.current.has(K))return;if(_.current.add(K),E.has(K))E.set(K,!0);else return;let le=!0;E.forEach(ne=>{ne||(le=!1)}),le&&(V?.(),D(z.current),o&&p?.(),a&&a())};return u.jsx(bR,{isPresent:I,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:c,root:m,onExitComplete:I?void 0:te,anchorX:d,anchorY:h,children:U},K)})})},f_=j.createContext({strict:!1}),Bk={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 Vk=!1;function kR(){if(Vk)return;const e={};for(const t in Bk)e[t]={isEnabled:n=>Bk[t].some(a=>!!n[a])};Bj(e),Vk=!0}function h_(){return kR(),oD()}function wR(e){const t=h_();for(const n in e)t[n]={...t[n],...e[n]};Bj(t)}const SR=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 Nd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||SR.has(e)}let m_=e=>!Nd(e);function zR(e){typeof e=="function"&&(m_=t=>t.startsWith("on")?!Nd(t):e(t))}try{zR(require("@emotion/is-prop-valid").default)}catch{}function jR(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(m_(s)||n===!0&&Nd(s)||!t&&!Nd(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Yd=j.createContext({});function _R(e,t){if(Gd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Ql(n)?n:void 0,animate:Ql(a)?a:void 0}}return e.inherit!==!1?t:{}}function NR(e){const{initial:t,animate:n}=_R(e,j.useContext(Yd));return j.useMemo(()=>({initial:t,animate:n}),[Zk(t),Zk(n)])}function Zk(e){return Array.isArray(e)?e.join(" "):e}const Og=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function p_(e,t,n){for(const a in t)!yn(t[a])&&!Yj(a,n)&&(e[a]=t[a])}function CR({transformTemplate:e},t){return j.useMemo(()=>{const n=Og();return Cg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function TR(e,t){const n=e.style||{},a={};return p_(a,n,e),Object.assign(a,CR(e,t)),a}function ER(e,t){const n={},a=TR(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 x_=()=>({...Og(),attrs:{}});function AR(e,t,n,a){const s=j.useMemo(()=>{const c=x_();return Jj(c,t,Xj(a),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[t]);if(e.style){const c={};p_(c,e.style,e),s.style={...c,...s.style}}return s}const OR=["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 Mg(e){return typeof e!="string"||e.includes("-")?!1:!!(OR.indexOf(e)>-1||/[A-Z]/u.test(e))}function MR(e,t,n,{latestValues:a},s,c=!1,o){const h=(o??Mg(e)?AR:ER)(t,a,s,e),m=jR(t,typeof e=="string",c),x=e!==j.Fragment?{...m,...h,ref:n}:{},{children:p}=t,b=j.useMemo(()=>yn(p)?p.get():p,[p]);return j.createElement(e,{...x,children:b})}function DR({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:RR(n,a,s,e),renderState:t()}}function RR(e,t,n,a){const s={},c=a(e,{});for(const b in c)s[b]=fd(c[b]);let{initial:o,animate:d}=e;const h=Gd(e),m=Ij(e);t&&m&&!h&&e.inherit!==!1&&(o===void 0&&(o=t.initial),d===void 0&&(d=t.animate));let x=n?n.initial===!1:!1;x=x||o===!1;const p=x?d:o;if(p&&typeof p!="boolean"&&!qd(p)){const b=Array.isArray(p)?p:[p];for(let v=0;v<b.length;v++){const S=kg(e,b[v]);if(S){const{transitionEnd:z,transition:E,..._}=S;for(const A in _){let N=_[A];if(Array.isArray(N)){const P=x?N.length-1:0;N=N[P]}N!==null&&(s[A]=N)}for(const A in z)s[A]=z[A]}}}return s}const g_=e=>(t,n)=>{const a=j.useContext(Yd),s=j.useContext(Hd),c=()=>DR(e,t,a,s);return n?c():ng(c)},$R=g_({scrapeMotionValuesFromProps:Tg,createRenderState:Og}),LR=g_({scrapeMotionValuesFromProps:Qj,createRenderState:x_}),PR=Symbol.for("motionComponentSymbol");function UR(e,t,n){const a=j.useRef(n);j.useInsertionEffect(()=>{a.current=n});const s=j.useRef(null);return j.useCallback(c=>{c&&e.onMount?.(c),t&&(c?t.mount(c):t.unmount());const o=a.current;if(typeof o=="function")if(c){const d=o(c);typeof d=="function"&&(s.current=d)}else s.current?(s.current(),s.current=null):o(c);else o&&(o.current=c)},[t])}const y_=j.createContext({});function Rl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function IR(e,t,n,a,s,c){const{visualElement:o}=j.useContext(Yd),d=j.useContext(f_),h=j.useContext(Hd),m=j.useContext(Eg).reducedMotion,x=j.useRef(null),p=j.useRef(!1);a=a||d.renderer,!x.current&&a&&(x.current=a(e,{visualState:t,parent:o,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,isSVG:c}),p.current&&x.current&&(x.current.manuallyAnimateOnMount=!0));const b=x.current,v=j.useContext(y_);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&BR(x.current,n,s,v);const S=j.useRef(!1);j.useInsertionEffect(()=>{b&&S.current&&b.update(n,h)});const z=n[_j],E=j.useRef(!!z&&!window.MotionHandoffIsComplete?.(z)&&window.MotionHasOptimisedAnimation?.(z));return Zz(()=>{p.current=!0,b&&(S.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),E.current&&b.animationState&&b.animationState.animateChanges())}),j.useEffect(()=>{b&&(!E.current&&b.animationState&&b.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(z)}),E.current=!1),b.enteringChildren=void 0)}),b}function BR(e,t,n,a){const{layoutId:s,layout:c,drag:o,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutCrossfade:x}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:b_(e.parent)),e.projection.setOptions({layoutId:s,layout:c,alwaysMeasureLayout:!!o||d&&Rl(d),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:a,crossfade:x,layoutScroll:h,layoutRoot:m})}function b_(e){if(e)return e.options.allowProjection!==!1?e.projection:b_(e.parent)}function Ym(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&wR(a);const c=n?n==="svg":Mg(e),o=c?LR:$R;function d(m,x){let p;const b={...j.useContext(Eg),...m,layoutId:VR(m)},{isStatic:v}=b,S=NR(m),z=o(m,v);if(!v&&Vz){ZR();const E=FR(b);p=E.MeasureLayout,S.visualElement=IR(e,z,b,s,E.ProjectionNode,c)}return u.jsxs(Yd.Provider,{value:S,children:[p&&S.visualElement?u.jsx(p,{visualElement:S.visualElement,...b}):null,MR(e,m,UR(z,S.visualElement,x),z,v,t,c)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=j.forwardRef(d);return h[PR]=e,h}function VR({layoutId:e}){const t=j.useContext(tg).id;return t&&e!==void 0?t+"-"+e:e}function ZR(e,t){j.useContext(f_).strict}function FR(e){const t=h_(),{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 HR(e,t){if(typeof Proxy>"u")return Ym;const n=new Map,a=(c,o)=>Ym(c,o,e,t),s=(c,o)=>a(c,o);return new Proxy(s,{get:(c,o)=>o==="create"?a:(n.has(o)||n.set(o,Ym(o,void 0,e,t)),n.get(o))})}const qR=(e,t)=>t.isSVG??Mg(e)?new zD(t):new yD(t,{allowProjection:e!==j.Fragment});class GR extends oi{constructor(t){super(t),t.animationState||(t.animationState=TD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();qd(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 YR=0;class JR extends oi{constructor(){super(...arguments),this.id=YR++}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 KR={animation:{Feature:GR},exit:{Feature:JR}};function xc(e){return{point:{x:e.pageX,y:e.pageY}}}const XR=e=>t=>jg(t)&&e(t,xc(t));function Bl(e,t,n,a){return Wl(e,t,XR(n),a)}const v_=({current:e})=>e?e.ownerDocument.defaultView:null,Fk=(e,t)=>Math.abs(e-t);function QR(e,t){const n=Fk(e.x,t.x),a=Fk(e.y,t.y);return Math.sqrt(n**2+a**2)}const Hk=new Set(["auto","scroll"]);class k_{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:c=!1,distanceThreshold:o=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Km(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,z=QR(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!z)return;const{point:E}=v,{timestamp:_}=fn;this.history.push({...E,timestamp:_});const{onStart:A,onMove:N}=this.handlers;S||(A&&A(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Jm(S,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:z,onSessionEnd:E,resumeAnimation:_}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=Km(v.type==="pointercancel"?this.lastMoveEventInfo:Jm(S,this.transformPagePoint),this.history);this.startEvent&&z&&z(v,A),E&&E(v,A)},!jg(t))return;this.dragSnapToOrigin=c,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=o,this.contextWindow=s||window;const h=xc(t),m=Jm(h,this.transformPagePoint),{point:x}=m,{timestamp:p}=fn;this.history=[{...x,timestamp:p}];const{onSessionStart:b}=n;b&&b(t,Km(m,this.history)),this.removeListeners=hc(Bl(this.contextWindow,"pointermove",this.handlePointerMove),Bl(this.contextWindow,"pointerup",this.handlePointerUp),Bl(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(Hk.has(a.overflowX)||Hk.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),wt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ni(this.updatePoint)}}function Jm(e,t){return t?{point:t(e.point)}:e}function qk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Km({point:e},t){return{point:e,delta:qk(e,w_(t)),offset:qk(e,WR(t)),velocity:e$(t,.1)}}function WR(e){return e[0]}function w_(e){return e[e.length-1]}function e$(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=w_(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>pa(t)));)n--;if(!a)return{x:0,y:0};const c=gr(s.timestamp-a.timestamp);if(c===0)return{x:0,y:0};const o={x:(s.x-a.x)/c,y:(s.y-a.y)/c};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function t$(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?Ct(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?Ct(n,e,a.max):Math.min(e,n)),e}function 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 n$(e,{top:t,left:n,bottom:a,right:s}){return{x:Gk(e.x,n,s),y:Gk(e.y,t,a)}}function Yk(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 r$(e,t){return{x:Yk(e.x,t.x),y:Yk(e.y,t.y)}}function a$(e,t){let n=.5;const a=Tn(e),s=Tn(t);return s>a?n=Jl(t.min,t.max-a,e.min):a>s&&(n=Jl(e.min,e.max-s,t.min)),Ur(0,1,n)}function i$(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 gx=.35;function s$(e=gx){return e===!1?e=0:e===!0&&(e=gx),{x:Jk(e,"left","right"),y:Jk(e,"top","bottom")}}function Jk(e,t,n){return{min:Kk(e,t),max:Kk(e,n)}}function Kk(e,t){return typeof e=="number"?e:e[t]||0}const o$=new WeakMap;class l${constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=en(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const c=p=>{n?(this.stopAnimation(),this.snapToCursor(xc(p).point)):this.pauseAnimation()},o=(p,b)=>{this.stopAnimation();const{drag:v,dragPropagation:S,onDragStart:z}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=JM(v),!this.openDragLock))return;this.latestPointerEvent=p,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),mr(_=>{let A=this.getAxisMotionValue(_).get()||0;if(Pr.test(A)){const{projection:N}=this.visualElement;if(N&&N.layout){const P=N.layout.layoutBox[_];P&&(A=Tn(P)*(parseFloat(A)/100))}}this.originPoint[_]=A}),z&&wt.postRender(()=>z(p,b)),cx(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(p,b)=>{this.latestPointerEvent=p,this.latestPanInfo=b;const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:z,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:_}=b;if(S&&this.currentDirection===null){this.currentDirection=c$(_),this.currentDirection!==null&&z&&z(this.currentDirection);return}this.updateAxis("x",b.point,_),this.updateAxis("y",b.point,_),this.visualElement.render(),E&&E(p,b)},h=(p,b)=>{this.latestPointerEvent=p,this.latestPanInfo=b,this.stop(p,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>mr(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:x}=this.getProps();this.panSession=new k_(t,{onSessionStart:c,onStart:o,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:x,distanceThreshold:a,contextWindow:v_(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:o}=s;this.startAnimation(o);const{onDragEnd:d}=this.getProps();d&&wt.postRender(()=>d(a,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:s}=this.getProps();if(!a||!Zu(t,s,this.currentDirection))return;const c=this.getAxisMotionValue(t);let o=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(o=t$(o,this.constraints[t],this.elastic[t])),c.set(o)}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&&Rl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=n$(a.layoutBox,t):this.constraints=!1,this.elastic=s$(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&mr(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=i$(a.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const c=fD(a,s.root,this.visualElement.getTransformPagePoint());let o=r$(s.layout.layoutBox,c);if(n){const d=n(cD(o));this.hasMutatedConstraints=!!d,d&&(o=Zj(d))}return o}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:c,dragSnapToOrigin:o,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=mr(x=>{if(!Zu(x,n,this.currentDirection))return;let p=h&&h[x]||{};o&&(p={min:0,max:0});const b=s?200:1e6,v=s?40:1e7,S={type:"inertia",velocity:a?t[x]:0,bounceStiffness:b,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...c,...p};return this.startAxisValueAnimation(x,S)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return cx(this.visualElement,t),a.start(vg(t,a,0,n,this.visualElement,!1))}stopAnimation(){mr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){mr(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){mr(n=>{const{drag:a}=this.getProps();if(!Zu(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,c=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:d}=s.layout.layoutBox[n],h=c.get()||0;c.set(t[n]-Ct(o,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!Rl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};mr(o=>{const d=this.getAxisMotionValue(o);if(d&&this.constraints!==!1){const h=d.get();s[o]=a$({min:h,max:h},this.constraints[o])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),mr(o=>{if(!Zu(o,t,null))return;const d=this.getAxisMotionValue(o),{min:h,max:m}=this.constraints[o];d.set(Ct(h,m,s[o]))})}addListeners(){if(!this.visualElement.current)return;o$.set(this.visualElement,this);const t=this.visualElement.current,n=Bl(t,"pointerdown",h=>{const{drag:m,dragListener:x=!0}=this.getProps(),p=h.target,b=p!==t&&Lj(p);m&&x&&!b&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();Rl(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()),wt.read(a);const o=Wl(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(mr(x=>{const p=this.getAxisMotionValue(x);p&&(this.originPoint[x]+=h[x].translate,p.set(p.get()+h[x].translate))}),this.visualElement.render())}));return()=>{o(),n(),c(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:c=!1,dragElastic:o=gx,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:c,dragElastic:o,dragMomentum:d}}}function Zu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function c$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class u$ extends oi{constructor(t){super(t),this.removeGroupControls=yr,this.removeListeners=yr,this.controls=new l$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yr}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 Xk=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class d$ extends oi{constructor(){super(...arguments),this.removePointerDownListener=yr}onPointerDown(t){this.session=new k_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:v_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:Xk(t),onStart:Xk(n),onMove:a,onEnd:(c,o)=>{delete this.session,s&&wt.postRender(()=>s(c,o))}}}mount(){this.removePointerDownListener=Bl(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 Xm=!1;class f$ extends j.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),Xm&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),hd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:c}=this.props,{projection:o}=a;return o&&(o.isPresent=c,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Xm=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==c?o.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?o.promote():o.relegate()||wt.postRender(()=>{const d=o.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;Xm=!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 S_(e){const[t,n]=d_(),a=j.useContext(tg);return u.jsx(f$,{...e,layoutGroup:a,switchLayoutGroup:j.useContext(y_),isPresent:t,safeToRemove:n})}const h$={pan:{Feature:d$},drag:{Feature:u$,ProjectionNode:u_,MeasureLayout:S_}};function Qk(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&&wt.postRender(()=>c(t,xc(t)))}class m$ extends oi{mount(){const{current:t}=this.node;t&&(this.unmount=KM(t,(n,a)=>(Qk(this.node,a,"Start"),s=>Qk(this.node,s,"End"))))}unmount(){}}class p$ extends oi{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=hc(Wl(this.node.current,"focus",()=>this.onFocus()),Wl(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&&wt.postRender(()=>c(t,xc(t)))}class x$ extends oi{mount(){const{current:t}=this.node;t&&(this.unmount=WM(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 yx=new WeakMap,Qm=new WeakMap,g$=e=>{const t=yx.get(e.target);t&&t(e)},y$=e=>{e.forEach(g$)};function b$({root:e,...t}){const n=e||document;Qm.has(n)||Qm.set(n,{});const a=Qm.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(y$,{root:e,...t})),a[s]}function v$(e,t,n){const a=b$(t);return yx.set(e,n),a.observe(e),()=>{yx.delete(e),a.unobserve(e)}}const k$={some:0,all:1};class w$ extends oi{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,o={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:k$[s]},d=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:x,onViewportLeave:p}=this.node.getProps(),b=m?x:p;b&&b(h)};return v$(this.node.current,o,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(S$(t,n))&&this.startObserver()}unmount(){}}function S$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const z$={inView:{Feature:w$},tap:{Feature:x$},focus:{Feature:p$},hover:{Feature:m$}},j$={layout:{ProjectionNode:u_,MeasureLayout:S_}},_$={...KR,...z$,...h$,...j$},$e=HR(_$,qR),z_=()=>{const[e,t]=j.useState(!!localStorage.getItem("morpheus.auth.token"));return j.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"}}},N$=new Set(["apoc_delegate","neo_delegate","trinity_delegate","smith_delegate"]);function C$(e){return N$.has(e)}function T$(e){const t=[],n=new Set;for(let a=0;a<e.length;a++){if(n.has(a))continue;const s=e[a];if(s.type==="ai"&&Array.isArray(s.tool_calls)&&s.tool_calls.length>0){const c=s.tool_calls.map(o=>{const d=e.findIndex((h,m)=>m>a&&h.type==="tool"&&h.tool_call_id===o.id);return d!==-1&&n.add(d),{call:{id:o.id??"",name:o.name??"",args:o.args??{}},result:d!==-1?e[d]:null}});t.push({index:a,message:s,toolGroups:c})}else t.push({index:a,message:s})}return t}const ua={getSessions:async()=>xe.get("/sessions"),createSession:async()=>xe.post("/sessions",{}),deleteSession:async e=>xe.delete(`/sessions/${e}`),renameSession:async(e,t)=>xe.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>xe.post(`/sessions/${e}/archive`,{}),getMessages:async e=>xe.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>xe.post("/chat",{sessionId:e,message:t})},fa={list:()=>xe.get("/webhooks"),get:e=>xe.get(`/webhooks/${e}`),create:e=>xe.post("/webhooks",e),update:(e,t)=>xe.put(`/webhooks/${e}`,t),delete:e=>xe.delete(`/webhooks/${e}`),listNotifications:e=>{const t=new URLSearchParams;e?.webhookId&&t.set("webhookId",e.webhookId),e?.unreadOnly&&t.set("unreadOnly","true");const n=t.toString()?`?${t}`:"";return xe.get(`/webhooks/notifications${n}`)},unreadCount:()=>xe.get("/webhooks/notifications/unread-count"),markRead:e=>xe.post("/webhooks/notifications/read",{ids:e})},Fu="morpheus.chat.lastSeenAt",E$="morpheus.chat.uiSessionId",Wm="morpheus.chronos.lastSeenAt",ep="morpheus.webhook.lastSeenAt",A$=5e3,O$=1e4,M$=1e4;function D$(){const e=br(),t=yo(),n=j.useRef(t);n.current=t;const a=j.useRef(0),s=j.useRef(0),c=j.useRef(0);j.useEffect(()=>{const o=sessionStorage.getItem(Fu);a.current=o?parseInt(o,10):Date.now(),o||sessionStorage.setItem(Fu,String(a.current));const d=sessionStorage.getItem(Wm);s.current=d?parseInt(d,10):Date.now(),d||sessionStorage.setItem(Wm,String(s.current));const h=sessionStorage.getItem(ep);c.current=h?parseInt(h,10):Date.now(),h||sessionStorage.setItem(ep,String(c.current))},[]),j.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]),j.useEffect(()=>{if(e.pathname!=="/chat")return;const o=()=>{const h=Date.now();a.current=h,sessionStorage.setItem(Fu,String(h))};o();const d=setInterval(o,3e3);return()=>clearInterval(d)},[e.pathname]),j.useEffect(()=>{if(e.pathname==="/chat"||!("Notification"in window))return;const o=async()=>{if(Notification.permission!=="granted")return;const h=sessionStorage.getItem(E$);if(h)try{const x=(await ua.getMessages(h)).filter(v=>v.type==="ai"&&v.content).at(-1);if(!x?.created_at||x.created_at<=a.current)return;a.current=x.created_at,sessionStorage.setItem(Fu,String(x.created_at));const p=x.content.replace(/[#*`[\]]/g,"").trim().slice(0,120),b=new Notification("Morpheus",{body:p||"Nova resposta do agente",tag:"morpheus-chat",requireInteraction:!0});b.onclick=()=>{window.focus(),n.current("/chat"),b.close()}}catch{}};o();const d=setInterval(o,A$);return()=>clearInterval(d)},[e.pathname]),j.useEffect(()=>{if(!("Notification"in window))return;const o=async()=>{if(Notification.permission==="granted")try{const m=(await fa.listNotifications({unreadOnly:!0})).filter(S=>S.status==="completed");if(!m.length)return;const x=m.reduce((S,z)=>{const E=z.completed_at??z.created_at,_=S.completed_at??S.created_at;return E>_?z:S}),p=x.completed_at??x.created_at;if(p<=c.current)return;c.current=p,sessionStorage.setItem(ep,String(p));const b=x.result?x.result.replace(/[#*`[\]]/g,"").trim().slice(0,120):`Webhook: ${x.webhook_name}`,v=new Notification("Morpheus — Webhook ✓",{body:b,tag:"morpheus-webhook",requireInteraction:!0});v.onclick=()=>{window.focus(),n.current("/notifications"),v.close()}}catch{}};o();const d=setInterval(o,M$);return()=>clearInterval(d)},[]),j.useEffect(()=>{if(!("Notification"in window))return;const o=async()=>{if(Notification.permission==="granted")try{const h=s.current,m=await xe.get(`/chronos/executions/recent?since=${h}`);if(!m.length)return;const x=m[0];if(x.completed_at<=s.current)return;s.current=x.completed_at,sessionStorage.setItem(Wm,String(x.completed_at));const p=x.status==="success"?"✓":"✗",b=x.job_prompt.slice(0,80),v=new Notification(`Morpheus — Chronos ${p}`,{body:b||"Job executado",tag:"morpheus-chronos",requireInteraction:!0});v.onclick=()=>{window.focus(),n.current("/chronos"),v.close()}}catch{}};o();const d=setInterval(o,O$);return()=>clearInterval(d)},[])}function R$({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(Pi,{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(Nz,{className:"w-6 h-6"})})]})]})}const Ir=({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,co=({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})}),Br=({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}),Vr=({className:e,children:t})=>u.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),$$=({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}),xr=({className:e,variant:t="default",size:n="default",...a})=>{const d=`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 ${t==="destructive"?"bg-red-500 text-zinc-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90":t==="outline"?"border border-azure-border dark:border-matrix-primary bg-transparent hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="secondary"?"bg-azure-surface dark:bg-zinc-800 hover:bg-azure-hover dark:hover:bg-zinc-700/80 text-azure-text-primary dark:text-matrix-secondary":t==="ghost"?"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="link"?"text-azure-primary dark:text-matrix-highlight underline-offset-4 hover:underline":"bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black hover:bg-azure-primary/90 dark:hover:bg-matrix-highlight/90"} ${n==="sm"?"h-9 px-3 rounded-md":n==="lg"?"h-11 px-8 rounded-md":n==="icon"?"h-10 w-10":"h-10 px-4 py-2"} ${e||""}`;return u.jsx("button",{className:d,...a})};function L$({isOpen:e,onClose:t,onConfirm:n}){return u.jsx(Ir,{open:e,onOpenChange:t,children:u.jsxs(co,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[u.jsx(Br,{children:u.jsx(Vr,{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(xr,{variant:"outline",onClick:t,children:"Cancel"}),u.jsx(xr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Ja={list:e=>{const t=new URLSearchParams;e?.status&&t.set("status",e.status),e?.agent&&t.set("agent",e.agent),e?.origin_channel&&t.set("origin_channel",e.origin_channel),e?.session_id&&t.set("session_id",e.session_id),e?.limit&&t.set("limit",String(e.limit));const n=t.toString()?`?${t}`:"";return xe.get(`/tasks${n}`)},get:e=>xe.get(`/tasks/${e}`),stats:()=>xe.get("/tasks/stats"),retry:e=>xe.post(`/tasks/${e}/retry`,{}),cancel:e=>xe.post(`/tasks/${e}/cancel`,{})},md=["matrix","dark-soft","azure","azure-dark"],P$=new Set(["matrix","dark-soft","azure-dark"]),U$={matrix:b5,"dark-soft":RA,azure:J5,"azure-dark":g5},ew={matrix:"Matrix","dark-soft":"Dark Soft",azure:"Azure","azure-dark":"Azure Dark"};function I$(){const e=localStorage.getItem("theme");return e==="dark"?"matrix":e==="light"?"azure":e&&md.includes(e)?e:"matrix"}function B$({children:e}){const t=br(),[n,a]=j.useState(I$),[s,c]=j.useState(!1),[o,d]=j.useState(!1),{logout:h}=z_();D$();const m=()=>a(A=>md[(md.indexOf(A)+1)%md.length]),x=U$[n],{data:p}=We("/webhooks/notifications/unread-count",()=>fa.unreadCount(),{refreshInterval:1e4}),b=p?.count??0,{data:v}=We("/tasks/stats",()=>Ja.stats(),{refreshInterval:5e3}),S=(v?.pending??0)+(v?.running??0),z=async()=>{try{await xe.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(A){console.error("Failed to restart:",A),alert("Failed to restart the agent. Please try again.")}};j.useEffect(()=>{const A=P$.has(n);document.documentElement.classList.toggle("dark",A),document.documentElement.setAttribute("data-theme",n),localStorage.setItem("theme",n)},[n]),j.useEffect(()=>{c(!1)},[t.pathname]);const E=[{icon:Lp,label:"Dashboard",path:"/"},{icon:Pp,label:"Chat",path:"/chat"},{icon:Up,label:"Zaion",path:"/zaion"},{icon:so,label:"Smiths",path:"/smiths"},{icon:bd,label:"MCP Servers",path:"/mcp-servers"},{icon:Zi,label:"Skills",path:"/skills"},{icon:Dp,label:"Usage Stats",path:"/stats"},{icon:Pi,label:"Sati Memories",path:"/sati-memories"},{icon:Bp,label:"Webhooks",path:"/webhooks"},{icon:ql,label:"Notifications",path:"/notifications"},{icon:Gl,label:"Tasks",path:"/tasks"},{icon:Qs,label:"Trinity DBs",path:"/trinity-databases"},{icon:er,label:"Chronos",path:"/chronos"},{icon:vd,label:"Logs",path:"/logs"},{icon:io,label:"Model Pricing",path:"/model-pricing"}],_=[{icon:Lp,label:"Dashboard",path:"/"},{icon:Pp,label:"Chat",path:"/chat"},{icon:Up,label:"Zaion",path:"/zaion"},{icon:so,label:"Smiths",path:"/smiths"},{icon:bd,label:"MCP Servers",path:"/mcp-servers"},{icon:Zi,label:"Skills",path:"/skills"},{icon:Dp,label:"Usage Stats",path:"/stats"},{icon:Pi,label:"Sati Memories",path:"/sati-memories"},{icon:Bp,label:"Webhooks",path:"/webhooks"},{icon:ql,label:"Notifications",path:"/notifications"},{icon:Gl,label:"Tasks",path:"/tasks"},{icon:Qs,label:"Trinity DBs",path:"/trinity-databases"},{icon:er,label:"Chronos",path:"/chronos"},{icon:vd,label:"Logs",path:"/logs"},{icon:io,label:"Model Pricing",path:"/model-pricing"}];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(R$,{onMenuClick:()=>c(!0),themeIcon:x,themeLabel:ew[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(Pi,{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:ew[n],children:u.jsx(x,{className:"w-4 h-4"})})]}),u.jsx("nav",{className:"flex-1 p-2 space-y-0.5",children:E.map(A=>{const N=t.pathname===A.path;return u.jsxs(Wa,{to:A.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[A.path==="/notifications"?u.jsxs("div",{className:"relative shrink-0",children:[u.jsx(A.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(A.icon,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:A.label}),A.path==="/tasks"&&S>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:S>99?"99+":S}),A.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})]},A.path)})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[u.jsx(C1,{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(_1,{className:"w-4 h-4 shrink-0"}),u.jsx("span",{children:"Logout"})]})})]}),u.jsx(Ag,{children:s&&u.jsxs($e.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($e.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:A=>A.stopPropagation(),children:[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(Pi,{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:_.map(A=>{const N=t.pathname===A.path;return u.jsxs(Wa,{to:A.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${N?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>c(!1),children:[A.path==="/notifications"?u.jsxs("div",{className:"relative",children:[u.jsx(A.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(A.icon,{className:"w-5 h-5"}),u.jsx("span",{children:A.label}),A.path==="/tasks"&&S>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:S>99?"99+":S}),A.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})]},A.path)})}),u.jsx("div",{className:"p-2",children:u.jsxs("button",{onClick:()=>{d(!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(C1,{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(_1,{className:"w-5 h-5"}),u.jsx("span",{children:"Logout"})]})})]})]})}),u.jsxs("main",{className:`flex-1 relative flex flex-col ${t.pathname==="/chat"||t.pathname.endsWith("/audit")?"overflow-hidden p-0 md:p-0":"overflow-auto p-4 md:p-8"}`,children:[u.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"||t.pathname.endsWith("/audit")?"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(H3,{}),u.jsx(L$,{isOpen:o,onClose:()=>d(!1),onConfirm:z})]})}const V$={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},tp=({title:e,value:t,icon:n,subValue:a})=>u.jsxs($e.div,{variants:V$,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})]}),bx={fetchUsageStats:async()=>xe.get("/stats/usage"),fetchGroupedUsageStats:async()=>xe.get("/stats/usage/grouped")},Ha=Xa.getInstance(),hr={fetchServers:async()=>Ha.get("/mcp/servers"),addServer:async(e,t)=>Ha.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>Ha.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>Ha.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>Ha.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>Ha.post("/mcp/reload",{}),fetchStatus:async()=>Ha.get("/mcp/status"),fetchStats:async()=>Ha.get("/mcp/stats")},Ps=Xa.getInstance(),Li={fetchSkills:async()=>Ps.get("/skills"),fetchSkill:async e=>Ps.get(`/skills/${encodeURIComponent(e)}`),reloadSkills:async()=>Ps.post("/skills/reload",{}),enableSkill:async e=>Ps.post(`/skills/${encodeURIComponent(e)}/enable`,{}),disableSkill:async e=>Ps.post(`/skills/${encodeURIComponent(e)}/disable`,{}),uploadSkill:async e=>Ps.uploadFile("/skills/upload",e)},Z$={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.07}}},_l={hidden:{opacity:0,y:12},show:{opacity:1,y:0}};function Nl({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(Wa,{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(Fd,{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 Un({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 F$({status:e}){return e==="completed"?u.jsx(Gx,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"}):e==="failed"?u.jsx(ei,{className:"w-3.5 h-3.5 text-red-500 shrink-0"}):e==="running"?u.jsx(cc,{className:"w-3.5 h-3.5 text-blue-500 animate-spin shrink-0"}):u.jsx(er,{className:"w-3.5 h-3.5 text-yellow-500 shrink-0"})}function H$(){const{data:e}=Iz(),{data:t}=We("/tasks/stats",()=>Ja.stats(),{refreshInterval:5e3}),{data:n}=We("/api/stats/usage",()=>bx.fetchUsageStats(),{refreshInterval:3e4}),{data:a}=We("/api/mcp/stats",()=>hr.fetchStats(),{refreshInterval:3e4}),{data:s}=We("/api/smiths",()=>xe.get("/api/smiths"),{refreshInterval:1e4}),{data:c=[]}=We("/api/chronos",()=>xe.get("/api/chronos"),{refreshInterval:3e4}),{data:o}=We("/api/skills",()=>Li.fetchSkills(),{refreshInterval:6e4}),{data:d=[]}=We(["/tasks",{limit:5}],()=>Ja.list({limit:5}),{refreshInterval:5e3}),h=(n?.totalInputTokens??0)+(n?.totalOutputTokens??0),m=n?.totalEstimatedCostUsd!=null,x=n?.totalEstimatedCostUsd??0,p=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],S=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,z=(t?.pending??0)+(t?.running??0),E=t?.failed?"warn":z>0?"ok":"neutral",_=(a?.totalTools??0)>0?"ok":"neutral",A=(s?.online??0)>0?"ok":(s?.total??0)>0?"warn":"neutral",N=b.length>0?"ok":"neutral",P=(o?.enabled??0)>0?"ok":"neutral";return u.jsxs($e.div,{className:"space-y-6",variants:Z$,initial:"hidden",animate:"show",children:[u.jsxs($e.div,{variants:_l,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($e.div,{variants:_l,className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[u.jsx(tp,{title:"Agent Status",value:e?.status.toUpperCase()??"CONNECTING...",icon:Pi,subValue:e?`PID: ${e.pid}`:""}),u.jsx(tp,{title:"Uptime",value:e?Bz(e.uptimeSeconds):"-",icon:er,subValue:e?`${e.uptimeSeconds.toFixed(0)}s elapsed`:""}),u.jsx(tp,{title:"Version",value:e?.projectVersion??"-",icon:jz,subValue:`Node ${e?.nodeVersion??"-"}`})]}),u.jsxs($e.div,{variants:_l,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(xA,{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(mA,{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?p(h):"—"}),u.jsxs("p",{className:"text-[10px] text-azure-text-secondary dark:text-matrix-tertiary mt-1",children:[p(n?.totalInputTokens??0)," in · ",p(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(io,{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?`$${x.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($e.div,{variants:_l,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(Nl,{icon:Zi,title:"Skills",to:"/skills",status:P,children:[u.jsx(Un,{label:"Enabled",value:o?`${o.enabled} / ${o.total}`:"—",highlight:(o?.enabled??0)>0}),u.jsx(Un,{label:"Total",value:o?.total??"—"})]}),u.jsxs(Nl,{icon:bd,title:"MCP Servers",to:"/mcp-servers",status:_,children:[u.jsx(Un,{label:"Tools loaded",value:a?.totalTools??"—",highlight:!!a?.totalTools}),u.jsx(Un,{label:"Servers",value:a?.servers?.length??"—"}),a?.lastLoadedAt&&u.jsx(Un,{label:"Last loaded",value:new Date(a.lastLoadedAt).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),u.jsxs(Nl,{icon:so,title:"Smiths",to:"/smiths",status:A,children:[u.jsx(Un,{label:"Online",value:s?`${s.online} / ${s.total}`:"—",highlight:(s?.online??0)>0}),u.jsx(Un,{label:"System",value:s?.enabled?"enabled":"disabled"})]}),u.jsxs(Nl,{icon:Gl,title:"Tasks",to:"/tasks",status:E,children:[u.jsx(Un,{label:"Running",value:t?.running??"—",highlight:!!t?.running}),u.jsx(Un,{label:"Pending",value:t?.pending??"—"}),u.jsx(Un,{label:"Completed",value:t?.completed??"—"}),(t?.failed??0)>0&&u.jsx(Un,{label:"Failed",value:t.failed})]}),u.jsxs(Nl,{icon:er,title:"Chronos",to:"/chronos",status:N,children:[u.jsx(Un,{label:"Active jobs",value:b.length,highlight:b.length>0}),u.jsx(Un,{label:"Total jobs",value:c.length}),S&&u.jsx(Un,{label:"Next run",value:`in ${S}`})]})]})]}),d.length>0&&u.jsxs($e.div,{variants:_l,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(Wa,{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(Fd,{className:"w-3 h-3"})]})]}),u.jsx("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.map((D,M)=>u.jsxs("div",{className:`flex items-center gap-3 px-4 py-2.5 ${M<d.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(F$,{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))})]})]})}function q$(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:t<6048e5?`${Math.floor(t/864e5)}d ago`:new Date(e).toLocaleDateString()}const G$=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:c,onRenameSession:o,isOpen:d,toggleSidebar:h})=>{const m=yo(),[x,p]=j.useState(null),[b,v]=j.useState(""),S=j.useRef(null);j.useEffect(()=>{x&&S.current&&S.current.focus()},[x]);const z=(N,P)=>{N.stopPropagation(),p(P.id),v(P.title||"Untitled Session")},E=N=>{N?.stopPropagation(),x&&b.trim()&&(o(x,b.trim()),p(null))},_=N=>{N?.stopPropagation(),p(null)},A=N=>{N.key==="Enter"?E():N.key==="Escape"&&_()};return d?u.jsxs("div",{className:"w-72 bg-white dark:bg-black border-r border-gray-300 dark:border-matrix-primary flex flex-col h-full shrink-0 transition-colors duration-300",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-300 dark:border-matrix-primary shrink-0",children:[u.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),u.jsx("button",{onClick:h,className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-400 dark:text-matrix-secondary/60 transition-colors",title:"Collapse sidebar",children:u.jsx(k5,{size:16})})]}),u.jsx("div",{className:"px-3 py-2.5 shrink-0",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-xl hover:bg-azure-secondary dark:hover:bg-matrix-secondary transition-colors text-sm font-medium shadow-sm",children:[u.jsx(N1,{size:16}),"New Chat"]})}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-0.5",children:[e.length===0&&u.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/40 mt-12 text-sm px-4",children:"No sessions yet. Start a new chat!"}),e.map(N=>{const P=t===N.id,D=x===N.id;return u.jsxs("div",{onClick:()=>!D&&n(N.id),className:`
20
- group relative flex items-center gap-2 px-3 py-2.5 rounded-xl cursor-pointer transition-all
21
- ${P?"bg-azure-primary/10 dark:bg-matrix-primary/15 text-azure-primary dark:text-matrix-highlight":"hover:bg-gray-100 dark:hover:bg-matrix-primary/10 text-gray-700 dark:text-matrix-secondary"}
22
- `,children:[u.jsx("div",{className:"flex-1 min-w-0",children:D?u.jsx("div",{onClick:M=>M.stopPropagation(),children:u.jsx("input",{ref:S,type:"text",value:b,onChange:M=>v(M.target.value),onKeyDown:A,className:"w-full text-sm px-1.5 py-0.5 bg-white dark:bg-black border border-azure-primary dark:border-matrix-highlight rounded-lg focus:outline-none dark:text-matrix-highlight"})}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"text-sm font-medium truncate leading-snug",children:N.title||"Untitled Session"}),u.jsx("div",{className:"text-xs text-gray-400 dark:text-matrix-secondary/50 mt-0.5",children:q$(N.started_at)})]})}),u.jsx("div",{className:`flex items-center gap-0.5 shrink-0 transition-opacity ${P||D?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:M=>M.stopPropagation(),children:D?u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:E,className:"p-1.5 rounded-lg text-emerald-600 hover:bg-emerald-50 dark:text-emerald-400 dark:hover:bg-emerald-900/20 transition-colors",title:"Save",children:u.jsx(Rp,{size:13})}),u.jsx("button",{onClick:_,className:"p-1.5 rounded-lg text-red-500 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 transition-colors",title:"Cancel",children:u.jsx(Yi,{size:13})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:M=>z(M,N),className:"p-1.5 rounded-lg text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:text-matrix-secondary/50 dark:hover:text-blue-400 dark:hover:bg-blue-900/20 transition-colors",title:"Rename",children:u.jsx(uc,{size:13})}),u.jsx("button",{onClick:()=>m(`/sessions/${N.id}/audit`),className:"p-1.5 rounded-lg text-gray-400 hover:text-violet-500 hover:bg-violet-50 dark:text-matrix-secondary/50 dark:hover:text-violet-400 dark:hover:bg-violet-900/20 transition-colors",title:"Audit",children:u.jsx(vA,{size:13})}),u.jsx("button",{onClick:()=>s(N.id),className:"p-1.5 rounded-lg text-gray-400 hover:text-amber-500 hover:bg-amber-50 dark:text-matrix-secondary/50 dark:hover:text-amber-400 dark:hover:bg-amber-900/20 transition-colors",title:"Archive",children:u.jsx(oA,{size:13})}),u.jsx("button",{onClick:()=>c(N.id),className:"p-1.5 rounded-lg text-gray-400 hover:text-red-500 hover:bg-red-50 dark:text-matrix-secondary/50 dark:hover:text-red-400 dark:hover:bg-red-900/20 transition-colors",title:"Delete",children:u.jsx(ga,{size:13})})]})})]},N.id)})]})]}):u.jsxs("div",{className:"w-14 bg-white dark:bg-black border-r border-gray-300 dark:border-matrix-primary flex flex-col items-center py-3 gap-3 shrink-0 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-400 dark:text-matrix-secondary/60 transition-colors",title:"Expand sidebar",children:u.jsx(S5,{size:18})}),u.jsx("div",{className:"w-8 h-px bg-gray-200 dark:bg-matrix-primary/20"}),u.jsx("button",{onClick:a,className:"p-2.5 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black rounded-xl hover:bg-azure-secondary dark:hover:bg-matrix-secondary shadow-sm transition-colors",title:"New chat",children:u.jsx(N1,{size:18})})]})};function Y$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const J$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X$={};function tw(e,t){return(X$.jsx?K$:J$).test(e)}const Q$=/[ \t\n\f\r]/g;function W$(e){return typeof e=="object"?e.type==="text"?nw(e.value):!1:nw(e)}function nw(e){return e.replace(Q$,"")===""}class gc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}gc.prototype.normal={};gc.prototype.property={};gc.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 gc(n,a,t)}function vx(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 e6=0;const Re=Ji(),Ht=Ji(),kx=Ji(),de=Ji(),gt=Ji(),to=Ji(),Qn=Ji();function Ji(){return 2**++e6}const wx=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:Ht,commaOrSpaceSeparated:Qn,commaSeparated:to,number:de,overloadedBoolean:kx,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),np=Object.keys(wx);class Dg extends Vn{constructor(t,n,a,s){let c=-1;if(super(t,n),rw(this,"space",s),typeof a=="number")for(;++c<np.length;){const o=np[c];rw(this,np[c],(a&wx[o])===wx[o])}}}Dg.prototype.defined=!0;function rw(e,t,n){n&&(e[t]=n)}function zo(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const c=new Dg(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),t[a]=c,n[vx(a)]=a,n[vx(c.attribute)]=a}return new gc(t,n,e.space)}const __=zo({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:gt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:de,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:gt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Ht,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N_(e,t){return t in e?e[t]:t}function C_(e,t){return N_(e,t.toLowerCase())}const t6=zo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:to,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:gt,autoFocus:Re,autoPlay:Re,blocking:gt,capture:null,charSet:null,checked:Re,cite:null,className:gt,cols:de,colSpan:null,content:null,contentEditable:Ht,controls:Re,controlsList:gt,coords:de|to,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:kx,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:gt,height:de,hidden:kx,high:de,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:gt,itemRef:gt,itemScope:Re,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,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:Re,optimum:de,pattern:null,ping:gt,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:gt,required:Re,reversed:Re,rows:de,rowSpan:de,sandbox:gt,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Re,useMap:null,value:Ht,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Re,disableRemotePlayback:Re,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:C_}),n6=zo({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:Qn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Re,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:to,g2:to,glyphName:to,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N_}),T_=zo({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()}}),E_=zo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:C_}),A_=zo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),r6={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"},a6=/[A-Z]/g,aw=/-[a-z]/g,i6=/^data[-\w.:]+$/i;function s6(e,t){const n=vx(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"&&i6.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(aw,l6);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!aw.test(c)){let o=c.replace(a6,o6);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Dg}return new s(a,t)}function o6(e){return"-"+e.toLowerCase()}function l6(e){return e.charAt(1).toUpperCase()}const c6=j_([__,t6,T_,E_,A_],"html"),Rg=j_([__,n6,T_,E_,A_],"svg");function u6(e){return e.join(" ").trim()}var Us={},rp,iw;function d6(){if(iw)return rp;iw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
23
- `,m="/",x="*",p="",b="comment",v="declaration";function S(E,_){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];_=_||{};var A=1,N=1;function P(oe){var se=oe.match(t);se&&(A+=se.length);var Z=oe.lastIndexOf(h);N=~Z?oe.length-Z:N+oe.length}function D(){var oe={line:A,column:N};return function(se){return se.position=new M(oe),K(),se}}function M(oe){this.start=oe,this.end={line:A,column:N},this.source=_.source}M.prototype.content=E;function V(oe){var se=new Error(_.source+":"+A+":"+N+": "+oe);if(se.reason=oe,se.filename=_.source,se.line=A,se.column=N,se.source=E,!_.silent)throw se}function U(oe){var se=oe.exec(E);if(se){var Z=se[0];return P(Z),E=E.slice(Z.length),se}}function K(){U(n)}function I(oe){var se;for(oe=oe||[];se=te();)se!==!1&&oe.push(se);return oe}function te(){var oe=D();if(!(m!=E.charAt(0)||x!=E.charAt(1))){for(var se=2;p!=E.charAt(se)&&(x!=E.charAt(se)||m!=E.charAt(se+1));)++se;if(se+=2,p===E.charAt(se-1))return V("End of comment missing");var Z=E.slice(2,se-2);return N+=2,P(Z),E=E.slice(se),N+=2,oe({type:b,comment:Z})}}function le(){var oe=D(),se=U(a);if(se){if(te(),!U(s))return V("property missing ':'");var Z=U(c),B=oe({type:v,property:z(se[0].replace(e,p)),value:Z?z(Z[0].replace(e,p)):p});return U(o),B}}function ne(){var oe=[];I(oe);for(var se;se=le();)se!==!1&&(oe.push(se),I(oe));return oe}return K(),ne()}function z(E){return E?E.replace(d,p):p}return rp=S,rp}var sw;function f6(){if(sw)return Us;sw=1;var e=Us&&Us.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Us,"__esModule",{value:!0}),Us.default=n;const t=e(d6());function n(a,s){let c=null;if(!a||typeof a!="string")return c;const o=(0,t.default)(a),d=typeof s=="function";return o.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:x}=h;d?s(m,x,h):x&&(c=c||{},c[m]=x)}),c}return Us}var Cl={},ow;function h6(){if(ow)return Cl;ow=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(m){return!m||n.test(m)||e.test(m)},o=function(m,x){return x.toUpperCase()},d=function(m,x){return"".concat(x,"-")},h=function(m,x){return x===void 0&&(x={}),c(m)?m:(m=m.toLowerCase(),x.reactCompat?m=m.replace(s,d):m=m.replace(a,d),m.replace(t,o))};return Cl.camelCase=h,Cl}var Tl,lw;function m6(){if(lw)return Tl;lw=1;var e=Tl&&Tl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(f6()),n=h6();function a(s,c){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(d,h){d&&h&&(o[(0,n.camelCase)(d,c)]=h)}),o}return a.default=a,Tl=a,Tl}var p6=m6();const x6=Px(p6),O_=M_("end"),$g=M_("start");function M_(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 g6(e){const t=$g(e),n=O_(e);if(t&&n)return{start:t,end:n}}function Vl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?cw(e.position):"start"in e||"end"in e?cw(e):"line"in e||"column"in e?Sx(e):""}function Sx(e){return uw(e&&e.line)+":"+uw(e&&e.column)}function cw(e){return Sx(e&&e.start)+"-"+Sx(e&&e.end)}function uw(e){return e&&typeof e=="number"?e:1}class vn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",c={},o=!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&&(o=!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 d=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=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Vl(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=o&&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}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const Lg={}.hasOwnProperty,y6=new Map,b6=/[A-Z]/g,v6=new Set(["table","tbody","thead","tfoot","tr"]),k6=new Set(["td","th"]),D_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function w6(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=E6(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=T6(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"?Rg:c6,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=R_(s,e,void 0);return c&&typeof c!="string"?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}function R_(e,t,n){if(t.type==="element")return S6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return z6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return _6(e,t,n);if(t.type==="mdxjsEsm")return j6(e,t);if(t.type==="root")return N6(e,t,n);if(t.type==="text")return C6(e,t)}function S6(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Rg,e.schema=s),e.ancestors.push(t);const c=L_(e,t.tagName,!1),o=A6(e,t);let d=Ug(e,t);return v6.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!W$(h):!0})),$_(e,o,c,t),Pg(o,d),e.ancestors.pop(),e.schema=a,e.create(t,c,o,n)}function z6(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)}ec(e,t.position)}function j6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ec(e,t.position)}function _6(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Rg,e.schema=s),e.ancestors.push(t);const c=t.name===null?e.Fragment:L_(e,t.name,!0),o=O6(e,t),d=Ug(e,t);return $_(e,o,c,t),Pg(o,d),e.ancestors.pop(),e.schema=a,e.create(t,c,o,n)}function N6(e,t,n){const a={};return Pg(a,Ug(e,t)),e.create(t,e.Fragment,a,n)}function C6(e,t){return t.value}function $_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Pg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function T6(e,t,n){return a;function a(s,c,o,d){const m=Array.isArray(o.children)?n:t;return d?m(c,o,d):m(c,o)}}function E6(e,t){return n;function n(a,s,c,o){const d=Array.isArray(c.children),h=$g(a);return t(s,c,o,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function A6(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&Lg.call(t.properties,s)){const c=M6(e,s,t.properties[s]);if(c){const[o,d]=c;e.tableCellAlignToStyle&&o==="align"&&typeof d=="string"&&k6.has(t.tagName)?a=d:n[o]=d}}if(a){const c=n.style||(n.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function O6(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 o=c.expression;o.type;const d=o.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ec(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 d=a.value.data.estree.body[0];d.type,c=e.evaluater.evaluateExpression(d.expression)}else ec(e,t.position);else c=a.value===null?!0:a.value;n[s]=c}return n}function Ug(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:y6;for(;++a<t.children.length;){const c=t.children[a];let o;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;o=h+"-"+m,s.set(h,m+1)}}const d=R_(e,c,o);d!==void 0&&n.push(d)}return n}function M6(e,t,n){const a=s6(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Y$(n):u6(n)),a.property==="style"){let s=typeof n=="object"?n:D6(e,String(n));return e.stylePropertyNameCase==="css"&&(s=R6(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?r6[a.property]||a.property:a.attribute,n]}}function D6(e,t){try{return x6(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=D_+"#cannot-parse-style-attribute",s}}function L_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let c=-1,o;for(;++c<s.length;){const d=tw(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};o=o?{type:"MemberExpression",object:o,property:d,computed:!!(c&&d.type==="Literal"),optional:!1}:d}a=o}else a=tw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Lg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);ec(e)}function ec(e,t){const n=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=D_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function R6(e){const t={};let n;for(n in e)Lg.call(e,n)&&(t[$6(n)]=e[n]);return t}function $6(e){let t=e.replace(b6,L6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function L6(e){return"-"+e.toLowerCase()}const ap={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"]},P6={};function Ig(e,t){const n=P6,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return P_(e,a,s)}function P_(e,t,n){if(U6(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 dw(e.children,t,n)}return Array.isArray(e)?dw(e,t,n):""}function dw(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=P_(e[s],t,n);return a.join("")}function U6(e){return!!(e&&typeof e=="object")}const fw=document.createElement("i");function Bg(e){const t="&"+e+";";fw.innerHTML=t;const n=fw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wn(e,t,n,a){const s=e.length;let c=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)o=Array.from(a),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);c<a.length;)o=a.slice(c,c+1e4),o.unshift(t,0),e.splice(...o),c+=1e4,t+=1e4}function pr(e,t){return e.length>0?(Wn(e,e.length,0,t),e):t}const hw={}.hasOwnProperty;function U_(e){const t={};let n=-1;for(;++n<e.length;)I6(t,e[n]);return t}function I6(e,t){let n;for(n in t){const s=(hw.call(e,n)?e[n]:void 0)||(e[n]={}),c=t[n];let o;if(c)for(o in c){hw.call(s,o)||(s[o]=[]);const d=c[o];B6(s[o],Array.isArray(d)?d:d?[d]:[])}}}function B6(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Wn(e,0,0,a)}function I_(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 Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=li(/[A-Za-z]/),bn=li(/[\dA-Za-z]/),V6=li(/[#-'*+\--9=?A-Z^-~]/);function Cd(e){return e!==null&&(e<32||e===127)}const zx=li(/\d/),Z6=li(/[\dA-Fa-f]/),F6=li(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function pt(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const Jd=li(new RegExp("\\p{P}|\\p{S}","u")),Fi=li(/\s/);function li(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const c=e.charCodeAt(n);let o="";if(c===37&&bn(e.charCodeAt(n+1))&&bn(e.charCodeAt(n+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(o=String.fromCharCode(c));else if(c>55295&&c<57344){const d=e.charCodeAt(n+1);c<56320&&d>56319&&d<57344?(o=String.fromCharCode(c,d),s=1):o="�"}else o=String.fromCharCode(c);o&&(t.push(e.slice(a,n),encodeURIComponent(o)),a=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Xe(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let c=0;return o;function o(h){return Ve(h)?(e.enter(n),d(h)):t(h)}function d(h){return Ve(h)&&c++<s?(e.consume(h),d):(e.exit(n),t(h))}}const H6={tokenize:q6};function q6(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Xe(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),c(d)}function c(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,o(d)}function o(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return _e(d)?(e.consume(d),e.exit("chunkText"),c):(e.consume(d),o)}}const G6={tokenize:Y6},mw={tokenize:J6};function Y6(e){const t=this,n=[];let a=0,s,c,o;return d;function d(N){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,h,m)(N)}return m(N)}function h(N){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const P=t.events.length;let D=P,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}_(a);let V=P;for(;V<t.events.length;)t.events[V][1].end={...M},V++;return Wn(t.events,D+1,0,t.events.slice(P)),t.events.length=V,m(N)}return d(N)}function m(N){if(a===n.length){if(!s)return b(N);if(s.currentConstruct&&s.currentConstruct.concrete)return S(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(mw,x,p)(N)}function x(N){return s&&A(),_(a),b(N)}function p(N){return t.parser.lazy[t.now().line]=a!==n.length,o=t.now().offset,S(N)}function b(N){return t.containerState={},e.attempt(mw,v,S)(N)}function v(N){return a++,n.push([t.currentConstruct,t.containerState]),b(N)}function S(N){if(N===null){s&&A(),_(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),z(N)}function z(N){if(N===null){E(e.exit("chunkFlow"),!0),_(0),e.consume(N);return}return _e(N)?(e.consume(N),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(N),z)}function E(N,P){const D=t.sliceStream(N);if(P&&D.push(null),N.previous=c,c&&(c.next=N),c=N,s.defineSkip(N.start),s.write(D),t.parser.lazy[N.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<o&&(!s.events[M][1].end||s.events[M][1].end.offset>o))return;const V=t.events.length;let U=V,K,I;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(K){I=t.events[U][1].end;break}K=!0}for(_(a),M=V;M<t.events.length;)t.events[M][1].end={...I},M++;Wn(t.events,U+1,0,t.events.slice(V)),t.events.length=M}}function _(N){let P=n.length;for(;P-- >N;){const D=n[P];t.containerState=D[1],D[0].exit.call(t,e)}n.length=N}function A(){s.write([null]),c=void 0,s=void 0,t.containerState._closeFlow=void 0}}function J6(e,t,n){return Xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function uo(e){if(e===null||pt(e)||Fi(e))return 1;if(Jd(e))return 2}function Kd(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 jx={name:"attention",resolveAll:K6,tokenize:X6};function K6(e,t){let n=-1,a,s,c,o,d,h,m,x;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 p={...e[a][1].end},b={...e[n][1].start};pw(p,-h),pw(b,h),o={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[a][1].end}},d={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:{...o.start},end:{...d.end}},e[a][1].end={...o.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=pr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=pr(m,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",c,t]]),m=pr(m,Kd(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=pr(m,[["exit",c,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(x=2,m=pr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):x=0,Wn(e,a-1,n-a+3,m),n=a+m.length-x-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function X6(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=uo(a);let c;return o;function o(h){return c=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===c)return e.consume(h),d;const m=e.exit("attentionSequence"),x=uo(h),p=!x||x===2&&s||n.includes(h),b=!s||s===2&&x||n.includes(a);return m._open=!!(c===42?p:p&&(s||!b)),m._close=!!(c===42?b:b&&(x||!p)),t(h)}}function pw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Q6={name:"autolink",tokenize:W6};function W6(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 Nn(v)?(e.consume(v),o):v===64?n(v):m(v)}function o(v){return v===43||v===45||v===46||bn(v)?(a=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||bn(v))&&a++<32?(e.consume(v),d):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Cd(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),x):V6(v)?(e.consume(v),m):n(v)}function x(v){return bn(v)?p(v):n(v)}function p(v){return v===46?(e.consume(v),a=0,x):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||bn(v))&&a++<63){const S=v===45?b:p;return e.consume(v),S}return n(v)}}const yc={partial:!0,tokenize:e9};function e9(e,t,n){return a;function a(c){return Ve(c)?Xe(e,s,"linePrefix")(c):s(c)}function s(c){return c===null||_e(c)?t(c):n(c)}}const B_={continuation:{tokenize:n9},exit:r9,name:"blockQuote",tokenize:t9};function t9(e,t,n){const a=this;return s;function s(o){if(o===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),c}return n(o)}function c(o){return Ve(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function n9(e,t,n){const a=this;return s;function s(o){return Ve(o)?Xe(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):c(o)}function c(o){return e.attempt(B_,t,n)(o)}}function r9(e){e.exit("blockQuote")}const V_={name:"characterEscape",tokenize:a9};function a9(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 F6(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(c)}}const Z_={name:"characterReference",tokenize:i9};function i9(e,t,n){const a=this;let s=0,c,o;return d;function d(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,o=bn,x(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,o=Z6,x):(e.enter("characterReferenceValue"),c=7,o=zx,x(p))}function x(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return o===bn&&!Bg(a.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&s++<c?(e.consume(p),x):n(p)}}const xw={partial:!0,tokenize:o9},gw={concrete:!0,name:"codeFenced",tokenize:s9};function s9(e,t,n){const a=this,s={partial:!0,tokenize:D};let c=0,o=0,d;return h;function h(M){return m(M)}function m(M){const V=a.events[a.events.length-1];return c=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(M)}function x(M){return M===d?(o++,e.consume(M),x):o<3?n(M):(e.exit("codeFencedFenceSequence"),Ve(M)?Xe(e,p,"whitespace")(M):p(M))}function p(M){return M===null||_e(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(xw,z,P)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||_e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(M)):Ve(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(e,v,"whitespace")(M)):M===96&&M===d?n(M):(e.consume(M),b)}function v(M){return M===null||_e(M)?p(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(M))}function S(M){return M===null||_e(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(M)):M===96&&M===d?n(M):(e.consume(M),S)}function z(M){return e.attempt(s,P,E)(M)}function E(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),_}function _(M){return c>0&&Ve(M)?Xe(e,A,"linePrefix",c+1)(M):A(M)}function A(M){return M===null||_e(M)?e.check(xw,z,P)(M):(e.enter("codeFlowValue"),N(M))}function N(M){return M===null||_e(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),N)}function P(M){return e.exit("codeFenced"),t(M)}function D(M,V,U){let K=0;return I;function I(se){return M.enter("lineEnding"),M.consume(se),M.exit("lineEnding"),te}function te(se){return M.enter("codeFencedFence"),Ve(se)?Xe(M,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):le(se)}function le(se){return se===d?(M.enter("codeFencedFenceSequence"),ne(se)):U(se)}function ne(se){return se===d?(K++,M.consume(se),ne):K>=o?(M.exit("codeFencedFenceSequence"),Ve(se)?Xe(M,oe,"whitespace")(se):oe(se)):U(se)}function oe(se){return se===null||_e(se)?(M.exit("codeFencedFence"),V(se)):U(se)}}}function o9(e,t,n){const a=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c)}function c(o){return a.parser.lazy[a.now().line]?n(o):t(o)}}const ip={name:"codeIndented",tokenize:c9},l9={partial:!0,tokenize:u9};function c9(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),Xe(e,c,"linePrefix",5)(m)}function c(m){const x=a.events[a.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?h(m):_e(m)?e.attempt(l9,o,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||_e(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function u9(e,t,n){const a=this;return s;function s(o){return a.parser.lazy[a.now().line]?n(o):_e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Xe(e,c,"linePrefix",5)(o)}function c(o){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(o):_e(o)?s(o):n(o)}}const d9={name:"codeText",previous:h9,resolve:f9,tokenize:m9};function f9(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 h9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function m9(e,t,n){let a=0,s,c;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),d(p)}function d(p){return p===96?(e.consume(p),a++,d):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(c=e.enter("codeTextSequence"),s=0,x(p)):_e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||_e(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),m)}function x(p){return p===96?(e.consume(p),s++,x):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(c.type="codeTextData",m(p))}}class p9{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&&El(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),El(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),El(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);El(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);El(this.left,n.reverse())}}}function El(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 F_(e){const t={};let n=-1,a,s,c,o,d,h,m;const x=new p9(e);for(;++n<x.length;){for(;n in t;)n=t[n];if(a=x.get(n),n&&a[1].type==="chunkFlow"&&x.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,x9(x,n)),n=t[n],m=!0);else if(a[1]._container){for(c=n,s=void 0;c--;)if(o=x.get(c),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(x.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=c);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(a[1].end={...x.get(s)[1].start},d=x.slice(s,n),d.unshift(a),x.splice(s,n-s+1,d))}}return Wn(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!m}function x9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const c=[];let o=n._tokenizer;o||(o=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const d=o.events,h=[],m={};let x,p,b=-1,v=n,S=0,z=0;const E=[z];for(;v;){for(;e.get(++s)[1]!==v;);c.push(s),v._tokenizer||(x=a.sliceStream(v),v.next||x.push(null),p&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(x),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=n;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(z=b+1,E.push(z),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),b=E.length;b--;){const _=d.slice(E[b],E[b+1]),A=c.pop();h.push([A,A+_.length-1]),e.splice(A,2,_)}for(h.reverse(),b=-1;++b<h.length;)m[S+h[b][0]]=S+h[b][1],S+=h[b][1]-h[b][0]-1;return m}const g9={resolve:b9,tokenize:v9},y9={partial:!0,tokenize:k9};function b9(e){return F_(e),e}function v9(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?c(d):_e(d)?e.check(y9,o,c)(d):(e.consume(d),s)}function c(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function o(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function k9(e,t,n){const a=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Xe(e,c,"linePrefix")}function c(o){if(o===null||_e(o))return n(o);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(o):e.interrupt(a.parser.constructs.flow,n,t)(o)}}function H_(e,t,n,a,s,c,o,d,h){const m=h||Number.POSITIVE_INFINITY;let x=0;return p;function p(_){return _===60?(e.enter(a),e.enter(s),e.enter(c),e.consume(_),e.exit(c),b):_===null||_===32||_===41||Cd(_)?n(_):(e.enter(a),e.enter(o),e.enter(d),e.enter("chunkString",{contentType:"string"}),z(_))}function b(_){return _===62?(e.enter(c),e.consume(_),e.exit(c),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(d),b(_)):_===null||_===60||_e(_)?n(_):(e.consume(_),_===92?S:v)}function S(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function z(_){return!x&&(_===null||_===41||pt(_))?(e.exit("chunkString"),e.exit(d),e.exit(o),e.exit(a),t(_)):x<m&&_===40?(e.consume(_),x++,z):_===41?(e.consume(_),x--,z):_===null||_===32||_===40||Cd(_)?n(_):(e.consume(_),_===92?E:z)}function E(_){return _===40||_===41||_===92?(e.consume(_),z):z(_)}}function q_(e,t,n,a,s,c){const o=this;let d=0,h;return m;function m(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(c),x}function x(v){return d>999||v===null||v===91||v===93&&!h||v===94&&!d&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(c),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):_e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||_e(v)||d++>999?(e.exit("chunkString"),x(v)):(e.consume(v),h||(h=!Ve(v)),v===92?b:p)}function b(v){return v===91||v===92||v===93?(e.consume(v),d++,p):p(v)}}function G_(e,t,n,a,s,c){let o;return d;function d(b){return b===34||b===39||b===40?(e.enter(a),e.enter(s),e.consume(b),e.exit(s),o=b===40?41:b,h):n(b)}function h(b){return b===o?(e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):(e.enter(c),m(b))}function m(b){return b===o?(e.exit(c),h(o)):b===null?n(b):_e(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Xe(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===o||b===null||_e(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?p:x)}function p(b){return b===o||b===92?(e.consume(b),x):x(b)}}function Zl(e,t){let n;return a;function a(s){return _e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Ve(s)?Xe(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const w9={name:"definition",tokenize:z9},S9={partial:!0,tokenize:j9};function z9(e,t,n){const a=this;let s;return c;function c(v){return e.enter("definition"),o(v)}function o(v){return q_.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return s=Tr(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 pt(v)?Zl(e,m)(v):m(v)}function m(v){return H_(e,x,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function x(v){return e.attempt(S9,p,p)(v)}function p(v){return Ve(v)?Xe(e,b,"whitespace")(v):b(v)}function b(v){return v===null||_e(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function j9(e,t,n){return a;function a(d){return pt(d)?Zl(e,s)(d):n(d)}function s(d){return G_(e,c,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function c(d){return Ve(d)?Xe(e,o,"whitespace")(d):o(d)}function o(d){return d===null||_e(d)?t(d):n(d)}}const _9={name:"hardBreakEscape",tokenize:N9};function N9(e,t,n){return a;function a(c){return e.enter("hardBreakEscape"),e.consume(c),s}function s(c){return _e(c)?(e.exit("hardBreakEscape"),t(c)):n(c)}}const C9={name:"headingAtx",resolve:T9,tokenize:E9};function T9(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"},Wn(e,a,n-a+1,[["enter",s,t],["enter",c,t],["exit",c,t],["exit",s,t]])),e}function E9(e,t,n){let a=0;return s;function s(x){return e.enter("atxHeading"),c(x)}function c(x){return e.enter("atxHeadingSequence"),o(x)}function o(x){return x===35&&a++<6?(e.consume(x),o):x===null||pt(x)?(e.exit("atxHeadingSequence"),d(x)):n(x)}function d(x){return x===35?(e.enter("atxHeadingSequence"),h(x)):x===null||_e(x)?(e.exit("atxHeading"),t(x)):Ve(x)?Xe(e,d,"whitespace")(x):(e.enter("atxHeadingText"),m(x))}function h(x){return x===35?(e.consume(x),h):(e.exit("atxHeadingSequence"),d(x))}function m(x){return x===null||x===35||pt(x)?(e.exit("atxHeadingText"),d(x)):(e.consume(x),m)}}const A9=["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"],yw=["pre","script","style","textarea"],O9={concrete:!0,name:"htmlFlow",resolveTo:R9,tokenize:$9},M9={partial:!0,tokenize:P9},D9={partial:!0,tokenize:L9};function R9(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 $9(e,t,n){const a=this;let s,c,o,d,h;return m;function m(w){return x(w)}function x(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),p}function p(w){return w===33?(e.consume(w),b):w===47?(e.consume(w),c=!0,z):w===63?(e.consume(w),s=3,a.interrupt?t:O):Nn(w)?(e.consume(w),o=String.fromCharCode(w),E):n(w)}function b(w){return w===45?(e.consume(w),s=2,v):w===91?(e.consume(w),s=5,d=0,S):Nn(w)?(e.consume(w),s=4,a.interrupt?t:O):n(w)}function v(w){return w===45?(e.consume(w),a.interrupt?t:O):n(w)}function S(w){const X="CDATA[";return w===X.charCodeAt(d++)?(e.consume(w),d===X.length?a.interrupt?t:le:S):n(w)}function z(w){return Nn(w)?(e.consume(w),o=String.fromCharCode(w),E):n(w)}function E(w){if(w===null||w===47||w===62||pt(w)){const X=w===47,me=o.toLowerCase();return!X&&!c&&yw.includes(me)?(s=1,a.interrupt?t(w):le(w)):A9.includes(o.toLowerCase())?(s=6,X?(e.consume(w),_):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):c?A(w):N(w))}return w===45||bn(w)?(e.consume(w),o+=String.fromCharCode(w),E):n(w)}function _(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function A(w){return Ve(w)?(e.consume(w),A):I(w)}function N(w){return w===47?(e.consume(w),I):w===58||w===95||Nn(w)?(e.consume(w),P):Ve(w)?(e.consume(w),N):I(w)}function P(w){return w===45||w===46||w===58||w===95||bn(w)?(e.consume(w),P):D(w)}function D(w){return w===61?(e.consume(w),M):Ve(w)?(e.consume(w),D):N(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,V):Ve(w)?(e.consume(w),M):U(w)}function V(w){return w===h?(e.consume(w),h=null,K):w===null||_e(w)?n(w):(e.consume(w),V)}function U(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||pt(w)?D(w):(e.consume(w),U)}function K(w){return w===47||w===62||Ve(w)?N(w):n(w)}function I(w){return w===62?(e.consume(w),te):n(w)}function te(w){return w===null||_e(w)?le(w):Ve(w)?(e.consume(w),te):n(w)}function le(w){return w===45&&s===2?(e.consume(w),Z):w===60&&s===1?(e.consume(w),B):w===62&&s===4?(e.consume(w),C):w===63&&s===3?(e.consume(w),O):w===93&&s===5?(e.consume(w),ue):_e(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(M9,H,ne)(w)):w===null||_e(w)?(e.exit("htmlFlowData"),ne(w)):(e.consume(w),le)}function ne(w){return e.check(D9,oe,H)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),se}function se(w){return w===null||_e(w)?ne(w):(e.enter("htmlFlowData"),le(w))}function Z(w){return w===45?(e.consume(w),O):le(w)}function B(w){return w===47?(e.consume(w),o="",Y):le(w)}function Y(w){if(w===62){const X=o.toLowerCase();return yw.includes(X)?(e.consume(w),C):le(w)}return Nn(w)&&o.length<8?(e.consume(w),o+=String.fromCharCode(w),Y):le(w)}function ue(w){return w===93?(e.consume(w),O):le(w)}function O(w){return w===62?(e.consume(w),C):w===45&&s===2?(e.consume(w),O):le(w)}function C(w){return w===null||_e(w)?(e.exit("htmlFlowData"),H(w)):(e.consume(w),C)}function H(w){return e.exit("htmlFlow"),t(w)}}function L9(e,t,n){const a=this;return s;function s(o){return _e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c):n(o)}function c(o){return a.parser.lazy[a.now().line]?n(o):t(o)}}function P9(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yc,t,n)}}const U9={name:"htmlText",tokenize:I9};function I9(e,t,n){const a=this;let s,c,o;return d;function d(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),D):O===63?(e.consume(O),N):Nn(O)?(e.consume(O),U):n(O)}function m(O){return O===45?(e.consume(O),x):O===91?(e.consume(O),c=0,S):Nn(O)?(e.consume(O),A):n(O)}function x(O){return O===45?(e.consume(O),v):n(O)}function p(O){return O===null?n(O):O===45?(e.consume(O),b):_e(O)?(o=p,B(O)):(e.consume(O),p)}function b(O){return O===45?(e.consume(O),v):p(O)}function v(O){return O===62?Z(O):O===45?b(O):p(O)}function S(O){const C="CDATA[";return O===C.charCodeAt(c++)?(e.consume(O),c===C.length?z:S):n(O)}function z(O){return O===null?n(O):O===93?(e.consume(O),E):_e(O)?(o=z,B(O)):(e.consume(O),z)}function E(O){return O===93?(e.consume(O),_):z(O)}function _(O){return O===62?Z(O):O===93?(e.consume(O),_):z(O)}function A(O){return O===null||O===62?Z(O):_e(O)?(o=A,B(O)):(e.consume(O),A)}function N(O){return O===null?n(O):O===63?(e.consume(O),P):_e(O)?(o=N,B(O)):(e.consume(O),N)}function P(O){return O===62?Z(O):N(O)}function D(O){return Nn(O)?(e.consume(O),M):n(O)}function M(O){return O===45||bn(O)?(e.consume(O),M):V(O)}function V(O){return _e(O)?(o=V,B(O)):Ve(O)?(e.consume(O),V):Z(O)}function U(O){return O===45||bn(O)?(e.consume(O),U):O===47||O===62||pt(O)?K(O):n(O)}function K(O){return O===47?(e.consume(O),Z):O===58||O===95||Nn(O)?(e.consume(O),I):_e(O)?(o=K,B(O)):Ve(O)?(e.consume(O),K):Z(O)}function I(O){return O===45||O===46||O===58||O===95||bn(O)?(e.consume(O),I):te(O)}function te(O){return O===61?(e.consume(O),le):_e(O)?(o=te,B(O)):Ve(O)?(e.consume(O),te):K(O)}function le(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,ne):_e(O)?(o=le,B(O)):Ve(O)?(e.consume(O),le):(e.consume(O),oe)}function ne(O){return O===s?(e.consume(O),s=void 0,se):O===null?n(O):_e(O)?(o=ne,B(O)):(e.consume(O),ne)}function oe(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||pt(O)?K(O):(e.consume(O),oe)}function se(O){return O===47||O===62||pt(O)?K(O):n(O)}function Z(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function B(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return Ve(O)?Xe(e,ue,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):ue(O)}function ue(O){return e.enter("htmlTextData"),o(O)}}const Vg={name:"labelEnd",resolveAll:F9,resolveTo:H9,tokenize:q9},B9={tokenize:G9},V9={tokenize:Y9},Z9={tokenize:J9};function F9(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&&Wn(e,0,e.length,n),e}function H9(e,t){let n=e.length,a=0,s,c,o,d;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(o){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"&&(o=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[o][1].end}},x={type:"labelText",start:{...e[c+a+2][1].end},end:{...e[o-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=pr(d,e.slice(c+1,c+a+3)),d=pr(d,[["enter",x,t]]),d=pr(d,Kd(t.parser.constructs.insideSpan.null,e.slice(c+a+4,o-3),t)),d=pr(d,[["exit",x,t],e[o-2],e[o-1],["exit",m,t]]),d=pr(d,e.slice(o+1)),d=pr(d,[["exit",h,t]]),Wn(e,c,e.length,d),e}function q9(e,t,n){const a=this;let s=a.events.length,c,o;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 d;function d(b){return c?c._inactive?p(b):(o=a.parser.defined.includes(Tr(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(B9,x,o?x:p)(b):b===91?e.attempt(V9,x,o?m:p)(b):o?x(b):p(b)}function m(b){return e.attempt(Z9,x,p)(b)}function x(b){return t(b)}function p(b){return c._balanced=!0,n(b)}}function G9(e,t,n){return a;function a(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return pt(p)?Zl(e,c)(p):c(p)}function c(p){return p===41?x(p):H_(e,o,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return pt(p)?Zl(e,h)(p):x(p)}function d(p){return n(p)}function h(p){return p===34||p===39||p===40?G_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):x(p)}function m(p){return pt(p)?Zl(e,x)(p):x(p)}function x(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function Y9(e,t,n){const a=this;return s;function s(d){return q_.call(a,e,c,o,"reference","referenceMarker","referenceString")(d)}function c(d){return a.parser.defined.includes(Tr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function o(d){return n(d)}}function J9(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 K9={name:"labelStartImage",resolveAll:Vg.resolveAll,tokenize:X9};function X9(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),c}function c(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),o):n(d)}function o(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const Q9={name:"labelStartLink",resolveAll:Vg.resolveAll,tokenize:W9};function W9(e,t,n){const a=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),c}function c(o){return o===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(o):t(o)}}const sp={name:"lineEnding",tokenize:eL};function eL(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Xe(e,t,"linePrefix")}}const pd={name:"thematicBreak",tokenize:tL};function tL(e,t,n){let a=0,s;return c;function c(m){return e.enter("thematicBreak"),o(m)}function o(m){return s=m,d(m)}function d(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||_e(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Ve(m)?Xe(e,d,"whitespace")(m):d(m))}}const In={continuation:{tokenize:iL},exit:oL,name:"list",tokenize:aL},nL={partial:!0,tokenize:lL},rL={partial:!0,tokenize:sL};function aL(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,o=0;return d;function d(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:zx(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(pd,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 zx(v)&&++o<10?(e.consume(v),h):(!a.interrupt||o<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(yc,a.interrupt?n:x,e.attempt(nL,b,p))}function x(v){return a.containerState.initialBlankLine=!0,c++,b(v)}function p(v){return Ve(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 iL(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(yc,s,c);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Xe(e,t,"listItemIndent",a.containerState.size+1)(d)}function c(d){return a.containerState.furtherBlankLines||!Ve(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,o(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(rL,t,o)(d))}function o(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Xe(e,e.attempt(In,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function sL(e,t,n){const a=this;return Xe(e,s,"listItemIndent",a.containerState.size+1);function s(c){const o=a.events[a.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===a.containerState.size?t(c):n(c)}}function oL(e){e.exit(this.containerState.type)}function lL(e,t,n){const a=this;return Xe(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const o=a.events[a.events.length-1];return!Ve(c)&&o&&o[1].type==="listItemPrefixWhitespace"?t(c):n(c)}}const bw={name:"setextUnderline",resolveTo:cL,tokenize:uL};function cL(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 o={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",o,t]),e.splice(c+1,0,["exit",e[a][1],t]),e[a][1].end={...e[c][1].end}):e[a][1]=o,e.push(["exit",o,t]),e}function uL(e,t,n){const a=this;let s;return c;function c(m){let x=a.events.length,p;for(;x--;)if(a.events[x][1].type!=="lineEnding"&&a.events[x][1].type!=="linePrefix"&&a.events[x][1].type!=="content"){p=a.events[x][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||p)?(e.enter("setextHeadingLine"),s=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===s?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Ve(m)?Xe(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||_e(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const dL={tokenize:fL};function fL(e){const t=this,n=e.attempt(yc,a,e.attempt(this.parser.constructs.flowInitial,s,Xe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(g9,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 hL={resolveAll:J_()},mL=Y_("string"),pL=Y_("text");function Y_(e){return{resolveAll:J_(e==="text"?xL:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],c=n.attempt(s,o,d);return o;function o(x){return m(x)?c(x):d(x)}function d(x){if(x===null){n.consume(x);return}return n.enter("data"),n.consume(x),h}function h(x){return m(x)?(n.exit("data"),c(x)):(n.consume(x),h)}function m(x){if(x===null)return!0;const p=s[x];let b=-1;if(p)for(;++b<p.length;){const v=p[b];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function J_(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 xL(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,o=-1,d=0,h;for(;c--;){const m=s[c];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)d++,o--;if(o)break;o=-1}else if(m===-2)h=!0,d++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?o:a.start._bufferIndex+o,_index:a.start._index+c,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const gL={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:B_},yL={91:w9},bL={[-2]:ip,[-1]:ip,32:ip},vL={35:C9,42:pd,45:[bw,pd],60:O9,61:bw,95:pd,96:gw,126:gw},kL={38:Z_,92:V_},wL={[-5]:sp,[-4]:sp,[-3]:sp,33:K9,38:Z_,42:jx,60:[Q6,U9],91:Q9,92:[_9,V_],93:Vg,95:jx,96:d9},SL={null:[jx,hL]},zL={null:[42,95]},jL={null:[]},_L=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:zL,contentInitial:yL,disable:jL,document:gL,flow:vL,flowInitial:bL,insideSpan:SL,string:kL,text:wL},Symbol.toStringTag,{value:"Module"}));function NL(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 o=[],d=[];const h={attempt:V(D),check:V(M),consume:A,enter:N,exit:P,interrupt:V(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:z,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:p};let x=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function p(te){return o=pr(o,te),E(),o[o.length-1]!==null?[]:(U(t,0),m.events=Kd(c,m.events,m),m.events)}function b(te,le){return TL(v(te),le)}function v(te){return CL(o,te)}function S(){const{_bufferIndex:te,_index:le,line:ne,column:oe,offset:se}=a;return{_bufferIndex:te,_index:le,line:ne,column:oe,offset:se}}function z(te){s[te.line]=te.column,I()}function E(){let te;for(;a._index<o.length;){const le=o[a._index];if(typeof le=="string")for(te=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===te&&a._bufferIndex<le.length;)_(le.charCodeAt(a._bufferIndex));else _(le)}}function _(te){x=x(te)}function A(te){_e(te)?(a.line++,a.column=1,a.offset+=te===-3?2:1,I()):te!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=te}function N(te,le){const ne=le||{};return ne.type=te,ne.start=S(),m.events.push(["enter",ne,m]),d.push(ne),ne}function P(te){const le=d.pop();return le.end=S(),m.events.push(["exit",le,m]),le}function D(te,le){U(te,le.from)}function M(te,le){le.restore()}function V(te,le){return ne;function ne(oe,se,Z){let B,Y,ue,O;return Array.isArray(oe)?H(oe):"tokenize"in oe?H([oe]):C(oe);function C(pe){return ge;function ge(Pe){const Ee=Pe!==null&&pe[Pe],yt=Pe!==null&&pe.null,$=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(yt)?yt:yt?[yt]:[]];return H($)(Pe)}}function H(pe){return B=pe,Y=0,pe.length===0?Z:w(pe[Y])}function w(pe){return ge;function ge(Pe){return O=K(),ue=pe,pe.partial||(m.currentConstruct=pe),pe.name&&m.parser.constructs.disable.null.includes(pe.name)?me():pe.tokenize.call(le?Object.assign(Object.create(m),le):m,h,X,me)(Pe)}}function X(pe){return te(ue,O),se}function me(pe){return O.restore(),++Y<B.length?w(B[Y]):Z}}}function U(te,le){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Wn(m.events,le,m.events.length-le,te.resolve(m.events.slice(le),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function K(){const te=S(),le=m.previous,ne=m.currentConstruct,oe=m.events.length,se=Array.from(d);return{from:oe,restore:Z};function Z(){a=te,m.previous=le,m.currentConstruct=ne,m.events.length=oe,d=se,I()}}function I(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function CL(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,c=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(a,c)];else{if(o=e.slice(n,s),a>-1){const d=o[0];typeof d=="string"?o[0]=d.slice(a):o.shift()}c>0&&o.push(e[s].slice(0,c))}return o}function TL(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const c=e[n];let o;if(typeof c=="string")o=c;else switch(c){case-5:{o="\r";break}case-4:{o=`
24
- `;break}case-3:{o=`\r
25
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(c)}s=c===-2,a.push(o)}return a.join("")}function EL(e){const a={constructs:U_([_L,...(e||{}).extensions||[]]),content:s(H6),defined:[],document:s(G6),flow:s(dL),lazy:{},string:s(mL),text:s(pL)};return a;function s(c){return o;function o(d){return NL(a,c,d)}}}function AL(e){for(;!F_(e););return e}const vw=/[\0\t\n\r]/g;function OL(){let e=1,t="",n=!0,a;return s;function s(c,o,d){const h=[];let m,x,p,b,v;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(o||void 0).decode(c)),p=0,t="",n&&(c.charCodeAt(0)===65279&&p++,n=void 0);p<c.length;){if(vw.lastIndex=p,m=vw.exec(c),b=m&&m.index!==void 0?m.index:c.length,v=c.charCodeAt(b),!m){t=c.slice(p);break}if(v===10&&p===b&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),p<b&&(h.push(c.slice(p,b)),e+=b-p),v){case 0:{h.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,h.push(-2);e++<x;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}p=b+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const ML=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DL(e){return e.replace(ML,RL)}function RL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),c=s===120||s===88;return I_(n.slice(c?2:1),c?16:10)}return Bg(n)||e}const K_={}.hasOwnProperty;function $L(e,t,n){return typeof t!="string"&&(n=t,t=void 0),LL(n)(AL(EL(n).document().write(OL()(e,t,!0))))}function LL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(lt),autolinkProtocol:K,autolinkEmail:K,atxHeading:c(St),blockQuote:c(yt),characterEscape:K,characterReference:K,codeFenced:c($),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:c($,o),codeText:c(Oe,o),codeTextData:K,data:K,codeFlowValue:K,definition:c(Ue),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:c(Je),hardBreakEscape:c(Ze),hardBreakTrailing:c(Ze),htmlFlow:c(rt,o),htmlFlowData:K,htmlText:c(rt,o),htmlTextData:K,image:c(ft),label:o,link:c(lt),listItem:c(nr),listItemValue:b,listOrdered:c(rn,p),listUnordered:c(rn),paragraph:c($t),reference:w,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:c(St),strong:c(Kt),thematicBreak:c(Qi)},exit:{atxHeading:h(),atxHeadingSequence:D,autolink:h(),autolinkEmail:Ee,autolinkProtocol:Pe,blockQuote:h(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:pe,characterReference:ge,codeFenced:h(E),codeFencedFence:z,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:I,codeIndented:h(_),codeText:h(se),codeTextData:I,data:I,definition:h(),definitionDestinationString:P,definitionLabelString:A,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ne),htmlFlowData:I,htmlText:h(oe),htmlTextData:I,image:h(B),label:ue,labelText:Y,lineEnding:te,link:h(Z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:X,resourceDestinationString:O,resourceTitleString:C,resource:H,setextHeading:h(U),setextHeadingLineSequence:V,setextHeadingText:M,strong:h(),thematicBreak:h()}};X_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ee){let fe={type:"root",children:[]};const we={stack:[fe],tokenStack:[],config:t,enter:d,exit:m,buffer:o,resume:x,data:n},Ce=[];let Ke=-1;for(;++Ke<ee.length;)if(ee[Ke][1].type==="listOrdered"||ee[Ke][1].type==="listUnordered")if(ee[Ke][0]==="enter")Ce.push(Ke);else{const kn=Ce.pop();Ke=s(ee,kn,Ke)}for(Ke=-1;++Ke<ee.length;){const kn=t[ee[Ke][0]];K_.call(kn,ee[Ke][1].type)&&kn[ee[Ke][1].type].call(Object.assign({sliceSerialize:ee[Ke][2].sliceSerialize},we),ee[Ke][1])}if(we.tokenStack.length>0){const kn=we.tokenStack[we.tokenStack.length-1];(kn[1]||kw).call(we,void 0,kn[0])}for(fe.position={start:qa(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:qa(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)fe=t.transforms[Ke](fe)||fe;return fe}function s(ee,fe,we){let Ce=fe-1,Ke=-1,kn=!1,Fn,wn,Xt,An;for(;++Ce<=we;){const ht=ee[Ce];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?Ke++:Ke--,An=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(Fn&&!An&&!Ke&&!Xt&&(Xt=Ce),An=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:An=void 0}if(!Ke&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||Ke===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(Fn){let va=Ce;for(wn=void 0;va--;){const wr=ee[va];if(wr[1].type==="lineEnding"||wr[1].type==="lineEndingBlank"){if(wr[0]==="exit")continue;wn&&(ee[wn][1].type="lineEndingBlank",kn=!0),wr[1].type="lineEnding",wn=va}else if(!(wr[1].type==="linePrefix"||wr[1].type==="blockQuotePrefix"||wr[1].type==="blockQuotePrefixWhitespace"||wr[1].type==="blockQuoteMarker"||wr[1].type==="listItemIndent"))break}Xt&&(!wn||Xt<wn)&&(Fn._spread=!0),Fn.end=Object.assign({},wn?ee[wn][1].start:ht[1].end),ee.splice(wn||Ce,0,["exit",Fn,ht[2]]),Ce++,we++}if(ht[1].type==="listItemPrefix"){const va={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};Fn=va,ee.splice(Ce,0,["enter",va,ht[2]]),Ce++,we++,Xt=void 0,An=!0}}}return ee[fe][1]._spread=kn,we}function c(ee,fe){return we;function we(Ce){d.call(this,ee(Ce),Ce),fe&&fe.call(this,Ce)}}function o(){this.stack.push({type:"fragment",children:[]})}function d(ee,fe,we){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([fe,we||void 0]),ee.position={start:qa(fe.start),end:void 0}}function h(ee){return fe;function fe(we){ee&&ee.call(this,we),m.call(this,we)}}function m(ee,fe){const we=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==ee.type&&(fe?fe.call(this,ee,Ce[0]):(Ce[1]||kw).call(this,ee,Ce[0]));else throw new Error("Cannot close `"+ee.type+"` ("+Vl({start:ee.start,end:ee.end})+"): it’s not open");we.position.end=qa(ee.end)}function x(){return Ig(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(ee){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=ee}function S(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=ee}function z(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee.replace(/(\r?\n|\r)$/g,"")}function A(ee){const fe=this.resume(),we=this.stack[this.stack.length-1];we.label=fe,we.identifier=Tr(this.sliceSerialize(ee)).toLowerCase()}function N(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.title=ee}function P(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.url=ee}function D(ee){const fe=this.stack[this.stack.length-1];if(!fe.depth){const we=this.sliceSerialize(ee).length;fe.depth=we}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function V(ee){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function K(ee){const we=this.stack[this.stack.length-1].children;let Ce=we[we.length-1];(!Ce||Ce.type!=="text")&&(Ce=bt(),Ce.position={start:qa(ee.start),end:void 0},we.push(Ce)),this.stack.push(Ce)}function I(ee){const fe=this.stack.pop();fe.value+=this.sliceSerialize(ee),fe.position.end=qa(ee.end)}function te(ee){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=fe.children[fe.children.length-1];we.position.end=qa(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(K.call(this,ee),I.call(this,ee))}function le(){this.data.atHardBreak=!0}function ne(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee}function oe(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee}function se(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.value=ee}function Z(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=fe,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function B(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=fe,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function Y(ee){const fe=this.sliceSerialize(ee),we=this.stack[this.stack.length-2];we.label=DL(fe),we.identifier=Tr(fe).toLowerCase()}function ue(){const ee=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 Ce=ee.children;we.children=Ce}else we.alt=fe}function O(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.url=ee}function C(){const ee=this.resume(),fe=this.stack[this.stack.length-1];fe.title=ee}function H(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function X(ee){const fe=this.resume(),we=this.stack[this.stack.length-1];we.label=fe,we.identifier=Tr(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function me(ee){this.data.characterReferenceType=ee.type}function pe(ee){const fe=this.sliceSerialize(ee),we=this.data.characterReferenceType;let Ce;we?(Ce=I_(fe,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Bg(fe);const Ke=this.stack[this.stack.length-1];Ke.value+=Ce}function ge(ee){const fe=this.stack.pop();fe.position.end=qa(ee.end)}function Pe(ee){I.call(this,ee);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(ee)}function Ee(ee){I.call(this,ee);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(ee)}function yt(){return{type:"blockquote",children:[]}}function $(){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 Je(){return{type:"emphasis",children:[]}}function St(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function rt(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function lt(){return{type:"link",title:null,url:"",children:[]}}function rn(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function nr(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function $t(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function bt(){return{type:"text",value:""}}function Qi(){return{type:"thematicBreak"}}}function qa(e){return{line:e.line,column:e.column,offset:e.offset}}function X_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?X_(e,a):PL(e,a)}}function PL(e,t){let n;for(n in t)if(K_.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 kw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vl({start:t.start,end:t.end})+") is still open")}function UL(e){const t=this;t.parser=n;function n(a){return $L(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function IL(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 BL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
26
- `}]}function VL(e,t){const n=t.value?t.value+`
27
- `:"",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 ZL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=jo(a.toLowerCase()),c=e.footnoteOrder.indexOf(a);let o,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),o=e.footnoteOrder.length):o=c+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function qL(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 GL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Q_(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 o=s[s.length-1];return o&&o.type==="text"?o.value+=a:s.push({type:"text",value:a}),s}function YL(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Q_(e,t);const s={src:jo(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 JL(e,t){const n={src:jo(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 KL(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 XL(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return Q_(e,t);const s={href:jo(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 QL(e,t){const n={href:jo(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 WL(e,t,n){const a=e.all(t),s=n?e8(n):W_(t),c={},o=[];if(typeof t.checked=="boolean"){const x=a[0];let p;x&&x.type==="element"&&x.tagName==="p"?p=x:(p={type:"element",tagName:"p",properties:{},children:[]},a.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const x=a[d];(s||d!==0||x.type!=="element"||x.tagName!=="p")&&o.push({type:"text",value:`
28
- `}),x.type==="element"&&x.tagName==="p"&&!s?o.push(...x.children):o.push(x)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
29
- `});const m={type:"element",tagName:"li",properties:c,children:o};return e.patch(t,m),e.applyData(t,m)}function e8(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=W_(n[a])}return t}function W_(e){const t=e.spread;return t??e.children.length>1}function t8(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 o=a[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.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 n8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function r8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function a8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function i8(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=$g(t.children[1]),h=O_(t.children[t.children.length-1]);d&&h&&(o.position={start:d,end:h}),s.push(o)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)}function s8(e,t,n){const a=n?n.children:void 0,c=(a?a.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,d=o?o.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const p=t.children[h],b={},v=o?o[h]:void 0;v&&(b.align=v);let S={type:"element",tagName:c,properties:b,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),m.push(S)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,x),e.applyData(t,x)}function o8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ww=9,Sw=32;function l8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const c=[];for(;a;)c.push(zw(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return c.push(zw(t.slice(s),s>0,!1)),c.join("")}function zw(e,t,n){let a=0,s=e.length;if(t){let c=e.codePointAt(a);for(;c===ww||c===Sw;)a++,c=e.codePointAt(a)}if(n){let c=e.codePointAt(s-1);for(;c===ww||c===Sw;)s--,c=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function c8(e,t){const n={type:"text",value:l8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function u8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const d8={blockquote:IL,break:BL,code:VL,delete:ZL,emphasis:FL,footnoteReference:HL,heading:qL,html:GL,imageReference:YL,image:JL,inlineCode:KL,linkReference:XL,link:QL,listItem:WL,list:t8,paragraph:n8,root:r8,strong:a8,table:i8,tableCell:o8,tableRow:s8,text:c8,thematicBreak:u8,toml:Hu,yaml:Hu,definition:Hu,footnoteDefinition:Hu};function Hu(){}const e2=-1,Xd=0,Fl=1,Td=2,Zg=3,Fg=4,Hg=5,qg=6,t2=7,n2=8,jw=typeof self=="object"?self:globalThis,f8=(e,t)=>{const n=(s,c)=>(e.set(c,s),s),a=s=>{if(e.has(s))return e.get(s);const[c,o]=t[s];switch(c){case Xd:case e2:return n(o,s);case Fl:{const d=n([],s);for(const h of o)d.push(a(h));return d}case Td:{const d=n({},s);for(const[h,m]of o)d[a(h)]=a(m);return d}case Zg:return n(new Date(o),s);case Fg:{const{source:d,flags:h}=o;return n(new RegExp(d,h),s)}case Hg:{const d=n(new Map,s);for(const[h,m]of o)d.set(a(h),a(m));return d}case qg:{const d=n(new Set,s);for(const h of o)d.add(a(h));return d}case t2:{const{name:d,message:h}=o;return n(new jw[d](h),s)}case n2:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:d}=new Uint8Array(o);return n(new DataView(d),o)}}return n(new jw[c](o),s)};return a},_w=e=>f8(new Map,e)(0),Is="",{toString:h8}={},{keys:m8}=Object,Al=e=>{const t=typeof e;if(t!=="object"||!e)return[Xd,t];const n=h8.call(e).slice(8,-1);switch(n){case"Array":return[Fl,Is];case"Object":return[Td,Is];case"Date":return[Zg,Is];case"RegExp":return[Fg,Is];case"Map":return[Hg,Is];case"Set":return[qg,Is];case"DataView":return[Fl,n]}return n.includes("Array")?[Fl,n]:n.includes("Error")?[t2,n]:[Td,n]},qu=([e,t])=>e===Xd&&(t==="function"||t==="symbol"),p8=(e,t,n,a)=>{const s=(o,d)=>{const h=a.push(o)-1;return n.set(d,h),h},c=o=>{if(n.has(o))return n.get(o);let[d,h]=Al(o);switch(d){case Xd:{let x=o;switch(h){case"bigint":d=n2,x=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);x=null;break;case"undefined":return s([e2],o)}return s([d,x],o)}case Fl:{if(h){let b=o;return h==="DataView"?b=new Uint8Array(o.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(o)),s([h,[...b]],o)}const x=[],p=s([d,x],o);for(const b of o)x.push(c(b));return p}case Td:{if(h)switch(h){case"BigInt":return s([h,o.toString()],o);case"Boolean":case"Number":case"String":return s([h,o.valueOf()],o)}if(t&&"toJSON"in o)return c(o.toJSON());const x=[],p=s([d,x],o);for(const b of m8(o))(e||!qu(Al(o[b])))&&x.push([c(b),c(o[b])]);return p}case Zg:return s([d,o.toISOString()],o);case Fg:{const{source:x,flags:p}=o;return s([d,{source:x,flags:p}],o)}case Hg:{const x=[],p=s([d,x],o);for(const[b,v]of o)(e||!(qu(Al(b))||qu(Al(v))))&&x.push([c(b),c(v)]);return p}case qg:{const x=[],p=s([d,x],o);for(const b of o)(e||!qu(Al(b)))&&x.push(c(b));return p}}const{message:m}=o;return s([d,{name:h,message:m}],o)};return c},Nw=(e,{json:t,lossy:n}={})=>{const a=[];return p8(!(t||n),!!t,new Map,a)(e),a},Ed=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_w(Nw(e,t)):structuredClone(e):(e,t)=>_w(Nw(e,t));function x8(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 g8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function y8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||x8,a=e.options.footnoteBackLabel||g8,s=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const x=e.all(m),p=String(m.identifier).toUpperCase(),b=jo(p.toLowerCase());let v=0;const S=[],z=e.footnoteCounts.get(p);for(;z!==void 0&&++v<=z;){S.length>0&&S.push({type:"text",value:" "});let A=typeof n=="string"?n:n(h,v);typeof A=="string"&&(A={type:"text",value:A}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=x[x.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else x.push(...S);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(x,!0)};e.patch(m,_),d.push(_)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Ed(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
30
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
31
- `}]}}const Qd=(function(e){if(e==null)return w8;if(typeof e=="function")return Wd(e);if(typeof e=="object")return Array.isArray(e)?b8(e):v8(e);if(typeof e=="string")return k8(e);throw new Error("Expected function, string, or object as test")});function b8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qd(e[n]);return Wd(a);function a(...s){let c=-1;for(;++c<t.length;)if(t[c].apply(this,s))return!0;return!1}}function v8(e){const t=e;return Wd(n);function n(a){const s=a;let c;for(c in e)if(s[c]!==t[c])return!1;return!0}}function k8(e){return Wd(t);function t(n){return n&&n.type===e}}function Wd(e){return t;function t(n,a,s){return!!(S8(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function w8(){return!0}function S8(e){return e!==null&&typeof e=="object"&&"type"in e}const r2=[],z8=!0,_x=!1,j8="skip";function a2(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const c=Qd(s),o=a?-1:1;d(e,void 0,[])();function d(h,m,x){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=r2,S,z,E;if((!t||c(h,m,x[x.length-1]||void 0))&&(v=_8(n(h,x)),v[0]===_x))return v;if("children"in h&&h.children){const _=h;if(_.children&&v[0]!==j8)for(z=(a?_.children.length:-1)+o,E=x.concat(_);z>-1&&z<_.children.length;){const A=_.children[z];if(S=d(A,z,E)(),S[0]===_x)return S;z=typeof S[1]=="number"?S[1]:z+o}}return v}}}function _8(e){return Array.isArray(e)?e:typeof e=="number"?[z8,e]:e==null?r2:[e]}function Gg(e,t,n,a){let s,c,o;typeof t=="function"&&typeof n!="function"?(c=void 0,o=t,s=n):(c=t,o=n,s=a),a2(e,c,d,s);function d(h,m){const x=m[m.length-1],p=x?x.children.indexOf(h):void 0;return o(h,p,x)}}const Nx={}.hasOwnProperty,N8={};function C8(e,t){const n=t||N8,a=new Map,s=new Map,c=new Map,o={...d8,...n.handlers},d={all:m,applyData:E8,definitionById:a,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:o,one:h,options:n,patch:T8,wrap:O8};return Gg(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const p=x.type==="definition"?a:s,b=String(x.identifier).toUpperCase();p.has(b)||p.set(b,x)}}),d;function h(x,p){const b=x.type,v=d.handlers[b];if(Nx.call(d.handlers,b)&&v)return v(d,x,p);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in x){const{children:z,...E}=x,_=Ed(E);return _.children=d.all(x),_}return Ed(x)}return(d.options.unknownHandler||A8)(d,x,p)}function m(x){const p=[];if("children"in x){const b=x.children;let v=-1;for(;++v<b.length;){const S=d.one(b[v],x);if(S){if(v&&b[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Cw(S.value)),!Array.isArray(S)&&S.type==="element")){const z=S.children[0];z&&z.type==="text"&&(z.value=Cw(z.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function T8(e,t){e.position&&(t.position=g6(e))}function E8(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 o="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:o}}n.type==="element"&&c&&Object.assign(n.properties,Ed(c)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function A8(e,t){const n=t.data||{},a="value"in t&&!(Nx.call(n,"hProperties")||Nx.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 O8(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
32
- `});++a<e.length;)a&&n.push({type:"text",value:`
33
- `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
34
- `}),n}function Cw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Tw(e,t){const n=C8(e,t),a=n.one(e,void 0),s=y8(n),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
35
- `},s),c}function M8(e,t){return e&&"run"in e?async function(n,a){const s=Tw(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Tw(n,{file:a,...e||t})}}function Ew(e){if(e)throw e}var op,Aw;function D8(){if(Aw)return op;Aw=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 x=e.call(m,"constructor"),p=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!x&&!p)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},o=function(m,x){n&&x.name==="__proto__"?n(m,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):m[x.name]=x.newValue},d=function(m,x){if(x==="__proto__")if(e.call(m,x)){if(a)return a(m,x).value}else return;return m[x]};return op=function h(){var m,x,p,b,v,S,z=arguments[0],E=1,_=arguments.length,A=!1;for(typeof z=="boolean"&&(A=z,z=arguments[1]||{},E=2),(z==null||typeof z!="object"&&typeof z!="function")&&(z={});E<_;++E)if(m=arguments[E],m!=null)for(x in m)p=d(z,x),b=d(m,x),z!==b&&(A&&b&&(c(b)||(v=s(b)))?(v?(v=!1,S=p&&s(p)?p:[]):S=p&&c(p)?p:{},o(z,{name:x,newValue:h(A,S,b)})):typeof b<"u"&&o(z,{name:x,newValue:b}));return z},op}var R8=D8();const lp=Px(R8);function Cx(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 $8(){const e=[],t={run:n,use:a};return t;function n(...s){let c=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);d(null,...s);function d(h,...m){const x=e[++c];let p=-1;if(h){o(h);return}for(;++p<s.length;)(m[p]===null||m[p]===void 0)&&(m[p]=s[p]);s=m,x?L8(x,d)(...m):o(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 L8(e,t){let n;return a;function a(...o){const d=e.length>o.length;let h;d&&o.push(s);try{h=e.apply(this,o)}catch(m){const x=m;if(d&&n)throw x;return s(x)}d||(h&&h.then&&typeof h.then=="function"?h.then(c,s):h instanceof Error?s(h):c(h))}function s(o,...d){n||(n=!0,t(o,...d))}function c(o){s(null,o)}}const $r={basename:P8,dirname:U8,extname:I8,join:B8,sep:"/"};function P8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bc(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 o=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(c){n=s+1;break}}else o<0&&(c=!0,o=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=o));return n===a?a=o:a<0&&(a=e.length),e.slice(n,a)}function U8(e){if(bc(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 I8(e){bc(e);let t=e.length,n=-1,a=0,s=-1,c=0,o;for(;t--;){const d=e.codePointAt(t);if(d===47){if(o){a=t+1;break}continue}n<0&&(o=!0,n=t+1),d===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 B8(...e){let t=-1,n;for(;++t<e.length;)bc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":V8(n)}function V8(e){bc(e);const t=e.codePointAt(0)===47;let n=Z8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Z8(e,t){let n="",a=0,s=-1,c=0,o=-1,d,h;for(;++o<=e.length;){if(o<e.length)d=e.codePointAt(o);else{if(d===47)break;d=47}if(d===47){if(!(s===o-1||c===1))if(s!==o-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=o,c=0;continue}}else if(n.length>0){n="",a=0,s=o,c=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),a=o-s-1;s=o,c=0}else d===46&&c>-1?c++:c=-1}return n}function bc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const F8={cwd:H8};function H8(){return"/"}function Tx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function q8(e){if(typeof e=="string")e=new URL(e);else if(!Tx(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 G8(e)}function G8(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 cp=["history","path","basename","stem","extname","dirname"];class i2{constructor(t){let n;t?Tx(t)?n={path:t}:typeof t=="string"||Y8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":F8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<cp.length;){const c=cp[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)cp.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?$r.basename(this.path):void 0}set basename(t){dp(t,"basename"),up(t,"basename"),this.path=$r.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$r.dirname(this.path):void 0}set dirname(t){Ow(this.basename,"dirname"),this.path=$r.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$r.extname(this.path):void 0}set extname(t){if(up(t,"extname"),Ow(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$r.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Tx(t)&&(t=q8(t)),dp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$r.basename(this.path,this.extname):void 0}set stem(t){dp(t,"stem"),up(t,"stem"),this.path=$r.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new vn(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function up(e,t){if(e&&e.includes($r.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$r.sep+"`")}function dp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ow(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Y8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const J8=(function(e){const a=this.constructor.prototype,s=a[e],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),K8={}.hasOwnProperty;class Yg extends J8{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=$8()}copy(){const t=new Yg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(lp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mp("data",this.frozen),this.namespace[t]=n,this):K8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mp("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=Gu(t),a=this.parser||this.Parser;return fp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),fp("process",this.parser||this.Parser),hp("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(c,o){const d=Gu(t),h=a.parse(d);a.run(h,d,function(x,p,b){if(x||!p||!b)return m(x);const v=p,S=a.stringify(v,b);W8(S)?b.value=S:b.result=S,m(x,b)});function m(x,p){x||!p?o(x):c?c(p):n(void 0,p)}}}processSync(t){let n=!1,a;return this.freeze(),fp("processSync",this.parser||this.Parser),hp("processSync",this.compiler||this.Compiler),this.process(t,s),Dw("processSync","process",n),a;function s(c,o){n=!0,Ew(c),a=o}}run(t,n,a){Mw(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(o,d){const h=Gu(n);s.run(t,h,m);function m(x,p,b){const v=p||t;x?d(x):o?o(v):a(void 0,v,b)}}}runSync(t,n){let a=!1,s;return this.run(t,n,c),Dw("runSync","run",a),s;function c(o,d){Ew(o),s=d,a=!0}}stringify(t,n){this.freeze();const a=Gu(n),s=this.compiler||this.Compiler;return hp("stringify",s),Mw(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(mp("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):o(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[x,...p]=m;h(x,p)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(m.plugins),m.settings&&(s.settings=lp(!0,s.settings,m.settings))}function d(m){let x=-1;if(m!=null)if(Array.isArray(m))for(;++x<m.length;){const p=m[x];c(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,x){let p=-1,b=-1;for(;++p<a.length;)if(a[p][0]===m){b=p;break}if(b===-1)a.push([m,...x]);else if(x.length>0){let[v,...S]=x;const z=a[b][1];Cx(z)&&Cx(v)&&(v=lp(!0,z,v)),a[b]=[m,v,...S]}}}}const X8=new Yg().freeze();function fp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mp(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 Mw(e){if(!Cx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gu(e){return Q8(e)?e:new i2(e)}function Q8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function W8(e){return typeof e=="string"||eP(e)}function eP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rw=[],$w={allowDangerousHtml:!0},nP=/^(https?|ircs?|mailto|xmpp)$/i,rP=[{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 aP(e){const t=iP(e),n=sP(e);return oP(t.runSync(t.parse(n),n),e)}function iP(e){const t=e.rehypePlugins||Rw,n=e.remarkPlugins||Rw,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$w}:$w;return X8().use(UL).use(n).use(M8,a).use(t)}function sP(e){const t=e.children||"",n=new i2;return typeof t=="string"&&(n.value=t),n}function oP(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,c=t.disallowedElements,o=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||lP;for(const x of rP)Object.hasOwn(t,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+tP+x.id,void 0);return Gg(e,m),w6(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(x,p,b){if(x.type==="raw"&&b&&typeof p=="number")return o?b.children.splice(p,1):b.children[p]={type:"text",value:x.value},p;if(x.type==="element"){let v;for(v in ap)if(Object.hasOwn(ap,v)&&Object.hasOwn(x.properties,v)){const S=x.properties[v],z=ap[v];(z===null||z.includes(x.tagName))&&(x.properties[v]=h(String(S||""),v,x))}}if(x.type==="element"){let v=n?!n.includes(x.tagName):c?c.includes(x.tagName):!1;if(!v&&a&&typeof p=="number"&&(v=!a(x,p,b)),v&&b&&typeof p=="number")return d&&x.children?b.children.splice(p,1,...x.children):b.children.splice(p,1),p}}}function lP(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||nP.test(e.slice(0,t))?e:""}function Lw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function cP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uP(e,t,n){const s=Qd((n||{}).ignore||[]),c=dP(t);let o=-1;for(;++o<c.length;)a2(e,"text",d);function d(m,x){let p=-1,b;for(;++p<x.length;){const v=x[p],S=b?b.children:void 0;if(s(v,S?S.indexOf(v):void 0,b))return;b=v}if(b)return h(m,x)}function h(m,x){const p=x[x.length-1],b=c[o][0],v=c[o][1];let S=0;const E=p.children.indexOf(m);let _=!1,A=[];b.lastIndex=0;let N=b.exec(m.value);for(;N;){const P=N.index,D={index:N.index,input:N.input,stack:[...x,m]};let M=v(...N,D);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?b.lastIndex=P+1:(S!==P&&A.push({type:"text",value:m.value.slice(S,P)}),Array.isArray(M)?A.push(...M):M&&A.push(M),S=P+N[0].length,_=!0),!b.global)break;N=b.exec(m.value)}return _?(S<m.value.length&&A.push({type:"text",value:m.value.slice(S)}),p.children.splice(E,1,...A)):A=[m],E+A.length}}function dP(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const s=n[a];t.push([fP(s[0]),hP(s[1])])}return t}function fP(e){return typeof e=="string"?new RegExp(cP(e),"g"):e}function hP(e){return typeof e=="function"?e:function(){return e}}const pp="phrasing",xp=["autolink","link","image","label"];function mP(){return{transforms:[kP],enter:{literalAutolink:xP,literalAutolinkEmail:gp,literalAutolinkHttp:gp,literalAutolinkWww:gp},exit:{literalAutolink:vP,literalAutolinkEmail:bP,literalAutolinkHttp:gP,literalAutolinkWww:yP}}}function pP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:xp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:xp},{character:":",before:"[ps]",after:"\\/",inConstruct:pp,notInConstruct:xp}]}}function xP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gp(e){this.config.enter.autolinkProtocol.call(this,e)}function gP(e){this.config.exit.autolinkProtocol.call(this,e)}function yP(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function bP(e){this.config.exit.autolinkEmail.call(this,e)}function vP(e){this.exit(e)}function kP(e){uP(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),SP]],{ignore:["link","linkReference"]})}function wP(e,t,n,a,s){let c="";if(!s2(s)||(/^w/i.test(t)&&(n=t+n,t="",c="http://"),!zP(n)))return!1;const o=jP(n+a);if(!o[0])return!1;const d={type:"link",title:null,url:c+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[d,{type:"text",value:o[1]}]:d}function SP(e,t,n,a){return!s2(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function jP(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=Lw(e,"(");let c=Lw(e,")");for(;a!==-1&&s>c;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),c++;return[e,n]}function s2(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fi(n)||Jd(n))&&(!t||n!==47)}o2.peek=DP;function _P(){this.buffer()}function NP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function CP(){this.buffer()}function TP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function EP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function AP(e){this.exit(e)}function OP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function MP(e){this.exit(e)}function DP(){return"["}function o2(e,t,n,a){const s=n.createTracker(a);let c=s.move("[^");const o=n.enter("footnoteReference"),d=n.enter("reference");return c+=s.move(n.safe(n.associationId(e),{after:"]",before:c})),d(),o(),c+=s.move("]"),c}function RP(){return{enter:{gfmFootnoteCallString:_P,gfmFootnoteCall:NP,gfmFootnoteDefinitionLabelString:CP,gfmFootnoteDefinition:TP},exit:{gfmFootnoteCallString:EP,gfmFootnoteCall:AP,gfmFootnoteDefinitionLabelString:OP,gfmFootnoteDefinition:MP}}}function $P(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:o2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,c,o){const d=c.createTracker(o);let h=d.move("[^");const m=c.enter("footnoteDefinition"),x=c.enter("label");return h+=d.move(c.safe(c.associationId(a),{before:h,after:"]"})),x(),h+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),h+=d.move((t?`
36
- `:" ")+c.indentLines(c.containerFlow(a,d.current()),t?l2:LP))),m(),h}}function LP(e,t,n){return t===0?e:l2(e,t,n)}function l2(e,t,n){return(n?"":" ")+e}const PP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];c2.peek=ZP;function UP(){return{canContainEols:["delete"],enter:{strikethrough:BP},exit:{strikethrough:VP}}}function IP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:PP}],handlers:{delete:c2}}}function BP(e){this.enter({type:"delete",children:[]},e)}function VP(e){this.exit(e)}function c2(e,t,n,a){const s=n.createTracker(a),c=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),c(),o}function ZP(){return"~"}function FP(e){return e.length}function HP(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||FP,c=[],o=[],d=[],h=[];let m=0,x=-1;for(;++x<e.length;){const z=[],E=[];let _=-1;for(e[x].length>m&&(m=e[x].length);++_<e[x].length;){const A=qP(e[x][_]);if(n.alignDelimiters!==!1){const N=s(A);E[_]=N,(h[_]===void 0||N>h[_])&&(h[_]=N)}z.push(A)}o[x]=z,d[x]=E}let p=-1;if(typeof a=="object"&&"length"in a)for(;++p<m;)c[p]=Pw(a[p]);else{const z=Pw(a);for(;++p<m;)c[p]=z}p=-1;const b=[],v=[];for(;++p<m;){const z=c[p];let E="",_="";z===99?(E=":",_=":"):z===108?E=":":z===114&&(_=":");let A=n.alignDelimiters===!1?1:Math.max(1,h[p]-E.length-_.length);const N=E+"-".repeat(A)+_;n.alignDelimiters!==!1&&(A=E.length+A+_.length,A>h[p]&&(h[p]=A),v[p]=A),b[p]=N}o.splice(1,0,b),d.splice(1,0,v),x=-1;const S=[];for(;++x<o.length;){const z=o[x],E=d[x];p=-1;const _=[];for(;++p<m;){const A=z[p]||"";let N="",P="";if(n.alignDelimiters!==!1){const D=h[p]-(E[p]||0),M=c[p];M===114?N=" ".repeat(D):M===99?D%2?(N=" ".repeat(D/2+.5),P=" ".repeat(D/2-.5)):(N=" ".repeat(D/2),P=N):P=" ".repeat(D)}n.delimiterStart!==!1&&!p&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&_.push(" "),n.alignDelimiters!==!1&&_.push(N),_.push(A),n.alignDelimiters!==!1&&_.push(P),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||p!==m-1)&&_.push("|")}S.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return S.join(`
37
- `)}function qP(e){return e==null?"":String(e)}function Pw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function GP(e,t,n,a){const s=n.enter("blockquote"),c=n.createTracker(a);c.move("> "),c.shift(2);const o=n.indentLines(n.containerFlow(e,c.current()),YP);return s(),o}function YP(e,t,n){return">"+(n?"":" ")+e}function JP(e,t){return Uw(e,t.inConstruct,!0)&&!Uw(e,t.notInConstruct,!1)}function Uw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Iw(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
38
- `&&JP(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
39
- `}function KP(e,t){const n=String(e);let a=n.indexOf(t),s=a,c=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++c>o&&(o=c):c=1,s=a+t.length,a=n.indexOf(t,s);return o}function XP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function QP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function WP(e,t,n,a){const s=QP(n),c=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(XP(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(c,eU);return p(),b}const d=n.createTracker(a),h=s.repeat(Math.max(KP(c,s)+1,3)),m=n.enter("codeFenced");let x=d.move(h);if(e.lang){const p=n.enter(`codeFencedLang${o}`);x+=d.move(n.safe(e.lang,{before:x,after:" ",encode:["`"],...d.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);x+=d.move(" "),x+=d.move(n.safe(e.meta,{before:x,after:`
40
- `,encode:["`"],...d.current()})),p()}return x+=d.move(`
41
- `),c&&(x+=d.move(c+`
42
- `)),x+=d.move(h),m(),x}function eU(e,t,n){return(n?"":" ")+e}function Jg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function tU(e,t,n,a){const s=Jg(n),c=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("[");return m+=h.move(n.safe(n.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":`
43
- `,...h.current()}))),d(),e.title&&(d=n.enter(`title${c}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),o(),m}function nU(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function tc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ad(e,t,n){const a=uo(e),s=uo(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}u2.peek=rU;function u2(e,t,n,a){const s=nU(n),c=n.enter("emphasis"),o=n.createTracker(a),d=o.move(s);let h=o.move(n.containerPhrasing(e,{after:s,before:d,...o.current()}));const m=h.charCodeAt(0),x=Ad(a.before.charCodeAt(a.before.length-1),m,s);x.inside&&(h=tc(m)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Ad(a.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+tc(p));const v=o.move(s);return c(),n.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+h+v}function rU(e,t,n){return n.options.emphasis||"*"}function aU(e,t){let n=!1;return Gg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,_x}),!!((!e.depth||e.depth<3)&&Ig(e)&&(t.options.setext||n))}function iU(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),c=n.createTracker(a);if(aU(e,n)){const x=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...c.current(),before:`
44
- `,after:`
45
- `});return p(),x(),b+`
46
- `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
47
- `))+1))}const o="#".repeat(s),d=n.enter("headingAtx"),h=n.enter("phrasing");c.move(o+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
48
- `,...c.current()});return/^[\t ]/.test(m)&&(m=tc(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),h(),d(),m}d2.peek=sU;function d2(e){return e.value||""}function sU(){return"<"}f2.peek=oU;function f2(e,t,n,a){const s=Jg(n),c=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("![");return m+=h.move(n.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),d(),e.title&&(d=n.enter(`title${c}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),m+=h.move(")"),o(),m}function oU(){return"!"}h2.peek=lU;function h2(e,t,n,a){const s=e.referenceType,c=n.enter("imageReference");let o=n.enter("label");const d=n.createTracker(a);let h=d.move("![");const m=n.safe(e.alt,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),o();const x=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return o(),n.stack=x,c(),s==="full"||!m||m!==p?h+=d.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function lU(){return"!"}m2.peek=cU;function m2(e,t,n){let a=e.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++c<n.unsafe.length;){const o=n.unsafe[c],d=n.compilePattern(o);let h;if(o.atBreak)for(;h=d.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return s+a+s}function cU(){return"`"}function p2(e,t){const n=Ig(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}x2.peek=uU;function x2(e,t,n,a){const s=Jg(n),c=s==='"'?"Quote":"Apostrophe",o=n.createTracker(a);let d,h;if(p2(e,n)){const x=n.stack;n.stack=[],d=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),d(),n.stack=x,p}d=n.enter("link"),h=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,{before:m,after:"](",...o.current()})),m+=o.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,{before:m,after:">",...o.current()})),m+=o.move(">")):(h=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,{before:m,after:e.title?" ":")",...o.current()}))),h(),e.title&&(h=n.enter(`title${c}`),m+=o.move(" "+s),m+=o.move(n.safe(e.title,{before:m,after:s,...o.current()})),m+=o.move(s),h()),m+=o.move(")"),d(),m}function uU(e,t,n){return p2(e,n)?"<":"["}g2.peek=dU;function g2(e,t,n,a){const s=e.referenceType,c=n.enter("linkReference");let o=n.enter("label");const d=n.createTracker(a);let h=d.move("[");const m=n.containerPhrasing(e,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),o();const x=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return o(),n.stack=x,c(),s==="full"||!m||m!==p?h+=d.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function dU(){return"["}function Kg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fU(e){const t=Kg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function hU(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function y2(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function mU(e,t,n,a){const s=n.enter("list"),c=n.bulletCurrent;let o=e.ordered?hU(n):Kg(n);const d=e.ordered?o==="."?")":".":fU(n);let h=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&x&&(!x.children||!x.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),y2(n)===o&&x){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(o=d),n.bulletCurrent=o;const m=n.containerFlow(e,a);return n.bulletLastUsed=o,n.bulletCurrent=c,s(),m}function pU(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function xU(e,t,n,a){const s=pU(n);let c=n.bulletCurrent||Kg(n);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let o=c.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const d=n.createTracker(a);d.move(c+" ".repeat(o-c.length)),d.shift(o);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,d.current()),x);return h(),m;function x(p,b,v){return b?(v?"":" ".repeat(o))+p:(v?c:c+" ".repeat(o-c.length))+p}}function gU(e,t,n,a){const s=n.enter("paragraph"),c=n.enter("phrasing"),o=n.containerPhrasing(e,a);return c(),s(),o}const yU=Qd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function bU(e,t,n,a){return(e.children.some(function(o){return yU(o)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function vU(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}b2.peek=kU;function b2(e,t,n,a){const s=vU(n),c=n.enter("strong"),o=n.createTracker(a),d=o.move(s+s);let h=o.move(n.containerPhrasing(e,{after:s,before:d,...o.current()}));const m=h.charCodeAt(0),x=Ad(a.before.charCodeAt(a.before.length-1),m,s);x.inside&&(h=tc(m)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Ad(a.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+tc(p));const v=o.move(s+s);return c(),n.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},d+h+v}function kU(e,t,n){return n.options.strong||"*"}function wU(e,t,n,a){return n.safe(e.value,a)}function SU(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zU(e,t,n){const a=(y2(n)+(n.options.ruleSpaces?" ":"")).repeat(SU(n));return n.options.ruleSpaces?a.slice(0,-1):a}const v2={blockquote:GP,break:Iw,code:WP,definition:tU,emphasis:u2,hardBreak:Iw,heading:iU,html:d2,image:f2,imageReference:h2,inlineCode:m2,link:x2,linkReference:g2,list:mU,listItem:xU,paragraph:gU,root:bU,strong:b2,text:wU,thematicBreak:zU};function jU(){return{enter:{table:_U,tableData:Bw,tableHeader:Bw,tableRow:CU},exit:{codeText:TU,table:NU,tableData:yp,tableHeader:yp,tableRow:yp}}}function _U(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function NU(e){this.exit(e),this.data.inTable=void 0}function CU(e){this.enter({type:"tableRow",children:[]},e)}function yp(e){this.exit(e)}function Bw(e){this.enter({type:"tableCell",children:[]},e)}function TU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,EU));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function EU(e,t){return t==="|"?t:e}function AU(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,c=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
49
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:o,tableCell:h,tableRow:d}};function o(v,S,z,E){return m(x(v,z,E),v.align)}function d(v,S,z,E){const _=p(v,z,E),A=m([_]);return A.slice(0,A.indexOf(`
50
- `))}function h(v,S,z,E){const _=z.enter("tableCell"),A=z.enter("phrasing"),N=z.containerPhrasing(v,{...E,before:c,after:c});return A(),_(),N}function m(v,S){return HP(v,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function x(v,S,z){const E=v.children;let _=-1;const A=[],N=S.enter("table");for(;++_<E.length;)A[_]=p(E[_],S,z);return N(),A}function p(v,S,z){const E=v.children;let _=-1;const A=[],N=S.enter("tableRow");for(;++_<E.length;)A[_]=h(E[_],v,S,z);return N(),A}function b(v,S,z){let E=v2.inlineCode(v,S,z);return z.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function OU(){return{exit:{taskListCheckValueChecked:Vw,taskListCheckValueUnchecked:Vw,paragraph:DU}}}function MU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:RU}}}function Vw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function DU(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let c=-1,o;for(;++c<s.length;){const d=s[c];if(d.type==="paragraph"){o=d;break}}o===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function RU(e,t,n,a){const s=e.children[0],c=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);c&&d.move(o);let h=v2.listItem(e,t,n,{...a,...d.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(x){return x+o}}function $U(){return[mP(),RP(),UP(),jU(),OU()]}function LU(e){return{extensions:[pP(),$P(e),IP(),AU(e),MU()]}}const PU={tokenize:FU,partial:!0},k2={tokenize:HU,partial:!0},w2={tokenize:qU,partial:!0},S2={tokenize:GU,partial:!0},UU={tokenize:YU,partial:!0},z2={name:"wwwAutolink",tokenize:VU,previous:_2},j2={name:"protocolAutolink",tokenize:ZU,previous:N2},ba={name:"emailAutolink",tokenize:BU,previous:C2},Zr={};function IU(){return{text:Zr}}let Mi=48;for(;Mi<123;)Zr[Mi]=ba,Mi++,Mi===58?Mi=65:Mi===91&&(Mi=97);Zr[43]=ba;Zr[45]=ba;Zr[46]=ba;Zr[95]=ba;Zr[72]=[ba,j2];Zr[104]=[ba,j2];Zr[87]=[ba,z2];Zr[119]=[ba,z2];function BU(e,t,n){const a=this;let s,c;return o;function o(p){return!Ex(p)||!C2.call(a,a.previous)||Xg(a.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(p))}function d(p){return Ex(p)?(e.consume(p),d):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(UU,x,m)(p):p===45||p===95||bn(p)?(c=!0,e.consume(p),h):x(p)}function m(p){return e.consume(p),s=!0,h}function x(p){return c&&s&&Nn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function VU(e,t,n){const a=this;return s;function s(o){return o!==87&&o!==119||!_2.call(a,a.previous)||Xg(a.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(PU,e.attempt(k2,e.attempt(w2,c),n),n)(o))}function c(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function ZU(e,t,n){const a=this;let s="",c=!1;return o;function o(p){return(p===72||p===104)&&N2.call(a,a.previous)&&!Xg(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),d):n(p)}function d(p){if(Nn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),d;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),c?m:(c=!0,h)):n(p)}function m(p){return p===null||Cd(p)||pt(p)||Fi(p)||Jd(p)?n(p):e.attempt(k2,e.attempt(w2,x),n)(p)}function x(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function FU(e,t,n){let a=0;return s;function s(o){return(o===87||o===119)&&a<3?(a++,e.consume(o),s):o===46&&a===3?(e.consume(o),c):n(o)}function c(o){return o===null?n(o):t(o)}}function HU(e,t,n){let a,s,c;return o;function o(m){return m===46||m===95?e.check(S2,h,d)(m):m===null||pt(m)||Fi(m)||m!==45&&Jd(m)?h(m):(c=!0,e.consume(m),o)}function d(m){return m===95?a=!0:(s=a,a=void 0),e.consume(m),o}function h(m){return s||a||!c?n(m):t(m)}}function qU(e,t){let n=0,a=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&a<n?c(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(S2,t,c)(o):o===null||pt(o)||Fi(o)?t(o):(e.consume(o),s)}function c(o){return o===41&&a++,e.consume(o),s}}function GU(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),c):d===93?(e.consume(d),s):d===60||d===null||pt(d)||Fi(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||pt(d)||Fi(d)?t(d):a(d)}function c(d){return Nn(d)?o(d):n(d)}function o(d){return d===59?(e.consume(d),a):Nn(d)?(e.consume(d),o):n(d)}}function YU(e,t,n){return a;function a(c){return e.consume(c),s}function s(c){return bn(c)?n(c):t(c)}}function _2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pt(e)}function N2(e){return!Nn(e)}function C2(e){return!(e===47||Ex(e))}function Ex(e){return e===43||e===45||e===46||e===95||bn(e)}function Xg(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const JU={tokenize:r7,partial:!0};function KU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:e7,continuation:{tokenize:t7},exit:n7}},text:{91:{name:"gfmFootnoteCall",tokenize:WU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:XU,resolveTo:QU}}}}function XU(e,t,n){const a=this;let s=a.events.length;const c=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){o=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!o||!o._balanced)return n(h);const m=Tr(a.sliceSerialize({start:o.end,end:a.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function QU(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",c,t],["enter",o,t],["exit",o,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function WU(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c=0,o;return d;function d(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(c>999||p===93&&!o||p===null||p===91||pt(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Tr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return pt(p)||(o=!0),c++,e.consume(p),p===92?x:m}function x(p){return p===91||p===92||p===93?(e.consume(p),c++,m):m(p)}}function e7(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,o=0,d;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):n(S)}function x(S){if(o>999||S===93&&!d||S===null||S===91||pt(S))return n(S);if(S===93){e.exit("chunkString");const z=e.exit("gfmFootnoteDefinitionLabelString");return c=Tr(a.sliceSerialize(z)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return pt(S)||(d=!0),o++,e.consume(S),S===92?p:x}function p(S){return S===91||S===92||S===93?(e.consume(S),o++,x):x(S)}function b(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(c)||s.push(c),Xe(e,v,"gfmFootnoteDefinitionWhitespace")):n(S)}function v(S){return t(S)}}function t7(e,t,n){return e.check(yc,t,e.attempt(JU,t,n))}function n7(e){e.exit("gfmFootnoteDefinition")}function r7(e,t,n){const a=this;return Xe(e,s,"gfmFootnoteDefinitionIndent",5);function s(c){const o=a.events[a.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(c):n(c)}}function a7(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:c,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(o,d){let h=-1;for(;++h<o.length;)if(o[h][0]==="enter"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._close){let m=h;for(;m--;)if(o[m][0]==="exit"&&o[m][1].type==="strikethroughSequenceTemporary"&&o[m][1]._open&&o[h][1].end.offset-o[h][1].start.offset===o[m][1].end.offset-o[m][1].start.offset){o[h][1].type="strikethroughSequence",o[m][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},o[m][1].start),end:Object.assign({},o[h][1].end)},p={type:"strikethroughText",start:Object.assign({},o[m][1].end),end:Object.assign({},o[h][1].start)},b=[["enter",x,d],["enter",o[m][1],d],["exit",o[m][1],d],["enter",p,d]],v=d.parser.constructs.insideSpan.null;v&&Wn(b,b.length,0,Kd(v,o.slice(m+1,h),d)),Wn(b,b.length,0,[["exit",p,d],["enter",o[h][1],d],["exit",o[h][1],d],["exit",x,d]]),Wn(o,m-1,h-m+3,b),h=m+b.length-2;break}}for(h=-1;++h<o.length;)o[h][1].type==="strikethroughSequenceTemporary"&&(o[h][1].type="data");return o}function c(o,d,h){const m=this.previous,x=this.events;let p=0;return b;function b(S){return m===126&&x[x.length-1][1].type!=="characterEscape"?h(S):(o.enter("strikethroughSequenceTemporary"),v(S))}function v(S){const z=uo(m);if(S===126)return p>1?h(S):(o.consume(S),p++,v);if(p<2&&!n)return h(S);const E=o.exit("strikethroughSequenceTemporary"),_=uo(S);return E._open=!_||_===2&&!!z,E._close=!z||z===2&&!!_,d(S)}}}class i7{constructor(){this.map=[]}add(t,n,a){s7(this,t,n,a)}consume(t){if(this.map.sort(function(c,o){return c[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const c of s)t.push(c);s=a.pop()}this.map.length=0}}function s7(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function o7(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=a.length-1;a[c]=a[c]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function l7(){return{flow:{null:{name:"table",tokenize:c7,resolveAll:u7}}}}function c7(e,t,n){const a=this;let s=0,c=0,o;return d;function d(I){let te=a.events.length-1;for(;te>-1;){const oe=a.events[te][1].type;if(oe==="lineEnding"||oe==="linePrefix")te--;else break}const le=te>-1?a.events[te][1].type:null,ne=le==="tableHead"||le==="tableRow"?M:h;return ne===M&&a.parser.lazy[a.now().line]?n(I):ne(I)}function h(I){return e.enter("tableHead"),e.enter("tableRow"),m(I)}function m(I){return I===124||(o=!0,c+=1),x(I)}function x(I){return I===null?n(I):_e(I)?c>1?(c=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),v):n(I):Ve(I)?Xe(e,x,"whitespace")(I):(c+=1,o&&(o=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,x):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||pt(I)?(e.exit("data"),x(I)):(e.consume(I),I===92?b:p)}function b(I){return I===92||I===124?(e.consume(I),p):p(I)}function v(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,Ve(I)?Xe(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):S(I))}function S(I){return I===45||I===58?E(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),z):D(I)}function z(I){return Ve(I)?Xe(e,E,"whitespace")(I):E(I)}function E(I){return I===58?(c+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):I===45?(c+=1,_(I)):I===null||_e(I)?P(I):D(I)}function _(I){return I===45?(e.enter("tableDelimiterFiller"),A(I)):D(I)}function A(I){return I===45?(e.consume(I),A):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(I))}function N(I){return Ve(I)?Xe(e,P,"whitespace")(I):P(I)}function P(I){return I===124?S(I):I===null||_e(I)?!o||s!==c?D(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):D(I)}function D(I){return n(I)}function M(I){return e.enter("tableRow"),V(I)}function V(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),V):I===null||_e(I)?(e.exit("tableRow"),t(I)):Ve(I)?Xe(e,V,"whitespace")(I):(e.enter("data"),U(I))}function U(I){return I===null||I===124||pt(I)?(e.exit("data"),V(I)):(e.consume(I),I===92?K:U)}function K(I){return I===92||I===124?(e.consume(I),U):U(I)}}function u7(e,t){let n=-1,a=!0,s=0,c=[0,0,0,0],o=[0,0,0,0],d=!1,h=0,m,x,p;const b=new i7;for(;++n<e.length;){const v=e[n],S=v[1];v[0]==="enter"?S.type==="tableHead"?(d=!1,h!==0&&(Zw(b,t,h,m,x),x=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(n,0,[["enter",m,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,p=void 0,c=[0,0,0,0],o=[0,n+1,0,0],d&&(d=!1,x={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(n,0,[["enter",x,t]])),s=S.type==="tableDelimiterRow"?2:x?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,o[2]===0&&(c[1]!==0&&(o[0]=o[1],p=Yu(b,t,c,s,void 0,p),c=[0,0,0,0]),o[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(c[1]!==0&&(o[0]=o[1],p=Yu(b,t,c,s,void 0,p)),c=o,o=[c[1],n,0,0])):S.type==="tableHead"?(d=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,c[1]!==0?(o[0]=o[1],p=Yu(b,t,c,s,n,p)):o[1]!==0&&(p=Yu(b,t,o,s,n,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(o[3]=n)}for(h!==0&&Zw(b,t,h,m,x),b.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=o7(t.events,n))}return e}function Yu(e,t,n,a,s,c){const o=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(c.end=Object.assign({},Fs(t.events,n[0])),e.add(n[0],0,[["exit",c,t]]));const h=Fs(t.events,n[1]);if(c={type:o,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",c,t]]),n[2]!==0){const m=Fs(t.events,n[2]),x=Fs(t.events,n[3]),p={type:d,start:Object.assign({},m),end:Object.assign({},x)};if(e.add(n[2],0,[["enter",p,t]]),a!==2){const b=t.events[n[2]],v=t.events[n[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,z=n[3]-n[2]-1;e.add(S,z,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(c.end=Object.assign({},Fs(t.events,s)),e.add(s,0,[["exit",c,t]]),c=void 0),c}function Zw(e,t,n,a,s){const c=[],o=Fs(t.events,n);s&&(s.end=Object.assign({},o),c.push(["exit",s,t])),a.end=Object.assign({},o),c.push(["exit",a,t]),e.add(n+1,0,c)}function Fs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const d7={name:"tasklistCheck",tokenize:h7};function f7(){return{text:{91:d7}}}function h7(e,t,n){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return pt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),o):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),o):n(h)}function o(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(h)}function d(h){return _e(h)?t(h):Ve(h)?e.check({tokenize:m7},t,n)(h):n(h)}}function m7(e,t,n){return Xe(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function p7(e){return U_([IU(),KU(),a7(e),l7(),f7()])}const x7={};function g7(e){const t=this,n=e||x7,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),c=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(p7(n)),c.push($U()),o.push(LU(n))}function Fw(e){if(e==null)return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}const y7=({group:e})=>{const[t,n]=j.useState(!1),a=e.result!==null,s=e.result?.content??"",c=s.startsWith("Error")||s.startsWith("❌");return u.jsxs("div",{className:"rounded-lg border border-gray-300 dark:border-matrix-primary/70 bg-white dark:bg-black overflow-hidden text-sm mb-1",children:[u.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors",children:[u.jsx(dc,{size:12,className:"text-amber-500 dark:text-amber-400/80 flex-shrink-0"}),u.jsx("span",{className:"flex-1 font-mono text-xs text-gray-600 dark:text-matrix-secondary/80 truncate",children:e.call.name}),a?c?u.jsx(ei,{size:12,className:"text-red-500 dark:text-red-400 flex-shrink-0"}):u.jsx(vo,{size:12,className:"text-emerald-500 dark:text-emerald-400 flex-shrink-0"}):u.jsx(cc,{size:12,className:"text-gray-400 animate-spin flex-shrink-0"}),u.jsx(bo,{size:12,className:`text-gray-400 dark:text-matrix-secondary/40 flex-shrink-0 transition-transform duration-200 ${t?"rotate-180":""}`})]}),u.jsx(Ag,{initial:!1,children:t&&u.jsx($e.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15,ease:"easeInOut"},className:"overflow-hidden",children:u.jsxs("div",{className:"px-3 pb-2.5 pt-1 border-t border-gray-100 dark:border-matrix-primary/20 space-y-2",children:[Object.keys(e.call.args??{}).length>0&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"args"}),u.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 whitespace-pre-wrap break-all bg-gray-50 dark:bg-zinc-900 rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 max-h-36 overflow-y-auto",children:Fw(e.call.args)})]}),a&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"result"}),u.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 whitespace-pre-wrap break-all bg-gray-50 dark:bg-zinc-900 rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 max-h-44 overflow-y-auto",children:Fw(s)})]})]})})})]})},b7={apoc_delegate:{label:"Apoc",emoji:"🧑‍🔬",colorClass:"text-amber-600 dark:text-amber-400",bgClass:"bg-amber-50 dark:bg-amber-900/10"},neo_delegate:{label:"Neo",emoji:"🥷",colorClass:"text-violet-600 dark:text-violet-400",bgClass:"bg-violet-50 dark:bg-violet-900/10"},trinity_delegate:{label:"Trinity",emoji:"👩‍💻",colorClass:"text-teal-600 dark:text-teal-400",bgClass:"bg-teal-50 dark:bg-teal-900/10"},smith_delegate:{label:"Smith",emoji:"🕶️",colorClass:"text-gray-500 dark:text-gray-400",bgClass:"bg-gray-50 dark:bg-zinc-900"}};function bp(e){return e?.task??e?.prompt??""}function v7(e){if(typeof e!="string")return String(e);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const k7=({group:e})=>{const[t,n]=j.useState(!1),a=b7[e.call.name]??{label:e.call.name,emoji:"🤖",colorClass:"text-gray-500",bgClass:"bg-gray-50 dark:bg-zinc-900"},s=e.result!==null,c=e.result?.content??"",o=c.startsWith("❌")||c.toLowerCase().startsWith("error"),d=bp(e.call.args).slice(0,100),h=e.call.args?.smith??null;return u.jsxs("div",{className:`rounded-lg border border-gray-300 dark:border-matrix-primary/70 overflow-hidden text-sm mb-1 ${a.bgClass}`,children:[u.jsxs("button",{onClick:()=>n(!t),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:brightness-95 dark:hover:brightness-110 transition-all",children:[u.jsx("span",{className:"text-base flex-shrink-0 leading-none",children:a.emoji}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:`text-xs font-semibold ${a.colorClass}`,children:[a.label,h?` · ${h}`:""]}),d&&u.jsx("div",{className:"text-xs text-gray-500 dark:text-matrix-secondary/60 truncate mt-0.5",children:d})]}),s?o?u.jsx(ei,{size:14,className:"text-red-500 dark:text-red-400 flex-shrink-0"}):u.jsx(vo,{size:14,className:"text-emerald-500 dark:text-emerald-400 flex-shrink-0"}):u.jsx(cc,{size:14,className:"text-gray-400 animate-spin flex-shrink-0"}),u.jsx(bo,{size:13,className:`text-gray-400 dark:text-matrix-secondary/40 flex-shrink-0 transition-transform duration-200 ${t?"rotate-180":""}`})]}),u.jsx(Ag,{initial:!1,children:t&&u.jsx($e.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeInOut"},className:"overflow-hidden",children:u.jsxs("div",{className:"px-3 pb-2.5 pt-1 border-t border-gray-200 dark:border-matrix-primary/20 space-y-2",children:[bp(e.call.args)&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"task"}),u.jsx("p",{className:"text-xs text-gray-600 dark:text-matrix-secondary/80 bg-white dark:bg-black rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 whitespace-pre-wrap",children:bp(e.call.args)})]}),s&&u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] text-gray-400 dark:text-matrix-secondary/40 uppercase tracking-wider mb-1",children:"result"}),u.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 whitespace-pre-wrap break-all bg-white dark:bg-black rounded-md p-2 border border-gray-100 dark:border-matrix-primary/20 max-h-56 overflow-y-auto",children:v7(c)})]})]})})})]})};function w7(e){return e==null||e===0?null:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Hw(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const S7=({message:e})=>{const t=e.usage_metadata,n=t?.input_tokens??t?.prompt_tokens??0,a=t?.output_tokens??t?.completion_tokens??0,s=n>0||a>0,c=w7(e.duration_ms),o=e.model;if(!s&&!c&&!o)return null;const d=o?(o.includes(":")?o.split(":").pop():o)?.split("-").slice(0,4).join("-")??o:null;return u.jsxs("div",{className:"mt-2 pt-1.5 border-t border-gray-100 dark:border-matrix-primary/20 flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[d&&u.jsx("span",{className:"text-[11px] font-mono text-gray-400 dark:text-matrix-secondary/40 truncate max-w-[180px]",title:o??"",children:d}),s&&u.jsxs("span",{className:"text-[11px] font-mono text-gray-400 dark:text-matrix-secondary/40",children:["↑",Hw(n)," ↓",Hw(a)]}),c&&u.jsx("span",{className:"text-[11px] font-mono text-gray-400 dark:text-matrix-secondary/40",children:c})]})};function z7(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function j7(e){return e.session_id?.startsWith("sati-evaluation-")===!0||e.tool_name?.toLowerCase().includes("sati")===!0}const _7=({message:e})=>{const[t,n]=j.useState(!1),a=j7(e),s=a?e.tool_name==="sati_evaluation_output"?"Sati · memory update":"Sati · analysis":e.tool_name??"tool result";return u.jsxs("details",{open:t,onToggle:c=>n(c.target.open),className:"w-full",children:[u.jsxs("summary",{className:"list-none cursor-pointer select-none flex items-center gap-2 text-xs text-gray-400 dark:text-matrix-secondary/40 hover:text-gray-500 dark:hover:text-matrix-secondary/60 transition-colors py-0.5",children:[u.jsx("div",{className:"flex-1 h-px bg-gray-200 dark:bg-matrix-primary/20"}),u.jsxs("span",{className:"flex items-center gap-1.5 whitespace-nowrap px-2",children:[u.jsx("span",{children:a?"🧠":"🔧"}),u.jsx("span",{children:s}),u.jsx(bo,{size:11,className:`transition-transform duration-200 ${t?"rotate-180":""}`})]}),u.jsx("div",{className:"flex-1 h-px bg-gray-200 dark:bg-matrix-primary/20"})]}),t&&u.jsx("pre",{className:"mt-2 px-3 py-2.5 whitespace-pre-wrap break-all text-xs font-mono text-gray-600 dark:text-matrix-secondary/80 border border-gray-300 dark:border-matrix-primary/60 rounded-lg bg-gray-50 dark:bg-zinc-900 max-h-48 overflow-y-auto",children:z7(e.content)})]})},N7={table:({children:e})=>u.jsx("div",{className:"my-2 overflow-x-auto rounded-lg border border-gray-200 dark:border-matrix-primary/60",children:u.jsx("table",{className:"min-w-full text-xs border-collapse",children:e})}),thead:({children:e})=>u.jsx("thead",{className:"bg-gray-100 dark:bg-zinc-900 text-gray-600 dark:text-matrix-secondary/70",children:e}),tbody:({children:e})=>u.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-matrix-primary/20",children:e}),tr:({children:e})=>u.jsx("tr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors",children:e}),th:({children:e})=>u.jsx("th",{className:"px-3 py-2 text-left font-semibold whitespace-nowrap border-b border-gray-200 dark:border-matrix-primary/40",children:e}),td:({children:e})=>u.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-matrix-secondary align-top",children:e})},C7=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a,activeSession:s,onToggleSidebar:c})=>{const[o,d]=j.useState(""),h=j.useRef(null),m=j.useRef(null);j.useEffect(()=>{h.current?.scrollIntoView({behavior:"smooth"})},[e,n]),j.useEffect(()=>{const b=m.current;b&&(b.style.height="auto",b.style.height=b.scrollHeight+"px")},[o]);const x=()=>{!o.trim()||n||(t(o.trim()),d(""),m.current&&(m.current.style.height="auto"))},p=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),x())};return u.jsxs("div",{className:"flex-1 flex flex-col h-full bg-white dark:bg-black overflow-hidden transition-colors duration-300",children:[c&&u.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 shrink-0 bg-white dark:bg-black border-b border-gray-300 dark:border-matrix-primary",children:[u.jsx("button",{onClick:c,className:"p-2 -ml-1 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary transition-colors","aria-label":"Open sessions",children:u.jsx(Nz,{size:20})}),u.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-matrix-highlight truncate flex-1",children:s?.title??(a?"Chat":"Morpheus")})]}),a?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-4 py-5 space-y-4",children:[T$(e).map(b=>{const{message:v,toolGroups:S}=b;if(v.type==="tool")return u.jsx("div",{className:"px-2 py-0.5",children:u.jsx(_7,{message:v})},b.index);const z=v.type==="human";return u.jsxs("div",{className:`flex items-end gap-2.5 ${z?"justify-end":"justify-start"}`,children:[!z&&u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight mb-0.5",children:u.jsx(ld,{size:14})}),u.jsxs("div",{className:`
51
- max-w-[85%] md:max-w-[72%] min-w-0
52
- ${z?"bg-azure-primary text-white dark:bg-matrix-primary dark:text-black rounded-2xl rounded-br-sm px-4 py-2.5":"bg-gray-50 dark:bg-zinc-900 border border-gray-300 dark:border-matrix-primary/60 text-gray-800 dark:text-matrix-secondary rounded-2xl rounded-bl-sm px-4 py-3"}
53
- `,children:[z&&u.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:v.content}),v.type==="ai"&&u.jsxs(u.Fragment,{children:[S&&S.length>0&&u.jsx("div",{className:"mb-2.5 space-y-1",children:S.map(E=>C$(E.call.name)?u.jsx(k7,{group:E},E.call.id):u.jsx(y7,{group:E},E.call.id))}),v.content&&u.jsx("div",{className:`
54
- prose prose-sm dark:prose-invert max-w-none
55
- prose-p:my-1.5 prose-p:leading-relaxed
56
- prose-headings:my-2 prose-headings:font-semibold
57
- prose-ul:my-1.5 prose-ol:my-1.5 prose-li:my-0.5
58
- prose-pre:my-2 prose-pre:rounded-lg prose-pre:text-xs
59
- prose-code:text-[0.8em] prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:font-mono
60
- prose-table:my-0 prose-thead:border-0 prose-tbody:border-0
61
- prose-tr:border-0 prose-th:p-0 prose-td:p-0
62
- dark:prose-p:text-matrix-secondary
63
- dark:prose-headings:text-matrix-highlight
64
- dark:prose-strong:text-matrix-highlight
65
- dark:prose-li:text-matrix-secondary
66
- dark:prose-code:text-matrix-highlight dark:prose-code:bg-black/60
67
- dark:prose-pre:bg-black dark:prose-pre:border dark:prose-pre:border-matrix-primary/30
68
- `,children:u.jsx(aP,{remarkPlugins:[g7],components:N7,children:v.content})}),u.jsx(S7,{message:v})]})]}),z&&u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center bg-gray-200 dark:bg-matrix-primary/30 text-gray-500 dark:text-matrix-secondary mb-0.5",children:u.jsx(Xx,{size:14})})]},b.index)}),n&&u.jsxs("div",{className:"flex items-end gap-2.5 justify-start",children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight mb-0.5",children:u.jsx(ld,{size:14})}),u.jsxs("div",{className:"bg-gray-50 dark:bg-zinc-900 border border-gray-300 dark:border-matrix-primary/60 rounded-2xl rounded-bl-sm px-4 py-3 flex items-center gap-1.5",children:[u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-azure-primary dark:bg-matrix-highlight animate-bounce",style:{animationDelay:"0ms"}}),u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-azure-primary dark:bg-matrix-highlight animate-bounce",style:{animationDelay:"160ms"}}),u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-azure-primary dark:bg-matrix-highlight animate-bounce",style:{animationDelay:"320ms"}})]})]}),u.jsx("div",{ref:h})]}),u.jsxs("div",{className:"shrink-0 px-4 pt-3 pb-4 bg-white dark:bg-black border-t border-gray-300 dark:border-matrix-primary",children:[u.jsxs("form",{onSubmit:b=>{b.preventDefault(),x()},className:"max-w-3xl mx-auto flex items-end gap-2",children:[u.jsx("textarea",{ref:m,value:o,onChange:b=>d(b.target.value),onKeyDown:p,placeholder:"Message Morpheus…",rows:1,disabled:n,className:`
69
- flex-1 resize-none max-h-40 overflow-y-auto
70
- bg-gray-100 dark:bg-zinc-900
71
- border border-gray-300 dark:border-matrix-primary/60
72
- rounded-xl px-4 py-3
73
- text-sm leading-relaxed
74
- text-gray-800 dark:text-matrix-secondary
75
- placeholder-gray-400 dark:placeholder-matrix-secondary/40
76
- focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-transparent
77
- disabled:opacity-50
78
- transition-all duration-200
79
- `}),u.jsx("button",{type:"submit",disabled:!o.trim()||n,className:"flex-shrink-0 p-3 rounded-xl bg-azure-primary text-white dark:bg-matrix-secondary dark:text-black hover:bg-azure-secondary dark:hover:bg-matrix-highlight disabled:opacity-40 disabled:cursor-not-allowed transition-colors shadow-sm",children:u.jsx(I5,{size:18})})]}),u.jsx("p",{className:"mt-1.5 text-center text-[11px] text-gray-300 dark:text-matrix-secondary/25 select-none",children:"Enter to send · Shift+Enter for newline"})]})]}):u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-5 p-8 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-2xl bg-azure-primary/10 dark:bg-matrix-primary/10 flex items-center justify-center",children:u.jsx(ld,{size:30,className:"text-azure-primary/60 dark:text-matrix-highlight/50"})}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("h3",{className:"text-base font-semibold text-gray-700 dark:text-matrix-highlight",children:"Morpheus is ready"}),u.jsx("p",{className:"text-sm text-gray-400 dark:text-matrix-secondary/60 max-w-[240px] leading-relaxed",children:"Select a session from the sidebar or start a new chat."})]})]})]})};function T2({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:c="Confirm",variant:o="default"}){return u.jsx(Ir,{open:e,onOpenChange:t,children:u.jsxs(co,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[u.jsx(Br,{children:u.jsx(Vr,{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($$,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[u.jsx(xr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),u.jsx(xr,{variant:o,onClick:()=>{n(),t()},className:o==="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 T7=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(null),[s,c]=j.useState([]),[o,d]=j.useState(!1),[h,m]=j.useState(()=>typeof window<"u"?window.innerWidth>=768:!0),x=j.useRef(!1);j.useEffect(()=>{x.current=o},[o]),j.useEffect(()=>{if(!n)return;const M=setInterval(async()=>{if(!x.current)try{const U=(await ua.getMessages(n)).filter(K=>K.type!=="system");c(K=>{if(U.length!==K.length)return U;const I=U.at(-1)?.created_at??0,te=K.at(-1)?.created_at??0;return I>te?U:K})}catch{}},3e3);return()=>clearInterval(M)},[n]);const[p,b]=j.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),v=async()=>{try{const M=await ua.getSessions();t(M)}catch(M){console.error("Failed to load sessions:",M)}};j.useEffect(()=>{v()},[]),j.useEffect(()=>{n?(S(n),sessionStorage.setItem("morpheus.chat.uiSessionId",n)):c([])},[n]);const S=async M=>{try{const V=await ua.getMessages(M);c(V.filter(U=>U.type!=="system"))}catch(V){console.error("Failed to load messages:",V)}},z=async()=>{try{const M=await ua.createSession();await v(),a(M.id),window.innerWidth<768&&m(!1)}catch(M){console.error("Failed to create session:",M)}},E=M=>{a(M),window.innerWidth<768&&m(!1)},_=async M=>{if(!n)return;const V={type:"human",content:M};c(U=>[...U,V]),d(!0);try{await ua.sendMessage(n,M),await S(n),await v()}catch(U){console.error("Failed to send message:",U)}finally{d(!1)}},A=M=>{b({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await ua.archiveSession(M),n===M&&a(null),await v()}catch(V){console.error("Failed to archive session:",V)}}})},N=M=>{b({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await ua.deleteSession(M),n===M&&a(null),await v()}catch(V){console.error("Failed to delete session:",V)}}})},P=async(M,V)=>{try{await ua.renameSession(M,V),await v()}catch(U){console.error("Failed to rename session:",U)}},D=e.find(M=>M.id===n)??null;return u.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-white dark:bg-black relative",children:[h&&u.jsx("div",{className:"fixed inset-0 bg-black/40 z-20 md:hidden",onClick:()=>m(!1)}),u.jsx("div",{className:`
80
- fixed top-16 bottom-0 left-0 z-40 flex
81
- md:relative md:inset-auto md:z-auto md:translate-x-0
82
- transition-transform duration-300 ease-out
83
- ${h?"translate-x-0":"-translate-x-full"}
84
- `,children:u.jsx(G$,{sessions:e,activeSessionId:n,onSelectSession:E,onCreateSession:z,onArchiveSession:A,onDeleteSession:N,onRenameSession:P,isOpen:h,toggleSidebar:()=>m(!h)})}),u.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden min-w-0",children:u.jsx(C7,{messages:s,onSendMessage:_,isLoading:o,activeSessionId:n,activeSession:D,onToggleSidebar:()=>m(!h)})}),u.jsx(T2,{isOpen:p.isOpen,onClose:()=>b(M=>({...M,isOpen:!1})),onConfirm:p.onConfirm,title:p.title,description:p.description,confirmJson:p.confirmJson,variant:p.variant})]})};function E7(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return We(`/chronos${n}`,()=>xe.get(`/chronos${n}`))}function A7(e,t=50){return We(e?`/chronos/${e}/executions?limit=${t}`:null,()=>xe.get(`/chronos/${e}/executions?limit=${t}`))}function E2(){return We("/config/chronos",()=>xe.get("/config/chronos"))}const Vi={createJob:e=>xe.post("/chronos",e),updateJob:(e,t)=>xe.put(`/chronos/${e}`,t),deleteJob:e=>xe.delete(`/chronos/${e}`),enableJob:e=>xe.patch(`/chronos/${e}/enable`,{}),disableJob:e=>xe.patch(`/chronos/${e}/disable`,{}),getConfig:()=>xe.get("/config/chronos"),updateConfig:e=>xe.post("/config/chronos",e),preview:(e,t,n)=>xe.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function zn({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 O7=(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},M7=(e,t)=>({classGroupId:e,validator:t}),A2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Od="-",qw=[],D7="arbitrary..",R7=e=>{const t=L7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return $7(o);const d=o.split(Od),h=d[0]===""&&d.length>1?1:0;return O2(d,h,t)},getConflictingClassGroupIds:(o,d)=>{if(d){const h=a[o],m=n[o];return h?m?O7(m,h):h:m||qw}return n[o]||qw}}},O2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],c=n.nextPart.get(s);if(c){const m=O2(e,t+1,c);if(m)return m}const o=n.validators;if(o===null)return;const d=t===0?e.join(Od):e.slice(t).join(Od),h=o.length;for(let m=0;m<h;m++){const x=o[m];if(x.validator(d))return x.classGroupId}},$7=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?D7+a:void 0})(),L7=e=>{const{theme:t,classGroups:n}=e;return P7(n,t)},P7=(e,t)=>{const n=A2();for(const a in e){const s=e[a];Qg(s,n,a,t)}return n},Qg=(e,t,n,a)=>{const s=e.length;for(let c=0;c<s;c++){const o=e[c];U7(o,t,n,a)}},U7=(e,t,n,a)=>{if(typeof e=="string"){I7(e,t,n);return}if(typeof e=="function"){B7(e,t,n,a);return}V7(e,t,n,a)},I7=(e,t,n)=>{const a=e===""?t:M2(t,e);a.classGroupId=n},B7=(e,t,n,a)=>{if(Z7(e)){Qg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(M7(n,e))},V7=(e,t,n,a)=>{const s=Object.entries(e),c=s.length;for(let o=0;o<c;o++){const[d,h]=s[o];Qg(h,M2(t,d),n,a)}},M2=(e,t)=>{let n=e;const a=t.split(Od),s=a.length;for(let c=0;c<s;c++){const o=a[c];let d=n.nextPart.get(o);d||(d=A2(),n.nextPart.set(o,d)),n=d}return n},Z7=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,F7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(c,o)=>{n[c]=o,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(c){let o=n[c];if(o!==void 0)return o;if((o=a[c])!==void 0)return s(c,o),o},set(c,o){c in n?n[c]=o:s(c,o)}}},Ax="!",Gw=":",H7=[],Yw=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),q7=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const c=[];let o=0,d=0,h=0,m;const x=s.length;for(let z=0;z<x;z++){const E=s[z];if(o===0&&d===0){if(E===Gw){c.push(s.slice(h,z)),h=z+1;continue}if(E==="/"){m=z;continue}}E==="["?o++:E==="]"?o--:E==="("?d++:E===")"&&d--}const p=c.length===0?s:s.slice(h);let b=p,v=!1;p.endsWith(Ax)?(b=p.slice(0,-1),v=!0):p.startsWith(Ax)&&(b=p.slice(1),v=!0);const S=m&&m>h?m-h:void 0;return Yw(c,v,b,S)};if(t){const s=t+Gw,c=a;a=o=>o.startsWith(s)?c(o.slice(s.length)):Yw(H7,!1,o,void 0,!0)}if(n){const s=a;a=c=>n({className:c,parseClassName:s})}return a},G7=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 o=n[c],d=o[0]==="[",h=t.has(o);d||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(o)):s.push(o)}return s.length>0&&(s.sort(),a.push(...s)),a}},Y7=e=>({cache:F7(e.cacheSize),parseClassName:q7(e),sortModifiers:G7(e),...R7(e)}),J7=/\s+/,K7=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:c}=t,o=[],d=e.trim().split(J7);let h="";for(let m=d.length-1;m>=0;m-=1){const x=d[m],{isExternal:p,modifiers:b,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:z}=n(x);if(p){h=x+(h.length>0?" "+h:h);continue}let E=!!z,_=a(E?S.substring(0,z):S);if(!_){if(!E){h=x+(h.length>0?" "+h:h);continue}if(_=a(S),!_){h=x+(h.length>0?" "+h:h);continue}E=!1}const A=b.length===0?"":b.length===1?b[0]:c(b).join(":"),N=v?A+Ax:A,P=N+_;if(o.indexOf(P)>-1)continue;o.push(P);const D=s(_,E);for(let M=0;M<D.length;++M){const V=D[M];o.push(N+V)}h=x+(h.length>0?" "+h:h)}return h},X7=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=D2(n))&&(s&&(s+=" "),s+=a);return s},D2=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=D2(e[a]))&&(n&&(n+=" "),n+=t);return n},Q7=(e,...t)=>{let n,a,s,c;const o=h=>{const m=t.reduce((x,p)=>p(x),e());return n=Y7(m),a=n.cache.get,s=n.cache.set,c=d,d(h)},d=h=>{const m=a(h);if(m)return m;const x=K7(h,n);return s(h,x),x};return c=o,(...h)=>c(X7(...h))},W7=[],Wt=e=>{const t=n=>n[e]||W7;return t.isThemeGetter=!0,t},R2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eI=/^\d+\/\d+$/,tI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nI=/\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$/,rI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bs=e=>eI.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>!!e&&Number.isInteger(Number(e)),vp=e=>e.endsWith("%")&&Le(e.slice(0,-1)),ca=e=>tI.test(e),sI=()=>!0,oI=e=>nI.test(e)&&!rI.test(e),L2=()=>!1,lI=e=>aI.test(e),cI=e=>iI.test(e),uI=e=>!be(e)&&!ve(e),dI=e=>_o(e,I2,L2),be=e=>R2.test(e),Di=e=>_o(e,B2,oI),kp=e=>_o(e,xI,Le),Jw=e=>_o(e,P2,L2),fI=e=>_o(e,U2,cI),Ju=e=>_o(e,V2,lI),ve=e=>$2.test(e),Ol=e=>No(e,B2),hI=e=>No(e,gI),Kw=e=>No(e,P2),mI=e=>No(e,I2),pI=e=>No(e,U2),Ku=e=>No(e,V2,!0),_o=(e,t,n)=>{const a=R2.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},No=(e,t,n=!1)=>{const a=$2.exec(e);return a?a[1]?t(a[1]):n:!1},P2=e=>e==="position"||e==="percentage",U2=e=>e==="image"||e==="url",I2=e=>e==="length"||e==="size"||e==="bg-size",B2=e=>e==="length",xI=e=>e==="number",gI=e=>e==="family-name",V2=e=>e==="shadow",yI=()=>{const e=Wt("color"),t=Wt("font"),n=Wt("text"),a=Wt("font-weight"),s=Wt("tracking"),c=Wt("leading"),o=Wt("breakpoint"),d=Wt("container"),h=Wt("spacing"),m=Wt("radius"),x=Wt("shadow"),p=Wt("inset-shadow"),b=Wt("text-shadow"),v=Wt("drop-shadow"),S=Wt("blur"),z=Wt("perspective"),E=Wt("aspect"),_=Wt("ease"),A=Wt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...P(),ve,be],M=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],U=()=>[ve,be,h],K=()=>[Bs,"full","auto",...U()],I=()=>[Ga,"none","subgrid",ve,be],te=()=>["auto",{span:["full",Ga,ve,be]},Ga,ve,be],le=()=>[Ga,"auto",ve,be],ne=()=>["auto","min","max","fr",ve,be],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...U()],B=()=>[Bs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],Y=()=>[e,ve,be],ue=()=>[...P(),Kw,Jw,{position:[ve,be]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",mI,dI,{size:[ve,be]}],H=()=>[vp,Ol,Di],w=()=>["","none","full",m,ve,be],X=()=>["",Le,Ol,Di],me=()=>["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"],ge=()=>[Le,vp,Kw,Jw],Pe=()=>["","none",S,ve,be],Ee=()=>["none",Le,ve,be],yt=()=>["none",Le,ve,be],$=()=>[Le,ve,be],Oe=()=>[Bs,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ca],breakpoint:[ca],color:[sI],container:[ca],"drop-shadow":[ca],ease:["in","out","in-out"],font:[uI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ca],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ca],shadow:[ca],spacing:["px",Le],text:[ca],"text-shadow":[ca],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bs,be,ve,E]}],container:["container"],columns:[{columns:[Le,be,ve,d]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],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:[Ga,"auto",ve,be]}],basis:[{basis:[Bs,"full","auto",d,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Bs,"auto","initial","none",be]}],grow:[{grow:["",Le,ve,be]}],shrink:[{shrink:["",Le,ve,be]}],order:[{order:[Ga,"first","last","none",ve,be]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:te()}],"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":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],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:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[d,"screen",...B()]}],"min-w":[{"min-w":[d,"screen","none",...B()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[o]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,Ol,Di]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ve,kp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vp,be]}],"font-family":[{font:[hI,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":[Le,"none",ve,kp]}],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:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",ve,Di]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Le,"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:ue()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ga,ve,be],radial:["",ve,be],conic:[Ga,ve,be]},pI,fI]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:w()}],"rounded-s":[{"rounded-s":w()}],"rounded-e":[{"rounded-e":w()}],"rounded-t":[{"rounded-t":w()}],"rounded-r":[{"rounded-r":w()}],"rounded-b":[{"rounded-b":w()}],"rounded-l":[{"rounded-l":w()}],"rounded-ss":[{"rounded-ss":w()}],"rounded-se":[{"rounded-se":w()}],"rounded-ee":[{"rounded-ee":w()}],"rounded-es":[{"rounded-es":w()}],"rounded-tl":[{"rounded-tl":w()}],"rounded-tr":[{"rounded-tr":w()}],"rounded-br":[{"rounded-br":w()}],"rounded-bl":[{"rounded-bl":w()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,ve,be]}],"outline-w":[{outline:["",Le,Ol,Di]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",x,Ku,Ju]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",p,Ku,Ju]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Le,Di]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",b,Ku,Ju]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Le,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":[Le]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[ve,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,be]}],filter:[{filter:["","none",ve,be]}],blur:[{blur:Pe()}],brightness:[{brightness:[Le,ve,be]}],contrast:[{contrast:[Le,ve,be]}],"drop-shadow":[{"drop-shadow":["","none",v,Ku,Ju]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Le,ve,be]}],"hue-rotate":[{"hue-rotate":[Le,ve,be]}],invert:[{invert:["",Le,ve,be]}],saturate:[{saturate:[Le,ve,be]}],sepia:[{sepia:["",Le,ve,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,be]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Le,ve,be]}],"backdrop-contrast":[{"backdrop-contrast":[Le,ve,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,ve,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,ve,be]}],"backdrop-invert":[{"backdrop-invert":["",Le,ve,be]}],"backdrop-opacity":[{"backdrop-opacity":[Le,ve,be]}],"backdrop-saturate":[{"backdrop-saturate":[Le,ve,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,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:[Le,"initial",ve,be]}],ease:[{ease:["linear","initial",_,ve,be]}],delay:[{delay:[Le,ve,be]}],animate:[{animate:["none",A,ve,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[z,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:yt()}],"scale-x":[{"scale-x":yt()}],"scale-y":[{"scale-y":yt()}],"scale-z":[{"scale-z":yt()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],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:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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",...Y()]}],"stroke-w":[{stroke:[Le,Ol,Di,kp]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},no=Q7(yI);function Ye({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:no("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 pn({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:no("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(o=>u.jsx("option",{value:o.value,className:"bg-azure-bg dark:bg-black",children:o.label},o.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 Ft({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:no("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 Nr({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:no("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:no("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:no("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const tn={fetchConfig:async()=>xe.get("/config"),updateConfig:async e=>xe.post("/config",e),getSatiConfig:async()=>xe.get("/config/sati"),updateSatiConfig:async e=>xe.post("/config/sati",e),deleteSatiConfig:async()=>xe.delete("/config/sati"),getApocConfig:async()=>xe.get("/config/apoc"),updateApocConfig:async e=>xe.post("/config/apoc",e),deleteApocConfig:async()=>xe.delete("/config/apoc"),getNeoConfig:async()=>xe.get("/config/neo"),updateNeoConfig:async e=>xe.post("/config/neo",e),deleteNeoConfig:async()=>xe.delete("/config/neo"),getTrinityConfig:async()=>xe.get("/config/trinity"),updateTrinityConfig:async e=>xe.post("/config/trinity",e),deleteTrinityConfig:async()=>xe.delete("/config/trinity"),getEncryptionStatus:async()=>xe.get("/config/encryption-status"),getEnvOverrides:async()=>xe.get("/config/env-overrides"),getSmithsConfig:async()=>await xe.get("/smiths/config"),updateSmithsConfig:async e=>xe.put("/smiths/config",e),getSmithsList:async()=>xe.get("/smiths"),pingSmith:async e=>xe.post(`/smiths/${e}/ping`,{}),removeSmith:async e=>xe.delete(`/smiths/${e}`)};function re(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:o,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=o.prototype,x=Object.keys(m);for(let p=0;p<x.length;p++){const b=x[p];b in d||(d[b]=m[b].bind(d))}}const s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function o(d){var h;const m=n?.Parent?new c:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const x of m._zod.deferred)x();return m}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}let ro=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Z2=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const F2={};function ai(e){return F2}function H2(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 Ox(e,t){return typeof t=="bigint"?t.toString():t}function ef(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Wg(e){return e==null}function ey(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function bI(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,o=Number.parseInt(e.toFixed(c).replace(".","")),d=Number.parseInt(t.toFixed(c).replace(".",""));return o%d/10**c}const Xw=Symbol("evaluating");function at(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Xw)return a===void 0&&(a=Xw,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ki(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ci(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Qw(e){return JSON.stringify(e)}function vI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const q2="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const kI=ef(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function fo(e){if(nc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(nc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function G2(e){return fo(e)?{...e}:Array.isArray(e)?[...e]:e}const wI=new Set(["string","number","symbol"]);function ho(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ui(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 SI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const zI={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 jI(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=ci(e._zod.def,{get shape(){const o={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(o[d]=n.shape[d])}return Ki(this,"shape",o),o},checks:[]});return ui(e,c)}function _I(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=ci(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete o[d]}return Ki(this,"shape",o),o},checks:[]});return ui(e,c)}function NI(e,t){if(!fo(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 o in t)if(Object.getOwnPropertyDescriptor(c,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=ci(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ki(this,"shape",c),c}});return ui(e,s)}function CI(e,t){if(!fo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ci(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ki(this,"shape",a),a}});return ui(e,n)}function TI(e,t){const n=ci(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ki(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ui(e,n)}function EI(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 o=ci(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Ki(this,"shape",h),h},checks:[]});return ui(t,o)}function AI(e,t,n){const a=ci(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const o in n){if(!(o in c))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(c[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)c[o]=new e({type:"nonoptional",innerType:s[o]});return Ki(this,"shape",c),c}});return ui(t,a)}function Js(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 Ks(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Xu(e){return typeof e=="string"?e:e?.message}function ii(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Xu(e.inst?._zod.def?.error?.(e))??Xu(t?.error?.(e))??Xu(n.customError?.(e))??Xu(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ty(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const Y2=(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,Ox,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},J2=re("$ZodError",Y2),K2=re("$ZodError",Y2,{Parent:Error});function OI(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 MI(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(o=>a({issues:o}));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 o=n,d=0;for(;d<c.path.length;){const h=c.path[d];d===c.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(c))):o[h]=o[h]||{_errors:[]},o=o[h],d++}}};return a(e),n}const ny=e=>(t,n,a,s)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new ro;if(o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>ii(h,c,ai())));throw q2(d,s?.callee),d}return o.value},ry=e=>async(t,n,a,s)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise&&(o=await o),o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>ii(h,c,ai())));throw q2(d,s?.callee),d}return o.value},tf=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 ro;return c.issues.length?{success:!1,error:new(e??J2)(c.issues.map(o=>ii(o,s,ai())))}:{success:!0,data:c.value}},DI=tf(K2),nf=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(o=>ii(o,s,ai())))}:{success:!0,data:c.value}},RI=nf(K2),$I=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ny(e)(t,n,s)},LI=e=>(t,n,a)=>ny(e)(t,n,a),PI=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ry(e)(t,n,s)},UI=e=>async(t,n,a)=>ry(e)(t,n,a),II=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return tf(e)(t,n,s)},BI=e=>(t,n,a)=>tf(e)(t,n,a),VI=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return nf(e)(t,n,s)},ZI=e=>async(t,n,a)=>nf(e)(t,n,a),FI=/^[cC][^\s-]{8,}$/,HI=/^[0-9a-z]+$/,qI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,GI=/^[0-9a-vA-V]{20}$/,YI=/^[A-Za-z0-9]{27}$/,JI=/^[a-zA-Z0-9_-]{21}$/,KI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XI=/^([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})$/,Ww=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)$/,QI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eB(){return new RegExp(WI,"u")}const tB=/^(?:(?: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])$/,nB=/^(([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}|:))$/,rB=/^((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])$/,aB=/^(([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])$/,iB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X2=/^[A-Za-z0-9_-]*$/,sB=/^\+[1-9]\d{6,14}$/,Q2="(?:(?:\\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])))",oB=new RegExp(`^${Q2}$`);function W2(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 lB(e){return new RegExp(`^${W2(e)}$`)}function cB(e){const t=W2({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(`^${Q2}T(?:${a})$`)}const uB=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},dB=/^-?\d+$/,eN=/^-?\d+(?:\.\d+)?$/,fB=/^(?:true|false)$/i,hB=/^[^A-Z]*$/,mB=/^[^a-z]*$/,Zn=re("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tN={number:"number",bigint:"bigint",object:"date"},nN=re("$ZodCheckLessThan",(e,t)=>{Zn.init(e,t);const n=tN[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})}}),rN=re("$ZodCheckGreaterThan",(e,t)=>{Zn.init(e,t);const n=tN[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})}}),pB=re("$ZodCheckMultipleOf",(e,t)=>{Zn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):bI(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})}}),xB=re("$ZodCheckNumberFormat",(e,t)=>{Zn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,c]=zI[t.format];e._zod.onattach.push(o=>{const d=o._zod.bag;d.format=t.format,d.minimum=s,d.maximum=c,n&&(d.pattern=dB)}),e._zod.check=o=>{const d=o.value;if(n){if(!Number.isInteger(d)){o.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?o.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):o.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}d<s&&o.issues.push({origin:"number",input:d,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),d>c&&o.issues.push({origin:"number",input:d,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),gB=re("$ZodCheckMaxLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Wg(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 o=ty(s);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),yB=re("$ZodCheckMinLength",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Wg(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 o=ty(s);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),bB=re("$ZodCheckLengthEquals",(e,t)=>{var n;Zn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Wg(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 o=ty(s),d=c>t.length;a.issues.push({origin:o,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),rf=re("$ZodCheckStringFormat",(e,t)=>{var n,a;Zn.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=()=>{})}),vB=re("$ZodCheckRegex",(e,t)=>{rf.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})}}),kB=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=hB),rf.init(e,t)}),wB=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=mB),rf.init(e,t)}),SB=re("$ZodCheckIncludes",(e,t)=>{Zn.init(e,t);const n=ho(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})}}),zB=re("$ZodCheckStartsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`^${ho(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})}}),jB=re("$ZodCheckEndsWith",(e,t)=>{Zn.init(e,t);const n=new RegExp(`.*${ho(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})}}),_B=re("$ZodCheckOverwrite",(e,t)=>{Zn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let NB=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(`
85
- `).filter(o=>o),s=Math.min(...a.map(o=>o.length-o.trimStart().length)),c=a.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of c)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,s.join(`
86
- `))}};const CB={major:4,minor:3,patch:6},Tt=re("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=CB;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=(o,d,h)=>{let m=Js(o),x;for(const p of d){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(m)continue;const b=o.issues.length,v=p._zod.check(o);if(v instanceof Promise&&h?.async===!1)throw new ro;if(x||v instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await v,o.issues.length!==b&&(m||(m=Js(o,b)))});else{if(o.issues.length===b)continue;m||(m=Js(o,b))}}return x?x.then(()=>o):o},c=(o,d,h)=>{if(Js(o))return o.aborted=!0,o;const m=s(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new ro;return m.then(x=>e._zod.parse(x,h))}return e._zod.parse(m,h)};e._zod.run=(o,d)=>{if(d.skipChecks)return e._zod.parse(o,d);if(d.direction==="backward"){const m=e._zod.parse({value:o.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(x=>c(x,o,d)):c(m,o,d)}const h=e._zod.parse(o,d);if(h instanceof Promise){if(d.async===!1)throw new ro;return h.then(m=>s(m,a,d))}return s(h,a,d)}}at(e,"~standard",()=>({validate:s=>{try{const c=DI(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return RI(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ay=re("$ZodString",(e,t)=>{Tt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??uB(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=re("$ZodStringFormat",(e,t)=>{rf.init(e,t),ay.init(e,t)}),TB=re("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=XI),_t.init(e,t)}),EB=re("$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=Ww(a))}else t.pattern??(t.pattern=Ww());_t.init(e,t)}),AB=re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=QI),_t.init(e,t)}),OB=re("$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})}}}),MB=re("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=eB()),_t.init(e,t)}),DB=re("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=JI),_t.init(e,t)}),RB=re("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=FI),_t.init(e,t)}),$B=re("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=HI),_t.init(e,t)}),LB=re("$ZodULID",(e,t)=>{t.pattern??(t.pattern=qI),_t.init(e,t)}),PB=re("$ZodXID",(e,t)=>{t.pattern??(t.pattern=GI),_t.init(e,t)}),UB=re("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=YI),_t.init(e,t)}),IB=re("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cB(t)),_t.init(e,t)}),BB=re("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oB),_t.init(e,t)}),VB=re("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=lB(t)),_t.init(e,t)}),ZB=re("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=KI),_t.init(e,t)}),FB=re("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tB),_t.init(e,t),e._zod.bag.format="ipv4"}),HB=re("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=nB),_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})}}}),qB=re("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=rB),_t.init(e,t)}),GB=re("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=aB),_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 o=Number(c);if(`${o}`!==c)throw new Error;if(o<0||o>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 aN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const YB=re("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=iB),_t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{aN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function JB(e){if(!X2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return aN(n)}const KB=re("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=X2),_t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{JB(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),XB=re("$ZodE164",(e,t)=>{t.pattern??(t.pattern=sB),_t.init(e,t)});function QB(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 WB=re("$ZodJWT",(e,t)=>{_t.init(e,t),e._zod.check=n=>{QB(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),iN=re("$ZodNumber",(e,t)=>{Tt.init(e,t),e._zod.pattern=e._zod.bag.pattern??eN,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}}),eV=re("$ZodNumberFormat",(e,t)=>{xB.init(e,t),iN.init(e,t)}),tV=re("$ZodBoolean",(e,t)=>{Tt.init(e,t),e._zod.pattern=fB,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}}),nV=re("$ZodUnknown",(e,t)=>{Tt.init(e,t),e._zod.parse=n=>n}),rV=re("$ZodNever",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function eS(e,t,n){e.issues.length&&t.issues.push(...Ks(n,e.issues)),t.value[n]=e.value}const aV=re("$ZodArray",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const c=[];for(let o=0;o<s.length;o++){const d=s[o],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?c.push(h.then(m=>eS(m,n,o))):eS(h,n,o)}return c.length?Promise.all(c).then(()=>n):n}});function Md(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Ks(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function sN(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=SI(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function oN(e,t,n,a,s,c){const o=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,x=h.optout==="optional";for(const p in t){if(d.has(p))continue;if(m==="never"){o.push(p);continue}const b=h.run({value:t[p],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Md(v,n,p,t,x))):Md(b,n,p,t,x)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const iV=re("$ZodObject",(e,t)=>{if(Tt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=ef(()=>sN(t));at(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const x=d[m]._zod;if(x.values){h[m]??(h[m]=new Set);for(const p of x.values)h[m].add(p)}}return h});const s=nc,c=t.catchall;let o;e._zod.parse=(d,h)=>{o??(o=a.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const x=[],p=o.shape;for(const b of o.keys){const v=p[b],S=v._zod.optout==="optional",z=v._zod.run({value:m[b],issues:[]},h);z instanceof Promise?x.push(z.then(E=>Md(E,d,b,m,S))):Md(z,d,b,m,S)}return c?oN(x,m,d,h,a.value,e):x.length?Promise.all(x).then(()=>d):d}}),sV=re("$ZodObjectJIT",(e,t)=>{iV.init(e,t);const n=e._zod.parse,a=ef(()=>sN(t)),s=b=>{const v=new NB(["shape","payload","ctx"]),S=a.value,z=N=>{const P=Qw(N);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let _=0;for(const N of S.keys)E[N]=`key_${_++}`;v.write("const newResult = {};");for(const N of S.keys){const P=E[N],D=Qw(N),V=b[N]?._zod?.optout==="optional";v.write(`const ${P} = ${z(N)};`),V?v.write(`
87
- if (${P}.issues.length) {
88
- if (${D} in input) {
89
- payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
90
- ...iss,
91
- path: iss.path ? [${D}, ...iss.path] : [${D}]
92
- })));
93
- }
94
- }
95
-
96
- if (${P}.value === undefined) {
97
- if (${D} in input) {
98
- newResult[${D}] = undefined;
99
- }
100
- } else {
101
- newResult[${D}] = ${P}.value;
102
- }
103
-
104
- `):v.write(`
105
- if (${P}.issues.length) {
106
- payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
107
- ...iss,
108
- path: iss.path ? [${D}, ...iss.path] : [${D}]
109
- })));
110
- }
111
-
112
- if (${P}.value === undefined) {
113
- if (${D} in input) {
114
- newResult[${D}] = undefined;
115
- }
116
- } else {
117
- newResult[${D}] = ${P}.value;
118
- }
119
-
120
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(N,P)=>A(b,N,P)};let c;const o=nc,d=!F2.jitless,m=d&&kI.value,x=t.catchall;let p;e._zod.parse=(b,v)=>{p??(p=a.value);const S=b.value;return o(S)?d&&m&&v?.async===!1&&v.jitless!==!0?(c||(c=s(t.shape)),b=c(b,v),x?oN([],S,b,v,p,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function tS(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=>!Js(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(o=>ii(o,a,ai())))}),t)}const lN=re("$ZodUnion",(e,t)=>{Tt.init(e,t),at(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),at(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),at(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),at(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=>ey(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 o=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},c);if(m instanceof Promise)d.push(m),o=!0;else{if(m.issues.length===0)return m;d.push(m)}}return o?Promise.all(d).then(h=>tS(h,s,e,c)):tS(d,s,e,c)}}),oV=re("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lN.init(e,t);const n=e._zod.parse;at(e._zod,"propValues",()=>{const s={};for(const c of t.options){const o=c._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(const[d,h]of Object.entries(o)){s[d]||(s[d]=new Set);for(const m of h)s[d].add(m)}}return s});const a=ef(()=>{const s=t.options,c=new Map;for(const o of s){const d=o._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const h of d){if(c.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);c.set(h,o)}}return c});e._zod.parse=(s,c)=>{const o=s.value;if(!nc(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const d=a.value.get(o?.[t.discriminator]);return d?d._zod.run(s,c):t.unionFallback?n(s,c):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),lV=re("$ZodIntersection",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,c=t.left._zod.run({value:s,issues:[]},a),o=t.right._zod.run({value:s,issues:[]},a);return c instanceof Promise||o instanceof Promise?Promise.all([c,o]).then(([h,m])=>nS(n,h,m)):nS(n,c,o)}});function Mx(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(fo(e)&&fo(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 o=Mx(e[c],t[c]);if(!o.valid)return{valid:!1,mergeErrorPath:[c,...o.mergeErrorPath]};s[c]=o.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],o=Mx(s,c);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function nS(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const c=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(c.length&&s&&e.issues.push({...s,keys:c}),Js(e))return e;const o=Mx(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const cV=re("$ZodRecord",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!fo(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const c=[],o=t.keyType._zod.values;if(o){n.value={};const d=new Set;for(const m of o)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);const x=t.valueType._zod.run({value:s[m],issues:[]},a);x instanceof Promise?c.push(x.then(p=>{p.issues.length&&n.issues.push(...Ks(m,p.issues)),n.value[m]=p.value})):(x.issues.length&&n.issues.push(...Ks(m,x.issues)),n.value[m]=x.value)}let h;for(const m in s)d.has(m)||(h=h??[],h.push(m));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const d of Reflect.ownKeys(s)){if(d==="__proto__")continue;let h=t.keyType._zod.run({value:d,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&eN.test(d)&&h.issues.length){const p=t.keyType._zod.run({value:Number(d),issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(h=p)}if(h.issues.length){t.mode==="loose"?n.value[d]=s[d]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(p=>ii(p,a,ai())),input:d,path:[d],inst:e});continue}const x=t.valueType._zod.run({value:s[d],issues:[]},a);x instanceof Promise?c.push(x.then(p=>{p.issues.length&&n.issues.push(...Ks(d,p.issues)),n.value[h.value]=p.value})):(x.issues.length&&n.issues.push(...Ks(d,x.issues)),n.value[h.value]=x.value)}}return c.length?Promise.all(c).then(()=>n):n}}),uV=re("$ZodEnum",(e,t)=>{Tt.init(e,t);const n=H2(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>wI.has(typeof s)).map(s=>typeof s=="string"?ho(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const o=s.value;return a.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),dV=re("$ZodLiteral",(e,t)=>{if(Tt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?ho(a):a?ho(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}}),fV=re("$ZodTransform",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Z2(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new ro;return n.value=s,n}});function rS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const cN=re("$ZodOptional",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",at(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),at(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ey(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=>rS(c,n.value)):rS(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),hV=re("$ZodExactOptional",(e,t)=>{cN.init(e,t),at(e._zod,"values",()=>t.innerType._zod.values),at(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),mV=re("$ZodNullable",(e,t)=>{Tt.init(e,t),at(e._zod,"optin",()=>t.innerType._zod.optin),at(e._zod,"optout",()=>t.innerType._zod.optout),at(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ey(n.source)}|null)$`):void 0}),at(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)}),pV=re("$ZodDefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",at(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=>aS(c,t)):aS(s,t)}});function aS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const xV=re("$ZodPrefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",at(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))}),gV=re("$ZodNonOptional",(e,t)=>{Tt.init(e,t),at(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=>iS(c,e)):iS(s,e)}});function iS(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 yV=re("$ZodCatch",(e,t)=>{Tt.init(e,t),at(e._zod,"optin",()=>t.innerType._zod.optin),at(e._zod,"optout",()=>t.innerType._zod.optout),at(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(o=>ii(o,a,ai()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(c=>ii(c,a,ai()))},input:n.value}),n.issues=[]),n)}}),bV=re("$ZodPipe",(e,t)=>{Tt.init(e,t),at(e._zod,"values",()=>t.in._zod.values),at(e._zod,"optin",()=>t.in._zod.optin),at(e._zod,"optout",()=>t.out._zod.optout),at(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(o=>Qu(o,t.in,a)):Qu(c,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(c=>Qu(c,t.out,a)):Qu(s,t.out,a)}});function Qu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const vV=re("$ZodReadonly",(e,t)=>{Tt.init(e,t),at(e._zod,"propValues",()=>t.innerType._zod.propValues),at(e._zod,"values",()=>t.innerType._zod.values),at(e._zod,"optin",()=>t.innerType?._zod?.optin),at(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(sS):sS(s)}});function sS(e){return e.value=Object.freeze(e.value),e}const kV=re("$ZodCustom",(e,t)=>{Zn.init(e,t),Tt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(c=>oS(c,n,a,e));oS(s,n,a,e)}});function oS(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(rc(s))}}var lS;let wV=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 SV(){return new wV}(lS=globalThis).__zod_globalRegistry??(lS.__zod_globalRegistry=SV());const $l=globalThis.__zod_globalRegistry;function zV(e,t){return new e({type:"string",...ze(t)})}function jV(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function cS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function _V(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function NV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function CV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function TV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function EV(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function AV(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function OV(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function MV(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function DV(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function RV(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function $V(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function LV(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function PV(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function UV(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function IV(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function BV(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function VV(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function ZV(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function FV(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function HV(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function qV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function GV(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function YV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function JV(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function KV(e,t){return new e({type:"number",checks:[],...ze(t)})}function XV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function QV(e,t){return new e({type:"boolean",...ze(t)})}function WV(e){return new e({type:"unknown"})}function eZ(e,t){return new e({type:"never",...ze(t)})}function uS(e,t){return new nN({check:"less_than",...ze(t),value:e,inclusive:!1})}function wp(e,t){return new nN({check:"less_than",...ze(t),value:e,inclusive:!0})}function dS(e,t){return new rN({check:"greater_than",...ze(t),value:e,inclusive:!1})}function Sp(e,t){return new rN({check:"greater_than",...ze(t),value:e,inclusive:!0})}function fS(e,t){return new pB({check:"multiple_of",...ze(t),value:e})}function uN(e,t){return new gB({check:"max_length",...ze(t),maximum:e})}function Dd(e,t){return new yB({check:"min_length",...ze(t),minimum:e})}function dN(e,t){return new bB({check:"length_equals",...ze(t),length:e})}function tZ(e,t){return new vB({check:"string_format",format:"regex",...ze(t),pattern:e})}function nZ(e){return new kB({check:"string_format",format:"lowercase",...ze(e)})}function rZ(e){return new wB({check:"string_format",format:"uppercase",...ze(e)})}function aZ(e,t){return new SB({check:"string_format",format:"includes",...ze(t),includes:e})}function iZ(e,t){return new zB({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function sZ(e,t){return new jB({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function Co(e){return new _B({check:"overwrite",tx:e})}function oZ(e){return Co(t=>t.normalize(e))}function lZ(){return Co(e=>e.trim())}function cZ(){return Co(e=>e.toLowerCase())}function uZ(){return Co(e=>e.toUpperCase())}function dZ(){return Co(e=>vI(e))}function fZ(e,t,n){return new e({type:"array",element:t,...ze(n)})}function hZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function mZ(e){const t=pZ(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(rc(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(rc(s))}},e(n.value,n)));return t}function pZ(e,t){const n=new Zn({check:"custom",...ze(t)});return n._zod.check=e,n}function fN(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 Gt(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 o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const d=e._zod.toJSONSchema?.();if(d)o.schema=d;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,x);else{const b=o.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,x)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),Gt(p,t,x),t.seen.get(p).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(o.schema,h),t.io==="input"&&jn(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function hN(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 o of e.seen.entries()){const d=e.metadataRegistry.get(o[0])?.id;if(d){const h=a.get(d);if(h&&h!==o[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,o[0])}}const s=o=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,b=e.external.uri??(S=>S);if(p)return{ref:b(p)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(o[1]===n)return{ref:"#"};const m=`#/${d}/`,x=o[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:m+x}},c=o=>{if(o[1].schema.$ref)return;const d=o[1],{ref:h,defId:m}=s(o);d.def={...d.schema},m&&(d.defId=m);const x=d.schema;for(const p in x)delete x[p];x.$ref=h};if(e.cycles==="throw")for(const o of e.seen.entries()){const d=o[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
121
-
122
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const d=o[1];if(t===o[0]){c(o);continue}if(e.external){const m=e.external.registry.get(o[0])?.id;if(t!==o[0]&&m){c(o);continue}}if(e.metadataRegistry.get(o[0])?.id){c(o);continue}if(d.cycle){c(o);continue}if(d.count>1&&e.reused==="ref"){c(o);continue}}}function mN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const d=e.seen.get(o);if(d.ref===null)return;const h=d.def??d.schema,m={...h},x=d.ref;if(d.ref=null,x){a(x);const b=e.seen.get(x),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),o._zod.parent===x)for(const z in h)z==="$ref"||z==="allOf"||z in m||delete h[z];if(v.$ref&&b.def)for(const z in h)z==="$ref"||z==="allOf"||z in b.def&&JSON.stringify(h[z])===JSON.stringify(b.def[z])&&delete h[z]}const p=o._zod.parent;if(p&&p!==x){a(p);const b=e.seen.get(p);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:o,jsonSchema:h,path:d.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[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 o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const c=e.external?.defs??{};for(const o of e.seen.entries()){const d=o[1];d.def&&d.defId&&(c[d.defId]=d.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rd(t,"input",e.processors),output:Rd(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function jn(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 jn(a.element,n);if(a.type==="set")return jn(a.valueType,n);if(a.type==="lazy")return jn(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 jn(a.innerType,n);if(a.type==="intersection")return jn(a.left,n)||jn(a.right,n);if(a.type==="record"||a.type==="map")return jn(a.keyType,n)||jn(a.valueType,n);if(a.type==="pipe")return jn(a.in,n)||jn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(jn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(jn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(jn(s,n))return!0;return!!(a.rest&&jn(a.rest,n))}return!1}const xZ=(e,t={})=>n=>{const a=fN({...n,processors:t});return Gt(e,a),hN(a,e),mN(a,e)},Rd=(e,t,n={})=>a=>{const{libraryOptions:s,target:c}=a??{},o=fN({...s??{},target:c,io:t,processors:n});return Gt(e,o),hN(o,e),mN(o,e)},gZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yZ=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:c,maximum:o,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof o=="number"&&(s.maxLength=o),d&&(s.format=gZ[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},bZ=(e,t,n,a)=>{const s=n,{minimum:c,maximum:o,format:d,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:x}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number",typeof x=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=x,s.exclusiveMinimum=!0):s.exclusiveMinimum=x),typeof c=="number"&&(s.minimum=c,typeof x=="number"&&t.target!=="draft-04"&&(x>=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 o=="number"&&(s.maximum=o,typeof m=="number"&&t.target!=="draft-04"&&(m<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof h=="number"&&(s.multipleOf=h)},vZ=(e,t,n,a)=>{n.type="boolean"},kZ=(e,t,n,a)=>{n.not={}},wZ=(e,t,n,a)=>{},SZ=(e,t,n,a)=>{const s=e._zod.def,c=H2(s.entries);c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),n.enum=c},zZ=(e,t,n,a)=>{const s=e._zod.def,c=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(o))}else c.push(o);if(c.length!==0)if(c.length===1){const o=c[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),c.every(o=>typeof o=="boolean")&&(n.type="boolean"),c.every(o=>o===null)&&(n.type="null"),n.enum=c},jZ=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_Z=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},NZ=(e,t,n,a)=>{const s=n,c=e._zod.def,{minimum:o,maximum:d}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Gt(c.element,t,{...a,path:[...a.path,"items"]})},CZ=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object",s.properties={};const o=c.shape;for(const m in o)s.properties[m]=Gt(o[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(o)),h=new Set([...d].filter(m=>{const x=c.shape[m]._zod;return t.io==="input"?x.optin===void 0:x.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=Gt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},TZ=(e,t,n,a)=>{const s=e._zod.def,c=s.inclusive===!1,o=s.options.map((d,h)=>Gt(d,t,{...a,path:[...a.path,c?"oneOf":"anyOf",h]}));c?n.oneOf=o:n.anyOf=o},EZ=(e,t,n,a)=>{const s=e._zod.def,c=Gt(s.left,t,{...a,path:[...a.path,"allOf",0]}),o=Gt(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(c)?c.allOf:[c],...d(o)?o.allOf:[o]];n.allOf=h},AZ=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object";const o=c.keyType,h=o._zod.bag?.patterns;if(c.mode==="loose"&&h&&h.size>0){const x=Gt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const p of h)s.patternProperties[p.source]=x}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Gt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Gt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=o._zod.values;if(m){const x=[...m].filter(p=>typeof p=="string"||typeof p=="number");x.length>0&&(s.required=x)}},OZ=(e,t,n,a)=>{const s=e._zod.def,c=Gt(s.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},MZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},DZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},RZ=(e,t,n,a)=>{const s=e._zod.def;Gt(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)))},$Z=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},LZ=(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;Gt(c,t,a);const o=t.seen.get(e);o.ref=c},PZ=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.readOnly=!0},pN=(e,t,n,a)=>{const s=e._zod.def;Gt(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},UZ=re("ZodISODateTime",(e,t)=>{IB.init(e,t),At.init(e,t)});function IZ(e){return qV(UZ,e)}const BZ=re("ZodISODate",(e,t)=>{BB.init(e,t),At.init(e,t)});function VZ(e){return GV(BZ,e)}const ZZ=re("ZodISOTime",(e,t)=>{VB.init(e,t),At.init(e,t)});function FZ(e){return YV(ZZ,e)}const HZ=re("ZodISODuration",(e,t)=>{ZB.init(e,t),At.init(e,t)});function qZ(e){return JV(HZ,e)}const GZ=(e,t)=>{J2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>MI(e,n)},flatten:{value:n=>OI(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ox,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ox,2)}},isEmpty:{get(){return e.issues.length===0}}})},vr=re("ZodError",GZ,{Parent:Error}),YZ=ny(vr),JZ=ry(vr),KZ=tf(vr),XZ=nf(vr),QZ=$I(vr),WZ=LI(vr),eF=PI(vr),tF=UI(vr),nF=II(vr),rF=BI(vr),aF=VI(vr),iF=ZI(vr),Et=re("ZodType",(e,t)=>(Tt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rd(e,"input"),output:Rd(e,"output")}}),e.toJSONSchema=xZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ci(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)=>ui(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>YZ(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>KZ(e,n,a),e.parseAsync=async(n,a)=>JZ(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>XZ(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>QZ(e,n,a),e.decode=(n,a)=>WZ(e,n,a),e.encodeAsync=async(n,a)=>eF(e,n,a),e.decodeAsync=async(n,a)=>tF(e,n,a),e.safeEncode=(n,a)=>nF(e,n,a),e.safeDecode=(n,a)=>rF(e,n,a),e.safeEncodeAsync=async(n,a)=>aF(e,n,a),e.safeDecodeAsync=async(n,a)=>iF(e,n,a),e.refine=(n,a)=>e.check(WF(n,a)),e.superRefine=n=>e.check(eH(n)),e.overwrite=n=>e.check(Co(n)),e.optional=()=>gS(e),e.exactOptional=()=>IF(e),e.nullable=()=>yS(e),e.nullish=()=>gS(yS(e)),e.nonoptional=n=>qF(e,n),e.array=()=>si(e),e.or=n=>bN([e,n]),e.and=n=>DF(e,n),e.transform=n=>bS(e,PF(n)),e.default=n=>ZF(e,n),e.prefault=n=>HF(e,n),e.catch=n=>YF(e,n),e.pipe=n=>bS(e,n),e.readonly=()=>XF(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)),xN=re("_ZodString",(e,t)=>{ay.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,c)=>yZ(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(tZ(...a)),e.includes=(...a)=>e.check(aZ(...a)),e.startsWith=(...a)=>e.check(iZ(...a)),e.endsWith=(...a)=>e.check(sZ(...a)),e.min=(...a)=>e.check(Dd(...a)),e.max=(...a)=>e.check(uN(...a)),e.length=(...a)=>e.check(dN(...a)),e.nonempty=(...a)=>e.check(Dd(1,...a)),e.lowercase=a=>e.check(nZ(a)),e.uppercase=a=>e.check(rZ(a)),e.trim=()=>e.check(lZ()),e.normalize=(...a)=>e.check(oZ(...a)),e.toLowerCase=()=>e.check(cZ()),e.toUpperCase=()=>e.check(uZ()),e.slugify=()=>e.check(dZ())}),sF=re("ZodString",(e,t)=>{ay.init(e,t),xN.init(e,t),e.email=n=>e.check(jV(oF,n)),e.url=n=>e.check(EV(lF,n)),e.jwt=n=>e.check(HV(SF,n)),e.emoji=n=>e.check(AV(cF,n)),e.guid=n=>e.check(cS(hS,n)),e.uuid=n=>e.check(_V(Wu,n)),e.uuidv4=n=>e.check(NV(Wu,n)),e.uuidv6=n=>e.check(CV(Wu,n)),e.uuidv7=n=>e.check(TV(Wu,n)),e.nanoid=n=>e.check(OV(uF,n)),e.guid=n=>e.check(cS(hS,n)),e.cuid=n=>e.check(MV(dF,n)),e.cuid2=n=>e.check(DV(fF,n)),e.ulid=n=>e.check(RV(hF,n)),e.base64=n=>e.check(VV(vF,n)),e.base64url=n=>e.check(ZV(kF,n)),e.xid=n=>e.check($V(mF,n)),e.ksuid=n=>e.check(LV(pF,n)),e.ipv4=n=>e.check(PV(xF,n)),e.ipv6=n=>e.check(UV(gF,n)),e.cidrv4=n=>e.check(IV(yF,n)),e.cidrv6=n=>e.check(BV(bF,n)),e.e164=n=>e.check(FV(wF,n)),e.datetime=n=>e.check(IZ(n)),e.date=n=>e.check(VZ(n)),e.time=n=>e.check(FZ(n)),e.duration=n=>e.check(qZ(n))});function qe(e){return zV(sF,e)}const At=re("ZodStringFormat",(e,t)=>{_t.init(e,t),xN.init(e,t)}),oF=re("ZodEmail",(e,t)=>{AB.init(e,t),At.init(e,t)}),hS=re("ZodGUID",(e,t)=>{TB.init(e,t),At.init(e,t)}),Wu=re("ZodUUID",(e,t)=>{EB.init(e,t),At.init(e,t)}),lF=re("ZodURL",(e,t)=>{OB.init(e,t),At.init(e,t)}),cF=re("ZodEmoji",(e,t)=>{MB.init(e,t),At.init(e,t)}),uF=re("ZodNanoID",(e,t)=>{DB.init(e,t),At.init(e,t)}),dF=re("ZodCUID",(e,t)=>{RB.init(e,t),At.init(e,t)}),fF=re("ZodCUID2",(e,t)=>{$B.init(e,t),At.init(e,t)}),hF=re("ZodULID",(e,t)=>{LB.init(e,t),At.init(e,t)}),mF=re("ZodXID",(e,t)=>{PB.init(e,t),At.init(e,t)}),pF=re("ZodKSUID",(e,t)=>{UB.init(e,t),At.init(e,t)}),xF=re("ZodIPv4",(e,t)=>{FB.init(e,t),At.init(e,t)}),gF=re("ZodIPv6",(e,t)=>{HB.init(e,t),At.init(e,t)}),yF=re("ZodCIDRv4",(e,t)=>{qB.init(e,t),At.init(e,t)}),bF=re("ZodCIDRv6",(e,t)=>{GB.init(e,t),At.init(e,t)}),vF=re("ZodBase64",(e,t)=>{YB.init(e,t),At.init(e,t)}),kF=re("ZodBase64URL",(e,t)=>{KB.init(e,t),At.init(e,t)}),wF=re("ZodE164",(e,t)=>{XB.init(e,t),At.init(e,t)}),SF=re("ZodJWT",(e,t)=>{WB.init(e,t),At.init(e,t)}),gN=re("ZodNumber",(e,t)=>{iN.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,c)=>bZ(e,a,s),e.gt=(a,s)=>e.check(dS(a,s)),e.gte=(a,s)=>e.check(Sp(a,s)),e.min=(a,s)=>e.check(Sp(a,s)),e.lt=(a,s)=>e.check(uS(a,s)),e.lte=(a,s)=>e.check(wp(a,s)),e.max=(a,s)=>e.check(wp(a,s)),e.int=a=>e.check(mS(a)),e.safe=a=>e.check(mS(a)),e.positive=a=>e.check(dS(0,a)),e.nonnegative=a=>e.check(Sp(0,a)),e.negative=a=>e.check(uS(0,a)),e.nonpositive=a=>e.check(wp(0,a)),e.multipleOf=(a,s)=>e.check(fS(a,s)),e.step=(a,s)=>e.check(fS(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 En(e){return KV(gN,e)}const zF=re("ZodNumberFormat",(e,t)=>{eV.init(e,t),gN.init(e,t)});function mS(e){return XV(zF,e)}const jF=re("ZodBoolean",(e,t)=>{tV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vZ(e,n,a)});function gn(e){return QV(jF,e)}const _F=re("ZodUnknown",(e,t)=>{nV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>wZ()});function pS(){return WV(_F)}const NF=re("ZodNever",(e,t)=>{rV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>kZ(e,n,a)});function CF(e){return eZ(NF,e)}const TF=re("ZodArray",(e,t)=>{aV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>NZ(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(Dd(n,a)),e.nonempty=n=>e.check(Dd(1,n)),e.max=(n,a)=>e.check(uN(n,a)),e.length=(n,a)=>e.check(dN(n,a)),e.unwrap=()=>e.element});function si(e,t){return fZ(TF,e,t)}const EF=re("ZodObject",(e,t)=>{sV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>CZ(e,n,a,s),at(e,"shape",()=>t.shape),e.keyof=()=>di(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:pS()}),e.loose=()=>e.clone({...e._zod.def,catchall:pS()}),e.strict=()=>e.clone({...e._zod.def,catchall:CF()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>NI(e,n),e.safeExtend=n=>CI(e,n),e.merge=n=>TI(e,n),e.pick=n=>jI(e,n),e.omit=n=>_I(e,n),e.partial=(...n)=>EI(vN,e,n[0]),e.required=(...n)=>AI(kN,e,n[0])});function nn(e,t){const n={type:"object",shape:e??{},...ze(t)};return new EF(n)}const yN=re("ZodUnion",(e,t)=>{lN.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>TZ(e,n,a,s),e.options=t.options});function bN(e,t){return new yN({type:"union",options:e,...ze(t)})}const AF=re("ZodDiscriminatedUnion",(e,t)=>{yN.init(e,t),oV.init(e,t)});function OF(e,t,n){return new AF({type:"union",options:t,discriminator:e,...ze(n)})}const MF=re("ZodIntersection",(e,t)=>{lV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>EZ(e,n,a,s)});function DF(e,t){return new MF({type:"intersection",left:e,right:t})}const RF=re("ZodRecord",(e,t)=>{cV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>AZ(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function xd(e,t,n){return new RF({type:"record",keyType:e,valueType:t,...ze(n)})}const Dx=re("ZodEnum",(e,t)=>{uV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(a,s,c)=>SZ(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 o of a)if(n.has(o))c[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Dx({...t,checks:[],...ze(s),entries:c})},e.exclude=(a,s)=>{const c={...t.entries};for(const o of a)if(n.has(o))delete c[o];else throw new Error(`Key ${o} not found in enum`);return new Dx({...t,checks:[],...ze(s),entries:c})}});function di(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Dx({type:"enum",entries:n,...ze(t)})}const $F=re("ZodLiteral",(e,t)=>{dV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>zZ(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 xS(e,t){return new $F({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const LF=re("ZodTransform",(e,t)=>{fV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_Z(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Z2(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(rc(c,n.value,t));else{const o=c;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(rc(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(c=>(n.value=c,n)):(n.value=s,n)}});function PF(e){return new LF({type:"transform",transform:e})}const vN=re("ZodOptional",(e,t)=>{cN.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function gS(e){return new vN({type:"optional",innerType:e})}const UF=re("ZodExactOptional",(e,t)=>{hV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function IF(e){return new UF({type:"optional",innerType:e})}const BF=re("ZodNullable",(e,t)=>{mV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>OZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yS(e){return new BF({type:"nullable",innerType:e})}const VF=re("ZodDefault",(e,t)=>{pV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>DZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZF(e,t){return new VF({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G2(t)}})}const FF=re("ZodPrefault",(e,t)=>{xV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>RZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function HF(e,t){return new FF({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G2(t)}})}const kN=re("ZodNonOptional",(e,t)=>{gV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>MZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function qF(e,t){return new kN({type:"nonoptional",innerType:e,...ze(t)})}const GF=re("ZodCatch",(e,t)=>{yV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$Z(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function YF(e,t){return new GF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JF=re("ZodPipe",(e,t)=>{bV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>LZ(e,n,a,s),e.in=t.in,e.out=t.out});function bS(e,t){return new JF({type:"pipe",in:e,out:t})}const KF=re("ZodReadonly",(e,t)=>{vV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>PZ(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function XF(e){return new KF({type:"readonly",innerType:e})}const QF=re("ZodCustom",(e,t)=>{kV.init(e,t),Et.init(e,t),e._zod.processJSONSchema=(n,a,s)=>jZ(e,n)});function WF(e,t={}){return hZ(QF,e,t)}function eH(e){return mZ(e)}const xt={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}},tH=nn({provider:di(["google","openai","openrouter","ollama"]).default(xt.audio.provider),model:qe().min(1).default(xt.audio.model),enabled:gn().default(xt.audio.enabled),apiKey:qe().optional(),base_url:qe().optional(),maxDurationSeconds:En().default(xt.audio.maxDurationSeconds),supportedMimeTypes:si(qe()).default(xt.audio.supportedMimeTypes)}),To=nn({provider:di(["openai","anthropic","openrouter","ollama","gemini"]).default(xt.llm.provider),model:qe().min(1).default(xt.llm.model),temperature:En().min(0).max(1).default(xt.llm.temperature),max_tokens:En().int().positive().optional(),api_key:qe().optional(),base_url:qe().optional(),context_window:En().int().positive().optional()}),nH=To.extend({memory_limit:En().int().positive().optional(),enabled_archived_sessions:gn().default(!0)}),rH=To.extend({working_dir:qe().optional(),timeout_ms:En().int().positive().optional(),execution_mode:di(["sync","async"]).default("async")}),aH=To.extend({execution_mode:di(["sync","async"]).default("async")}),iH=To.extend({execution_mode:di(["sync","async"]).default("async")}),sH=To.extend({skills_dir:qe().optional()}),oH=nn({telegram_notify_all:gn().optional()}).optional(),lH=nn({timezone:qe().default("UTC"),check_interval_ms:En().min(6e4).default(6e4),max_active_jobs:En().min(1).max(1e3).default(100)}),cH=nn({sandbox_dir:qe().optional(),readonly_mode:gn().default(!1),allowed_shell_commands:si(qe()).default([]),enable_filesystem:gn().default(!0),enable_shell:gn().default(!0),enable_git:gn().default(!0),enable_network:gn().default(!0),timeout_ms:En().int().positive().default(3e4)}),uH=nn({name:qe().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/,"Smith name must be lowercase alphanumeric with hyphens/underscores"),host:qe().min(1),port:En().int().min(1).max(65535).default(7900),auth_token:qe().min(1),tls:gn().default(!1)}),dH=nn({enabled:gn().default(!1),execution_mode:di(["sync","async"]).default("async"),heartbeat_interval_ms:En().int().min(5e3).default(3e4),connection_timeout_ms:En().int().min(1e3).default(1e4),task_timeout_ms:En().int().min(1e3).default(6e4),entries:si(uH).default([])}),fH=nn({agent:nn({name:qe().default(xt.agent.name),personality:qe().default(xt.agent.personality)}).default(xt.agent),llm:To.default(xt.llm),sati:nH.optional(),neo:aH.optional(),apoc:rH.optional(),trinity:iH.optional(),keymaker:sH.optional(),webhooks:oH,audio:tH.default(xt.audio),memory:nn({limit:En().int().positive().optional()}).default(xt.memory),runtime:nn({async_tasks:nn({enabled:gn().default(xt.runtime?.async_tasks.enabled)}).default(xt.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:lH.optional(),devkit:cH.optional(),smiths:dH.optional(),verbose_mode:gn().default(!0),channels:nn({telegram:nn({enabled:gn().default(!1),token:qe().optional(),allowedUsers:si(qe()).default([])}).default(xt.channels.telegram),discord:nn({enabled:gn().default(!1),token:qe().optional(),allowedUsers:si(qe()).default([])}).default(xt.channels.discord)}).default(xt.channels),ui:nn({enabled:gn().default(xt.ui.enabled),port:En().default(xt.ui.port)}).default(xt.ui),logging:nn({enabled:gn().default(xt.logging.enabled),level:di(["debug","info","warn","error"]).default(xt.logging.level),retention:qe().default(xt.logging.retention)}).default(xt.logging)}),hH=OF("transport",[nn({transport:xS("stdio"),command:qe().min(1,"Command is required for stdio transport"),args:si(qe()).optional().default([]),env:xd(qe(),qe()).optional().default({}),_comment:qe().optional()}),nn({transport:xS("http"),url:qe().url("Valid URL is required for http transport"),headers:xd(qe(),qe()).optional().default({}),args:si(qe()).optional().default([]),env:xd(qe(),qe()).optional().default({}),_comment:qe().optional()})]);xd(qe(),bN([hH,qe()]));function ce(e,t,n){function a(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:o,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=o.prototype,x=Object.keys(m);for(let p=0;p<x.length;p++){const b=x[p];b in d||(d[b]=m[b].bind(d))}}const s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function o(d){var h;const m=n?.Parent?new c:this;a(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const x of m._zod.deferred)x();return m}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class ao extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class wN extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const SN={};function Hi(e){return SN}function zN(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 Rx(e,t){return typeof t=="bigint"?t.toString():t}function iy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sy(e){return e==null}function oy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const vS=Symbol("evaluating");function ot(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==vS)return a===void 0&&(a=vS,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Xi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function kS(e){return JSON.stringify(e)}function mH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const pH=iy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ac(e){if($d(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!($d(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _N(e){return ac(e)?{...e}:Array.isArray(e)?[...e]:e}const xH=new Set(["string","number","symbol"]);function mo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hi(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 gH(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function yH(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=fi(e._zod.def,{get shape(){const o={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(o[d]=n.shape[d])}return Xi(this,"shape",o),o},checks:[]});return hi(e,c)}function bH(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=fi(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete o[d]}return Xi(this,"shape",o),o},checks:[]});return hi(e,c)}function vH(e,t){if(!ac(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 o in t)if(Object.getOwnPropertyDescriptor(c,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=fi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Xi(this,"shape",c),c}});return hi(e,s)}function kH(e,t){if(!ac(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Xi(this,"shape",a),a}});return hi(e,n)}function wH(e,t){const n=fi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Xi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return hi(e,n)}function SH(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 o=fi(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Xi(this,"shape",h),h},checks:[]});return hi(t,o)}function zH(e,t,n){const a=fi(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const o in n){if(!(o in c))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(c[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)c[o]=new e({type:"nonoptional",innerType:s[o]});return Xi(this,"shape",c),c}});return hi(t,a)}function Xs(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 NN(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function ed(e){return typeof e=="string"?e:e?.message}function qi(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=ed(e.inst?._zod.def?.error?.(e))??ed(t?.error?.(e))??ed(n.customError?.(e))??ed(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ly(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ic(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const CN=(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,Rx,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},TN=ce("$ZodError",CN),EN=ce("$ZodError",CN,{Parent:Error});function jH(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 _H(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(o=>a({issues:o}));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 o=n,d=0;for(;d<c.path.length;){const h=c.path[d];d===c.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(c))):o[h]=o[h]||{_errors:[]},o=o[h],d++}}};return a(e),n}const cy=e=>(t,n,a,s)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new ao;if(o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>qi(h,c,Hi())));throw jN(d,s?.callee),d}return o.value},uy=e=>async(t,n,a,s)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise&&(o=await o),o.issues.length){const d=new(s?.Err??e)(o.issues.map(h=>qi(h,c,Hi())));throw jN(d,s?.callee),d}return o.value},af=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 ao;return c.issues.length?{success:!1,error:new(e??TN)(c.issues.map(o=>qi(o,s,Hi())))}:{success:!0,data:c.value}},NH=af(EN),sf=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(o=>qi(o,s,Hi())))}:{success:!0,data:c.value}},CH=sf(EN),TH=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return cy(e)(t,n,s)},EH=e=>(t,n,a)=>cy(e)(t,n,a),AH=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return uy(e)(t,n,s)},OH=e=>async(t,n,a)=>uy(e)(t,n,a),MH=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return af(e)(t,n,s)},DH=e=>(t,n,a)=>af(e)(t,n,a),RH=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return sf(e)(t,n,s)},$H=e=>async(t,n,a)=>sf(e)(t,n,a),LH=/^[cC][^\s-]{8,}$/,PH=/^[0-9a-z]+$/,UH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,IH=/^[0-9a-vA-V]{20}$/,BH=/^[A-Za-z0-9]{27}$/,VH=/^[a-zA-Z0-9_-]{21}$/,ZH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,FH=/^([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})$/,wS=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)$/,HH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function GH(){return new RegExp(qH,"u")}const YH=/^(?:(?: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])$/,JH=/^(([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}|:))$/,KH=/^((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])$/,XH=/^(([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])$/,QH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,AN=/^[A-Za-z0-9_-]*$/,WH=/^\+[1-9]\d{6,14}$/,ON="(?:(?:\\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])))",eq=new RegExp(`^${ON}$`);function MN(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 tq(e){return new RegExp(`^${MN(e)}$`)}function nq(e){const t=MN({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(`^${ON}T(?:${a})$`)}const rq=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},aq=/^[^A-Z]*$/,iq=/^[^a-z]*$/,Fr=ce("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sq=ce("$ZodCheckMaxLength",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!sy(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 o=ly(s);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),oq=ce("$ZodCheckMinLength",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!sy(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 o=ly(s);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),lq=ce("$ZodCheckLengthEquals",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!sy(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 o=ly(s),d=c>t.length;a.issues.push({origin:o,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),of=ce("$ZodCheckStringFormat",(e,t)=>{var n,a;Fr.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=()=>{})}),cq=ce("$ZodCheckRegex",(e,t)=>{of.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})}}),uq=ce("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=aq),of.init(e,t)}),dq=ce("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iq),of.init(e,t)}),fq=ce("$ZodCheckIncludes",(e,t)=>{Fr.init(e,t);const n=mo(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})}}),hq=ce("$ZodCheckStartsWith",(e,t)=>{Fr.init(e,t);const n=new RegExp(`^${mo(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})}}),mq=ce("$ZodCheckEndsWith",(e,t)=>{Fr.init(e,t);const n=new RegExp(`.*${mo(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})}}),pq=ce("$ZodCheckOverwrite",(e,t)=>{Fr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class xq{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(`
123
- `).filter(o=>o),s=Math.min(...a.map(o=>o.length-o.trimStart().length)),c=a.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of c)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,s.join(`
124
- `))}}const gq={major:4,minor:3,patch:6},Yt=ce("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gq;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=(o,d,h)=>{let m=Xs(o),x;for(const p of d){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(m)continue;const b=o.issues.length,v=p._zod.check(o);if(v instanceof Promise&&h?.async===!1)throw new ao;if(x||v instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await v,o.issues.length!==b&&(m||(m=Xs(o,b)))});else{if(o.issues.length===b)continue;m||(m=Xs(o,b))}}return x?x.then(()=>o):o},c=(o,d,h)=>{if(Xs(o))return o.aborted=!0,o;const m=s(d,a,h);if(m instanceof Promise){if(h.async===!1)throw new ao;return m.then(x=>e._zod.parse(x,h))}return e._zod.parse(m,h)};e._zod.run=(o,d)=>{if(d.skipChecks)return e._zod.parse(o,d);if(d.direction==="backward"){const m=e._zod.parse({value:o.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(x=>c(x,o,d)):c(m,o,d)}const h=e._zod.parse(o,d);if(h instanceof Promise){if(d.async===!1)throw new ao;return h.then(m=>s(m,a,d))}return s(h,a,d)}}ot(e,"~standard",()=>({validate:s=>{try{const c=NH(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return CH(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),dy=ce("$ZodString",(e,t)=>{Yt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rq(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}}),Nt=ce("$ZodStringFormat",(e,t)=>{of.init(e,t),dy.init(e,t)}),yq=ce("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=FH),Nt.init(e,t)}),bq=ce("$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=wS(a))}else t.pattern??(t.pattern=wS());Nt.init(e,t)}),vq=ce("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=HH),Nt.init(e,t)}),kq=ce("$ZodURL",(e,t)=>{Nt.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})}}}),wq=ce("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=GH()),Nt.init(e,t)}),Sq=ce("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=VH),Nt.init(e,t)}),zq=ce("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=LH),Nt.init(e,t)}),jq=ce("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=PH),Nt.init(e,t)}),_q=ce("$ZodULID",(e,t)=>{t.pattern??(t.pattern=UH),Nt.init(e,t)}),Nq=ce("$ZodXID",(e,t)=>{t.pattern??(t.pattern=IH),Nt.init(e,t)}),Cq=ce("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=BH),Nt.init(e,t)}),Tq=ce("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nq(t)),Nt.init(e,t)}),Eq=ce("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=eq),Nt.init(e,t)}),Aq=ce("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tq(t)),Nt.init(e,t)}),Oq=ce("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ZH),Nt.init(e,t)}),Mq=ce("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=YH),Nt.init(e,t),e._zod.bag.format="ipv4"}),Dq=ce("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=JH),Nt.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})}}}),Rq=ce("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=KH),Nt.init(e,t)}),$q=ce("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=XH),Nt.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 o=Number(c);if(`${o}`!==c)throw new Error;if(o<0||o>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 DN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Lq=ce("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=QH),Nt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{DN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Pq(e){if(!AN.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return DN(n)}const Uq=ce("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=AN),Nt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Pq(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Iq=ce("$ZodE164",(e,t)=>{t.pattern??(t.pattern=WH),Nt.init(e,t)});function Bq(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 Vq=ce("$ZodJWT",(e,t)=>{Nt.init(e,t),e._zod.check=n=>{Bq(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Zq=ce("$ZodUnknown",(e,t)=>{Yt.init(e,t),e._zod.parse=n=>n}),Fq=ce("$ZodNever",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function SS(e,t,n){e.issues.length&&t.issues.push(...NN(n,e.issues)),t.value[n]=e.value}const Hq=ce("$ZodArray",(e,t)=>{Yt.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 o=0;o<s.length;o++){const d=s[o],h=t.element._zod.run({value:d,issues:[]},a);h instanceof Promise?c.push(h.then(m=>SS(m,n,o))):SS(h,n,o)}return c.length?Promise.all(c).then(()=>n):n}});function Ld(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...NN(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function RN(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=gH(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $N(e,t,n,a,s,c){const o=[],d=s.keySet,h=s.catchall._zod,m=h.def.type,x=h.optout==="optional";for(const p in t){if(d.has(p))continue;if(m==="never"){o.push(p);continue}const b=h.run({value:t[p],issues:[]},a);b instanceof Promise?e.push(b.then(v=>Ld(v,n,p,t,x))):Ld(b,n,p,t,x)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const qq=ce("$ZodObject",(e,t)=>{if(Yt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=iy(()=>RN(t));ot(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const x=d[m]._zod;if(x.values){h[m]??(h[m]=new Set);for(const p of x.values)h[m].add(p)}}return h});const s=$d,c=t.catchall;let o;e._zod.parse=(d,h)=>{o??(o=a.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const x=[],p=o.shape;for(const b of o.keys){const v=p[b],S=v._zod.optout==="optional",z=v._zod.run({value:m[b],issues:[]},h);z instanceof Promise?x.push(z.then(E=>Ld(E,d,b,m,S))):Ld(z,d,b,m,S)}return c?$N(x,m,d,h,a.value,e):x.length?Promise.all(x).then(()=>d):d}}),Gq=ce("$ZodObjectJIT",(e,t)=>{qq.init(e,t);const n=e._zod.parse,a=iy(()=>RN(t)),s=b=>{const v=new xq(["shape","payload","ctx"]),S=a.value,z=N=>{const P=kS(N);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};v.write("const input = payload.value;");const E=Object.create(null);let _=0;for(const N of S.keys)E[N]=`key_${_++}`;v.write("const newResult = {};");for(const N of S.keys){const P=E[N],D=kS(N),V=b[N]?._zod?.optout==="optional";v.write(`const ${P} = ${z(N)};`),V?v.write(`
125
- if (${P}.issues.length) {
126
- if (${D} in input) {
127
- payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
128
- ...iss,
129
- path: iss.path ? [${D}, ...iss.path] : [${D}]
130
- })));
131
- }
132
- }
133
-
134
- if (${P}.value === undefined) {
135
- if (${D} in input) {
136
- newResult[${D}] = undefined;
137
- }
138
- } else {
139
- newResult[${D}] = ${P}.value;
140
- }
141
-
142
- `):v.write(`
143
- if (${P}.issues.length) {
144
- payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
145
- ...iss,
146
- path: iss.path ? [${D}, ...iss.path] : [${D}]
147
- })));
148
- }
149
-
150
- if (${P}.value === undefined) {
151
- if (${D} in input) {
152
- newResult[${D}] = undefined;
153
- }
154
- } else {
155
- newResult[${D}] = ${P}.value;
156
- }
157
-
158
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(N,P)=>A(b,N,P)};let c;const o=$d,d=!SN.jitless,m=d&&pH.value,x=t.catchall;let p;e._zod.parse=(b,v)=>{p??(p=a.value);const S=b.value;return o(S)?d&&m&&v?.async===!1&&v.jitless!==!0?(c||(c=s(t.shape)),b=c(b,v),x?$N([],S,b,v,p,e):b):n(b,v):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function zS(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=>!Xs(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(o=>qi(o,a,Hi())))}),t)}const Yq=ce("$ZodUnion",(e,t)=>{Yt.init(e,t),ot(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),ot(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=>oy(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 o=!1;const d=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},c);if(m instanceof Promise)d.push(m),o=!0;else{if(m.issues.length===0)return m;d.push(m)}}return o?Promise.all(d).then(h=>zS(h,s,e,c)):zS(d,s,e,c)}}),Jq=ce("$ZodIntersection",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,c=t.left._zod.run({value:s,issues:[]},a),o=t.right._zod.run({value:s,issues:[]},a);return c instanceof Promise||o instanceof Promise?Promise.all([c,o]).then(([h,m])=>jS(n,h,m)):jS(n,c,o)}});function $x(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(ac(e)&&ac(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 o=$x(e[c],t[c]);if(!o.valid)return{valid:!1,mergeErrorPath:[c,...o.mergeErrorPath]};s[c]=o.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],o=$x(s,c);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function jS(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const h of d.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(d);const c=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(c.length&&s&&e.issues.push({...s,keys:c}),Xs(e))return e;const o=$x(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Kq=ce("$ZodEnum",(e,t)=>{Yt.init(e,t);const n=zN(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>xH.has(typeof s)).map(s=>typeof s=="string"?mo(s):s.toString()).join("|")})$`),e._zod.parse=(s,c)=>{const o=s.value;return a.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),Xq=ce("$ZodLiteral",(e,t)=>{if(Yt.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"?mo(a):a?mo(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}}),Qq=ce("$ZodTransform",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new wN(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new ao;return n.value=s,n}});function _S(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const LN=ce("$ZodOptional",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oy(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=>_S(c,n.value)):_S(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),Wq=ce("$ZodExactOptional",(e,t)=>{LN.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),eG=ce("$ZodNullable",(e,t)=>{Yt.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oy(n.source)}|null)$`):void 0}),ot(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)}),tG=ce("$ZodDefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",ot(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=>NS(c,t)):NS(s,t)}});function NS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const nG=ce("$ZodPrefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",ot(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))}),rG=ce("$ZodNonOptional",(e,t)=>{Yt.init(e,t),ot(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=>CS(c,e)):CS(s,e)}});function CS(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 aG=ce("$ZodCatch",(e,t)=>{Yt.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(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(o=>qi(o,a,Hi()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(c=>qi(c,a,Hi()))},input:n.value}),n.issues=[]),n)}}),iG=ce("$ZodPipe",(e,t)=>{Yt.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(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(o=>td(o,t.in,a)):td(c,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(c=>td(c,t.out,a)):td(s,t.out,a)}});function td(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const sG=ce("$ZodReadonly",(e,t)=>{Yt.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>t.innerType?._zod?.optin),ot(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(TS):TS(s)}});function TS(e){return e.value=Object.freeze(e.value),e}const oG=ce("$ZodCustom",(e,t)=>{Fr.init(e,t),Yt.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=>ES(c,n,a,e));ES(s,n,a,e)}});function ES(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(ic(s))}}var AS;class lG{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 cG(){return new lG}(AS=globalThis).__zod_globalRegistry??(AS.__zod_globalRegistry=cG());const Ll=globalThis.__zod_globalRegistry;function uG(e,t){return new e({type:"string",...Te(t)})}function dG(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function OS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function fG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function hG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}function mG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}function pG(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}function xG(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}function gG(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}function yG(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}function bG(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}function vG(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}function kG(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}function wG(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}function SG(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}function zG(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}function jG(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}function _G(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}function NG(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}function CG(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}function TG(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}function EG(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}function AG(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}function OG(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}function MG(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}function DG(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}function RG(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}function $G(e){return new e({type:"unknown"})}function LG(e,t){return new e({type:"never",...Te(t)})}function PN(e,t){return new sq({check:"max_length",...Te(t),maximum:e})}function Pd(e,t){return new oq({check:"min_length",...Te(t),minimum:e})}function UN(e,t){return new lq({check:"length_equals",...Te(t),length:e})}function PG(e,t){return new cq({check:"string_format",format:"regex",...Te(t),pattern:e})}function UG(e){return new uq({check:"string_format",format:"lowercase",...Te(e)})}function IG(e){return new dq({check:"string_format",format:"uppercase",...Te(e)})}function BG(e,t){return new fq({check:"string_format",format:"includes",...Te(t),includes:e})}function VG(e,t){return new hq({check:"string_format",format:"starts_with",...Te(t),prefix:e})}function ZG(e,t){return new mq({check:"string_format",format:"ends_with",...Te(t),suffix:e})}function Eo(e){return new pq({check:"overwrite",tx:e})}function FG(e){return Eo(t=>t.normalize(e))}function HG(){return Eo(e=>e.trim())}function qG(){return Eo(e=>e.toLowerCase())}function GG(){return Eo(e=>e.toUpperCase())}function YG(){return Eo(e=>mH(e))}function JG(e,t,n){return new e({type:"array",element:t,...Te(n)})}function KG(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}function XG(e){const t=QG(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(ic(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(ic(s))}},e(n.value,n)));return t}function QG(e,t){const n=new Fr({check:"custom",...Te(t)});return n._zod.check=e,n}function IN(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??Ll,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 hn(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 o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const d=e._zod.toJSONSchema?.();if(d)o.schema=d;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,x);else{const b=o.schema,v=t.processors[s.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);v(e,t,b,x)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),hn(p,t,x),t.seen.get(p).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(o.schema,h),t.io==="input"&&_n(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function BN(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 o of e.seen.entries()){const d=e.metadataRegistry.get(o[0])?.id;if(d){const h=a.get(d);if(h&&h!==o[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,o[0])}}const s=o=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,b=e.external.uri??(S=>S);if(p)return{ref:b(p)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${b("__shared")}#/${d}/${v}`}}if(o[1]===n)return{ref:"#"};const m=`#/${d}/`,x=o[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:m+x}},c=o=>{if(o[1].schema.$ref)return;const d=o[1],{ref:h,defId:m}=s(o);d.def={...d.schema},m&&(d.defId=m);const x=d.schema;for(const p in x)delete x[p];x.$ref=h};if(e.cycles==="throw")for(const o of e.seen.entries()){const d=o[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
159
-
160
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const d=o[1];if(t===o[0]){c(o);continue}if(e.external){const m=e.external.registry.get(o[0])?.id;if(t!==o[0]&&m){c(o);continue}}if(e.metadataRegistry.get(o[0])?.id){c(o);continue}if(d.cycle){c(o);continue}if(d.count>1&&e.reused==="ref"){c(o);continue}}}function VN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const d=e.seen.get(o);if(d.ref===null)return;const h=d.def??d.schema,m={...h},x=d.ref;if(d.ref=null,x){a(x);const b=e.seen.get(x),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),o._zod.parent===x)for(const z in h)z==="$ref"||z==="allOf"||z in m||delete h[z];if(v.$ref&&b.def)for(const z in h)z==="$ref"||z==="allOf"||z in b.def&&JSON.stringify(h[z])===JSON.stringify(b.def[z])&&delete h[z]}const p=o._zod.parent;if(p&&p!==x){a(p);const b=e.seen.get(p);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:o,jsonSchema:h,path:d.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[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 o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const c=e.external?.defs??{};for(const o of e.seen.entries()){const d=o[1];d.def&&d.defId&&(c[d.defId]=d.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ud(t,"input",e.processors),output:Ud(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function _n(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return _n(a.element,n);if(a.type==="set")return _n(a.valueType,n);if(a.type==="lazy")return _n(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return _n(a.innerType,n);if(a.type==="intersection")return _n(a.left,n)||_n(a.right,n);if(a.type==="record"||a.type==="map")return _n(a.keyType,n)||_n(a.valueType,n);if(a.type==="pipe")return _n(a.in,n)||_n(a.out,n);if(a.type==="object"){for(const s in a.shape)if(_n(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(_n(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(_n(s,n))return!0;return!!(a.rest&&_n(a.rest,n))}return!1}const WG=(e,t={})=>n=>{const a=IN({...n,processors:t});return hn(e,a),BN(a,e),VN(a,e)},Ud=(e,t,n={})=>a=>{const{libraryOptions:s,target:c}=a??{},o=IN({...s??{},target:c,io:t,processors:n});return hn(e,o),BN(o,e),VN(o,e)},eY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tY=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:c,maximum:o,format:d,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(s.minLength=c),typeof o=="number"&&(s.maxLength=o),d&&(s.format=eY[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},nY=(e,t,n,a)=>{n.not={}},rY=(e,t,n,a)=>{},aY=(e,t,n,a)=>{const s=e._zod.def,c=zN(s.entries);c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),n.enum=c},iY=(e,t,n,a)=>{const s=e._zod.def,c=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(o))}else c.push(o);if(c.length!==0)if(c.length===1){const o=c[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else c.every(o=>typeof o=="number")&&(n.type="number"),c.every(o=>typeof o=="string")&&(n.type="string"),c.every(o=>typeof o=="boolean")&&(n.type="boolean"),c.every(o=>o===null)&&(n.type="null"),n.enum=c},sY=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},oY=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},lY=(e,t,n,a)=>{const s=n,c=e._zod.def,{minimum:o,maximum:d}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=hn(c.element,t,{...a,path:[...a.path,"items"]})},cY=(e,t,n,a)=>{const s=n,c=e._zod.def;s.type="object",s.properties={};const o=c.shape;for(const m in o)s.properties[m]=hn(o[m],t,{...a,path:[...a.path,"properties",m]});const d=new Set(Object.keys(o)),h=new Set([...d].filter(m=>{const x=c.shape[m]._zod;return t.io==="input"?x.optin===void 0:x.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=hn(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},uY=(e,t,n,a)=>{const s=e._zod.def,c=s.inclusive===!1,o=s.options.map((d,h)=>hn(d,t,{...a,path:[...a.path,c?"oneOf":"anyOf",h]}));c?n.oneOf=o:n.anyOf=o},dY=(e,t,n,a)=>{const s=e._zod.def,c=hn(s.left,t,{...a,path:[...a.path,"allOf",0]}),o=hn(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,h=[...d(c)?c.allOf:[c],...d(o)?o.allOf:[o]];n.allOf=h},fY=(e,t,n,a)=>{const s=e._zod.def,c=hn(s.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},hY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},mY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},pY=(e,t,n,a)=>{const s=e._zod.def;hn(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)))},xY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},gY=(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;hn(c,t,a);const o=t.seen.get(e);o.ref=c},yY=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType,n.readOnly=!0},ZN=(e,t,n,a)=>{const s=e._zod.def;hn(s.innerType,t,a);const c=t.seen.get(e);c.ref=s.innerType},bY=ce("ZodISODateTime",(e,t)=>{Tq.init(e,t),Ot.init(e,t)});function vY(e){return OG(bY,e)}const kY=ce("ZodISODate",(e,t)=>{Eq.init(e,t),Ot.init(e,t)});function wY(e){return MG(kY,e)}const SY=ce("ZodISOTime",(e,t)=>{Aq.init(e,t),Ot.init(e,t)});function zY(e){return DG(SY,e)}const jY=ce("ZodISODuration",(e,t)=>{Oq.init(e,t),Ot.init(e,t)});function _Y(e){return RG(jY,e)}const FN=(e,t)=>{TN.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>_H(e,n)},flatten:{value:n=>jH(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Rx,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Rx,2)}},isEmpty:{get(){return e.issues.length===0}}})},NY=ce("ZodError",FN),kr=ce("ZodError",FN,{Parent:Error}),CY=cy(kr),TY=uy(kr),EY=af(kr),AY=sf(kr),OY=TH(kr),MY=EH(kr),DY=AH(kr),RY=OH(kr),$Y=MH(kr),LY=DH(kr),PY=RH(kr),UY=$H(kr),Jt=ce("ZodType",(e,t)=>(Yt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ud(e,"input"),output:Ud(e,"output")}}),e.toJSONSchema=WG(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fi(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)=>hi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>CY(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>EY(e,n,a),e.parseAsync=async(n,a)=>TY(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>AY(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>OY(e,n,a),e.decode=(n,a)=>MY(e,n,a),e.encodeAsync=async(n,a)=>DY(e,n,a),e.decodeAsync=async(n,a)=>RY(e,n,a),e.safeEncode=(n,a)=>$Y(e,n,a),e.safeDecode=(n,a)=>LY(e,n,a),e.safeEncodeAsync=async(n,a)=>PY(e,n,a),e.safeDecodeAsync=async(n,a)=>UY(e,n,a),e.refine=(n,a)=>e.check(OJ(n,a)),e.superRefine=n=>e.check(MJ(n)),e.overwrite=n=>e.check(Eo(n)),e.optional=()=>$S(e),e.exactOptional=()=>bJ(e),e.nullable=()=>LS(e),e.nullish=()=>$S(LS(e)),e.nonoptional=n=>jJ(e,n),e.array=()=>lJ(e),e.or=n=>qN([e,n]),e.and=n=>hJ(e,n),e.transform=n=>PS(e,gJ(n)),e.default=n=>wJ(e,n),e.prefault=n=>zJ(e,n),e.catch=n=>NJ(e,n),e.pipe=n=>PS(e,n),e.readonly=()=>EJ(e),e.describe=n=>{const a=e.clone();return Ll.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return Ll.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ll.get(e);const a=e.clone();return Ll.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),HN=ce("_ZodString",(e,t)=>{dy.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>tY(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(PG(...a)),e.includes=(...a)=>e.check(BG(...a)),e.startsWith=(...a)=>e.check(VG(...a)),e.endsWith=(...a)=>e.check(ZG(...a)),e.min=(...a)=>e.check(Pd(...a)),e.max=(...a)=>e.check(PN(...a)),e.length=(...a)=>e.check(UN(...a)),e.nonempty=(...a)=>e.check(Pd(1,...a)),e.lowercase=a=>e.check(UG(a)),e.uppercase=a=>e.check(IG(a)),e.trim=()=>e.check(HG()),e.normalize=(...a)=>e.check(FG(...a)),e.toLowerCase=()=>e.check(qG()),e.toUpperCase=()=>e.check(GG()),e.slugify=()=>e.check(YG())}),IY=ce("ZodString",(e,t)=>{dy.init(e,t),HN.init(e,t),e.email=n=>e.check(dG(BY,n)),e.url=n=>e.check(xG(VY,n)),e.jwt=n=>e.check(AG(rJ,n)),e.emoji=n=>e.check(gG(ZY,n)),e.guid=n=>e.check(OS(MS,n)),e.uuid=n=>e.check(fG(nd,n)),e.uuidv4=n=>e.check(hG(nd,n)),e.uuidv6=n=>e.check(mG(nd,n)),e.uuidv7=n=>e.check(pG(nd,n)),e.nanoid=n=>e.check(yG(FY,n)),e.guid=n=>e.check(OS(MS,n)),e.cuid=n=>e.check(bG(HY,n)),e.cuid2=n=>e.check(vG(qY,n)),e.ulid=n=>e.check(kG(GY,n)),e.base64=n=>e.check(CG(eJ,n)),e.base64url=n=>e.check(TG(tJ,n)),e.xid=n=>e.check(wG(YY,n)),e.ksuid=n=>e.check(SG(JY,n)),e.ipv4=n=>e.check(zG(KY,n)),e.ipv6=n=>e.check(jG(XY,n)),e.cidrv4=n=>e.check(_G(QY,n)),e.cidrv6=n=>e.check(NG(WY,n)),e.e164=n=>e.check(EG(nJ,n)),e.datetime=n=>e.check(vY(n)),e.date=n=>e.check(wY(n)),e.time=n=>e.check(zY(n)),e.duration=n=>e.check(_Y(n))});function zp(e){return uG(IY,e)}const Ot=ce("ZodStringFormat",(e,t)=>{Nt.init(e,t),HN.init(e,t)}),BY=ce("ZodEmail",(e,t)=>{vq.init(e,t),Ot.init(e,t)}),MS=ce("ZodGUID",(e,t)=>{yq.init(e,t),Ot.init(e,t)}),nd=ce("ZodUUID",(e,t)=>{bq.init(e,t),Ot.init(e,t)}),VY=ce("ZodURL",(e,t)=>{kq.init(e,t),Ot.init(e,t)}),ZY=ce("ZodEmoji",(e,t)=>{wq.init(e,t),Ot.init(e,t)}),FY=ce("ZodNanoID",(e,t)=>{Sq.init(e,t),Ot.init(e,t)}),HY=ce("ZodCUID",(e,t)=>{zq.init(e,t),Ot.init(e,t)}),qY=ce("ZodCUID2",(e,t)=>{jq.init(e,t),Ot.init(e,t)}),GY=ce("ZodULID",(e,t)=>{_q.init(e,t),Ot.init(e,t)}),YY=ce("ZodXID",(e,t)=>{Nq.init(e,t),Ot.init(e,t)}),JY=ce("ZodKSUID",(e,t)=>{Cq.init(e,t),Ot.init(e,t)}),KY=ce("ZodIPv4",(e,t)=>{Mq.init(e,t),Ot.init(e,t)}),XY=ce("ZodIPv6",(e,t)=>{Dq.init(e,t),Ot.init(e,t)}),QY=ce("ZodCIDRv4",(e,t)=>{Rq.init(e,t),Ot.init(e,t)}),WY=ce("ZodCIDRv6",(e,t)=>{$q.init(e,t),Ot.init(e,t)}),eJ=ce("ZodBase64",(e,t)=>{Lq.init(e,t),Ot.init(e,t)}),tJ=ce("ZodBase64URL",(e,t)=>{Uq.init(e,t),Ot.init(e,t)}),nJ=ce("ZodE164",(e,t)=>{Iq.init(e,t),Ot.init(e,t)}),rJ=ce("ZodJWT",(e,t)=>{Vq.init(e,t),Ot.init(e,t)}),aJ=ce("ZodUnknown",(e,t)=>{Zq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rY()});function DS(){return $G(aJ)}const iJ=ce("ZodNever",(e,t)=>{Fq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nY(e,n,a)});function sJ(e){return LG(iJ,e)}const oJ=ce("ZodArray",(e,t)=>{Hq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lY(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(Pd(n,a)),e.nonempty=n=>e.check(Pd(1,n)),e.max=(n,a)=>e.check(PN(n,a)),e.length=(n,a)=>e.check(UN(n,a)),e.unwrap=()=>e.element});function lJ(e,t){return JG(oJ,e,t)}const cJ=ce("ZodObject",(e,t)=>{Gq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cY(e,n,a,s),ot(e,"shape",()=>t.shape),e.keyof=()=>mJ(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:DS()}),e.loose=()=>e.clone({...e._zod.def,catchall:DS()}),e.strict=()=>e.clone({...e._zod.def,catchall:sJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>vH(e,n),e.safeExtend=n=>kH(e,n),e.merge=n=>wH(e,n),e.pick=n=>yH(e,n),e.omit=n=>bH(e,n),e.partial=(...n)=>SH(GN,e,n[0]),e.required=(...n)=>zH(YN,e,n[0])});function uJ(e,t){const n={type:"object",shape:e??{},...Te(t)};return new cJ(n)}const dJ=ce("ZodUnion",(e,t)=>{Yq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uY(e,n,a,s),e.options=t.options});function qN(e,t){return new dJ({type:"union",options:e,...Te(t)})}const fJ=ce("ZodIntersection",(e,t)=>{Jq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dY(e,n,a,s)});function hJ(e,t){return new fJ({type:"intersection",left:e,right:t})}const Lx=ce("ZodEnum",(e,t)=>{Kq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(a,s,c)=>aY(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 o of a)if(n.has(o))c[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Lx({...t,checks:[],...Te(s),entries:c})},e.exclude=(a,s)=>{const c={...t.entries};for(const o of a)if(n.has(o))delete c[o];else throw new Error(`Key ${o} not found in enum`);return new Lx({...t,checks:[],...Te(s),entries:c})}});function mJ(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Lx({type:"enum",entries:n,...Te(t)})}const pJ=ce("ZodLiteral",(e,t)=>{Xq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>iY(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 RS(e,t){return new pJ({type:"literal",values:Array.isArray(e)?e:[e],...Te(t)})}const xJ=ce("ZodTransform",(e,t)=>{Qq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oY(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new wN(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(ic(c,n.value,t));else{const o=c;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ic(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(c=>(n.value=c,n)):(n.value=s,n)}});function gJ(e){return new xJ({type:"transform",transform:e})}const GN=ce("ZodOptional",(e,t)=>{LN.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>ZN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function $S(e){return new GN({type:"optional",innerType:e})}const yJ=ce("ZodExactOptional",(e,t)=>{Wq.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>ZN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function bJ(e){return new yJ({type:"optional",innerType:e})}const vJ=ce("ZodNullable",(e,t)=>{eG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function LS(e){return new vJ({type:"nullable",innerType:e})}const kJ=ce("ZodDefault",(e,t)=>{tG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function wJ(e,t){return new kJ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_N(t)}})}const SJ=ce("ZodPrefault",(e,t)=>{nG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function zJ(e,t){return new SJ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_N(t)}})}const YN=ce("ZodNonOptional",(e,t)=>{rG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function jJ(e,t){return new YN({type:"nonoptional",innerType:e,...Te(t)})}const _J=ce("ZodCatch",(e,t)=>{aG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function NJ(e,t){return new _J({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const CJ=ce("ZodPipe",(e,t)=>{iG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gY(e,n,a,s),e.in=t.in,e.out=t.out});function PS(e,t){return new CJ({type:"pipe",in:e,out:t})}const TJ=ce("ZodReadonly",(e,t)=>{sG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>yY(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function EJ(e){return new TJ({type:"readonly",innerType:e})}const AJ=ce("ZodCustom",(e,t)=>{oG.init(e,t),Jt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sY(e,n)});function OJ(e,t={}){return KG(AJ,e,t)}function MJ(e){return XG(e)}const DJ=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"devkit",label:"DevKit"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"chronos",label:"Chronos"}],RJ=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],Ml=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function $J(){const{data:e,error:t}=We("/api/config",tn.fetchConfig),{data:n}=We("/api/config/sati",tn.getSatiConfig),{data:a}=We("/api/config/apoc",tn.getApocConfig),{data:s}=We("/api/config/neo",tn.getNeoConfig),{data:c}=We("/api/config/trinity",tn.getTrinityConfig),{data:o}=We("/api/config/encryption-status",()=>tn.getEncryptionStatus()),{data:d}=We("/api/config/env-overrides",()=>tn.getEnvOverrides()),{data:h}=E2(),[m,x]=j.useState(null),[p,b]=j.useState(null),[v,S]=j.useState(null),[z,E]=j.useState(null),[_,A]=j.useState(null),[N,P]=j.useState(null),[D,M]=j.useState("general"),[V,U]=j.useState("oracle"),[K,I]=j.useState(!1),[te,le]=j.useState({}),[ne,oe]=j.useState(null);j.useEffect(()=>{e&&!p&&b(e)},[e]),j.useEffect(()=>{n&&!v&&S(n)},[n]),j.useEffect(()=>{a&&!_?A(a):!a&&!_&&p&&A({...p.apoc??p.llm,temperature:p.apoc?.temperature??.2,timeout_ms:p.apoc?.timeout_ms??3e4})},[a,p]),j.useEffect(()=>{s&&!z?E(s):!s&&!z&&p&&E({...p.neo??p.llm,temperature:p.neo?.temperature??.2})},[s,p]),j.useEffect(()=>{c&&!N?P(c):!c&&!N&&p&&P({...p.trinity??p.llm,temperature:p.trinity?.temperature??.2})},[c,p]),j.useEffect(()=>{h&&!m&&x(h)},[h]);const se=JSON.stringify(e)!==JSON.stringify(p)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(z)||JSON.stringify(a)!==JSON.stringify(_)||JSON.stringify(c)!==JSON.stringify(N)||JSON.stringify(h)!==JSON.stringify(m),Z={general:JSON.stringify(e?.agent)!==JSON.stringify(p?.agent)||e?.verbose_mode!==p?.verbose_mode,agents:JSON.stringify(e?.llm)!==JSON.stringify(p?.llm)||JSON.stringify(n)!==JSON.stringify(v)||JSON.stringify(s)!==JSON.stringify(z)||JSON.stringify(a)!==JSON.stringify(_)||JSON.stringify(c)!==JSON.stringify(N),devkit:JSON.stringify(e?.devkit)!==JSON.stringify(p?.devkit),audio:JSON.stringify(e?.audio)!==JSON.stringify(p?.audio),channels:JSON.stringify(e?.channels?.telegram)!==JSON.stringify(p?.channels?.telegram)||JSON.stringify(e?.channels?.discord)!==JSON.stringify(p?.channels?.discord)||JSON.stringify(e?.webhooks)!==JSON.stringify(p?.webhooks),ui:JSON.stringify(e?.ui)!==JSON.stringify(p?.ui),logging:JSON.stringify(e?.logging)!==JSON.stringify(p?.logging),chronos:JSON.stringify(h)!==JSON.stringify(m)},B=($,Oe)=>{if(!o?.apiKeysEncrypted)return null;const{morpheusSecretSet:Ue,apiKeysEncrypted:Je}=o,St=Je[$];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"}):d&&d[Y($)]?null:Ue?St?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"})},Y=$=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[$],ue=$=>!d||!d[$]?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"}),O=$=>!!(d&&d[$]),C=($,Oe)=>{if(!p)return;const Ue=JSON.parse(JSON.stringify(p));let Je=Ue;for(let St=0;St<$.length-1;St++)(Je[$[St]]===void 0||Je[$[St]]===null)&&(Je[$[St]]={}),Je=Je[$[St]];Je[$[$.length-1]]=Oe,b(Ue);try{fH.parse(Ue),le({})}catch(St){if(St instanceof NY){const Ze={};St.errors.forEach(rt=>{const ft=rt.path.join(".");Ze[ft]=rt.message}),le(Ze)}}},H=($,Oe)=>{v&&S({...v,[$]:Oe})},w=($,Oe)=>{_&&A({..._,[$]:Oe})},X=($,Oe)=>{z&&E({...z,[$]:Oe})},me=($,Oe)=>{N&&P({...N,[$]:Oe})},pe=()=>{!p||!N||P({...N,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},ge=()=>{!p||!v||S({...v,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},Pe=()=>{!p||!_||A({..._,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},Ee=()=>{!p||!z||E({...z,provider:p.llm.provider,model:p.llm.model,api_key:p.llm.api_key})},yt=async()=>{if(p){I(!0),oe(null);try{const $=await tn.updateConfig(p);v&&await tn.updateSatiConfig(v),z&&await tn.updateNeoConfig(z),_&&await tn.updateApocConfig(_),N&&await tn.updateTrinityConfig(N),m&&await Vi.updateConfig(m),Bn("/api/config"),Bn("/api/config/sati"),Bn("/api/config/neo"),Bn("/api/config/apoc"),Bn("/api/config/trinity"),Bn("/api/config/chronos"),le({});const Oe=$._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($){if(oe({type:"error",message:$.message}),$.details&&Array.isArray($.details)){const Oe={};$.details.forEach(Ue=>{const Je=Ue.path.join(".");Oe[Je]=Ue.message}),le(Oe)}}finally{I(!1)}}};return t?u.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):p?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(Up,{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:yt,disabled:!se||Object.keys(te).length>0||K,className:`px-4 py-2 rounded font-medium transition-colors ${se&&Object.keys(te).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(Yi,{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:DJ.map($=>u.jsxs("button",{onClick:()=>M($.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===$.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:[$.label,Z[$.id]&&u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0"})]},$.id))})}),u.jsxs("div",{className:"space-y-6",children:[D==="general"&&u.jsxs(zn,{title:"Agent Identity",children:[u.jsx(Ye,{label:"Agent Name",value:p.agent.name,onChange:$=>C(["agent","name"],$.target.value),error:te["agent.name"]}),u.jsx(Ye,{label:"Personality",value:p.agent.personality,onChange:$=>C(["agent","personality"],$.target.value),error:te["agent.personality"]}),u.jsx(pn,{label:"Verbose Mode",value:p.verbose_mode!==!1?"true":"false",onChange:$=>C(["verbose_mode"],$.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:RJ.map($=>u.jsx("button",{onClick:()=>U($.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${V===$.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:$.label},$.id))}),V==="oracle"&&u.jsxs(zn,{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"}),ue("llm.provider")]}),u.jsx(pn,{label:"",value:p.llm.provider,onChange:$=>C(["llm","provider"],$.target.value),options:Ml,error:te["llm.provider"],disabled:O("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"}),ue("llm.model")]}),u.jsx(Ye,{label:"",value:p.llm.model,onChange:$=>C(["llm","model"],$.target.value),disabled:O("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"}),ue("llm.temperature")]}),u.jsx(Ft,{label:"",value:p.llm.temperature,onChange:$=>C(["llm","temperature"],parseFloat($.target.value)),step:.1,min:0,max:1,error:te["llm.temperature"],disabled:O("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"}),ue("llm.max_tokens")]}),u.jsx(Ft,{label:"",value:p.llm.max_tokens??"",onChange:$=>C(["llm","max_tokens"],$.target.value?parseInt($.target.value):void 0),min:1,error:te["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:O("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)"}),ue("llm.context_window")]}),u.jsx(Ft,{label:"",value:p.llm.context_window??100,onChange:$=>C(["llm","context_window"],parseInt($.target.value)),min:1,step:1,error:te["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:O("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:[ue("llm.api_key"),B("oracle",p.llm.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:p.llm.api_key||"",onChange:$=>C(["llm","api_key"],$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("llm.api_key")}),p.llm.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:p.llm.base_url||"https://openrouter.ai/api/v1",onChange:$=>C(["llm","base_url"],$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),V==="sati"&&u.jsxs(zn,{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:ge,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"}),ue("sati.provider")]}),u.jsx(pn,{label:"",value:v.provider,onChange:$=>H("provider",$.target.value),options:Ml,disabled:O("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"}),ue("sati.model")]}),u.jsx(Ye,{label:"",value:v.model,onChange:$=>H("model",$.target.value),disabled:O("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:[ue("sati.api_key"),B("sati",v.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:v.api_key||"",onChange:$=>H("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("sati.api_key")}),v.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:v.base_url||"https://openrouter.ai/api/v1",onChange:$=>H("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),u.jsx(Ft,{label:"Memory Limit",value:v.memory_limit??10,onChange:$=>H("memory_limit",parseInt($.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),u.jsx(Nr,{label:"Enable Archived Sessions in Memory Retrieval",checked:v.enabled_archived_sessions??!0,onChange:$=>H("enabled_archived_sessions",$)})]})]}),V==="neo"&&u.jsxs(zn,{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"})]}),z&&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"}),ue("neo.provider")]}),u.jsx(pn,{label:"",value:z.provider,onChange:$=>X("provider",$.target.value),options:Ml,disabled:O("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"}),ue("neo.model")]}),u.jsx(Ye,{label:"",value:z.model,onChange:$=>X("model",$.target.value),disabled:O("neo.model")}),u.jsx(Ye,{label:"Personality",value:z.personality||"analytical_engineer",onChange:$=>X("personality",$.target.value),placeholder:"analytical_engineer",helperText:"e.g., analytical_engineer, meticulous_auditor, systems_thinker"}),u.jsx(pn,{label:"Execution Mode",value:z.execution_mode||"async",onChange:$=>X("execution_mode",$.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"}),ue("neo.temperature")]}),u.jsx(Ft,{label:"",value:z.temperature,onChange:$=>X("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:O("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"}),ue("neo.max_tokens")]}),u.jsx(Ft,{label:"",value:z.max_tokens??"",onChange:$=>X("max_tokens",$.target.value?parseInt($.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:O("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)"}),ue("neo.context_window")]}),u.jsx(Ft,{label:"",value:z.context_window??100,onChange:$=>X("context_window",parseInt($.target.value)),min:1,step:1,disabled:O("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:[ue("neo.api_key"),B("neo",z.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:z.api_key||"",onChange:$=>X("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("neo.api_key")}),z.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:z.base_url||"https://openrouter.ai/api/v1",onChange:$=>X("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),V==="trinity"&&u.jsxs(zn,{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"})]}),N&&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"}),ue("trinity.provider")]}),u.jsx(pn,{label:"",value:N.provider,onChange:$=>me("provider",$.target.value),options:Ml,disabled:O("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"}),ue("trinity.model")]}),u.jsx(Ye,{label:"",value:N.model,onChange:$=>me("model",$.target.value),disabled:O("trinity.model")}),u.jsx(Ye,{label:"Personality",value:N.personality||"data_specialist",onChange:$=>me("personality",$.target.value),placeholder:"data_specialist",helperText:"e.g., data_specialist, query_optimizer, db_architect"}),u.jsx(pn,{label:"Execution Mode",value:N.execution_mode||"async",onChange:$=>me("execution_mode",$.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"}),ue("trinity.temperature")]}),u.jsx(Ft,{label:"",value:N.temperature,onChange:$=>me("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:O("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"}),ue("trinity.max_tokens")]}),u.jsx(Ft,{label:"",value:N.max_tokens??"",onChange:$=>me("max_tokens",$.target.value?parseInt($.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:O("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:[ue("trinity.api_key"),B("trinity",N.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:N.api_key||"",onChange:$=>me("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("trinity.api_key")}),N.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:N.base_url||"https://openrouter.ai/api/v1",onChange:$=>me("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),V==="apoc"&&u.jsxs(zn,{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"})]}),_&&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"}),ue("apoc.provider")]}),u.jsx(pn,{label:"",value:_.provider,onChange:$=>w("provider",$.target.value),options:Ml,disabled:O("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"}),ue("apoc.model")]}),u.jsx(Ye,{label:"",value:_.model,onChange:$=>w("model",$.target.value),disabled:O("apoc.model")}),u.jsx(Ye,{label:"Personality",value:_.personality||"pragmatic_dev",onChange:$=>w("personality",$.target.value),placeholder:"pragmatic_dev",helperText:"e.g., pragmatic_dev, cautious_admin, automation_specialist"}),u.jsx(pn,{label:"Execution Mode",value:_.execution_mode||"async",onChange:$=>w("execution_mode",$.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"}),ue("apoc.temperature")]}),u.jsx(Ft,{label:"",value:_.temperature,onChange:$=>w("temperature",parseFloat($.target.value)),step:.1,min:0,max:1,disabled:O("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:[ue("apoc.api_key"),B("apoc",_.api_key)]})]}),u.jsx(Ye,{label:"",type:"password",value:_.api_key||"",onChange:$=>w("api_key",$.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:O("apoc.api_key")}),_.provider==="openrouter"&&u.jsx(Ye,{label:"Base URL",value:_.base_url||"https://openrouter.ai/api/v1",onChange:$=>w("base_url",$.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),u.jsx(Ft,{label:"Timeout (ms)",value:_.timeout_ms??3e4,onChange:$=>w("timeout_ms",parseInt($.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(zn,{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(Ye,{label:"Sandbox Directory",value:p.devkit?.sandbox_dir||"",onChange:$=>C(["devkit","sandbox_dir"],$.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:O("devkit.sandbox_dir")}),u.jsx(pn,{label:"Read-Only Mode",value:p.devkit?.readonly_mode?"true":"false",onChange:$=>C(["devkit","readonly_mode"],$.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:O("devkit.readonly_mode")}),u.jsx(Ft,{label:"Timeout (ms)",value:p.devkit?.timeout_ms??3e4,onChange:$=>C(["devkit","timeout_ms"],parseInt($.target.value)),min:1e3,step:1e3,helperText:"Default timeout for shell and system operations in milliseconds.",disabled:O("devkit.timeout_ms")})]}),u.jsxs(zn,{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(Nr,{label:"Filesystem (read, write, list, copy, move, delete files)",checked:p.devkit?.enable_filesystem!==!1,onChange:$=>C(["devkit","enable_filesystem"],$)}),u.jsx(Nr,{label:"Shell (run_command, run_script, which)",checked:p.devkit?.enable_shell!==!1,onChange:$=>C(["devkit","enable_shell"],$)}),u.jsx(Nr,{label:"Git (status, diff, commit, push, pull, clone, branch)",checked:p.devkit?.enable_git!==!1,onChange:$=>C(["devkit","enable_git"],$)}),u.jsx(Nr,{label:"Network (http_request, ping, dns_lookup, download_file)",checked:p.devkit?.enable_network!==!1,onChange:$=>C(["devkit","enable_network"],$)})]}),u.jsxs(zn,{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(Ye,{label:"Allowed Commands",value:(p.devkit?.allowed_shell_commands||[]).join(", "),onChange:$=>C(["devkit","allowed_shell_commands"],$.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:O("devkit.allowed_shell_commands")})]})]}),D==="audio"&&u.jsxs(zn,{title:"Audio Transcription",children:[u.jsx(Nr,{label:"Enable Audio",checked:p.audio.enabled,onChange:$=>C(["audio","enabled"],$)}),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"}),ue("audio.provider")]}),u.jsx(pn,{label:"",value:p.audio.provider||"google",onChange:$=>C(["audio","provider"],$.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:te["audio.provider"],disabled:O("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"}),ue("audio.model")]}),u.jsx(Ye,{label:"",value:p.audio.model,onChange:$=>C(["audio","model"],$.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:te["audio.model"],disabled:O("audio.model")}),p.audio.provider==="ollama"&&u.jsx(Ye,{label:"Base URL",value:p.audio.base_url||"",onChange:$=>C(["audio","base_url"],$.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:[ue("audio.apiKey"),B("audio",p.audio.apiKey)]})]}),u.jsx(Ye,{label:"",type:"password",value:p.audio.apiKey||"",onChange:$=>C(["audio","apiKey"],$.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:O("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)"}),ue("audio.maxDurationSeconds")]}),u.jsx(Ft,{label:"",value:p.audio.maxDurationSeconds,onChange:$=>C(["audio","maxDurationSeconds"],parseInt($.target.value)),min:1,disabled:O("audio.maxDurationSeconds")}),u.jsx(Ye,{label:"Supported Mime Types",value:p.audio.supportedMimeTypes.join(", "),onChange:$=>C(["audio","supportedMimeTypes"],$.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(zn,{title:"Telegram",children:[u.jsx(Nr,{label:"Enable Telegram",checked:p.channels.telegram.enabled,onChange:$=>C(["channels","telegram","enabled"],$)}),p.channels.telegram.enabled&&u.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[u.jsx(Ye,{label:"Bot Token",type:"password",value:p.channels.telegram.token||"",onChange:$=>C(["channels","telegram","token"],$.target.value)}),u.jsx(Ye,{label:"Allowed Users (comma separated)",value:p.channels.telegram.allowedUsers.join(", "),onChange:$=>C(["channels","telegram","allowedUsers"],$.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),u.jsxs(zn,{title:"Discord",children:[u.jsx(Nr,{label:"Enable Discord",checked:p.channels.discord.enabled,onChange:$=>C(["channels","discord","enabled"],$)}),p.channels.discord.enabled&&u.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[u.jsx(Ye,{label:"Bot Token",type:"password",value:p.channels.discord.token||"",onChange:$=>C(["channels","discord","token"],$.target.value)}),u.jsx(Ye,{label:"Allowed Users (comma separated)",value:(p.channels.discord.allowedUsers??[]).join(", "),onChange:$=>C(["channels","discord","allowedUsers"],$.target.value.split(",").map(Oe=>Oe.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),D==="ui"&&u.jsxs(zn,{title:"Dashboard",children:[u.jsx(Nr,{label:"Enable Web UI",checked:p.ui.enabled,onChange:$=>C(["ui","enabled"],$)}),u.jsx(Ft,{label:"Port",value:p.ui.port,onChange:$=>C(["ui","port"],parseInt($.target.value)),disabled:!0,helperText:"Port changes require daemon restart."})]}),D==="logging"&&u.jsxs(zn,{title:"Logging",children:[u.jsx(Nr,{label:"Enable Logging",checked:p.logging.enabled,onChange:$=>C(["logging","enabled"],$)}),u.jsx(pn,{label:"Log Level",value:p.logging.level,onChange:$=>C(["logging","level"],$.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),D==="chronos"&&m&&u.jsxs(zn,{title:"Chronos — Temporal Intent Engine",children:[u.jsx(pn,{label:"Timezone",value:m.timezone,onChange:$=>x({...m,timezone:$.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(Ft,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:$=>x({...m,check_interval_ms:Number($.target.value)*1e3}),min:60}),u.jsx(Ft,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:$=>x({...m,max_active_jobs:Number($.target.value)}),min:1,max:1e3})]})]})]}):u.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function LJ(){const{data:e}=Z3(),[t,n]=j.useState(null),{data:a,mutate:s}=F3(t),c=j.useRef(null);return j.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),j.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[a]),u.jsxs($e.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($p,{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(o=>u.jsxs("button",{onClick:()=>n(o.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===o.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($p,{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:o.name}),u.jsxs("span",{className:"text-xs opacity-70",children:[(o.size/1024).toFixed(1)," KB"]})]})]},o.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:o=>n(o.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(o=>u.jsx("option",{value:o.name,children:o.name},o.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(Ka,{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((o,d)=>{const h=o.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]})]},d):u.jsx("div",{children:o},d)}):u.jsx("span",{className:"opacity-50",children:"Select a log file to view content..."})})]})]})]})}function PJ(){const[e,t]=j.useState(null),[n,a]=j.useState([]),[s,c]=j.useState(!0),[o,d]=j.useState("");if(j.useEffect(()=>{async function x(){try{const[p,b]=await Promise.all([bx.fetchUsageStats(),bx.fetchGroupedUsageStats()]);t(p),a(b)}catch(p){d("Failed to load usage statistics"),console.error(p)}finally{c(!1)}}x()},[]),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(o)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: ",o]});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($e.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.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(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:"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($e.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(Pp,{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($e.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(Qs,{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($e.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(io,{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($e.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((x,p)=>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:x.provider}),u.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:x.model}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.messageCount.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.totalInputTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.totalOutputTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:x.totalTokens.toLocaleString()}),u.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:x.totalAudioSeconds>0?x.totalAudioSeconds.toLocaleString():"—"}),u.jsx("td",{className:"p-4 text-right font-bold text-green-600 dark:text-green-400",children:x.estimatedCostUsd!=null?`$${x.estimatedCostUsd.toFixed(4)}`:"—"})]},`${x.provider}-${x.model}-${p}`))})]})})]})]})}const UJ=()=>{const[e,t]=j.useState(""),[n,a]=j.useState(""),s=yo(),c=br(),o=d=>{d.preventDefault(),e&&(a(""),fetch("/api/config",{headers:{"x-architect-pass":e}}).then(async h=>{if(h.ok){localStorage.setItem("morpheus.auth.token",e);const m=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:o,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:d=>t(d.target.value),className:"w-full bg-azure-bg dark:bg-black border border-azure-border dark:border-green-800 p-2 focus:outline-none focus:border-azure-primary dark:focus:border-green-500 text-azure-text-primary dark:text-green-500 placeholder-azure-text-secondary/50 dark:placeholder-green-900 rounded dark:rounded-none",placeholder:"••••••••",autoFocus:!0})]}),n&&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."})]})})},IJ=({children:e})=>{const{isAuthenticated:t}=z_(),n=br();return t?u.jsx(u.Fragment,{children:e}):u.jsx(xz,{to:"/login",state:{from:n},replace:!0})},BJ=({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})}),VJ=({...e})=>u.jsx("thead",{...e}),ZJ=({...e})=>u.jsx("tbody",{...e}),jp=({...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}),Vs=({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}),Ri=({className:e,...t})=>u.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),US=({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})},Id=({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})},_p=({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}),IS=({className:e,...t})=>u.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),FJ=({className:e,...t})=>u.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),Np=({className:e,...t})=>u.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),HJ=({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})},qJ=({className:e,...t})=>u.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),JN=({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})]})]})},GJ=({isOpen:e,onClose:t,memory:n})=>n?u.jsx(JN,{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(Yx,{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(Id,{variant:"outline",children:n.category})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(n3,{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(Id,{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(Sz,{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(er,{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(lc,{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(t5,{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(s5,{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(xr,{onClick:t,children:"Close"})})]})}):null,KN=({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:o="Cancel"})=>u.jsx(JN,{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(xr,{variant:"outline",onClick:t,children:o}),u.jsx(xr,{variant:"destructive",onClick:()=>{n(),t()},children:c})]})]})}),YJ=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),s=j.useCallback(h=>(t(!0),a(null),xe.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),c=j.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(x=>x).catch(x=>{throw a(x.message||"An error occurred"),x}).finally(()=>{t(!1)})),[]),o=j.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(x=>x).catch(x=>{throw a(x.message||"An error occurred"),x}).finally(()=>{t(!1)})),[]),d=j.useCallback(h=>(t(!0),a(null),xe.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:s,post:c,put:o,del:d,loading:e,error:n}},JJ=()=>{const[e,t]=j.useState([]),[n,a]=j.useState(!0),[s,c]=j.useState([]),[o,d]=j.useState(""),[h,m]=j.useState("all"),[x,p]=j.useState("all"),[b,v]=j.useState(null),[S,z]=j.useState(!1),[E,_]=j.useState(null),[A,N]=j.useState(!1),[P,D]=j.useState(null),[M,V]=j.useState(!1),{get:U,del:K,post:I}=YJ();j.useEffect(()=>{te()},[]);const te=async()=>{try{a(!0);const C=await U("/sati/memories");t(C),v(null)}catch(C){v("Failed to load memories. Please try again."),console.error("Error fetching memories:",C)}finally{a(!1)}},le=()=>{s.length===Y.length?c([]):c(Y.map(C=>C.id))},ne=C=>{s.includes(C)?c(s.filter(H=>H!==C)):c([...s,C])},oe=async()=>{if(s.length!==0)try{await I("/sati/memories/bulk-delete",{ids:s}),await te(),c([]),z(!1)}catch(C){v("Failed to delete memories. Please try again."),console.error("Error deleting memories:",C)}},se=C=>{D(C),V(!0)},Z=async()=>{if(P)try{await K(`/sati/memories/${P}`),await te()}catch(C){v("Failed to delete memory. Please try again."),console.error("Error deleting memory:",C)}finally{D(null),V(!1)}},B=C=>{_(C),N(!0)},Y=e.filter(C=>{const H=C.summary.toLowerCase().includes(o.toLowerCase())||C.details?.toLowerCase().includes(o.toLowerCase())||C.category.toLowerCase().includes(o.toLowerCase()),w=h==="all"||C.category===h,X=x==="all"||C.importance===x;return H&&w&&X&&!C.archived}),ue=Array.from(new Set(e.map(C=>C.category))),O=Array.from(new Set(e.map(C=>C.importance)));return n?u.jsx(_p,{className:"w-full",children:u.jsx(Np,{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(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:"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(xr,{variant:"destructive",size:"sm",onClick:()=>z(!0),disabled:s.length===0,children:[u.jsx(ga,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),b&&u.jsx(HJ,{variant:"destructive",children:u.jsx(qJ,{children:b})}),u.jsxs(_p,{children:[u.jsx(IS,{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(P5,{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:o,onChange:C=>d(C.target.value),className:"w-full pl-10 pr-4 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight"})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[u.jsxs("select",{value:h,onChange:C=>m(C.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[u.jsx("option",{value:"all",children:"All Categories"}),ue.map(C=>u.jsx("option",{value:C,children:C},C))]}),u.jsxs("select",{value:x,onChange:C=>p(C.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[u.jsx("option",{value:"all",children:"All Importance"}),O.map(C=>u.jsx("option",{value:C,children:C},C))]})]})]})}),u.jsx(Np,{className:"p-0",children:u.jsxs(BJ,{children:[u.jsx(VJ,{children:u.jsxs(jp,{className:"hover:bg-transparent",children:[u.jsx(Vs,{className:"w-12",children:u.jsx(US,{checked:Y.length>0&&s.length===Y.length,onCheckedChange:le})}),u.jsx(Vs,{children:"Summary"}),u.jsx(Vs,{children:"Category"}),u.jsx(Vs,{children:"Importance"}),u.jsx(Vs,{children:"Created"}),u.jsx(Vs,{className:"w-32",children:"Actions"})]})}),u.jsx(ZJ,{children:Y.length===0?u.jsx(jp,{children:u.jsx(Ri,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):Y.map(C=>u.jsxs(jp,{children:[u.jsx(Ri,{children:u.jsx(US,{checked:s.includes(C.id),onCheckedChange:()=>ne(C.id)})}),u.jsx(Ri,{className:"font-medium max-w-xs truncate",children:C.summary}),u.jsx(Ri,{children:u.jsx(Id,{variant:"outline",children:C.category})}),u.jsx(Ri,{children:u.jsx(Id,{variant:C.importance==="critical"?"destructive":C.importance==="high"?"default":C.importance==="medium"?"secondary":"outline",children:C.importance})}),u.jsx(Ri,{children:u.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[u.jsx(Sz,{className:"w-4 h-4"}),new Date(C.created_at).toLocaleDateString()]})}),u.jsx(Ri,{children:u.jsxs("div",{className:"flex gap-1",children:[u.jsx(xr,{variant:"ghost",size:"sm",onClick:()=>B(C),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:u.jsx(lc,{className:"w-4 h-4"})}),u.jsx(xr,{variant:"ghost",size:"sm",onClick:()=>se(C.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:u.jsx(ga,{className:"w-4 h-4"})})]})})]},C.id))})]})})]}),S&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsxs(_p,{className:"w-full max-w-md mx-4",children:[u.jsx(IS,{children:u.jsx(FJ,{children:"Delete Memories"})}),u.jsxs(Np,{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(xr,{variant:"outline",onClick:()=>z(!1),children:"Cancel"}),u.jsx(xr,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),u.jsx(GJ,{isOpen:A,onClose:()=>N(!1),memory:E}),u.jsx(KN,{isOpen:M,onClose:()=>V(!1),onConfirm:Z,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},KJ=({label:e,values:t,onChange:n,placeholder:a})=>{const s=t.length>0?t:[""],c=(h,m)=>{const x=[...s];x[h]=m,n(x.filter(p=>p.trim().length>0))},o=()=>n([...s,""]),d=h=>{const m=s.filter((x,p)=>p!==h);n(m.filter(x=>x.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:x=>c(m,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:()=>d(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:o,children:"Add argument"})]})},BS=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const c=j.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),o=(m,x,p)=>{const b=[...c];b[m]={...b[m],[x]:p},n(b.filter(v=>v.key.trim().length>0||v.value.trim().length>0))},d=()=>n([...c,{key:"",value:""}]),h=m=>{const x=c.filter((p,b)=>b!==m);n(x.filter(p=>p.key.trim().length>0||p.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,x)=>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:p=>o(x,"key",p.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:p=>o(x,"value",p.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(x),children:"Remove"})]},`${e}-${x}`)),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:d,children:"Add entry"})]})},XJ=({transport:e,command:t,url:n,args:a,env:s,headers:c,onCommandChange:o,onUrlChange:d,onArgsChange:h,onEnvChange:m,onHeadersChange:x})=>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:p=>o(p.target.value),placeholder:"npx"})]}),u.jsx(KJ,{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:p=>d(p.target.value),placeholder:"https://example.com/mcp"})]}),u.jsx(BS,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&u.jsx(BS,{label:"Headers",values:c,onChange:x,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),QJ=uJ({name:zp().min(1,"Name is required"),transport:qN([RS("stdio"),RS("http")]),command:zp().optional(),url:zp().optional()}),rd=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Cp=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),WJ=({open:e,mode:t,initial:n,onClose:a,onSubmit:s})=>{const[c,o]=j.useState(n?.name??""),[d,h]=j.useState(n?.config.transport??"stdio"),[m,x]=j.useState(n?.config.transport==="stdio"?n.config.command:""),[p,b]=j.useState(n?.config.transport==="http"?n.config.url:""),[v,S]=j.useState(n?.config.args??[]),[z,E]=j.useState(rd(n?.config.env)),[_,A]=j.useState(n?.config.transport==="http"?rd(n.config.headers):[]),[N,P]=j.useState(null);j.useEffect(()=>{e&&(o(n?.name??""),h(n?.config.transport??"stdio"),x(n?.config.transport==="stdio"?n.config.command:""),b(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),E(rd(n?.config.env)),A(n?.config.transport==="http"?rd(n.config.headers):[]),P(null))},[e,n]);const D=t==="create",M=async()=>{const U=QJ.safeParse({name:c,transport:d,command:m,url:p});if(!U.success){P(U.error.issues[0]?.message??"Invalid form");return}if(d==="stdio"&&(!m||m.trim().length===0)){P("Command is required for stdio transport.");return}if(d==="http"&&(!p||p.trim().length===0)){P("URL is required for http transport.");return}const K=d==="stdio"?{transport:"stdio",command:m.trim(),args:v.length>0?v:void 0,env:z.length>0?Cp(z):void 0}:{transport:"http",url:p.trim(),headers:_.length>0?Cp(_):void 0,env:z.length>0?Cp(z):void 0};P(null),await s(c.trim(),K)},V=j.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return u.jsx(Ir,{open:e,onOpenChange:a,children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{children:V})}),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=>o(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:d,onChange:U=>h(U.target.value),children:[u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"})]})]}),u.jsx(XJ,{transport:d,command:m,url:p,args:v,env:z,headers:_,onCommandChange:x,onUrlChange:b,onArgsChange:S,onEnvChange:E,onHeadersChange:A}),N&&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:N}),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 eK({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(vd,{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(_z,{className:"w-2.5 h-2.5"}),"http"]})}function tK({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(vo,{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(ei,{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 nK=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:s})=>{const c=t?.ok,o=t&&!t.ok,d=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?o?"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":o?"bg-red-500/10":"bg-azure-primary/10 dark:bg-matrix-highlight/10":"bg-azure-surface dark:bg-zinc-900"}`,children:u.jsx(dc,{className:`w-4 h-4 ${e.enabled?c?"text-emerald-500":o?"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(eK,{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(tK,{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})]}),d.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 (",d.length,")"]}),u.jsx("div",{className:"flex flex-wrap gap-1",children:d.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))})]}),o&&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(Gi,{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(uc,{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(Kx,{className:"w-4 h-4"}):u.jsx(Jx,{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(ga,{className:"w-3.5 h-3.5"})})]})]})]})},rK=()=>{const{data:e,error:t,mutate:n,isLoading:a}=We("/api/mcp/servers",()=>hr.fetchServers()),[s,c]=j.useState(""),[o,d]=j.useState("all"),[h,m]=j.useState(!1),[x,p]=j.useState(null),[b,v]=j.useState(!1),[S,z]=j.useState(null),[E,_]=j.useState(null),[A,N]=j.useState({}),[P,D]=j.useState(!1),[M,V]=j.useState(!1),[U,K]=j.useState(null),I=e?.servers??[];j.useEffect(()=>{hr.fetchStats().then(C=>{K(C);const H={};for(const w of C.servers)H[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};N(H)}).catch(()=>{})},[]);const te=j.useMemo(()=>I.filter(C=>{const H=C.name.toLowerCase().includes(s.toLowerCase()),w=o==="all"||C.config.transport===o;return H&&w}),[I,s,o]),le=()=>{p(null),m(!0)},ne=C=>{p(C),m(!0)},oe=async()=>{const C=await hr.fetchStats();K(C);const H={};for(const w of C.servers)H[w.name]={name:w.name,ok:w.ok,toolCount:w.toolCount,error:w.error};return N(H),C},se=async(C,H)=>{try{x?await hr.updateServer(x.name,H):await hr.addServer(C,H),m(!1),p(null),await n(),await hr.reloadTools();const w=await oe();_({type:"success",message:`MCP server saved. Tools reloaded: ${w.totalTools} total.`})}catch(w){_({type:"error",message:w.message||"Failed to save MCP server."})}},Z=async C=>{z(C),v(!0)},B=async()=>{if(S)try{await hr.deleteServer(S.name),await n(),v(!1),z(null),await hr.reloadTools();const C=await oe();_({type:"success",message:`MCP server deleted. Tools reloaded: ${C.totalTools} total.`})}catch(C){_({type:"error",message:C.message||"Failed to delete MCP server."})}},Y=async()=>{D(!0);try{const C=await oe();_({type:"success",message:`Status checked: ${C.totalTools} tools from ${C.servers.length} servers.`})}catch(C){_({type:"error",message:C.message||"Failed to check MCP status."})}finally{D(!1)}},ue=async()=>{V(!0);try{await hr.reloadTools();const C=await oe();_({type:"success",message:`MCP tools reloaded: ${C.totalTools} tools from ${C.servers.length} servers.`})}catch(C){_({type:"error",message:C.message||"Failed to reload MCP tools."})}finally{V(!1)}},O=async(C,H)=>{try{await hr.toggleServer(C.name,H),await n(),await hr.reloadTools();const w=await oe();_({type:"success",message:`MCP server ${H?"enabled":"disabled"}. Tools reloaded: ${w.totalTools} total.`})}catch(w){_({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(bd,{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:P,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:Y,children:P?"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:ue,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"})]})]}),E&&u.jsx("div",{className:`p-4 rounded border ${E.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:E.message}),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=>c(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:o,onChange:C=>d(C.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&&te.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:te.map(C=>u.jsx(nK,{server:C,probeResult:A[C.name],onEdit:ne,onDelete:Z,onToggle:O},`${C.name}-${C.enabled?"on":"off"}`))}),u.jsx(WJ,{open:h,mode:x?"edit":"create",initial:x??void 0,onClose:()=>m(!1),onSubmit:se}),u.jsx(Ir,{open:b,onOpenChange:v,children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{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:['"',S?.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:B,children:"Delete"})]})]})]})})]})},Tp={list:()=>xe.get("/model-pricing"),upsert:e=>xe.post("/model-pricing",e),update:(e,t,n)=>xe.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>xe.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},aK={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},VS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},iK=["anthropic","openai","google","openrouter","ollama","other"],ZS=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),sK=()=>{const{data:e=[],mutate:t}=We("/api/model-pricing",()=>Tp.list()),[n,a]=j.useState(!1),[s,c]=j.useState(null),[o,d]=j.useState(ZS()),[h,m]=j.useState(null),[x,p]=j.useState(null),[b,v]=j.useState(!1),S=(N,P)=>{p({type:N,message:P}),setTimeout(()=>p(null),3e3)},z=()=>{c(null),d(ZS()),a(!0)},E=N=>{c(N),d({...N}),a(!0)},_=async()=>{if(!(!o.provider.trim()||!o.model.trim())){v(!0);try{await Tp.upsert(o),await t(),a(!1),S("success",s?"Pricing updated.":"Pricing created.")}catch{S("error","Failed to save pricing entry.")}finally{v(!1)}}},A=async()=>{if(h)try{await Tp.delete(h.provider,h.model),await t(),m(null),S("success","Pricing entry deleted.")}catch{S("error","Failed to delete pricing entry.")}};return u.jsxs($e.div,{variants:aK,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:VS,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(io,{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:z,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(oo,{className:"w-4 h-4"})," Add Pricing"]})]}),x&&u.jsx($e.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${x.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:x.message}),u.jsx($e.div,{variants:VS,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(N=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:N},N))})}),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(N=>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:N.provider}),u.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:N.model}),u.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.input_price_per_1m.toFixed(4)]}),u.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.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:()=>E(N),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:u.jsx(uc,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>m(N),className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",title:"Delete",children:u.jsx(ga,{className:"w-4 h-4"})})]})})]},`${N.provider}/${N.model}`))})]})}),u.jsx(Ir,{open:n,onOpenChange:a,children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{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:o.provider}):u.jsxs("select",{value:o.provider,onChange:N=>d({...o,provider:N.target.value}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight",children:[u.jsx("option",{value:"",children:"Select provider..."}),iK.map(N=>u.jsx("option",{value:N,children:N},N))]})]}),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:o.model}):u.jsx("input",{type:"text",value:o.model,onChange:N=>d({...o,model:N.target.value}),placeholder:"e.g. gpt-4o",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),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:o.input_price_per_1m,onChange:N=>d({...o,input_price_per_1m:parseFloat(N.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),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:o.output_price_per_1m,onChange:N=>d({...o,output_price_per_1m:parseFloat(N.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]})]}),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:_,disabled:b||!o.provider.trim()||!o.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(Ir,{open:!!h,onOpenChange:N=>!N&&m(null),children:u.jsxs(co,{children:[u.jsx(Br,{children:u.jsx(Vr,{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:A,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},oK={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},FS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},lK=["ui","telegram","discord"],HS=()=>({name:"",prompt:"",notification_channels:["ui"]}),cK=()=>{const{data:e=[],mutate:t}=We("/webhooks",()=>fa.list(),{refreshInterval:1e4}),[n,a]=j.useState(!1),[s,c]=j.useState(null),[o,d]=j.useState(HS()),[h,m]=j.useState(null),[x,p]=j.useState(null),[b,v]=j.useState(!1),[S,z]=j.useState(null),[E,_]=j.useState(null),A=(ne,oe)=>{p({type:ne,message:oe}),setTimeout(()=>p(null),3500)},N=()=>{c(null),d(HS()),_(null),a(!0)},P=ne=>{c(ne),d({name:ne.name,prompt:ne.prompt,notification_channels:ne.notification_channels}),_(null),a(!0)},D=ne=>/^[a-z0-9-_]+$/.test(ne),M=async()=>{if(!(!o.name.trim()||!o.prompt.trim())){if(!D(o.name)){_("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(o.notification_channels.length===0){_("Select at least one notification channel.");return}_(null),v(!0);try{s?(await fa.update(s.id,o),A("success","Webhook updated.")):(await fa.create(o),A("success","Webhook created.")),await t(),a(!1)}catch(ne){const oe=ne?.message||"Failed to save webhook.";_(oe)}finally{v(!1)}}},V=async ne=>{try{await fa.update(ne.id,{enabled:!ne.enabled}),await t()}catch{A("error","Failed to toggle webhook.")}},U=async()=>{if(h)try{await fa.delete(h.id),await t(),m(null),A("success","Webhook deleted.")}catch{A("error","Failed to delete webhook.")}},K=ne=>`${window.location.origin}/api/webhooks/trigger/${ne}`,I=ne=>`curl -X POST ${K(ne.name)} \\
161
- -H "x-api-key: ${ne.api_key}" \\
162
- -H "Content-Type: application/json" \\
163
- -d '{"event":"your_payload"}'`,te=async(ne,oe)=>{await navigator.clipboard.writeText(ne),z(oe),setTimeout(()=>z(null),2e3)},le=ne=>{const oe=o.notification_channels.includes(ne);d({...o,notification_channels:oe?o.notification_channels.filter(se=>se!==ne):[...o.notification_channels,ne]})};return u.jsxs($e.div,{variants:oK,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:FS,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(Bp,{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(Wa,{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(ql,{className:"w-4 h-4"}),"Notifications"]}),u.jsxs("button",{onClick:N,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[u.jsx(oo,{className:"w-4 h-4"}),"New Webhook"]})]})]}),x&&u.jsx($e.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${x.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:x.message}),u.jsx($e.div,{variants:FS,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:N,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:()=>te(I(ne),`curl-${ne.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy curl example",children:S===`curl-${ne.id}`?u.jsx(Rp,{className:"w-3.5 h-3.5 text-green-500"}):u.jsx(vd,{className:"w-3.5 h-3.5"})}),u.jsx("button",{onClick:()=>te(ne.api_key,`key-${ne.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy API key",children:S===`key-${ne.id}`?u.jsx(Rp,{className:"w-3.5 h-3.5 text-green-500"}):u.jsx(LA,{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:()=>V(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(Kx,{className:"w-3.5 h-3.5"})," Enabled"]}):u.jsxs(u.Fragment,{children:[u.jsx(Jx,{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:()=>P(ne),title:"Edit",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:u.jsx(uc,{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(ga,{className:"w-4 h-4"})})]})})]},ne.id))})]})})}),u.jsxs(Ir,{open:n,onOpenChange:a,children:[u.jsx(Br,{children:u.jsx(Vr,{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:o.name,onChange:ne=>{d({...o,name:ne.target.value.toLowerCase().replace(/\s+/g,"-")}),_(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"}),o.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/",o.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:o.prompt,onChange:ne=>d({...o,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:lK.map(ne=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:o.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))})]}),E&&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:E}),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||!o.name.trim()||!o.prompt.trim()||o.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(Ir,{open:!!h,onOpenChange:ne=>!ne&&m(null),children:[u.jsx(Br,{children:u.jsx(Vr,{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"})]})]})]})]})},uK={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},qS={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},GS=({status:e})=>e==="completed"?u.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[u.jsx(Gx,{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(ei,{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(er,{className:"w-4 h-4 animate-pulse"}),u.jsx("span",{className:"text-xs",children:"Pending"})]}),ad=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),dK=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},fK=()=>{const[e,t]=j.useState(!1),[n,a]=j.useState(null),{data:s=[],mutate:c}=We(["/webhooks/notifications",e],()=>fa.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),o=s.filter(x=>!x.read).length,d=async x=>{x.length!==0&&(await fa.markRead(x),await c())},h=()=>{const x=s.filter(p=>!p.read).map(p=>p.id);d(x)},m=async x=>{a(x),x.read||await d([x.id])};return u.jsxs($e.div,{variants:uK,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:qS,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(ql,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight"}),o>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:o>9?"9+":o})]}),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(Wa,{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(wz,{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(KA,{className:"w-4 h-4"}),"Unread only"]}),o>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(wA,{className:"w-4 h-4"}),"Mark all read"]})]})]}),u.jsx($e.div,{variants:qS,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(x=>u.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:x},x))})}),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(x=>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 ${x.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[u.jsx("td",{className:"px-4 py-3 w-6",children:!x.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:x.webhook_name}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(GS,{status:x.status})}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:ad(x.created_at)}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:x.completed_at?ad(x.completed_at):"—"}),u.jsx("td",{className:"px-4 py-3",children:u.jsx("button",{onClick:()=>m(x),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(lc,{className:"w-4 h-4"})})})]},x.id))})]})})}),u.jsxs(Ir,{open:!!n,onOpenChange:x=>!x&&a(null),children:[u.jsx(Br,{children:u.jsxs(Vr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[u.jsx(ql,{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(GS,{status:n.status}),u.jsx("span",{children:ad(n.created_at)}),n.completed_at&&u.jsxs("span",{children:["→ ",ad(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:dK(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"})})]})]})]})},hK={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},id={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},mK={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function XN({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(Gx,{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(ei,{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(cc,{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(ei,{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(er,{className:"w-3 h-3"}),"Pending"]})}function QN({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 WN({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 YS=e=>e?new Date(e).toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",JS=e=>e?new Date(e).toLocaleString():"—";function pK({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(Gl,{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(XN,{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(Yi,{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(QN,{agent:e.agent})},{label:"Channel",value:u.jsx(WN,{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:JS(e.created_at)},{label:"Finished",value:JS(e.finished_at)}].map(({label:o,value:d})=>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:o}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary",children:d})]},o))}),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(Gi,{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 xK={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 Zs({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 ${xK[e]??"text-azure-text dark:text-matrix-secondary"}`,children:t})]})}function gK(){const[e,t]=j.useState(""),[n,a]=j.useState(""),[s,c]=j.useState(""),[o,d]=j.useState(""),[h,m]=j.useState(null),x=j.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:s||void 0,session_id:o.trim()||void 0,limit:200}),[e,n,s,o]),{data:p}=We("/tasks/stats",()=>Ja.stats(),{refreshInterval:5e3}),{data:b=[],mutate:v}=We(["/tasks",x],()=>Ja.list(x),{refreshInterval:3e3}),S="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($e.div,{variants:hK,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:id,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(Gl,{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($e.div,{variants:id,className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[u.jsx(Zs,{label:"Pending",value:p?.pending??0}),u.jsx(Zs,{label:"Running",value:p?.running??0}),u.jsx(Zs,{label:"Completed",value:p?.completed??0}),u.jsx(Zs,{label:"Failed",value:p?.failed??0}),u.jsx(Zs,{label:"Cancelled",value:p?.cancelled??0}),u.jsx(Zs,{label:"Total",value:p?.total??0})]}),u.jsxs($e.div,{variants:id,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:S,value:e,onChange:z=>t(z.target.value||""),children:[u.jsx("option",{value:"",children:"All status"}),Object.entries(mK).map(([z,E])=>u.jsx("option",{value:z,children:E},z))]}),u.jsxs("select",{className:S,value:n,onChange:z=>a(z.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:S,value:s,onChange:z=>c(z.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:`${S} placeholder:text-azure-text-secondary/50 dark:placeholder:text-matrix-secondary/40`,value:o,onChange:z=>d(z.target.value),placeholder:"Filter by session ID"})]}),u.jsx($e.div,{variants:id,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(z=>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 ${z.cls}`,children:z.label},z.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(Ka,{className:"w-5 h-5 mx-auto mb-2 opacity-40"}),"No tasks found."]})}):b.map(z=>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:z.id.slice(0,8)}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(XN,{status:z.status})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(QN,{agent:z.agent})}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(WN,{channel:z.origin_channel})}),u.jsx("td",{className:"px-4 py-3 font-mono text-xs text-azure-text-secondary dark:text-matrix-tertiary",children:z.session_id?z.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:[z.attempt_count,"/",z.max_attempts]}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:YS(z.created_at)}),u.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-secondary whitespace-nowrap",children:YS(z.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(z),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(lc,{className:"w-3.5 h-3.5"})}),(z.status==="pending"||z.status==="running")&&u.jsx("button",{onClick:async()=>{await Ja.cancel(z.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(uA,{className:"w-3.5 h-3.5"})})]})})]},z.id))})]})})}),h&&u.jsx(pK,{task:h,onClose:()=>m(null),onCancel:async()=>{await Ja.cancel(h.id),m(null),v()},onRetry:async()=>{await Ja.retry(h.id),m(null),v()}})]})}const Ep={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},KS={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},yK={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 bK(){return xe.get("/trinity/databases")}function vK(){const{data:e,error:t}=We("/trinity/databases",bK,{refreshInterval:3e4}),[n,a]=j.useState(!1),[s,c]=j.useState(null),[o,d]=j.useState(KS),[h,m]=j.useState(!1),[x,p]=j.useState(null),[b,v]=j.useState({}),[S,z]=j.useState(null),[E,_]=j.useState({}),[A,N]=j.useState(null),[P,D]=j.useState(null),[M,V]=j.useState(null),[U,K]=j.useState(!1),I=()=>{c(null),d(KS),K(!1),p(null),a(!0)},te=w=>{c(w),d({name:w.name,type:w.type,host:w.host||"",port:w.port?String(w.port):"",database_name:w.database_name||"",username:w.username||"",password:"",connection_string:"",allow_read:w.allow_read,allow_insert:w.allow_insert,allow_update:w.allow_update,allow_delete:w.allow_delete,allow_ddl:w.allow_ddl}),K(!!w.connection_string),p(null),a(!0)},le=async()=>{if(m(!0),p(null),!U&&!o.database_name.trim()){p(o.type==="sqlite"?"File path is required.":"Database name is required."),m(!1);return}try{const w={name:o.name,type:o.type,allow_read:o.allow_read,allow_insert:o.allow_insert,allow_update:o.allow_update,allow_delete:o.allow_delete,allow_ddl:o.allow_ddl};U?(!s||o.connection_string)&&(w.connection_string=o.connection_string||null):(w.host=o.host||null,w.port=o.port?parseInt(o.port):null,w.database_name=o.database_name||null,w.username=o.username||null,(!s||o.password)&&(w.password=o.password||null)),s?await xe.put(`/trinity/databases/${s.id}`,w):await xe.post("/trinity/databases",w),await Bn("/trinity/databases"),a(!1)}catch(w){p(w.message||"Failed to save database")}finally{m(!1)}},ne=w=>{V(w)},oe=async()=>{if(!M)return;const w=M.id;D(w);try{await xe.delete(`/trinity/databases/${w}`),await Bn("/trinity/databases")}catch(X){alert(`Delete failed: ${X.message}`)}finally{D(null),V(null)}},se=async w=>{z(w);try{const X=await xe.post(`/trinity/databases/${w}/test`,{});_(me=>({...me,[w]:X.success}))}catch{_(X=>({...X,[w]:!1}))}finally{z(null)}},Z=async w=>{N(w);try{await xe.post(`/trinity/databases/${w}/refresh-schema`,{}),await Bn("/trinity/databases")}catch(X){alert(`Schema refresh failed: ${X.message}`)}finally{N(null)}},B=w=>{v(X=>({...X,[w]:!X[w]}))},Y=w=>{w!=="mongodb"&&K(!1),d(X=>({...X,type:w,port:Ep[w]?String(Ep[w]):""}))},ue=w=>{d(X=>({...X,[w]:!X[w]}))};if(t)return u.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const O="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",C="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(me=>w[me.key]).map(me=>me.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(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:"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:I,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(oo,{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(Qs,{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 X=w.schema_json?JSON.parse(w.schema_json):null,me=!!X?.databases,pe=me?X.databases.reduce((Ue,Je)=>Ue+Je.tables.length,0):X?.tables?.length??0,ge=me?X.databases.length:0,Pe=w.type==="mongodb"?"collection":"table",Ee=w.type==="mongodb"?"collections":"tables",yt=E[w.id],$=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(Qs,{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}),yt===!0&&u.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[u.jsx(cd,{className:"w-3 h-3"})," Connected"]}),yt===!1&&u.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[u.jsx(Ez,{className:"w-3 h-3"})," Failed"]}),Oe.length>0&&u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Ip,{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",me&&ge>0&&u.jsxs("span",{className:"ml-2 opacity-70",children:["· ",ge," database",ge!==1?"s":""," · ",pe," ",pe!==1?Ee:Pe]}),!me&&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:()=>se(w.id),disabled:S===w.id,title:"Test connection",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:S===w.id?u.jsx(cd,{className:"w-4 h-4 animate-pulse"}):u.jsx(cd,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>Z(w.id),disabled:A===w.id,title:"Refresh schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:u.jsx(Ka,{className:`w-4 h-4 ${A===w.id?"animate-spin":""}`})}),u.jsx("button",{onClick:()=>te(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:P===w.id,title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-red-500 transition-colors",children:u.jsx(ga,{className:"w-4 h-4"})}),X&&u.jsx("button",{onClick:()=>B(w.id),title:$?"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:$?u.jsx(bo,{className:"w-4 h-4"}):u.jsx(Fd,{className:"w-4 h-4"})})]})]}),$&&X&&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:me?`${ge} database${ge!==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:me?X.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(Je=>u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:Je.name}),u.jsx("div",{className:"pl-3 space-y-0.5",children:Je.columns?.map(St=>u.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[u.jsx("span",{children:St.name}),u.jsx("span",{className:"opacity-50 ml-2",children:St.type}),St.nullable===!1&&u.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},St.name))})]},Je.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)):X.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(Je=>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:Je.name}),u.jsx("span",{className:"opacity-50 ml-2",children:Je.type}),Je.nullable===!1&&u.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},Je.name))})]},Ue.name))})]})]},w.id)})}):u.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),u.jsx(T2,{isOpen:!!M,onClose:()=>V(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(Yi,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Name *"}),u.jsx("input",{className:O,value:o.name,onChange:w=>d(X=>({...X,name:w.target.value})),placeholder:"My Production DB"})]}),u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Type *"}),u.jsxs("select",{className:O,value:o.type,onChange:w=>Y(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"})]})]}),o.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"})]}),o.type==="mongodb"&&U?u.jsxs("div",{children:[u.jsxs("label",{className:C,children:["Connection String ",s&&u.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),u.jsx("input",{className:O,type:"password",value:o.connection_string,onChange:w=>d(X=>({...X,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:[o.type!=="sqlite"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Host"}),u.jsx("input",{className:O,value:o.host,onChange:w=>d(X=>({...X,host:w.target.value})),placeholder:"localhost"})]}),u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Port"}),u.jsx("input",{className:O,type:"number",value:o.port,onChange:w=>d(X=>({...X,port:w.target.value})),placeholder:String(Ep[o.type]||"")})]})]}),u.jsxs("div",{children:[u.jsxs("label",{className:C,children:[o.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 ${x&&!o.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:o.database_name,onChange:w=>d(X=>({...X,database_name:w.target.value})),placeholder:o.type==="sqlite"?"/path/to/database.db":"mydb"})]}),o.type!=="sqlite"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("label",{className:C,children:"Username"}),u.jsx("input",{className:O,value:o.username,onChange:w=>d(X=>({...X,username:w.target.value})),placeholder:"postgres"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:C,children:["Password ",s&&u.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),u.jsx("input",{className:O,type:"password",value:o.password,onChange:w=>d(X=>({...X,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(Ip,{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:yK[o.type]?.map(({key:w,label:X,description:me})=>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:!!o[w],onChange:()=>ue(w),className:"sr-only"}),u.jsx("div",{className:`w-4 h-4 rounded border transition-colors flex items-center justify-center ${o[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:o[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:X}),u.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:me})]})]},w))})]}),x&&u.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:x})]}),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||!o.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 kK={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 wK({jobId:e}){const{data:t,isLoading:n}=A7(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 ${kK[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 SK({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 XS(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function QS(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function zK({onEdit:e}){const{data:t,isLoading:n}=E7(),[a,s]=j.useState(null),[c,o]=j.useState(null),[d,h]=j.useState(null),m=async p=>{o(p.id);try{p.enabled?await Vi.disableJob(p.id):await Vi.enableJob(p.id),await Bn(b=>typeof b=="string"&&b.startsWith("/chronos"))}finally{o(null)}},x=async()=>{if(d){o(d.id);try{await Vi.deleteJob(d.id),await Bn(p=>typeof p=="string"&&p.startsWith("/chronos"))}finally{o(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(p=>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:p.prompt,children:XS(p.prompt,50)}),u.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:p.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:p.schedule_type}),u.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:p.schedule_expression,children:p.schedule_expression})]}),u.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:QS(p.next_run_at)}),u.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:QS(p.last_run_at)}),u.jsx("td",{className:"px-4 py-3",children:u.jsx(SK,{enabled:p.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===p.id?"Hide history":"View history",onClick:()=>s(a===p.id?null:p.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===p.id?u.jsx(zz,{className:"w-4 h-4"}):u.jsx(a5,{className:"w-4 h-4"})}),u.jsx("button",{title:"Edit",onClick:()=>e(p),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(T5,{className:"w-4 h-4"})}),u.jsx("button",{title:p.enabled?"Disable":"Enable",onClick:()=>m(p),disabled:c===p.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:p.enabled?u.jsx(N5,{className:"w-4 h-4"}):u.jsx(Cz,{className:"w-4 h-4"})}),u.jsx("button",{title:"Delete",onClick:()=>h(p),disabled:c===p.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(ga,{className:"w-4 h-4"})})]})})]},p.id),a===p.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(wK,{jobId:p.id})]})},`${p.id}-history`)]}))})]}),u.jsx(KN,{isOpen:!!d,onClose:()=>h(null),onConfirm:x,title:"Delete Chronos Job",message:d?`Delete job "${XS(d.prompt,60)}"? This action cannot be undone.`:""})]})}function jK({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=j.useState(null),[c,o]=j.useState(null),d=j.useRef(null);if(j.useEffect(()=>{if(!e.trim()){s(null),o(null);return}return d.current&&clearTimeout(d.current),d.current=setTimeout(async()=>{try{const m=await Vi.preview(e,t,n);s(m),o(null)}catch(m){o(m.message??"Invalid expression"),s(null)}},500),()=>{d.current&&clearTimeout(d.current)}},[e,t,n]),!e.trim())return null;const h=(m,x)=>{try{return new Date(m).toLocaleString("pt-BR",{timeZone:x,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(er,{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,x)=>u.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",x+2,": ",m]},x))})]}):u.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})})}const _K=["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"],NK=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],CK=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],TK={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 EK({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:c}=E2(),[o,d]=j.useState(""),[h,m]=j.useState("once"),[x,p]=j.useState(""),[b,v]=j.useState("UTC"),[S,z]=j.useState([]),[E,_]=j.useState(null),[A,N]=j.useState(!1),P=M=>{z(V=>V.includes(M)?V.filter(U=>U!==M):[...V,M])};j.useEffect(()=>{a?(d(a.prompt),m(a.schedule_type),p(a.schedule_expression),v(a.timezone),z(a.notify_channels??[])):(d(""),m("once"),p(""),v(c?.timezone??"UTC"),z([])),_(null)},[a,e,c?.timezone]);const D=async()=>{if(_(null),!o.trim()){_("Prompt is required");return}if(!x.trim()){_("Schedule expression is required");return}N(!0);try{if(s&&a){const M={prompt:o,schedule_expression:x,timezone:b,notify_channels:S};await Vi.updateJob(a.id,M)}else{const M={prompt:o,schedule_type:h,schedule_expression:x,timezone:b,notify_channels:S};await Vi.createJob(M)}await Bn(M=>typeof M=="string"&&M.startsWith("/chronos")),n(),t()}catch(M){_(M.message??"Failed to save job")}finally{N(!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(Yi,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsx(Ye,{label:"Prompt",value:o,onChange:M=>d(M.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&u.jsx(pn,{label:"Schedule Type",value:h,onChange:M=>m(M.target.value),options:CK}),u.jsxs("div",{children:[u.jsx(Ye,{label:"Schedule Expression",value:x,onChange:M=>p(M.target.value),placeholder:TK[h]}),u.jsx(jK,{scheduleExpression:x,scheduleType:h,timezone:b})]}),u.jsx(pn,{label:"Timezone",value:b,onChange:M=>v(M.target.value),options:_K.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:NK.map(({value:M,label:V})=>u.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:S.includes(M),onChange:()=>P(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:V})]},M))})]}),E&&u.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:E})]}),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:A,className:"px-4 py-2 rounded text-sm bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight font-bold hover:opacity-90 disabled:opacity-50 transition-opacity font-mono",children:A?"Saving…":s?"Update":"Create"})]})]})]}):null}function AK(){const[e,t]=j.useState(!1),[n,a]=j.useState(null),s=d=>{a(d),t(!0)},c=()=>{t(!1),a(null)},o=()=>{Bn(d=>typeof d=="string"&&d.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(er,{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(oo,{className:"w-4 h-4"}),"New Job"]})]}),u.jsx(zK,{onEdit:s}),u.jsx(EK,{isOpen:e,onClose:c,onCreated:o,editJob:n})]})}const WS={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},gd={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function OK({skill:e,onToggle:t,onView:n}){return u.jsxs($e.div,{variants:gd,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(Zi,{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(Yx,{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(Xx,{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(lc,{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(Kx,{className:"w-4 h-4"}):u.jsx(Jx,{className:"w-4 h-4"})})]})]})]})}function MK({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(Zi,{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(Xx,{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(Yi,{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(YA,{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(Yx,{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 DK(){const[e,t]=j.useState(null),[n,a]=j.useState(!1),[s,c]=j.useState(!1),[o,d]=j.useState(!1),[h,m]=j.useState(null),[x,p]=j.useState(null),b=j.useRef(null),{data:v,mutate:S,isLoading:z}=We("/skills",()=>Li.fetchSkills(),{refreshInterval:1e4}),E=v?.skills??[],_=v?.enabled??0,A=async()=>{await Li.reloadSkills(),S()},N=async V=>{V.enabled?await Li.disableSkill(V.name):await Li.enableSkill(V.name),S()},P=async V=>{a(!0);try{const U=await Li.fetchSkill(V.name);t(U)}finally{a(!1)}},D=async V=>{const U=V.target.files?.[0];if(U){m(null),p(null),d(!0);try{const K=await Li.uploadSkill(U);p(`Skill "${K.skill.name}" uploaded successfully!`),S(),b.current&&(b.current.value="")}catch(K){m({error:K.message||"Upload failed",details:K.details})}finally{d(!1)}}},M=()=>{m(null),p(null),c(!0)};return u.jsxs($e.div,{variants:WS,initial:"hidden",animate:"show",className:"space-y-6",children:[u.jsxs($e.div,{variants:gd,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(Zi,{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:[E.length," skill",E.length!==1?"s":"",", ",_," 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(Lu,{className:"w-4 h-4"}),"Upload"]}),u.jsxs("button",{onClick:A,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[u.jsx(Ka,{className:"w-4 h-4"}),"Reload"]})]})]}),z?u.jsxs($e.div,{variants:gd,className:"text-center py-12",children:[u.jsx(Ka,{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..."})]}):E.length===0?u.jsxs($e.div,{variants:gd,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[u.jsx(Zi,{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(Lu,{className:"w-4 h-4"}),"Upload Skill"]})]}):u.jsx($e.div,{variants:WS,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:E.map(V=>u.jsx(OK,{skill:V,onToggle:()=>N(V),onView:()=>P(V)},V.name))}),u.jsx(MK,{skill:e,open:!!e,onOpenChange:V=>!V&&t(null)}),u.jsxs(Ir,{open:s,onOpenChange:c,children:[u.jsx(Br,{children:u.jsx(Vr,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Lu,{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:o,className:"hidden",id:"skill-upload-input"}),u.jsxs("label",{htmlFor:"skill-upload-input",className:`flex flex-col items-center gap-2 cursor-pointer ${o?"opacity-50 cursor-not-allowed":""}`,children:[o?u.jsx(Ka,{className:"w-8 h-8 animate-spin text-azure-primary dark:text-matrix-primary"}):u.jsx(Lu,{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:o?"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(Gi,{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})]})]}),x&&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(vo,{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:x})]}),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
164
- └── my-skill/
165
- ├── SKILL.md (required)
166
- ├── scripts/ (optional)
167
- │ └── script.js
168
- └── examples/ (optional)
169
- └── output.txt`})]})]})]}),n&&u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsx(Ka,{className:"w-8 h-8 animate-spin text-white"})})]})}const RK={name:"",host:"",port:7900,auth_token:"",tls:!1};function $K(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 LK(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 PK({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 UK({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 IK({status:e,entry:t,onPing:n,onEdit:a,onDelete:s}){const[c,o]=j.useState(!1),d=e.state==="online";return u.jsxs("div",{className:`rounded-lg border bg-white dark:bg-black transition-all ${d?"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 ${d?"bg-emerald-500/10":"bg-zinc-100 dark:bg-zinc-900"}`,children:u.jsx(V5,{className:`w-4 h-4 ${d?"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(PK,{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(d5,{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(Tz,{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(uc,{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(ga,{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(Gi,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),u.jsx("span",{children:e.error})]}),d&&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(jz,{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(WA,{className:"w-3 h-3"})," RAM"]}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:LK(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(er,{className:"w-3 h-3"})," Uptime"]}),u.jsx("span",{className:"text-azure-text dark:text-matrix-secondary font-mono",children:$K(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"})]})]})}),!d&&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:()=>o(!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(zz,{className:"w-3.5 h-3.5"}):u.jsx(bo,{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(UK,{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 ez({title:e,initial:t,isEdit:n,onSave:a,onClose:s,saving:c,error:o}){const[d,h]=j.useState(t),[m,x]=j.useState(null),p=()=>{if(!d.name.trim()){x("Name is required.");return}if(!d.host.trim()){x("Host is required.");return}if(!n&&!d.auth_token.trim()){x("Auth token is required.");return}x(null),a(d)};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(so,{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(Yi,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"p-5 space-y-3",children:[(m||o)&&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(Gi,{className:"w-4 h-4 shrink-0 mt-0.5"}),u.jsx("span",{children:m||o})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx("div",{className:"col-span-2",children:u.jsx(Ye,{label:"Name",value:d.name,onChange:b=>h({...d,name:b.target.value}),disabled:n,helperText:n?"Name cannot be changed after creation.":"Unique identifier (lowercase, hyphens ok)."})}),u.jsx(Ye,{label:"Host",value:d.host,onChange:b=>h({...d,host:b.target.value}),placeholder:"localhost"}),u.jsx(Ft,{label:"Port",value:d.port,onChange:b=>h({...d,port:Number(b.target.value)}),min:1,max:65535}),u.jsx("div",{className:"col-span-2",children:u.jsx(Ye,{label:"Auth Token",value:d.auth_token,onChange:b=>h({...d,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:d.tls??!1,onChange:b=>h({...d,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:p,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 BK(){const{data:e,mutate:t}=We("/api/smiths",tn.getSmithsList,{refreshInterval:1e4}),{data:n,mutate:a}=We("/api/smiths/config",tn.getSmithsConfig),[s,c]=j.useState(null),[o,d]=j.useState(!1),[h,m]=j.useState(!1),[x,p]=j.useState(!1),[b,v]=j.useState(null),[S,z]=j.useState(!1),[E,_]=j.useState(null),[A,N]=j.useState(null),[P,D]=j.useState(!1);n&&!s&&c(n);const M=(B,Y)=>{N({type:B,message:Y}),setTimeout(()=>N(null),4e3)},V=async B=>{try{const Y=await tn.pingSmith(B);M("success",`Ping ${B}: ${Y.latency_ms}ms`)}catch(Y){M("error",`Ping failed: ${Y.message}`)}},U=async B=>{if(confirm(`Remove Smith "${B}" from the registry?`))try{await tn.removeSmith(B),t(),a(),c(null),M("success",`Smith "${B}" removed.`)}catch(Y){M("error",`Failed to remove: ${Y.message}`)}},K=async B=>{if(s){if(s.entries.some(Y=>Y.name===B.name)){_(`Smith "${B.name}" already exists.`);return}z(!0),_(null);try{const Y={...s,entries:[...s.entries,B]};await tn.updateSmithsConfig(Y),p(!1),c(null),t(),a(),M("success",`Smith "${B.name}" added.`)}catch(Y){_(Y.message)}finally{z(!1)}}},I=async B=>{if(s){z(!0),_(null);try{const Y={...s,entries:s.entries.map(ue=>ue.name===B.name?B:ue)};await tn.updateSmithsConfig(Y),v(null),c(null),t(),a(),M("success",`Smith "${B.name}" updated.`)}catch(Y){_(Y.message)}finally{z(!1)}}},te=async()=>{if(s){m(!0);try{await tn.updateSmithsConfig(s),t(),a(),M("success","Settings saved."),d(!1)}catch(B){M("error",B.message)}finally{m(!1)}}},le=e?.smiths??[],ne=le.filter(B=>B.state==="online").length,oe=le.filter(B=>B.state==="offline"||B.state==="error").length,se=le.filter(B=>B.state==="connecting").length,Z={};return(s??n)?.entries?.forEach(B=>{Z[B.name]=B}),u.jsxs("div",{className:"space-y-6",children:[A&&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 ${A.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:[A.type==="success"?u.jsx(Ip,{className:"w-4 h-4"}):u.jsx(Gi,{className:"w-4 h-4"}),A.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(so,{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(B=>setTimeout(B,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(Ka,{className:`w-4 h-4 transition-transform ${P?"animate-spin":""}`})}),u.jsxs("button",{onClick:()=>{d(!o),!s&&n&&c(n)},className:`flex items-center gap-1.5 px-3 py-2 rounded border text-sm transition-colors ${o?"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(T1,{className:"w-4 h-4"}),"Settings"]}),u.jsxs("button",{onClick:()=>{p(!0),_(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(oo,{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(cd,{className:"w-3.5 h-3.5 text-emerald-500"}),u.jsxs("span",{className:"font-semibold text-emerald-500",children:[ne," online"]})]}),se>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(Tz,{className:"w-3.5 h-3.5 text-amber-500"}),u.jsxs("span",{className:"font-semibold text-amber-500",children:[se," connecting"]})]}),oe>0&&u.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[u.jsx(Ez,{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(G5,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"Smiths subsystem disabled"})]})]}),o&&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(T1,{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(Nr,{label:"Enable Smiths",checked:s.enabled,onChange:B=>c({...s,enabled:B}),helperText:"Master switch — disabling stops all Smith connections."})}),u.jsx(pn,{label:"Execution Mode",value:s.execution_mode,onChange:B=>c({...s,execution_mode:B.target.value}),options:[{label:"Sync — inline result",value:"sync"},{label:"Async — background task",value:"async"}]}),u.jsx(Ft,{label:"Heartbeat Interval (s)",value:Math.round(s.heartbeat_interval_ms/1e3),onChange:B=>c({...s,heartbeat_interval_ms:Number(B.target.value)*1e3}),min:5}),u.jsx(Ft,{label:"Connection Timeout (s)",value:Math.round(s.connection_timeout_ms/1e3),onChange:B=>c({...s,connection_timeout_ms:Number(B.target.value)*1e3}),min:1}),u.jsx(Ft,{label:"Task Timeout (s)",value:Math.round(s.task_timeout_ms/1e3),onChange:B=>c({...s,task_timeout_ms:Number(B.target.value)*1e3}),min:5})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx("button",{onClick:te,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(so,{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:()=>{p(!0),_(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(oo,{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(B=>u.jsx(IK,{status:B,entry:Z[B.name],onPing:V,onEdit:Y=>{v({...Y,auth_token:""}),_(null)},onDelete:U},B.name))}),x&&u.jsx(ez,{title:"Add Smith",initial:RK,onSave:K,onClose:()=>p(!1),saving:S,error:E}),b&&u.jsx(ez,{title:"Edit Smith",initial:b,isEdit:!0,onSave:I,onClose:()=>v(null),saving:S,error:E})]})}function VK(e,t=0,n=100){const a=n,s=t*n,{data:c,error:o,isLoading:d}=We(e?`/sessions/${e}/audit?limit=${a}&offset=${s}`:null,h=>xe.get(h),{revalidateOnFocus:!1});return{data:c,error:o,isLoading:d}}const ZK={llm_call:u.jsx(Az,{size:14}),tool_call:u.jsx(dc,{size:14}),mcp_tool:u.jsx(_z,{size:14}),task_created:u.jsx(Cz,{size:14}),task_completed:u.jsx(vo,{size:14}),skill_executed:u.jsx(ld,{size:14}),chronos_job:u.jsx(er,{size:14})},FK={llm_call:"text-blue-400 dark:text-blue-400",tool_call:"text-amber-500 dark:text-amber-400",mcp_tool:"text-purple-500 dark:text-purple-400",task_created:"text-gray-500 dark:text-matrix-secondary",task_completed:"text-green-600 dark:text-matrix-highlight",skill_executed:"text-teal-600 dark:text-teal-400",chronos_job:"text-orange-500 dark:text-orange-400"},HK={oracle:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300",apoc:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",neo:"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",trinity:"bg-teal-100 text-teal-700 dark:bg-teal-900/40 dark:text-teal-300",smith:"bg-gray-200 text-gray-700 dark:bg-gray-700/60 dark:text-gray-300",keymaker:"bg-pink-100 text-pink-700 dark:bg-pink-900/40 dark:text-pink-300",chronos:"bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-300"};function qK(e){return e==null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function GK(e){return e==null||e===0?"—":e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}function YK(e,t){if(e==null&&t==null)return"";const n=e??0,a=t??0;return`↑${n.toLocaleString()} ↓${a.toLocaleString()}`}const tz=({event:e})=>{const t=ZK[e.event_type]??u.jsx(dc,{size:14}),n=FK[e.event_type]??"text-gray-500",a=e.agent?HK[e.agent]??"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300":null,s=e.tool_name??e.model??e.event_type,c=YK(e.input_tokens,e.output_tokens),o=GK(e.estimated_cost_usd),d=qK(e.duration_ms),h=e.status==="error"?u.jsx(ei,{size:14,className:"text-red-500 flex-shrink-0"}):e.status==="success"?u.jsx(vo,{size:14,className:"text-green-500 dark:text-matrix-highlight flex-shrink-0"}):null;return u.jsxs("div",{className:"py-2 px-3 rounded-lg hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors border-b border-gray-100 dark:border-matrix-primary/20 last:border-0",children:[u.jsxs("div",{className:"flex flex-col gap-0.5 md:hidden",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:`flex-shrink-0 ${n}`,children:t}),a&&u.jsx("span",{className:`flex-shrink-0 text-xs font-semibold px-1.5 py-0.5 rounded ${a}`,children:e.agent}),u.jsx("span",{className:"flex-1 text-sm text-gray-700 dark:text-matrix-secondary font-mono break-all leading-snug",children:s}),h]}),u.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0 pl-5 text-[11px] text-gray-400 dark:text-matrix-secondary/60 font-mono",children:[c&&u.jsx("span",{children:c}),u.jsx("span",{children:d}),o!=="—"&&u.jsx("span",{className:"text-gray-600 dark:text-matrix-secondary",children:o})]})]}),u.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[u.jsx("span",{className:`flex-shrink-0 ${n}`,children:t}),a&&u.jsx("span",{className:`flex-shrink-0 text-xs font-semibold px-1.5 py-0.5 rounded ${a}`,children:e.agent}),u.jsx("span",{className:"flex-1 text-sm truncate text-gray-700 dark:text-matrix-secondary font-mono",children:s}),c&&u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono whitespace-nowrap",children:c}),u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono w-16 text-right whitespace-nowrap",children:d}),h,u.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono w-20 text-right whitespace-nowrap",children:o})]})]})},JK=({events:e,page:t,pageSize:n,totalCount:a,onPageChange:s})=>{const c=Math.ceil(a/n),o=t*n+1,d=Math.min(t*n+e.length,a);if(e.length===0)return u.jsx("div",{className:"flex items-center justify-center h-40 text-gray-400 dark:text-matrix-secondary/50 text-sm",children:"No audit events for this session."});const h=[],m=new Map;for(const p of e)if(p.task_id){const b=m.get(p.task_id)??[];b.push(p),m.set(p.task_id,b)}const x=new Set;for(const p of e)p.task_id?x.has(p.task_id)||(x.add(p.task_id),h.push({taskId:p.task_id,events:m.get(p.task_id)})):h.push({taskId:null,events:[p]});return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"hidden md:flex items-center gap-3 px-3 py-1 text-xs text-gray-400 dark:text-matrix-secondary/60 border-b border-gray-200 dark:border-matrix-primary/30 font-mono",children:[u.jsx("span",{className:"w-4"}),u.jsx("span",{className:"w-14 flex-shrink-0",children:"agent"}),u.jsx("span",{className:"flex-1",children:"event / tool / model"}),u.jsx("span",{className:"w-28 text-right",children:"tokens ↑↓"}),u.jsx("span",{className:"w-16 text-right",children:"duration"}),u.jsx("span",{className:"w-4"}),u.jsx("span",{className:"w-20 text-right",children:"cost"})]}),u.jsx("div",{className:"flex flex-col",children:h.map(p=>p.taskId?u.jsxs("div",{className:"mb-1",children:[u.jsxs("div",{className:"px-3 py-1 text-xs text-gray-400 dark:text-matrix-secondary/50 font-mono border-l-2 border-blue-300 dark:border-matrix-primary/60 ml-1 mb-0.5",children:["task: ",p.taskId.slice(0,8),"…"]}),u.jsx("div",{className:"pl-4",children:p.events.map(b=>u.jsx(tz,{event:b},b.id))})]},p.taskId):u.jsx(tz,{event:p.events[0]},p.events[0].id))}),c>1&&u.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-200 dark:border-matrix-primary/30 mt-2",children:[u.jsxs("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60",children:[o,"–",d," of ",a," events"]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{onClick:()=>s(t-1),disabled:t===0,className:"p-1 rounded text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight disabled:opacity-30 transition-colors",children:u.jsx(_A,{size:16})}),u.jsxs("span",{className:"text-xs self-center text-gray-500 dark:text-matrix-secondary font-mono px-2",children:[t+1," / ",c]}),u.jsx("button",{onClick:()=>s(t+1),disabled:t>=c-1,className:"p-1 rounded text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight disabled:opacity-30 transition-colors",children:u.jsx(Fd,{size:16})})]})]})]})};function Ap(e){return e===0?"$0.00":e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}function KK(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}const XK=({summary:e})=>u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-matrix-primary p-4 bg-white dark:bg-black",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-700 dark:text-matrix-highlight mb-3 flex items-center gap-2",children:[u.jsx(io,{size:14})," Total Cost"]}),u.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-matrix-highlight font-mono",children:Ap(e.totalCostUsd)}),u.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs text-gray-500 dark:text-matrix-secondary",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Az,{size:12,className:"text-blue-400"}),u.jsxs("span",{children:[e.llmCallCount," LLM calls"]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(dc,{size:12,className:"text-amber-400"}),u.jsxs("span",{children:[e.toolCallCount," tool calls"]})]}),u.jsxs("div",{className:"flex items-center gap-1.5 col-span-2",children:[u.jsx(er,{size:12,className:"text-gray-400"}),u.jsxs("span",{children:[KK(e.totalDurationMs)," total duration"]})]})]})]}),e.byAgent.length>0&&u.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-matrix-primary p-4 bg-white dark:bg-black",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-matrix-highlight mb-3",children:"By Agent"}),u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-gray-400 dark:text-matrix-secondary/60 border-b border-gray-100 dark:border-matrix-primary/30",children:[u.jsx("th",{className:"text-left pb-1.5",children:"Agent"}),u.jsx("th",{className:"text-right pb-1.5",children:"Calls"}),u.jsx("th",{className:"text-right pb-1.5",children:"Tokens"}),u.jsx("th",{className:"text-right pb-1.5",children:"Cost"})]})}),u.jsx("tbody",{children:e.byAgent.map(t=>u.jsxs("tr",{className:"border-b border-gray-50 dark:border-matrix-primary/10 last:border-0",children:[u.jsx("td",{className:"py-1.5 text-gray-700 dark:text-matrix-secondary font-semibold",children:t.agent}),u.jsx("td",{className:"py-1.5 text-right text-gray-500 dark:text-matrix-secondary/70 font-mono",children:t.llmCalls}),u.jsx("td",{className:"py-1.5 text-right text-gray-500 dark:text-matrix-secondary/70 font-mono",children:(t.inputTokens+t.outputTokens).toLocaleString()}),u.jsx("td",{className:"py-1.5 text-right text-gray-700 dark:text-matrix-highlight font-mono",children:Ap(t.estimatedCostUsd)})]},t.agent))})]})]}),e.byModel.length>0&&u.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-matrix-primary p-4 bg-white dark:bg-black",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-matrix-highlight mb-3",children:"By Model"}),u.jsx("div",{className:"flex flex-col gap-2",children:e.byModel.map(t=>u.jsxs("div",{className:"border-b border-gray-50 dark:border-matrix-primary/10 last:border-0 pb-2 last:pb-0",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2 mb-0.5",children:[u.jsx("span",{className:"text-xs font-mono text-gray-700 dark:text-matrix-secondary break-all leading-snug",children:t.model}),u.jsx("span",{className:"text-xs font-mono text-gray-700 dark:text-matrix-highlight whitespace-nowrap shrink-0",children:Ap(t.estimatedCostUsd)})]}),u.jsxs("div",{className:"text-[11px] text-gray-400 dark:text-matrix-secondary/60 font-mono flex flex-wrap gap-x-3",children:[u.jsxs("span",{children:[t.calls," calls"]}),u.jsxs("span",{children:["in ",t.inputTokens.toLocaleString()]}),u.jsxs("span",{children:["out ",t.outputTokens.toLocaleString()]})]})]},`${t.provider}/${t.model}`))})]})]});function QK(e,t){const n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download=`audit-${e.slice(0,8)}.json`,s.click(),URL.revokeObjectURL(a)}function WK(e,t){const n=["id","created_at","event_type","agent","tool_name","provider","model","input_tokens","output_tokens","duration_ms","status","estimated_cost_usd"],a=t.events.map(h=>[h.id,new Date(h.created_at).toISOString(),h.event_type,h.agent??"",h.tool_name??"",h.provider??"",h.model??"",h.input_tokens??"",h.output_tokens??"",h.duration_ms??"",h.status??"",h.estimated_cost_usd??""].map(m=>`"${String(m).replace(/"/g,'""')}"`).join(",")),s=[n.join(","),...a].join(`
170
- `),c=new Blob([s],{type:"text/csv"}),o=URL.createObjectURL(c),d=document.createElement("a");d.href=o,d.download=`audit-${e.slice(0,8)}.csv`,d.click(),URL.revokeObjectURL(o)}const eX=({sessionId:e,data:t})=>{const[n,a]=j.useState(!1);return t?u.jsxs("div",{className:"relative",children:[u.jsxs("button",{onClick:()=>a(!n),className:"flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-lg border border-gray-200 dark:border-matrix-primary text-gray-600 dark:text-matrix-secondary hover:text-gray-900 dark:hover:text-matrix-highlight hover:border-gray-300 dark:hover:border-matrix-highlight transition-colors",children:[u.jsx(VA,{size:14}),"Export",u.jsx(bo,{size:12})]}),n&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),u.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 bg-white dark:bg-black border border-gray-200 dark:border-matrix-primary rounded-lg shadow-xl min-w-[140px] py-1",children:[u.jsxs("button",{onClick:()=>{QK(e,t),a(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-matrix-secondary hover:bg-gray-50 dark:hover:bg-zinc-900 transition-colors",children:[u.jsx(HA,{size:14,className:"text-blue-500"}),"Export JSON"]}),u.jsxs("button",{onClick:()=>{WK(e,t),a(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-matrix-secondary hover:bg-gray-50 dark:hover:bg-zinc-900 transition-colors",children:[u.jsx($p,{size:14,className:"text-green-500"}),"Export CSV"]})]})]})]}):null},nz=100,tX=()=>{const{id:e}=sE(),t=yo(),[n,a]=j.useState(0),{data:s,error:c,isLoading:o}=VK(e??null,n,nz),d=j.useRef(null),[h,m]=j.useState(()=>typeof window<"u"?window.innerWidth>=768:!0);return j.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[s]),u.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-black",children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-matrix-primary bg-white dark:bg-black flex-shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{onClick:()=>t(-1),className:"p-1.5 rounded-lg text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:u.jsx(wz,{size:18})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold text-gray-900 dark:text-matrix-highlight",children:"Session Audit"}),u.jsx("p",{className:"text-xs text-gray-400 dark:text-matrix-secondary/60 font-mono",children:e})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>m(x=>!x),className:"p-1.5 rounded-lg text-gray-400 dark:text-matrix-secondary hover:text-gray-700 dark:hover:text-matrix-highlight hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors md:hidden",title:"Toggle summary panel",children:u.jsx(j5,{size:18})}),u.jsx(eX,{sessionId:e??"",data:s})]})]}),u.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[h&&u.jsx("div",{className:"fixed inset-0 bg-black/40 z-20 md:hidden",onClick:()=>m(!1)}),u.jsxs("div",{ref:d,className:"flex-[6] overflow-y-auto p-6 custom-scrollbar",children:[o&&u.jsxs("div",{className:"flex items-center justify-center h-40 gap-2 text-gray-400 dark:text-matrix-secondary",children:[u.jsx(cc,{size:18,className:"animate-spin"}),"Loading audit events…"]}),c&&u.jsxs("div",{className:"flex items-center gap-2 text-red-500 dark:text-red-400 p-4 rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:[u.jsx(Gi,{size:16}),"Failed to load audit events: ",c.message]}),s&&u.jsx(JK,{events:s.events,page:n,pageSize:nz,totalCount:s.summary.llmCallCount+s.summary.toolCallCount,onPageChange:a})]}),u.jsx("div",{className:`
171
- fixed top-16 bottom-0 right-0 z-40 w-72
172
- md:relative md:inset-auto md:z-auto md:w-auto md:flex-[4] md:translate-x-0
173
- transition-transform duration-300 ease-out
174
- overflow-y-auto p-6 border-l border-gray-200 dark:border-matrix-primary
175
- bg-white dark:bg-black custom-scrollbar
176
- ${h?"translate-x-0":"translate-x-full"}
177
- `,children:s?u.jsx(XK,{summary:s.summary}):!o&&u.jsx("div",{className:"text-sm text-gray-400 dark:text-matrix-secondary/50 text-center mt-10",children:"No summary available."})})]})]})};function nX(){return u.jsx(FE,{children:u.jsxs(S1,{children:[u.jsx(Zt,{path:"/login",element:u.jsx(UJ,{})}),u.jsx(Zt,{path:"/*",element:u.jsx(IJ,{children:u.jsx(B$,{children:u.jsxs(S1,{children:[u.jsx(Zt,{path:"/",element:u.jsx(H$,{})}),u.jsx(Zt,{path:"/chat",element:u.jsx(T7,{})}),u.jsx(Zt,{path:"/zaion",element:u.jsx($J,{})}),u.jsx(Zt,{path:"/logs",element:u.jsx(LJ,{})}),u.jsx(Zt,{path:"/stats",element:u.jsx(PJ,{})}),u.jsx(Zt,{path:"/sati-memories",element:u.jsx(JJ,{})}),u.jsx(Zt,{path:"/mcp-servers",element:u.jsx(rK,{})}),u.jsx(Zt,{path:"/model-pricing",element:u.jsx(sK,{})}),u.jsx(Zt,{path:"/webhooks",element:u.jsx(cK,{})}),u.jsx(Zt,{path:"/notifications",element:u.jsx(fK,{})}),u.jsx(Zt,{path:"/tasks",element:u.jsx(gK,{})}),u.jsx(Zt,{path:"/trinity-databases",element:u.jsx(vK,{})}),u.jsx(Zt,{path:"/chronos",element:u.jsx(AK,{})}),u.jsx(Zt,{path:"/skills",element:u.jsx(DK,{})}),u.jsx(Zt,{path:"/smiths",element:u.jsx(BK,{})}),u.jsx(Zt,{path:"/sessions/:id/audit",element:u.jsx(tX,{})}),u.jsx(Zt,{path:"*",element:u.jsx(xz,{to:"/",replace:!0})})]})})})})]})})}ST.createRoot(document.getElementById("root")).render(u.jsx(j.StrictMode,{children:u.jsx(nX,{})}));