@yattalo/task-system 0.3.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dashboard-app/assets/spa-entry-CnIKatv4.js +24 -0
- package/dashboard-app/assets/styles-CAIFwsCh.css +1 -0
- package/dashboard-app/index.html +14 -0
- package/dist/commands/agent.d.ts +2 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +97 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/context.d.ts +2 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +151 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/dashboard.d.ts +2 -0
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +133 -6
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/day.d.ts +9 -0
- package/dist/commands/day.d.ts.map +1 -0
- package/dist/commands/day.js +98 -0
- package/dist/commands/day.js.map +1 -0
- package/dist/commands/drift.d.ts +2 -0
- package/dist/commands/drift.d.ts.map +1 -0
- package/dist/commands/drift.js +190 -0
- package/dist/commands/drift.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +35 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/generators/mgrep-setup.d.ts +6 -0
- package/dist/generators/mgrep-setup.d.ts.map +1 -0
- package/dist/generators/mgrep-setup.js +191 -0
- package/dist/generators/mgrep-setup.js.map +1 -0
- package/dist/generators/mgrep-skill.d.ts +6 -0
- package/dist/generators/mgrep-skill.d.ts.map +1 -0
- package/dist/generators/mgrep-skill.js +173 -0
- package/dist/generators/mgrep-skill.js.map +1 -0
- package/dist/generators/uca-functions.d.ts +8 -0
- package/dist/generators/uca-functions.d.ts.map +1 -0
- package/dist/generators/uca-functions.js +57 -0
- package/dist/generators/uca-functions.js.map +1 -0
- package/dist/generators/uca-reexports.d.ts +8 -0
- package/dist/generators/uca-reexports.d.ts.map +1 -0
- package/dist/generators/uca-reexports.js +112 -0
- package/dist/generators/uca-reexports.js.map +1 -0
- package/dist/generators/uca-schema.d.ts +8 -0
- package/dist/generators/uca-schema.d.ts.map +1 -0
- package/dist/generators/uca-schema.js +650 -0
- package/dist/generators/uca-schema.js.map +1 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/presets/research.d.ts.map +1 -1
- package/dist/presets/research.js +10 -0
- package/dist/presets/research.js.map +1 -1
- package/dist/presets/software.d.ts.map +1 -1
- package/dist/presets/software.js +10 -0
- package/dist/presets/software.js.map +1 -1
- package/dist/utils/convex-run.d.ts +10 -0
- package/dist/utils/convex-run.d.ts.map +1 -0
- package/dist/utils/convex-run.js +34 -0
- package/dist/utils/convex-run.js.map +1 -0
- package/dist/utils/detect.d.ts.map +1 -1
- package/dist/utils/detect.js +15 -0
- package/dist/utils/detect.js.map +1 -1
- package/dist/utils/merge.d.ts.map +1 -1
- package/dist/utils/merge.js +2 -0
- package/dist/utils/merge.js.map +1 -1
- package/package.json +6 -4
- package/templates/uca/agents.ts +59 -0
- package/templates/uca/contextEntries.ts +125 -0
- package/templates/uca/cronManager.ts +255 -0
- package/templates/uca/cronUtils.ts +99 -0
- package/templates/uca/driftEvents.ts +106 -0
- package/templates/uca/heartbeats.ts +167 -0
- package/templates/uca/hooks.ts +430 -0
- package/templates/uca/memory.ts +326 -0
- package/templates/uca/sessionBridge.ts +238 -0
- package/templates/uca/skills.ts +284 -0
- package/templates/uca/ucaTasks.ts +500 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function q_(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Fd={exports:{}},Wr={};var _y;function $_(){if(_y)return Wr;_y=1;var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,o,c){var h=null;if(c!==void 0&&(h=""+c),o.key!==void 0&&(h=""+o.key),"key"in o){c={};for(var m in o)m!=="key"&&(c[m]=o[m])}else c=o;return o=c.ref,{$$typeof:a,type:r,key:h,ref:o!==void 0?o:null,props:c}}return Wr.Fragment=t,Wr.jsx=s,Wr.jsxs=s,Wr}var Sy;function V_(){return Sy||(Sy=1,Fd.exports=$_()),Fd.exports}var d=V_(),Jd={exports:{}},Ne={};var wy;function I_(){if(wy)return Ne;wy=1;var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),_=Symbol.iterator;function S(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,A={};function H(N,I,Y){this.props=N,this.context=I,this.refs=A,this.updater=Y||k}H.prototype.isReactComponent={},H.prototype.setState=function(N,I){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,I,"setState")},H.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function X(){}X.prototype=H.prototype;function P(N,I,Y){this.props=N,this.context=I,this.refs=A,this.updater=Y||k}var q=P.prototype=new X;q.constructor=P,w(q,H.prototype),q.isPureReactComponent=!0;var ie=Array.isArray;function ee(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function R(N,I,Y){var W=Y.ref;return{$$typeof:a,type:N,key:I,ref:W!==void 0?W:null,props:Y}}function se(N,I){return R(N.type,I,N.props)}function fe(N){return typeof N=="object"&&N!==null&&N.$$typeof===a}function ge(N){var I={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Y){return I[Y]})}var Ee=/\/+/g;function $(N,I){return typeof N=="object"&&N!==null&&N.key!=null?ge(""+N.key):I.toString(36)}function xe(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(ee,ee):(N.status="pending",N.then(function(I){N.status==="pending"&&(N.status="fulfilled",N.value=I)},function(I){N.status==="pending"&&(N.status="rejected",N.reason=I)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function M(N,I,Y,W,_e){var Ce=typeof N;(Ce==="undefined"||Ce==="boolean")&&(N=null);var ye=!1;if(N===null)ye=!0;else switch(Ce){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(N.$$typeof){case a:case t:ye=!0;break;case v:return ye=N._init,M(ye(N._payload),I,Y,W,_e)}}if(ye)return _e=_e(N),ye=W===""?"."+$(N,0):W,ie(_e)?(Y="",ye!=null&&(Y=ye.replace(Ee,"$&/")+"/"),M(_e,I,Y,"",function(Ht){return Ht})):_e!=null&&(fe(_e)&&(_e=se(_e,Y+(_e.key==null||N&&N.key===_e.key?"":(""+_e.key).replace(Ee,"$&/")+"/")+ye)),I.push(_e)),1;ye=0;var ht=W===""?".":W+":";if(ie(N))for(var Xe=0;Xe<N.length;Xe++)W=N[Xe],Ce=ht+$(W,Xe),ye+=M(W,I,Y,Ce,_e);else if(Xe=S(N),typeof Xe=="function")for(N=Xe.call(N),Xe=0;!(W=N.next()).done;)W=W.value,Ce=ht+$(W,Xe++),ye+=M(W,I,Y,Ce,_e);else if(Ce==="object"){if(typeof N.then=="function")return M(xe(N),I,Y,W,_e);throw I=String(N),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return ye}function J(N,I,Y){if(N==null)return N;var W=[],_e=0;return M(N,W,"","",function(Ce){return I.call(Y,Ce,_e++)}),W}function G(N){if(N._status===-1){var I=N._result;I=I(),I.then(function(Y){(N._status===0||N._status===-1)&&(N._status=1,N._result=Y)},function(Y){(N._status===0||N._status===-1)&&(N._status=2,N._result=Y)}),N._status===-1&&(N._status=0,N._result=I)}if(N._status===1)return N._result.default;throw N._result}var Ie=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Ze={map:J,forEach:function(N,I,Y){J(N,function(){I.apply(this,arguments)},Y)},count:function(N){var I=0;return J(N,function(){I++}),I},toArray:function(N){return J(N,function(I){return I})||[]},only:function(N){if(!fe(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ne.Activity=x,Ne.Children=Ze,Ne.Component=H,Ne.Fragment=s,Ne.Profiler=o,Ne.PureComponent=P,Ne.StrictMode=r,Ne.Suspense=p,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},Ne.cache=function(N){return function(){return N.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(N,I,Y){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var W=w({},N.props),_e=N.key;if(I!=null)for(Ce in I.key!==void 0&&(_e=""+I.key),I)!L.call(I,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&I.ref===void 0||(W[Ce]=I[Ce]);var Ce=arguments.length-2;if(Ce===1)W.children=Y;else if(1<Ce){for(var ye=Array(Ce),ht=0;ht<Ce;ht++)ye[ht]=arguments[ht+2];W.children=ye}return R(N.type,_e,W)},Ne.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:c,_context:N},N},Ne.createElement=function(N,I,Y){var W,_e={},Ce=null;if(I!=null)for(W in I.key!==void 0&&(Ce=""+I.key),I)L.call(I,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(_e[W]=I[W]);var ye=arguments.length-2;if(ye===1)_e.children=Y;else if(1<ye){for(var ht=Array(ye),Xe=0;Xe<ye;Xe++)ht[Xe]=arguments[Xe+2];_e.children=ht}if(N&&N.defaultProps)for(W in ye=N.defaultProps,ye)_e[W]===void 0&&(_e[W]=ye[W]);return R(N,Ce,_e)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(N){return{$$typeof:m,render:N}},Ne.isValidElement=fe,Ne.lazy=function(N){return{$$typeof:v,_payload:{_status:-1,_result:N},_init:G}},Ne.memo=function(N,I){return{$$typeof:g,type:N,compare:I===void 0?null:I}},Ne.startTransition=function(N){var I=D.T,Y={};D.T=Y;try{var W=N(),_e=D.S;_e!==null&&_e(Y,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(ee,Ie)}catch(Ce){Ie(Ce)}finally{I!==null&&Y.types!==null&&(I.types=Y.types),D.T=I}},Ne.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ne.use=function(N){return D.H.use(N)},Ne.useActionState=function(N,I,Y){return D.H.useActionState(N,I,Y)},Ne.useCallback=function(N,I){return D.H.useCallback(N,I)},Ne.useContext=function(N){return D.H.useContext(N)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(N,I){return D.H.useDeferredValue(N,I)},Ne.useEffect=function(N,I){return D.H.useEffect(N,I)},Ne.useEffectEvent=function(N){return D.H.useEffectEvent(N)},Ne.useId=function(){return D.H.useId()},Ne.useImperativeHandle=function(N,I,Y){return D.H.useImperativeHandle(N,I,Y)},Ne.useInsertionEffect=function(N,I){return D.H.useInsertionEffect(N,I)},Ne.useLayoutEffect=function(N,I){return D.H.useLayoutEffect(N,I)},Ne.useMemo=function(N,I){return D.H.useMemo(N,I)},Ne.useOptimistic=function(N,I){return D.H.useOptimistic(N,I)},Ne.useReducer=function(N,I,Y){return D.H.useReducer(N,I,Y)},Ne.useRef=function(N){return D.H.useRef(N)},Ne.useState=function(N){return D.H.useState(N)},Ne.useSyncExternalStore=function(N,I,Y){return D.H.useSyncExternalStore(N,I,Y)},Ne.useTransition=function(){return D.H.useTransition()},Ne.version="19.2.4",Ne}var ky;function Tl(){return ky||(ky=1,Jd.exports=I_()),Jd.exports}var Q=Tl();const ha=q_(Q);var Wd={exports:{}},el={},ef={exports:{}},tf={};var Ty;function Z_(){return Ty||(Ty=1,(function(a){function t(M,J){var G=M.length;M.push(J);e:for(;0<G;){var Ie=G-1>>>1,Ze=M[Ie];if(0<o(Ze,J))M[Ie]=J,M[G]=Ze,G=Ie;else break e}}function s(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var J=M[0],G=M.pop();if(G!==J){M[0]=G;e:for(var Ie=0,Ze=M.length,N=Ze>>>1;Ie<N;){var I=2*(Ie+1)-1,Y=M[I],W=I+1,_e=M[W];if(0>o(Y,G))W<Ze&&0>o(_e,Y)?(M[Ie]=_e,M[W]=G,Ie=W):(M[Ie]=Y,M[I]=G,Ie=I);else if(W<Ze&&0>o(_e,G))M[Ie]=_e,M[W]=G,Ie=W;else break e}}return J}function o(M,J){var G=M.sortIndex-J.sortIndex;return G!==0?G:M.id-J.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;a.unstable_now=function(){return c.now()}}else{var h=Date,m=h.now();a.unstable_now=function(){return h.now()-m}}var p=[],g=[],v=1,x=null,_=3,S=!1,k=!1,w=!1,A=!1,H=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function q(M){for(var J=s(g);J!==null;){if(J.callback===null)r(g);else if(J.startTime<=M)r(g),J.sortIndex=J.expirationTime,t(p,J);else break;J=s(g)}}function ie(M){if(w=!1,q(M),!k)if(s(p)!==null)k=!0,ee||(ee=!0,ge());else{var J=s(g);J!==null&&xe(ie,J.startTime-M)}}var ee=!1,D=-1,L=5,R=-1;function se(){return A?!0:!(a.unstable_now()-R<L)}function fe(){if(A=!1,ee){var M=a.unstable_now();R=M;var J=!0;try{e:{k=!1,w&&(w=!1,X(D),D=-1),S=!0;var G=_;try{t:{for(q(M),x=s(p);x!==null&&!(x.expirationTime>M&&se());){var Ie=x.callback;if(typeof Ie=="function"){x.callback=null,_=x.priorityLevel;var Ze=Ie(x.expirationTime<=M);if(M=a.unstable_now(),typeof Ze=="function"){x.callback=Ze,q(M),J=!0;break t}x===s(p)&&r(p),q(M)}else r(p);x=s(p)}if(x!==null)J=!0;else{var N=s(g);N!==null&&xe(ie,N.startTime-M),J=!1}}break e}finally{x=null,_=G,S=!1}J=void 0}}finally{J?ge():ee=!1}}}var ge;if(typeof P=="function")ge=function(){P(fe)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,$=Ee.port2;Ee.port1.onmessage=fe,ge=function(){$.postMessage(null)}}else ge=function(){H(fe,0)};function xe(M,J){D=H(function(){M(a.unstable_now())},J)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(M){M.callback=null},a.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},a.unstable_getCurrentPriorityLevel=function(){return _},a.unstable_next=function(M){switch(_){case 1:case 2:case 3:var J=3;break;default:J=_}var G=_;_=J;try{return M()}finally{_=G}},a.unstable_requestPaint=function(){A=!0},a.unstable_runWithPriority=function(M,J){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var G=_;_=M;try{return J()}finally{_=G}},a.unstable_scheduleCallback=function(M,J,G){var Ie=a.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Ie+G:Ie):G=Ie,M){case 1:var Ze=-1;break;case 2:Ze=250;break;case 5:Ze=1073741823;break;case 4:Ze=1e4;break;default:Ze=5e3}return Ze=G+Ze,M={id:v++,callback:J,priorityLevel:M,startTime:G,expirationTime:Ze,sortIndex:-1},G>Ie?(M.sortIndex=G,t(g,M),s(p)===null&&M===s(g)&&(w?(X(D),D=-1):w=!0,xe(ie,G-Ie))):(M.sortIndex=Ze,t(p,M),k||S||(k=!0,ee||(ee=!0,ge()))),M},a.unstable_shouldYield=se,a.unstable_wrapCallback=function(M){var J=_;return function(){var G=_;_=J;try{return M.apply(this,arguments)}finally{_=G}}}})(tf)),tf}var jy;function H_(){return jy||(jy=1,ef.exports=Z_()),ef.exports}var nf={exports:{}},It={};var Ny;function P_(){if(Ny)return It;Ny=1;var a=Tl();function t(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(p,g,v){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:p,containerInfo:g,implementation:v}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,It.createPortal=function(p,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return c(p,g,null,v)},It.flushSync=function(p){var g=h.T,v=r.p;try{if(h.T=null,r.p=2,p)return p()}finally{h.T=g,r.p=v,r.d.f()}},It.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(p,g))},It.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},It.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var v=g.as,x=m(v,g.crossOrigin),_=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?r.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:_,fetchPriority:S}):v==="script"&&r.d.X(p,{crossOrigin:x,integrity:_,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},It.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=m(g.as,g.crossOrigin);r.d.M(p,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(p)},It.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,x=m(v,g.crossOrigin);r.d.L(p,v,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},It.preloadModule=function(p,g){if(typeof p=="string")if(g){var v=m(g.as,g.crossOrigin);r.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(p)},It.requestFormReset=function(p){r.d.r(p)},It.unstable_batchedUpdates=function(p,g){return p(g)},It.useFormState=function(p,g,v){return h.H.useFormState(p,g,v)},It.useFormStatus=function(){return h.H.useHostTransitionStatus()},It.version="19.2.4",It}var Cy;function ax(){if(Cy)return nf.exports;Cy=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(t){console.error(t)}}return a(),nf.exports=P_(),nf.exports}var Ry;function Q_(){if(Ry)return el;Ry=1;var a=H_(),t=Tl(),s=ax();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(c(e)!==e)throw Error(r(188))}function g(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,l=n;;){var u=i.return;if(u===null)break;var f=u.alternate;if(f===null){if(l=u.return,l!==null){i=l;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===i)return p(u),e;if(f===l)return p(u),n;f=f.sibling}throw Error(r(188))}if(i.return!==l.return)i=u,l=f;else{for(var y=!1,b=u.child;b;){if(b===i){y=!0,i=u,l=f;break}if(b===l){y=!0,l=u,i=f;break}b=b.sibling}if(!y){for(b=f.child;b;){if(b===i){y=!0,i=f,l=u;break}if(b===l){y=!0,l=f,i=u;break}b=b.sibling}if(!y)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,_=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),P=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),fe=Symbol.iterator;function ge(e){return e===null||typeof e!="object"?null:(e=fe&&e[fe]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case H:return"Profiler";case A:return"StrictMode";case ie:return"Suspense";case ee:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case P:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case q:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return n=e.displayName||null,n!==null?n:$(e.type)||"Memo";case L:n=e._payload,e=e._init;try{return $(e(n))}catch{}}return null}var xe=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},Ie=[],Ze=-1;function N(e){return{current:e}}function I(e){0>Ze||(e.current=Ie[Ze],Ie[Ze]=null,Ze--)}function Y(e,n){Ze++,Ie[Ze]=e.current,e.current=n}var W=N(null),_e=N(null),Ce=N(null),ye=N(null);function ht(e,n){switch(Y(Ce,n),Y(_e,e),Y(W,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Hg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Hg(n),e=Pg(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(W),Y(W,e)}function Xe(){I(W),I(_e),I(Ce)}function Ht(e){e.memoizedState!==null&&Y(ye,e);var n=W.current,i=Pg(n,e.type);n!==i&&(Y(_e,e),Y(W,i))}function sn(e){_e.current===e&&(I(W),I(_e)),ye.current===e&&(I(ye),Xr._currentValue=G)}var Un,ar;function ss(e){if(Un===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Un=n&&n[1]||"",ar=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Un+e+ar}var Pa=!1;function Qa(e,n){if(!e||Pa)return"";Pa=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(U){var O=U}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(U){O=U}e.call(Z.prototype)}}else{try{throw Error()}catch(U){O=U}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(U){if(U&&O&&typeof U.stack=="string")return[U.stack,O.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),y=f[0],b=f[1];if(y&&b){var T=y.split(`
|
|
4
|
+
`),z=b.split(`
|
|
5
|
+
`);for(u=l=0;l<T.length&&!T[l].includes("DetermineComponentFrameRoot");)l++;for(;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;if(l===T.length||u===z.length)for(l=T.length-1,u=z.length-1;1<=l&&0<=u&&T[l]!==z[u];)u--;for(;1<=l&&0<=u;l--,u--)if(T[l]!==z[u]){if(l!==1||u!==1)do if(l--,u--,0>u||T[l]!==z[u]){var B=`
|
|
6
|
+
`+T[l].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=l&&0<=u);break}}}finally{Pa=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ss(i):""}function zs(e,n){switch(e.tag){case 26:case 27:case 5:return ss(e.type);case 16:return ss("Lazy");case 13:return e.child!==n&&n!==null?ss("Suspense Fallback"):ss("Suspense");case 19:return ss("SuspenseList");case 0:case 15:return Qa(e.type,!1);case 11:return Qa(e.type.render,!1);case 1:return Qa(e.type,!0);case 31:return ss("Activity");default:return""}}function Ga(e){try{var n="",i=null;do n+=zs(e,i),i=e,e=e.return;while(e);return n}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var Bn=Object.prototype.hasOwnProperty,ir=a.unstable_scheduleCallback,rr=a.unstable_cancelCallback,Nl=a.unstable_shouldYield,Uc=a.unstable_requestPaint,Pt=a.unstable_now,Bc=a.unstable_getCurrentPriorityLevel,ct=a.unstable_ImmediatePriority,Lt=a.unstable_UserBlockingPriority,Vt=a.unstable_NormalPriority,Cl=a.unstable_LowPriority,kh=a.unstable_IdlePriority,_0=a.log,S0=a.unstable_setDisableYieldValue,lr=null,an=null;function Os(e){if(typeof _0=="function"&&S0(e),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(lr,e)}catch{}}var rn=Math.clz32?Math.clz32:T0,w0=Math.log,k0=Math.LN2;function T0(e){return e>>>=0,e===0?32:31-(w0(e)/k0|0)|0}var Rl=256,Al=262144,El=4194304;function ga(e){var n=e&42;if(n!==0)return n;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function zl(e,n,i){var l=e.pendingLanes;if(l===0)return 0;var u=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var b=l&134217727;return b!==0?(l=b&~f,l!==0?u=ga(l):(y&=b,y!==0?u=ga(y):i||(i=b&~e,i!==0&&(u=ga(i))))):(b=l&~f,b!==0?u=ga(b):y!==0?u=ga(y):i||(i=l&~e,i!==0&&(u=ga(i)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,i=n&-n,f>=i||f===32&&(i&4194048)!==0)?n:u}function or(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function j0(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Th(){var e=El;return El<<=1,(El&62914560)===0&&(El=4194304),e}function qc(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function cr(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function N0(e,n,i,l,u,f){var y=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,z=e.hiddenUpdates;for(i=y&~i;0<i;){var B=31-rn(i),Z=1<<B;b[B]=0,T[B]=-1;var O=z[B];if(O!==null)for(z[B]=null,B=0;B<O.length;B++){var U=O[B];U!==null&&(U.lane&=-536870913)}i&=~Z}l!==0&&jh(e,l,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~n))}function jh(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-rn(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function Nh(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var l=31-rn(i),u=1<<l;u&n|e[l]&n&&(e[l]|=n),i&=~u}}function Ch(e,n){var i=n&-n;return i=(i&42)!==0?1:$c(i),(i&(e.suspendedLanes|n))!==0?0:i}function $c(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Vc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rh(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:my(e.type))}function Ah(e,n){var i=J.p;try{return J.p=e,n()}finally{J.p=i}}var Ms=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Ms,Yt="__reactProps$"+Ms,Ya="__reactContainer$"+Ms,Ic="__reactEvents$"+Ms,C0="__reactListeners$"+Ms,R0="__reactHandles$"+Ms,Eh="__reactResources$"+Ms,ur="__reactMarker$"+Ms;function Zc(e){delete e[Dt],delete e[Yt],delete e[Ic],delete e[C0],delete e[R0]}function Xa(e){var n=e[Dt];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Ya]||i[Dt]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=Jg(e);e!==null;){if(i=e[Dt])return i;e=Jg(e)}return n}e=i,i=e.parentNode}return null}function Ka(e){if(e=e[Dt]||e[Ya]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function dr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Fa(e){var n=e[Eh];return n||(n=e[Eh]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ot(e){e[ur]=!0}var zh=new Set,Oh={};function ya(e,n){Ja(e,n),Ja(e+"Capture",n)}function Ja(e,n){for(Oh[e]=n,e=0;e<n.length;e++)zh.add(n[e])}var A0=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]*$"),Mh={},Lh={};function E0(e){return Bn.call(Lh,e)?!0:Bn.call(Mh,e)?!1:A0.test(e)?Lh[e]=!0:(Mh[e]=!0,!1)}function Ol(e,n,i){if(E0(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+i)}}function Ml(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function as(e,n,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(n,i,""+l)}}function xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dh(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function z0(e,n,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var u=l.get,f=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(y){i=""+y,f.call(this,y)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(y){i=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Hc(e){if(!e._valueTracker){var n=Dh(e)?"checked":"value";e._valueTracker=z0(e,n,""+e[n])}}function Uh(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=Dh(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function Ll(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var O0=/[\n"\\]/g;function bn(e){return e.replace(O0,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Pc(e,n,i,l,u,f,y,b){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),n!=null?y==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+xn(n)):e.value!==""+xn(n)&&(e.value=""+xn(n)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),n!=null?Qc(e,y,xn(n)):i!=null?Qc(e,y,xn(i)):l!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+xn(b):e.removeAttribute("name")}function Bh(e,n,i,l,u,f,y,b){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||i!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Hc(e);return}i=i!=null?""+xn(i):"",n=n!=null?""+xn(n):i,b||n===e.value||(e.value=n),e.defaultValue=n}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=b?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Hc(e)}function Qc(e,n,i){n==="number"&&Ll(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Wa(e,n,i,l){if(e=e.options,n){n={};for(var u=0;u<i.length;u++)n["$"+i[u]]=!0;for(i=0;i<e.length;i++)u=n.hasOwnProperty("$"+e[i].value),e[i].selected!==u&&(e[i].selected=u),u&&l&&(e[i].defaultSelected=!0)}else{for(i=""+xn(i),n=null,u=0;u<e.length;u++){if(e[u].value===i){e[u].selected=!0,l&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function qh(e,n,i){if(n!=null&&(n=""+xn(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+xn(i):""}function $h(e,n,i,l){if(n==null){if(l!=null){if(i!=null)throw Error(r(92));if(xe(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),n=i}i=xn(n),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Hc(e)}function ei(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var M0=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 Vh(e,n,i){var l=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,i):typeof i!="number"||i===0||M0.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function Ih(e,n,i){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var u in n)l=n[u],n.hasOwnProperty(u)&&i[u]!==l&&Vh(e,u,l)}else for(var f in n)n.hasOwnProperty(f)&&Vh(e,f,n[f])}function Gc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 L0=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"]]),D0=/^[\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 Dl(e){return D0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var Yc=null;function Xc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ti=null,ni=null;function Zh(e){var n=Ka(e);if(n&&(e=n.stateNode)){var i=e[Yt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Pc(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+bn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==e&&l.form===e.form){var u=l[Yt]||null;if(!u)throw Error(r(90));Pc(l,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<i.length;n++)l=i[n],l.form===e.form&&Uh(l)}break e;case"textarea":qh(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&Wa(e,!!i.multiple,n,!1)}}}var Kc=!1;function Hh(e,n,i){if(Kc)return e(n,i);Kc=!0;try{var l=e(n);return l}finally{if(Kc=!1,(ti!==null||ni!==null)&&(ko(),ti&&(n=ti,e=ni,ni=ti=null,Zh(n),e)))for(n=0;n<e.length;n++)Zh(e[n])}}function fr(e,n){var i=e.stateNode;if(i===null)return null;var l=i[Yt]||null;if(l===null)return null;i=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,n,typeof i));return i}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=!1;if(rs)try{var hr={};Object.defineProperty(hr,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",hr,hr),window.removeEventListener("test",hr,hr)}catch{Fc=!1}var Ls=null,Jc=null,Ul=null;function Ph(){if(Ul)return Ul;var e,n=Jc,i=n.length,l,u="value"in Ls?Ls.value:Ls.textContent,f=u.length;for(e=0;e<i&&n[e]===u[e];e++);var y=i-e;for(l=1;l<=y&&n[i-l]===u[f-l];l++);return Ul=u.slice(e,1<l?1-l:void 0)}function Bl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function ql(){return!0}function Qh(){return!1}function Xt(e){function n(i,l,u,f,y){this._reactName=i,this._targetInst=u,this.type=l,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(i=e[b],this[b]=i?i(f):f[b]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ql:Qh,this.isPropagationStopped=Qh,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ql)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ql)},persist:function(){},isPersistent:ql}),n}var va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=Xt(va),mr=x({},va,{view:0,detail:0}),U0=Xt(mr),Wc,eu,pr,Vl=x({},mr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==pr&&(pr&&e.type==="mousemove"?(Wc=e.screenX-pr.screenX,eu=e.screenY-pr.screenY):eu=Wc=0,pr=e),Wc)},movementY:function(e){return"movementY"in e?e.movementY:eu}}),Gh=Xt(Vl),B0=x({},Vl,{dataTransfer:0}),q0=Xt(B0),$0=x({},mr,{relatedTarget:0}),tu=Xt($0),V0=x({},va,{animationName:0,elapsedTime:0,pseudoElement:0}),I0=Xt(V0),Z0=x({},va,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),H0=Xt(Z0),P0=x({},va,{data:0}),Yh=Xt(P0),Q0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G0={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"},Y0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function X0(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Y0[e])?!!n[e]:!1}function nu(){return X0}var K0=x({},mr,{key:function(e){if(e.key){var n=Q0[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?G0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nu,charCode:function(e){return e.type==="keypress"?Bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),F0=Xt(K0),J0=x({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xh=Xt(J0),W0=x({},mr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nu}),eb=Xt(W0),tb=x({},va,{propertyName:0,elapsedTime:0,pseudoElement:0}),nb=Xt(tb),sb=x({},Vl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ab=Xt(sb),ib=x({},va,{newState:0,oldState:0}),rb=Xt(ib),lb=[9,13,27,32],su=rs&&"CompositionEvent"in window,gr=null;rs&&"documentMode"in document&&(gr=document.documentMode);var ob=rs&&"TextEvent"in window&&!gr,Kh=rs&&(!su||gr&&8<gr&&11>=gr),Fh=" ",Jh=!1;function Wh(e,n){switch(e){case"keyup":return lb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function em(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var si=!1;function cb(e,n){switch(e){case"compositionend":return em(n);case"keypress":return n.which!==32?null:(Jh=!0,Fh);case"textInput":return e=n.data,e===Fh&&Jh?null:e;default:return null}}function ub(e,n){if(si)return e==="compositionend"||!su&&Wh(e,n)?(e=Ph(),Ul=Jc=Ls=null,si=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Kh&&n.locale!=="ko"?null:n.data;default:return null}}var db={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 tm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!db[e.type]:n==="textarea"}function nm(e,n,i,l){ti?ni?ni.push(l):ni=[l]:ti=l,n=Eo(n,"onChange"),0<n.length&&(i=new $l("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var yr=null,vr=null;function fb(e){Bg(e,0)}function Il(e){var n=dr(e);if(Uh(n))return e}function sm(e,n){if(e==="change")return n}var am=!1;if(rs){var au;if(rs){var iu="oninput"in document;if(!iu){var im=document.createElement("div");im.setAttribute("oninput","return;"),iu=typeof im.oninput=="function"}au=iu}else au=!1;am=au&&(!document.documentMode||9<document.documentMode)}function rm(){yr&&(yr.detachEvent("onpropertychange",lm),vr=yr=null)}function lm(e){if(e.propertyName==="value"&&Il(vr)){var n=[];nm(n,vr,e,Xc(e)),Hh(fb,n)}}function hb(e,n,i){e==="focusin"?(rm(),yr=n,vr=i,yr.attachEvent("onpropertychange",lm)):e==="focusout"&&rm()}function mb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Il(vr)}function pb(e,n){if(e==="click")return Il(n)}function gb(e,n){if(e==="input"||e==="change")return Il(n)}function yb(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ln=typeof Object.is=="function"?Object.is:yb;function xr(e,n){if(ln(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var u=i[l];if(!Bn.call(n,u)||!ln(e[u],n[u]))return!1}return!0}function om(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cm(e,n){var i=om(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=n&&l>=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=om(i)}}function um(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?um(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function dm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Ll(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Ll(e.document)}return n}function ru(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var vb=rs&&"documentMode"in document&&11>=document.documentMode,ai=null,lu=null,br=null,ou=!1;function fm(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ou||ai==null||ai!==Ll(l)||(l=ai,"selectionStart"in l&&ru(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),br&&xr(br,l)||(br=l,l=Eo(lu,"onSelect"),0<l.length&&(n=new $l("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=ai)))}function xa(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var ii={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionrun:xa("Transition","TransitionRun"),transitionstart:xa("Transition","TransitionStart"),transitioncancel:xa("Transition","TransitionCancel"),transitionend:xa("Transition","TransitionEnd")},cu={},hm={};rs&&(hm=document.createElement("div").style,"AnimationEvent"in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),"TransitionEvent"in window||delete ii.transitionend.transition);function ba(e){if(cu[e])return cu[e];if(!ii[e])return e;var n=ii[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in hm)return cu[e]=n[i];return e}var mm=ba("animationend"),pm=ba("animationiteration"),gm=ba("animationstart"),xb=ba("transitionrun"),bb=ba("transitionstart"),_b=ba("transitioncancel"),ym=ba("transitionend"),vm=new Map,uu="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(" ");uu.push("scrollEnd");function qn(e,n){vm.set(e,n),ya(n,[e])}var Zl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},_n=[],ri=0,du=0;function Hl(){for(var e=ri,n=du=ri=0;n<e;){var i=_n[n];_n[n++]=null;var l=_n[n];_n[n++]=null;var u=_n[n];_n[n++]=null;var f=_n[n];if(_n[n++]=null,l!==null&&u!==null){var y=l.pending;y===null?u.next=u:(u.next=y.next,y.next=u),l.pending=u}f!==0&&xm(i,u,f)}}function Pl(e,n,i,l){_n[ri++]=e,_n[ri++]=n,_n[ri++]=i,_n[ri++]=l,du|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function fu(e,n,i,l){return Pl(e,n,i,l),Ql(e)}function _a(e,n){return Pl(e,null,null,n),Ql(e)}function xm(e,n,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var u=!1,f=e.return;f!==null;)f.childLanes|=i,l=f.alternate,l!==null&&(l.childLanes|=i),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&n!==null&&(u=31-rn(i),e=f.hiddenUpdates,l=e[u],l===null?e[u]=[n]:l.push(n),n.lane=i|536870912),f):null}function Ql(e){if(50<Ir)throw Ir=0,_d=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var li={};function Sb(e,n,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function on(e,n,i,l){return new Sb(e,n,i,l)}function hu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ls(e,n){var i=e.alternate;return i===null?(i=on(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function bm(e,n){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Gl(e,n,i,l,u,f){var y=0;if(l=e,typeof e=="function")hu(e)&&(y=1);else if(typeof e=="string")y=N_(e,i,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=on(31,i,n,u),e.elementType=R,e.lanes=f,e;case w:return Sa(i.children,u,f,n);case A:y=8,u|=24;break;case H:return e=on(12,i,n,u|2),e.elementType=H,e.lanes=f,e;case ie:return e=on(13,i,n,u),e.elementType=ie,e.lanes=f,e;case ee:return e=on(19,i,n,u),e.elementType=ee,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:y=10;break e;case X:y=9;break e;case q:y=11;break e;case D:y=14;break e;case L:y=16,l=null;break e}y=29,i=Error(r(130,e===null?"null":typeof e,"")),l=null}return n=on(y,i,n,u),n.elementType=e,n.type=l,n.lanes=f,n}function Sa(e,n,i,l){return e=on(7,e,l,n),e.lanes=i,e}function mu(e,n,i){return e=on(6,e,null,n),e.lanes=i,e}function _m(e){var n=on(18,null,null,0);return n.stateNode=e,n}function pu(e,n,i){return n=on(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Sm=new WeakMap;function Sn(e,n){if(typeof e=="object"&&e!==null){var i=Sm.get(e);return i!==void 0?i:(n={value:e,source:n,stack:Ga(n)},Sm.set(e,n),n)}return{value:e,source:n,stack:Ga(n)}}var oi=[],ci=0,Yl=null,_r=0,wn=[],kn=0,Ds=null,Hn=1,Pn="";function os(e,n){oi[ci++]=_r,oi[ci++]=Yl,Yl=e,_r=n}function wm(e,n,i){wn[kn++]=Hn,wn[kn++]=Pn,wn[kn++]=Ds,Ds=e;var l=Hn;e=Pn;var u=32-rn(l)-1;l&=~(1<<u),i+=1;var f=32-rn(n)+u;if(30<f){var y=u-u%5;f=(l&(1<<y)-1).toString(32),l>>=y,u-=y,Hn=1<<32-rn(n)+u|i<<u|l,Pn=f+e}else Hn=1<<f|i<<u|l,Pn=e}function gu(e){e.return!==null&&(os(e,1),wm(e,1,0))}function yu(e){for(;e===Yl;)Yl=oi[--ci],oi[ci]=null,_r=oi[--ci],oi[ci]=null;for(;e===Ds;)Ds=wn[--kn],wn[kn]=null,Pn=wn[--kn],wn[kn]=null,Hn=wn[--kn],wn[kn]=null}function km(e,n){wn[kn++]=Hn,wn[kn++]=Pn,wn[kn++]=Ds,Hn=n.id,Pn=n.overflow,Ds=e}var Ut=null,ut=null,qe=!1,Us=null,Tn=!1,vu=Error(r(519));function Bs(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sr(Sn(n,e)),vu}function Tm(e){var n=e.stateNode,i=e.type,l=e.memoizedProps;switch(n[Dt]=e,n[Yt]=l,i){case"dialog":De("cancel",n),De("close",n);break;case"iframe":case"object":case"embed":De("load",n);break;case"video":case"audio":for(i=0;i<Hr.length;i++)De(Hr[i],n);break;case"source":De("error",n);break;case"img":case"image":case"link":De("error",n),De("load",n);break;case"details":De("toggle",n);break;case"input":De("invalid",n),Bh(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":De("invalid",n);break;case"textarea":De("invalid",n),$h(n,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||l.suppressHydrationWarning===!0||Ig(n.textContent,i)?(l.popover!=null&&(De("beforetoggle",n),De("toggle",n)),l.onScroll!=null&&De("scroll",n),l.onScrollEnd!=null&&De("scrollend",n),l.onClick!=null&&(n.onclick=is),n=!0):n=!1,n||Bs(e,!0)}function jm(e){for(Ut=e.return;Ut;)switch(Ut.tag){case 5:case 31:case 13:Tn=!1;return;case 27:case 3:Tn=!0;return;default:Ut=Ut.return}}function ui(e){if(e!==Ut)return!1;if(!qe)return jm(e),qe=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Dd(e.type,e.memoizedProps)),i=!i),i&&ut&&Bs(e),jm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ut=Fg(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ut=Fg(e)}else n===27?(n=ut,Js(e.type)?(e=Vd,Vd=null,ut=e):ut=n):ut=Ut?Nn(e.stateNode.nextSibling):null;return!0}function wa(){ut=Ut=null,qe=!1}function xu(){var e=Us;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),Us=null),e}function Sr(e){Us===null?Us=[e]:Us.push(e)}var bu=N(null),ka=null,cs=null;function qs(e,n,i){Y(bu,n._currentValue),n._currentValue=i}function us(e){e._currentValue=bu.current,I(bu)}function _u(e,n,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===i)break;e=e.return}}function Su(e,n,i,l){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var y=u.child;f=f.firstContext;e:for(;f!==null;){var b=f;f=u;for(var T=0;T<n.length;T++)if(b.context===n[T]){f.lanes|=i,b=f.alternate,b!==null&&(b.lanes|=i),_u(f.return,i,e),l||(y=null);break e}f=b.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(r(341));y.lanes|=i,f=y.alternate,f!==null&&(f.lanes|=i),_u(y,i,e),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===e){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function di(e,n,i,l){e=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(r(387));if(y=y.memoizedProps,y!==null){var b=u.type;ln(u.pendingProps.value,y.value)||(e!==null?e.push(b):e=[b])}}else if(u===ye.current){if(y=u.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Xr):e=[Xr])}u=u.return}e!==null&&Su(n,e,i,l),n.flags|=262144}function Xl(e){for(e=e.firstContext;e!==null;){if(!ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){ka=e,cs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return Nm(ka,e)}function Kl(e,n){return ka===null&&Ta(e),Nm(e,n)}function Nm(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},cs===null){if(e===null)throw Error(r(308));cs=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else cs=cs.next=n;return i}var wb=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},kb=a.unstable_scheduleCallback,Tb=a.unstable_NormalPriority,bt={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wu(){return{controller:new wb,data:new Map,refCount:0}}function wr(e){e.refCount--,e.refCount===0&&kb(Tb,function(){e.controller.abort()})}var kr=null,ku=0,fi=0,hi=null;function jb(e,n){if(kr===null){var i=kr=[];ku=0,fi=Nd(),hi={status:"pending",value:void 0,then:function(l){i.push(l)}}}return ku++,n.then(Cm,Cm),n}function Cm(){if(--ku===0&&kr!==null){hi!==null&&(hi.status="fulfilled");var e=kr;kr=null,fi=0,hi=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Nb(e,n){var i=[],l={status:"pending",value:null,reason:null,then:function(u){i.push(u)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var u=0;u<i.length;u++)(0,i[u])(n)},function(u){for(l.status="rejected",l.reason=u,u=0;u<i.length;u++)(0,i[u])(void 0)}),l}var Rm=M.S;M.S=function(e,n){fg=Pt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&jb(e,n),Rm!==null&&Rm(e,n)};var ja=N(null);function Tu(){var e=ja.current;return e!==null?e:it.pooledCache}function Fl(e,n){n===null?Y(ja,ja.current):Y(ja,n.pool)}function Am(){var e=Tu();return e===null?null:{parent:bt._currentValue,pool:e}}var mi=Error(r(460)),ju=Error(r(474)),Jl=Error(r(542)),Wl={then:function(){}};function Em(e){return e=e.status,e==="fulfilled"||e==="rejected"}function zm(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(is,is),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Mm(e),e;default:if(typeof n.status=="string")n.then(is,is);else{if(e=it,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=l}},function(l){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Mm(e),e}throw Ca=n,mi}}function Na(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ca=i,mi):i}}var Ca=null;function Om(){if(Ca===null)throw Error(r(459));var e=Ca;return Ca=null,e}function Mm(e){if(e===mi||e===Jl)throw Error(r(483))}var pi=null,Tr=0;function eo(e){var n=Tr;return Tr+=1,pi===null&&(pi=[]),zm(pi,e,n)}function jr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function to(e,n){throw n.$$typeof===_?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Lm(e){function n(C,j){if(e){var E=C.deletions;E===null?(C.deletions=[j],C.flags|=16):E.push(j)}}function i(C,j){if(!e)return null;for(;j!==null;)n(C,j),j=j.sibling;return null}function l(C){for(var j=new Map;C!==null;)C.key!==null?j.set(C.key,C):j.set(C.index,C),C=C.sibling;return j}function u(C,j){return C=ls(C,j),C.index=0,C.sibling=null,C}function f(C,j,E){return C.index=E,e?(E=C.alternate,E!==null?(E=E.index,E<j?(C.flags|=67108866,j):E):(C.flags|=67108866,j)):(C.flags|=1048576,j)}function y(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function b(C,j,E,V){return j===null||j.tag!==6?(j=mu(E,C.mode,V),j.return=C,j):(j=u(j,E),j.return=C,j)}function T(C,j,E,V){var ve=E.type;return ve===w?B(C,j,E.props.children,V,E.key):j!==null&&(j.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===L&&Na(ve)===j.type)?(j=u(j,E.props),jr(j,E),j.return=C,j):(j=Gl(E.type,E.key,E.props,null,C.mode,V),jr(j,E),j.return=C,j)}function z(C,j,E,V){return j===null||j.tag!==4||j.stateNode.containerInfo!==E.containerInfo||j.stateNode.implementation!==E.implementation?(j=pu(E,C.mode,V),j.return=C,j):(j=u(j,E.children||[]),j.return=C,j)}function B(C,j,E,V,ve){return j===null||j.tag!==7?(j=Sa(E,C.mode,V,ve),j.return=C,j):(j=u(j,E),j.return=C,j)}function Z(C,j,E){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=mu(""+j,C.mode,E),j.return=C,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case S:return E=Gl(j.type,j.key,j.props,null,C.mode,E),jr(E,j),E.return=C,E;case k:return j=pu(j,C.mode,E),j.return=C,j;case L:return j=Na(j),Z(C,j,E)}if(xe(j)||ge(j))return j=Sa(j,C.mode,E,null),j.return=C,j;if(typeof j.then=="function")return Z(C,eo(j),E);if(j.$$typeof===P)return Z(C,Kl(C,j),E);to(C,j)}return null}function O(C,j,E,V){var ve=j!==null?j.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return ve!==null?null:b(C,j,""+E,V);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case S:return E.key===ve?T(C,j,E,V):null;case k:return E.key===ve?z(C,j,E,V):null;case L:return E=Na(E),O(C,j,E,V)}if(xe(E)||ge(E))return ve!==null?null:B(C,j,E,V,null);if(typeof E.then=="function")return O(C,j,eo(E),V);if(E.$$typeof===P)return O(C,j,Kl(C,E),V);to(C,E)}return null}function U(C,j,E,V,ve){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return C=C.get(E)||null,b(j,C,""+V,ve);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return C=C.get(V.key===null?E:V.key)||null,T(j,C,V,ve);case k:return C=C.get(V.key===null?E:V.key)||null,z(j,C,V,ve);case L:return V=Na(V),U(C,j,E,V,ve)}if(xe(V)||ge(V))return C=C.get(E)||null,B(j,C,V,ve,null);if(typeof V.then=="function")return U(C,j,E,eo(V),ve);if(V.$$typeof===P)return U(C,j,E,Kl(j,V),ve);to(j,V)}return null}function ae(C,j,E,V){for(var ve=null,He=null,he=j,Ae=j=0,Be=null;he!==null&&Ae<E.length;Ae++){he.index>Ae?(Be=he,he=null):Be=he.sibling;var Pe=O(C,he,E[Ae],V);if(Pe===null){he===null&&(he=Be);break}e&&he&&Pe.alternate===null&&n(C,he),j=f(Pe,j,Ae),He===null?ve=Pe:He.sibling=Pe,He=Pe,he=Be}if(Ae===E.length)return i(C,he),qe&&os(C,Ae),ve;if(he===null){for(;Ae<E.length;Ae++)he=Z(C,E[Ae],V),he!==null&&(j=f(he,j,Ae),He===null?ve=he:He.sibling=he,He=he);return qe&&os(C,Ae),ve}for(he=l(he);Ae<E.length;Ae++)Be=U(he,C,Ae,E[Ae],V),Be!==null&&(e&&Be.alternate!==null&&he.delete(Be.key===null?Ae:Be.key),j=f(Be,j,Ae),He===null?ve=Be:He.sibling=Be,He=Be);return e&&he.forEach(function(sa){return n(C,sa)}),qe&&os(C,Ae),ve}function be(C,j,E,V){if(E==null)throw Error(r(151));for(var ve=null,He=null,he=j,Ae=j=0,Be=null,Pe=E.next();he!==null&&!Pe.done;Ae++,Pe=E.next()){he.index>Ae?(Be=he,he=null):Be=he.sibling;var sa=O(C,he,Pe.value,V);if(sa===null){he===null&&(he=Be);break}e&&he&&sa.alternate===null&&n(C,he),j=f(sa,j,Ae),He===null?ve=sa:He.sibling=sa,He=sa,he=Be}if(Pe.done)return i(C,he),qe&&os(C,Ae),ve;if(he===null){for(;!Pe.done;Ae++,Pe=E.next())Pe=Z(C,Pe.value,V),Pe!==null&&(j=f(Pe,j,Ae),He===null?ve=Pe:He.sibling=Pe,He=Pe);return qe&&os(C,Ae),ve}for(he=l(he);!Pe.done;Ae++,Pe=E.next())Pe=U(he,C,Ae,Pe.value,V),Pe!==null&&(e&&Pe.alternate!==null&&he.delete(Pe.key===null?Ae:Pe.key),j=f(Pe,j,Ae),He===null?ve=Pe:He.sibling=Pe,He=Pe);return e&&he.forEach(function(B_){return n(C,B_)}),qe&&os(C,Ae),ve}function nt(C,j,E,V){if(typeof E=="object"&&E!==null&&E.type===w&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case S:e:{for(var ve=E.key;j!==null;){if(j.key===ve){if(ve=E.type,ve===w){if(j.tag===7){i(C,j.sibling),V=u(j,E.props.children),V.return=C,C=V;break e}}else if(j.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===L&&Na(ve)===j.type){i(C,j.sibling),V=u(j,E.props),jr(V,E),V.return=C,C=V;break e}i(C,j);break}else n(C,j);j=j.sibling}E.type===w?(V=Sa(E.props.children,C.mode,V,E.key),V.return=C,C=V):(V=Gl(E.type,E.key,E.props,null,C.mode,V),jr(V,E),V.return=C,C=V)}return y(C);case k:e:{for(ve=E.key;j!==null;){if(j.key===ve)if(j.tag===4&&j.stateNode.containerInfo===E.containerInfo&&j.stateNode.implementation===E.implementation){i(C,j.sibling),V=u(j,E.children||[]),V.return=C,C=V;break e}else{i(C,j);break}else n(C,j);j=j.sibling}V=pu(E,C.mode,V),V.return=C,C=V}return y(C);case L:return E=Na(E),nt(C,j,E,V)}if(xe(E))return ae(C,j,E,V);if(ge(E)){if(ve=ge(E),typeof ve!="function")throw Error(r(150));return E=ve.call(E),be(C,j,E,V)}if(typeof E.then=="function")return nt(C,j,eo(E),V);if(E.$$typeof===P)return nt(C,j,Kl(C,E),V);to(C,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,j!==null&&j.tag===6?(i(C,j.sibling),V=u(j,E),V.return=C,C=V):(i(C,j),V=mu(E,C.mode,V),V.return=C,C=V),y(C)):i(C,j)}return function(C,j,E,V){try{Tr=0;var ve=nt(C,j,E,V);return pi=null,ve}catch(he){if(he===mi||he===Jl)throw he;var He=on(29,he,null,C.mode);return He.lanes=V,He.return=C,He}}}var Ra=Lm(!0),Dm=Lm(!1),$s=!1;function Nu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Vs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Is(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var u=l.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),l.pending=n,n=Ql(e),xm(e,null,i),n}return Pl(e,l,n,i),Ql(e)}function Nr(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,Nh(e,i)}}function Ru(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var u=null,f=null;if(i=i.firstBaseUpdate,i!==null){do{var y={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};f===null?u=f=y:f=f.next=y,i=i.next}while(i!==null);f===null?u=f=n:f=f.next=n}else u=f=n;i={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var Au=!1;function Cr(){if(Au){var e=hi;if(e!==null)throw e}}function Rr(e,n,i,l){Au=!1;var u=e.updateQueue;$s=!1;var f=u.firstBaseUpdate,y=u.lastBaseUpdate,b=u.shared.pending;if(b!==null){u.shared.pending=null;var T=b,z=T.next;T.next=null,y===null?f=z:y.next=z,y=T;var B=e.alternate;B!==null&&(B=B.updateQueue,b=B.lastBaseUpdate,b!==y&&(b===null?B.firstBaseUpdate=z:b.next=z,B.lastBaseUpdate=T))}if(f!==null){var Z=u.baseState;y=0,B=z=T=null,b=f;do{var O=b.lane&-536870913,U=O!==b.lane;if(U?(Ue&O)===O:(l&O)===O){O!==0&&O===fi&&(Au=!0),B!==null&&(B=B.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ae=e,be=b;O=n;var nt=i;switch(be.tag){case 1:if(ae=be.payload,typeof ae=="function"){Z=ae.call(nt,Z,O);break e}Z=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=be.payload,O=typeof ae=="function"?ae.call(nt,Z,O):ae,O==null)break e;Z=x({},Z,O);break e;case 2:$s=!0}}O=b.callback,O!==null&&(e.flags|=64,U&&(e.flags|=8192),U=u.callbacks,U===null?u.callbacks=[O]:U.push(O))}else U={lane:O,tag:b.tag,payload:b.payload,callback:b.callback,next:null},B===null?(z=B=U,T=Z):B=B.next=U,y|=O;if(b=b.next,b===null){if(b=u.shared.pending,b===null)break;U=b,b=U.next,U.next=null,u.lastBaseUpdate=U,u.shared.pending=null}}while(!0);B===null&&(T=Z),u.baseState=T,u.firstBaseUpdate=z,u.lastBaseUpdate=B,f===null&&(u.shared.lanes=0),Gs|=y,e.lanes=y,e.memoizedState=Z}}function Um(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function Bm(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Um(i[e],n)}var gi=N(null),no=N(0);function qm(e,n){e=xs,Y(no,e),Y(gi,n),xs=e|n.baseLanes}function Eu(){Y(no,xs),Y(gi,gi.current)}function zu(){xs=no.current,I(gi),I(no)}var cn=N(null),jn=null;function Zs(e){var n=e.alternate;Y(vt,vt.current&1),Y(cn,e),jn===null&&(n===null||gi.current!==null||n.memoizedState!==null)&&(jn=e)}function Ou(e){Y(vt,vt.current),Y(cn,e),jn===null&&(jn=e)}function $m(e){e.tag===22?(Y(vt,vt.current),Y(cn,e),jn===null&&(jn=e)):Hs()}function Hs(){Y(vt,vt.current),Y(cn,cn.current)}function un(e){I(cn),jn===e&&(jn=null),I(vt)}var vt=N(0);function so(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||qd(i)||$d(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ds=0,Re=null,et=null,_t=null,ao=!1,yi=!1,Aa=!1,io=0,Ar=0,vi=null,Cb=0;function mt(){throw Error(r(321))}function Mu(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!ln(e[i],n[i]))return!1;return!0}function Lu(e,n,i,l,u,f){return ds=f,Re=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?wp:Ku,Aa=!1,f=i(l,u),Aa=!1,yi&&(f=Im(n,i,l,u)),Vm(e),f}function Vm(e){M.H=Or;var n=et!==null&&et.next!==null;if(ds=0,_t=et=Re=null,ao=!1,Ar=0,vi=null,n)throw Error(r(300));e===null||St||(e=e.dependencies,e!==null&&Xl(e)&&(St=!0))}function Im(e,n,i,l){Re=e;var u=0;do{if(yi&&(vi=null),Ar=0,yi=!1,25<=u)throw Error(r(301));if(u+=1,_t=et=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}M.H=kp,f=n(i,l)}while(yi);return f}function Rb(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?Er(n):n,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(Re.flags|=1024),n}function Du(){var e=io!==0;return io=0,e}function Uu(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function Bu(e){if(ao){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}ao=!1}ds=0,_t=et=Re=null,yi=!1,Ar=io=0,vi=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Re.memoizedState=_t=e:_t=_t.next=e,_t}function xt(){if(et===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var n=_t===null?Re.memoizedState:_t.next;if(n!==null)_t=n,et=e;else{if(e===null)throw Re.alternate===null?Error(r(467)):Error(r(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},_t===null?Re.memoizedState=_t=e:_t=_t.next=e}return _t}function ro(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Er(e){var n=Ar;return Ar+=1,vi===null&&(vi=[]),e=zm(vi,e,n),n=Re,(_t===null?n.memoizedState:_t.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?wp:Ku),e}function lo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Er(e);if(e.$$typeof===P)return Bt(e)}throw Error(r(438,String(e)))}function qu(e){var n=null,i=Re.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var l=Re.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=ro(),Re.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),l=0;l<e;l++)i[l]=se;return n.index++,i}function fs(e,n){return typeof n=="function"?n(e):n}function oo(e){var n=xt();return $u(n,et,e)}function $u(e,n,i){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=i;var u=e.baseQueue,f=l.pending;if(f!==null){if(u!==null){var y=u.next;u.next=f.next,f.next=y}n.baseQueue=u=f,l.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{n=u.next;var b=y=null,T=null,z=n,B=!1;do{var Z=z.lane&-536870913;if(Z!==z.lane?(Ue&Z)===Z:(ds&Z)===Z){var O=z.revertLane;if(O===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Z===fi&&(B=!0);else if((ds&O)===O){z=z.next,O===fi&&(B=!0);continue}else Z={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(b=T=Z,y=f):T=T.next=Z,Re.lanes|=O,Gs|=O;Z=z.action,Aa&&i(f,Z),f=z.hasEagerState?z.eagerState:i(f,Z)}else O={lane:Z,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(b=T=O,y=f):T=T.next=O,Re.lanes|=Z,Gs|=Z;z=z.next}while(z!==null&&z!==n);if(T===null?y=f:T.next=b,!ln(f,e.memoizedState)&&(St=!0,B&&(i=hi,i!==null)))throw i;e.memoizedState=f,e.baseState=y,e.baseQueue=T,l.lastRenderedState=f}return u===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Vu(e){var n=xt(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=i.dispatch,u=i.pending,f=n.memoizedState;if(u!==null){i.pending=null;var y=u=u.next;do f=e(f,y.action),y=y.next;while(y!==u);ln(f,n.memoizedState)||(St=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),i.lastRenderedState=f}return[f,l]}function Zm(e,n,i){var l=Re,u=xt(),f=qe;if(f){if(i===void 0)throw Error(r(407));i=i()}else i=n();var y=!ln((et||u).memoizedState,i);if(y&&(u.memoizedState=i,St=!0),u=u.queue,Hu(Qm.bind(null,l,u,e),[e]),u.getSnapshot!==n||y||_t!==null&&_t.memoizedState.tag&1){if(l.flags|=2048,xi(9,{destroy:void 0},Pm.bind(null,l,u,i,n),null),it===null)throw Error(r(349));f||(ds&127)!==0||Hm(l,n,i)}return i}function Hm(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Re.updateQueue,n===null?(n=ro(),Re.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Pm(e,n,i,l){n.value=i,n.getSnapshot=l,Gm(n)&&Ym(e)}function Qm(e,n,i){return i(function(){Gm(n)&&Ym(e)})}function Gm(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!ln(e,i)}catch{return!0}}function Ym(e){var n=_a(e,2);n!==null&&en(n,e,2)}function Iu(e){var n=Qt();if(typeof e=="function"){var i=e;if(e=i(),Aa){Os(!0);try{i()}finally{Os(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},n}function Xm(e,n,i,l){return e.baseState=i,$u(e,et,typeof l=="function"?l:fs)}function Ab(e,n,i,l,u){if(fo(e))throw Error(r(485));if(e=n.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};M.T!==null?i(!0):f.isTransition=!1,l(f),i=n.pending,i===null?(f.next=n.pending=f,Km(n,f)):(f.next=i.next,n.pending=i.next=f)}}function Km(e,n){var i=n.action,l=n.payload,u=e.state;if(n.isTransition){var f=M.T,y={};M.T=y;try{var b=i(u,l),T=M.S;T!==null&&T(y,b),Fm(e,n,b)}catch(z){Zu(e,n,z)}finally{f!==null&&y.types!==null&&(f.types=y.types),M.T=f}}else try{f=i(u,l),Fm(e,n,f)}catch(z){Zu(e,n,z)}}function Fm(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){Jm(e,n,l)},function(l){return Zu(e,n,l)}):Jm(e,n,i)}function Jm(e,n,i){n.status="fulfilled",n.value=i,Wm(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,Km(e,i)))}function Zu(e,n,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=i,Wm(n),n=n.next;while(n!==l)}e.action=null}function Wm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function ep(e,n){return n}function tp(e,n){if(qe){var i=it.formState;if(i!==null){e:{var l=Re;if(qe){if(ut){t:{for(var u=ut,f=Tn;u.nodeType!==8;){if(!f){u=null;break t}if(u=Nn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){ut=Nn(u.nextSibling),l=u.data==="F!";break e}}Bs(l)}l=!1}l&&(n=i[0])}}return i=Qt(),i.memoizedState=i.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ep,lastRenderedState:n},i.queue=l,i=bp.bind(null,Re,l),l.dispatch=i,l=Iu(!1),f=Xu.bind(null,Re,!1,l.queue),l=Qt(),u={state:n,dispatch:null,action:e,pending:null},l.queue=u,i=Ab.bind(null,Re,u,f,i),u.dispatch=i,l.memoizedState=e,[n,i,!1]}function np(e){var n=xt();return sp(n,et,e)}function sp(e,n,i){if(n=$u(e,n,ep)[0],e=oo(fs)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=Er(n)}catch(y){throw y===mi?Jl:y}else l=n;n=xt();var u=n.queue,f=u.dispatch;return i!==n.memoizedState&&(Re.flags|=2048,xi(9,{destroy:void 0},Eb.bind(null,u,i),null)),[l,f,e]}function Eb(e,n){e.action=n}function ap(e){var n=xt(),i=et;if(i!==null)return sp(n,i,e);xt(),n=n.memoizedState,i=xt();var l=i.queue.dispatch;return i.memoizedState=e,[n,l,!1]}function xi(e,n,i,l){return e={tag:e,create:i,deps:l,inst:n,next:null},n=Re.updateQueue,n===null&&(n=ro(),Re.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,n.lastEffect=e),e}function ip(){return xt().memoizedState}function co(e,n,i,l){var u=Qt();Re.flags|=e,u.memoizedState=xi(1|n,{destroy:void 0},i,l===void 0?null:l)}function uo(e,n,i,l){var u=xt();l=l===void 0?null:l;var f=u.memoizedState.inst;et!==null&&l!==null&&Mu(l,et.memoizedState.deps)?u.memoizedState=xi(n,f,i,l):(Re.flags|=e,u.memoizedState=xi(1|n,f,i,l))}function rp(e,n){co(8390656,8,e,n)}function Hu(e,n){uo(2048,8,e,n)}function zb(e){Re.flags|=4;var n=Re.updateQueue;if(n===null)n=ro(),Re.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function lp(e){var n=xt().memoizedState;return zb({ref:n,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function op(e,n){return uo(4,2,e,n)}function cp(e,n){return uo(4,4,e,n)}function up(e,n){if(typeof n=="function"){e=e();var i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function dp(e,n,i){i=i!=null?i.concat([e]):null,uo(4,4,up.bind(null,n,e),i)}function Pu(){}function fp(e,n){var i=xt();n=n===void 0?null:n;var l=i.memoizedState;return n!==null&&Mu(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function hp(e,n){var i=xt();n=n===void 0?null:n;var l=i.memoizedState;if(n!==null&&Mu(n,l[1]))return l[0];if(l=e(),Aa){Os(!0);try{e()}finally{Os(!1)}}return i.memoizedState=[l,n],l}function Qu(e,n,i){return i===void 0||(ds&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=mg(),Re.lanes|=e,Gs|=e,i)}function mp(e,n,i,l){return ln(i,n)?i:gi.current!==null?(e=Qu(e,i,l),ln(e,n)||(St=!0),e):(ds&42)===0||(ds&1073741824)!==0&&(Ue&261930)===0?(St=!0,e.memoizedState=i):(e=mg(),Re.lanes|=e,Gs|=e,n)}function pp(e,n,i,l,u){var f=J.p;J.p=f!==0&&8>f?f:8;var y=M.T,b={};M.T=b,Xu(e,!1,n,i);try{var T=u(),z=M.S;if(z!==null&&z(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var B=Nb(T,l);zr(e,n,B,hn(e))}else zr(e,n,l,hn(e))}catch(Z){zr(e,n,{then:function(){},status:"rejected",reason:Z},hn())}finally{J.p=f,y!==null&&b.types!==null&&(y.types=b.types),M.T=y}}function Ob(){}function Gu(e,n,i,l){if(e.tag!==5)throw Error(r(476));var u=gp(e).queue;pp(e,u,n,G,i===null?Ob:function(){return yp(e),i(l)})}function gp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:G},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function yp(e){var n=gp(e);n.next===null&&(n=e.alternate.memoizedState),zr(e,n.next.queue,{},hn())}function Yu(){return Bt(Xr)}function vp(){return xt().memoizedState}function xp(){return xt().memoizedState}function Mb(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=hn();e=Vs(i);var l=Is(n,e,i);l!==null&&(en(l,n,i),Nr(l,n,i)),n={cache:wu()},e.payload=n;return}n=n.return}}function Lb(e,n,i){var l=hn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fo(e)?_p(n,i):(i=fu(e,n,i,l),i!==null&&(en(i,e,l),Sp(i,n,l)))}function bp(e,n,i){var l=hn();zr(e,n,i,l)}function zr(e,n,i,l){var u={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(fo(e))_p(n,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,b=f(y,i);if(u.hasEagerState=!0,u.eagerState=b,ln(b,y))return Pl(e,n,u,0),it===null&&Hl(),!1}catch{}if(i=fu(e,n,u,l),i!==null)return en(i,e,l),Sp(i,n,l),!0}return!1}function Xu(e,n,i,l){if(l={lane:2,revertLane:Nd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},fo(e)){if(n)throw Error(r(479))}else n=fu(e,i,l,2),n!==null&&en(n,e,2)}function fo(e){var n=e.alternate;return e===Re||n!==null&&n===Re}function _p(e,n){yi=ao=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Sp(e,n,i){if((i&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,Nh(e,i)}}var Or={readContext:Bt,use:lo,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};Or.useEffectEvent=mt;var wp={readContext:Bt,use:lo,useCallback:function(e,n){return Qt().memoizedState=[e,n===void 0?null:n],e},useContext:Bt,useEffect:rp,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,co(4194308,4,up.bind(null,n,e),i)},useLayoutEffect:function(e,n){return co(4194308,4,e,n)},useInsertionEffect:function(e,n){co(4,2,e,n)},useMemo:function(e,n){var i=Qt();n=n===void 0?null:n;var l=e();if(Aa){Os(!0);try{e()}finally{Os(!1)}}return i.memoizedState=[l,n],l},useReducer:function(e,n,i){var l=Qt();if(i!==void 0){var u=i(n);if(Aa){Os(!0);try{i(n)}finally{Os(!1)}}}else u=n;return l.memoizedState=l.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},l.queue=e,e=e.dispatch=Lb.bind(null,Re,e),[l.memoizedState,e]},useRef:function(e){var n=Qt();return e={current:e},n.memoizedState=e},useState:function(e){e=Iu(e);var n=e.queue,i=bp.bind(null,Re,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Pu,useDeferredValue:function(e,n){var i=Qt();return Qu(i,e,n)},useTransition:function(){var e=Iu(!1);return e=pp.bind(null,Re,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var l=Re,u=Qt();if(qe){if(i===void 0)throw Error(r(407));i=i()}else{if(i=n(),it===null)throw Error(r(349));(Ue&127)!==0||Hm(l,n,i)}u.memoizedState=i;var f={value:i,getSnapshot:n};return u.queue=f,rp(Qm.bind(null,l,f,e),[e]),l.flags|=2048,xi(9,{destroy:void 0},Pm.bind(null,l,f,i,n),null),i},useId:function(){var e=Qt(),n=it.identifierPrefix;if(qe){var i=Pn,l=Hn;i=(l&~(1<<32-rn(l)-1)).toString(32)+i,n="_"+n+"R_"+i,i=io++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=Cb++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Yu,useFormState:tp,useActionState:tp,useOptimistic:function(e){var n=Qt();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Xu.bind(null,Re,!0,i),i.dispatch=n,[e,n]},useMemoCache:qu,useCacheRefresh:function(){return Qt().memoizedState=Mb.bind(null,Re)},useEffectEvent:function(e){var n=Qt(),i={impl:e};return n.memoizedState=i,function(){if((Ye&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},Ku={readContext:Bt,use:lo,useCallback:fp,useContext:Bt,useEffect:Hu,useImperativeHandle:dp,useInsertionEffect:op,useLayoutEffect:cp,useMemo:hp,useReducer:oo,useRef:ip,useState:function(){return oo(fs)},useDebugValue:Pu,useDeferredValue:function(e,n){var i=xt();return mp(i,et.memoizedState,e,n)},useTransition:function(){var e=oo(fs)[0],n=xt().memoizedState;return[typeof e=="boolean"?e:Er(e),n]},useSyncExternalStore:Zm,useId:vp,useHostTransitionStatus:Yu,useFormState:np,useActionState:np,useOptimistic:function(e,n){var i=xt();return Xm(i,et,e,n)},useMemoCache:qu,useCacheRefresh:xp};Ku.useEffectEvent=lp;var kp={readContext:Bt,use:lo,useCallback:fp,useContext:Bt,useEffect:Hu,useImperativeHandle:dp,useInsertionEffect:op,useLayoutEffect:cp,useMemo:hp,useReducer:Vu,useRef:ip,useState:function(){return Vu(fs)},useDebugValue:Pu,useDeferredValue:function(e,n){var i=xt();return et===null?Qu(i,e,n):mp(i,et.memoizedState,e,n)},useTransition:function(){var e=Vu(fs)[0],n=xt().memoizedState;return[typeof e=="boolean"?e:Er(e),n]},useSyncExternalStore:Zm,useId:vp,useHostTransitionStatus:Yu,useFormState:ap,useActionState:ap,useOptimistic:function(e,n){var i=xt();return et!==null?Xm(i,et,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:qu,useCacheRefresh:xp};kp.useEffectEvent=lp;function Fu(e,n,i,l){n=e.memoizedState,i=i(l,n),i=i==null?n:x({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ju={enqueueSetState:function(e,n,i){e=e._reactInternals;var l=hn(),u=Vs(l);u.payload=n,i!=null&&(u.callback=i),n=Is(e,u,l),n!==null&&(en(n,e,l),Nr(n,e,l))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=hn(),u=Vs(l);u.tag=1,u.payload=n,i!=null&&(u.callback=i),n=Is(e,u,l),n!==null&&(en(n,e,l),Nr(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=hn(),l=Vs(i);l.tag=2,n!=null&&(l.callback=n),n=Is(e,l,i),n!==null&&(en(n,e,i),Nr(n,e,i))}};function Tp(e,n,i,l,u,f,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,y):n.prototype&&n.prototype.isPureReactComponent?!xr(i,l)||!xr(u,f):!0}function jp(e,n,i,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==e&&Ju.enqueueReplaceState(n,n.state,null)}function Ea(e,n){var i=n;if("ref"in n){i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}if(e=e.defaultProps){i===n&&(i=x({},i));for(var u in e)i[u]===void 0&&(i[u]=e[u])}return i}function Np(e){Zl(e)}function Cp(e){console.error(e)}function Rp(e){Zl(e)}function ho(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function Ap(e,n,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Wu(e,n,i){return i=Vs(i),i.tag=3,i.payload={element:null},i.callback=function(){ho(e,n)},i}function Ep(e){return e=Vs(e),e.tag=3,e}function zp(e,n,i,l){var u=i.type.getDerivedStateFromError;if(typeof u=="function"){var f=l.value;e.payload=function(){return u(f)},e.callback=function(){Ap(n,i,l)}}var y=i.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Ap(n,i,l),typeof u!="function"&&(Ys===null?Ys=new Set([this]):Ys.add(this));var b=l.stack;this.componentDidCatch(l.value,{componentStack:b!==null?b:""})})}function Db(e,n,i,l,u){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=i.alternate,n!==null&&di(n,i,u,!0),i=cn.current,i!==null){switch(i.tag){case 31:case 13:return jn===null?To():i.alternate===null&&pt===0&&(pt=3),i.flags&=-257,i.flags|=65536,i.lanes=u,l===Wl?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([l]):n.add(l),kd(e,l,u)),!1;case 22:return i.flags|=65536,l===Wl?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([l]):i.add(l)),kd(e,l,u)),!1}throw Error(r(435,i.tag))}return kd(e,l,u),To(),!1}if(qe)return n=cn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,l!==vu&&(e=Error(r(422),{cause:l}),Sr(Sn(e,i)))):(l!==vu&&(n=Error(r(423),{cause:l}),Sr(Sn(n,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,l=Sn(l,i),u=Wu(e.stateNode,l,u),Ru(e,u),pt!==4&&(pt=2)),!1;var f=Error(r(520),{cause:l});if(f=Sn(f,i),Vr===null?Vr=[f]:Vr.push(f),pt!==4&&(pt=2),n===null)return!0;l=Sn(l,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=Wu(i.stateNode,l,e),Ru(i,e),!1;case 1:if(n=i.type,f=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ys===null||!Ys.has(f))))return i.flags|=65536,u&=-u,i.lanes|=u,u=Ep(u),zp(u,e,i,l),Ru(i,u),!1}i=i.return}while(i!==null);return!1}var ed=Error(r(461)),St=!1;function qt(e,n,i,l){n.child=e===null?Dm(n,null,i,l):Ra(n,e.child,i,l)}function Op(e,n,i,l,u){i=i.render;var f=n.ref;if("ref"in l){var y={};for(var b in l)b!=="ref"&&(y[b]=l[b])}else y=l;return Ta(n),l=Lu(e,n,i,y,f,u),b=Du(),e!==null&&!St?(Uu(e,n,u),hs(e,n,u)):(qe&&b&&gu(n),n.flags|=1,qt(e,n,l,u),n.child)}function Mp(e,n,i,l,u){if(e===null){var f=i.type;return typeof f=="function"&&!hu(f)&&f.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=f,Lp(e,n,f,l,u)):(e=Gl(i.type,null,l,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!od(e,u)){var y=f.memoizedProps;if(i=i.compare,i=i!==null?i:xr,i(y,l)&&e.ref===n.ref)return hs(e,n,u)}return n.flags|=1,e=ls(f,l),e.ref=n.ref,e.return=n,n.child=e}function Lp(e,n,i,l,u){if(e!==null){var f=e.memoizedProps;if(xr(f,l)&&e.ref===n.ref)if(St=!1,n.pendingProps=l=f,od(e,u))(e.flags&131072)!==0&&(St=!0);else return n.lanes=e.lanes,hs(e,n,u)}return td(e,n,i,l,u)}function Dp(e,n,i,l){var u=l.children,f=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|i:i,e!==null){for(l=n.child=e.child,u=0;l!==null;)u=u|l.lanes|l.childLanes,l=l.sibling;l=u&~f}else l=0,n.child=null;return Up(e,n,f,i,l)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fl(n,f!==null?f.cachePool:null),f!==null?qm(n,f):Eu(),$m(n);else return l=n.lanes=536870912,Up(e,n,f!==null?f.baseLanes|i:i,i,l)}else f!==null?(Fl(n,f.cachePool),qm(n,f),Hs(),n.memoizedState=null):(e!==null&&Fl(n,null),Eu(),Hs());return qt(e,n,u,i),n.child}function Mr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Up(e,n,i,l,u){var f=Tu();return f=f===null?null:{parent:bt._currentValue,pool:f},n.memoizedState={baseLanes:i,cachePool:f},e!==null&&Fl(n,null),Eu(),$m(n),e!==null&&di(e,n,l,!0),n.childLanes=u,null}function mo(e,n){return n=go({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Bp(e,n,i){return Ra(n,e.child,null,i),e=mo(n,n.pendingProps),e.flags|=2,un(n),n.memoizedState=null,e}function Ub(e,n,i){var l=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(qe){if(l.mode==="hidden")return e=mo(n,l),n.lanes=536870912,Mr(null,e);if(Ou(n),(e=ut)?(e=Kg(e,Tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ds!==null?{id:Hn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},i=_m(e),i.return=n,n.child=i,Ut=n,ut=null)):e=null,e===null)throw Bs(n);return n.lanes=536870912,null}return mo(n,l)}var f=e.memoizedState;if(f!==null){var y=f.dehydrated;if(Ou(n),u)if(n.flags&256)n.flags&=-257,n=Bp(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(St||di(e,n,i,!1),u=(i&e.childLanes)!==0,St||u){if(l=it,l!==null&&(y=Ch(l,i),y!==0&&y!==f.retryLane))throw f.retryLane=y,_a(e,y),en(l,e,y),ed;To(),n=Bp(e,n,i)}else e=f.treeContext,ut=Nn(y.nextSibling),Ut=n,qe=!0,Us=null,Tn=!1,e!==null&&km(n,e),n=mo(n,l),n.flags|=4096;return n}return e=ls(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function po(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function td(e,n,i,l,u){return Ta(n),i=Lu(e,n,i,l,void 0,u),l=Du(),e!==null&&!St?(Uu(e,n,u),hs(e,n,u)):(qe&&l&&gu(n),n.flags|=1,qt(e,n,i,u),n.child)}function qp(e,n,i,l,u,f){return Ta(n),n.updateQueue=null,i=Im(n,l,i,u),Vm(e),l=Du(),e!==null&&!St?(Uu(e,n,f),hs(e,n,f)):(qe&&l&&gu(n),n.flags|=1,qt(e,n,i,f),n.child)}function $p(e,n,i,l,u){if(Ta(n),n.stateNode===null){var f=li,y=i.contextType;typeof y=="object"&&y!==null&&(f=Bt(y)),f=new i(l,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Ju,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=l,f.state=n.memoizedState,f.refs={},Nu(n),y=i.contextType,f.context=typeof y=="object"&&y!==null?Bt(y):li,f.state=n.memoizedState,y=i.getDerivedStateFromProps,typeof y=="function"&&(Fu(n,i,y,l),f.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&Ju.enqueueReplaceState(f,f.state,null),Rr(n,l,f,u),Cr(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){f=n.stateNode;var b=n.memoizedProps,T=Ea(i,b);f.props=T;var z=f.context,B=i.contextType;y=li,typeof B=="object"&&B!==null&&(y=Bt(B));var Z=i.getDerivedStateFromProps;B=typeof Z=="function"||typeof f.getSnapshotBeforeUpdate=="function",b=n.pendingProps!==b,B||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b||z!==y)&&jp(n,f,l,y),$s=!1;var O=n.memoizedState;f.state=O,Rr(n,l,f,u),Cr(),z=n.memoizedState,b||O!==z||$s?(typeof Z=="function"&&(Fu(n,i,Z,l),z=n.memoizedState),(T=$s||Tp(n,i,T,l,O,z,y))?(B||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=z),f.props=l,f.state=z,f.context=y,l=T):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{f=n.stateNode,Cu(e,n),y=n.memoizedProps,B=Ea(i,y),f.props=B,Z=n.pendingProps,O=f.context,z=i.contextType,T=li,typeof z=="object"&&z!==null&&(T=Bt(z)),b=i.getDerivedStateFromProps,(z=typeof b=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==Z||O!==T)&&jp(n,f,l,T),$s=!1,O=n.memoizedState,f.state=O,Rr(n,l,f,u),Cr();var U=n.memoizedState;y!==Z||O!==U||$s||e!==null&&e.dependencies!==null&&Xl(e.dependencies)?(typeof b=="function"&&(Fu(n,i,b,l),U=n.memoizedState),(B=$s||Tp(n,i,B,l,O,U,T)||e!==null&&e.dependencies!==null&&Xl(e.dependencies))?(z||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,U,T),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,U,T)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=U),f.props=l,f.state=U,f.context=T,l=B):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&O===e.memoizedState||(n.flags|=1024),l=!1)}return f=l,po(e,n),l=(n.flags&128)!==0,f||l?(f=n.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&l?(n.child=Ra(n,e.child,null,u),n.child=Ra(n,null,i,u)):qt(e,n,i,u),n.memoizedState=f.state,e=n.child):e=hs(e,n,u),e}function Vp(e,n,i,l){return wa(),n.flags|=256,qt(e,n,i,l),n.child}var nd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sd(e){return{baseLanes:e,cachePool:Am()}}function ad(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=fn),e}function Ip(e,n,i){var l=n.pendingProps,u=!1,f=(n.flags&128)!==0,y;if((y=f)||(y=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),y&&(u=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,e===null){if(qe){if(u?Zs(n):Hs(),(e=ut)?(e=Kg(e,Tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ds!==null?{id:Hn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},i=_m(e),i.return=n,n.child=i,Ut=n,ut=null)):e=null,e===null)throw Bs(n);return $d(e)?n.lanes=32:n.lanes=536870912,null}var b=l.children;return l=l.fallback,u?(Hs(),u=n.mode,b=go({mode:"hidden",children:b},u),l=Sa(l,u,i,null),b.return=n,l.return=n,b.sibling=l,n.child=b,l=n.child,l.memoizedState=sd(i),l.childLanes=ad(e,y,i),n.memoizedState=nd,Mr(null,l)):(Zs(n),id(n,b))}var T=e.memoizedState;if(T!==null&&(b=T.dehydrated,b!==null)){if(f)n.flags&256?(Zs(n),n.flags&=-257,n=rd(e,n,i)):n.memoizedState!==null?(Hs(),n.child=e.child,n.flags|=128,n=null):(Hs(),b=l.fallback,u=n.mode,l=go({mode:"visible",children:l.children},u),b=Sa(b,u,i,null),b.flags|=2,l.return=n,b.return=n,l.sibling=b,n.child=l,Ra(n,e.child,null,i),l=n.child,l.memoizedState=sd(i),l.childLanes=ad(e,y,i),n.memoizedState=nd,n=Mr(null,l));else if(Zs(n),$d(b)){if(y=b.nextSibling&&b.nextSibling.dataset,y)var z=y.dgst;y=z,l=Error(r(419)),l.stack="",l.digest=y,Sr({value:l,source:null,stack:null}),n=rd(e,n,i)}else if(St||di(e,n,i,!1),y=(i&e.childLanes)!==0,St||y){if(y=it,y!==null&&(l=Ch(y,i),l!==0&&l!==T.retryLane))throw T.retryLane=l,_a(e,l),en(y,e,l),ed;qd(b)||To(),n=rd(e,n,i)}else qd(b)?(n.flags|=192,n.child=e.child,n=null):(e=T.treeContext,ut=Nn(b.nextSibling),Ut=n,qe=!0,Us=null,Tn=!1,e!==null&&km(n,e),n=id(n,l.children),n.flags|=4096);return n}return u?(Hs(),b=l.fallback,u=n.mode,T=e.child,z=T.sibling,l=ls(T,{mode:"hidden",children:l.children}),l.subtreeFlags=T.subtreeFlags&65011712,z!==null?b=ls(z,b):(b=Sa(b,u,i,null),b.flags|=2),b.return=n,l.return=n,l.sibling=b,n.child=l,Mr(null,l),l=n.child,b=e.child.memoizedState,b===null?b=sd(i):(u=b.cachePool,u!==null?(T=bt._currentValue,u=u.parent!==T?{parent:T,pool:T}:u):u=Am(),b={baseLanes:b.baseLanes|i,cachePool:u}),l.memoizedState=b,l.childLanes=ad(e,y,i),n.memoizedState=nd,Mr(e.child,l)):(Zs(n),i=e.child,e=i.sibling,i=ls(i,{mode:"visible",children:l.children}),i.return=n,i.sibling=null,e!==null&&(y=n.deletions,y===null?(n.deletions=[e],n.flags|=16):y.push(e)),n.child=i,n.memoizedState=null,i)}function id(e,n){return n=go({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function go(e,n){return e=on(22,e,null,n),e.lanes=0,e}function rd(e,n,i){return Ra(n,e.child,null,i),e=id(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Zp(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),_u(e.return,n,i)}function ld(e,n,i,l,u,f){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:u,treeForkCount:f}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=l,y.tail=i,y.tailMode=u,y.treeForkCount=f)}function Hp(e,n,i){var l=n.pendingProps,u=l.revealOrder,f=l.tail;l=l.children;var y=vt.current,b=(y&2)!==0;if(b?(y=y&1|2,n.flags|=128):y&=1,Y(vt,y),qt(e,n,l,i),l=qe?_r:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zp(e,i,n);else if(e.tag===19)Zp(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(i=n.child,u=null;i!==null;)e=i.alternate,e!==null&&so(e)===null&&(u=i),i=i.sibling;i=u,i===null?(u=n.child,n.child=null):(u=i.sibling,i.sibling=null),ld(n,!1,u,i,f,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&so(e)===null){n.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}ld(n,!0,i,null,f,l);break;case"together":ld(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function hs(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Gs|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(di(e,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,i=ls(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=ls(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function od(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Xl(e)))}function Bb(e,n,i){switch(n.tag){case 3:ht(n,n.stateNode.containerInfo),qs(n,bt,e.memoizedState.cache),wa();break;case 27:case 5:Ht(n);break;case 4:ht(n,n.stateNode.containerInfo);break;case 10:qs(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ou(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Zs(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Ip(e,n,i):(Zs(n),e=hs(e,n,i),e!==null?e.sibling:null);Zs(n);break;case 19:var u=(e.flags&128)!==0;if(l=(i&n.childLanes)!==0,l||(di(e,n,i,!1),l=(i&n.childLanes)!==0),u){if(l)return Hp(e,n,i);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Y(vt,vt.current),l)break;return null;case 22:return n.lanes=0,Dp(e,n,i,n.pendingProps);case 24:qs(n,bt,e.memoizedState.cache)}return hs(e,n,i)}function Pp(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)St=!0;else{if(!od(e,i)&&(n.flags&128)===0)return St=!1,Bb(e,n,i);St=(e.flags&131072)!==0}else St=!1,qe&&(n.flags&1048576)!==0&&wm(n,_r,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=Na(n.elementType),n.type=e,typeof e=="function")hu(e)?(l=Ea(e,l),n.tag=1,n=$p(null,n,e,l,i)):(n.tag=0,n=td(null,n,e,l,i));else{if(e!=null){var u=e.$$typeof;if(u===q){n.tag=11,n=Op(null,n,e,l,i);break e}else if(u===D){n.tag=14,n=Mp(null,n,e,l,i);break e}}throw n=$(e)||e,Error(r(306,n,""))}}return n;case 0:return td(e,n,n.type,n.pendingProps,i);case 1:return l=n.type,u=Ea(l,n.pendingProps),$p(e,n,l,u,i);case 3:e:{if(ht(n,n.stateNode.containerInfo),e===null)throw Error(r(387));l=n.pendingProps;var f=n.memoizedState;u=f.element,Cu(e,n),Rr(n,l,null,i);var y=n.memoizedState;if(l=y.cache,qs(n,bt,l),l!==f.cache&&Su(n,[bt],i,!0),Cr(),l=y.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=Vp(e,n,l,i);break e}else if(l!==u){u=Sn(Error(r(424)),n),Sr(u),n=Vp(e,n,l,i);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ut=Nn(e.firstChild),Ut=n,qe=!0,Us=null,Tn=!0,i=Dm(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(wa(),l===u){n=hs(e,n,i);break e}qt(e,n,l,i)}n=n.child}return n;case 26:return po(e,n),e===null?(i=ny(n.type,null,n.pendingProps,null))?n.memoizedState=i:qe||(i=n.type,e=n.pendingProps,l=zo(Ce.current).createElement(i),l[Dt]=n,l[Yt]=e,$t(l,i,e),Ot(l),n.stateNode=l):n.memoizedState=ny(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ht(n),e===null&&qe&&(l=n.stateNode=Wg(n.type,n.pendingProps,Ce.current),Ut=n,Tn=!0,u=ut,Js(n.type)?(Vd=u,ut=Nn(l.firstChild)):ut=u),qt(e,n,n.pendingProps.children,i),po(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&qe&&((u=l=ut)&&(l=m_(l,n.type,n.pendingProps,Tn),l!==null?(n.stateNode=l,Ut=n,ut=Nn(l.firstChild),Tn=!1,u=!0):u=!1),u||Bs(n)),Ht(n),u=n.type,f=n.pendingProps,y=e!==null?e.memoizedProps:null,l=f.children,Dd(u,f)?l=null:y!==null&&Dd(u,y)&&(n.flags|=32),n.memoizedState!==null&&(u=Lu(e,n,Rb,null,null,i),Xr._currentValue=u),po(e,n),qt(e,n,l,i),n.child;case 6:return e===null&&qe&&((e=i=ut)&&(i=p_(i,n.pendingProps,Tn),i!==null?(n.stateNode=i,Ut=n,ut=null,e=!0):e=!1),e||Bs(n)),null;case 13:return Ip(e,n,i);case 4:return ht(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Ra(n,null,l,i):qt(e,n,l,i),n.child;case 11:return Op(e,n,n.type,n.pendingProps,i);case 7:return qt(e,n,n.pendingProps,i),n.child;case 8:return qt(e,n,n.pendingProps.children,i),n.child;case 12:return qt(e,n,n.pendingProps.children,i),n.child;case 10:return l=n.pendingProps,qs(n,n.type,l.value),qt(e,n,l.children,i),n.child;case 9:return u=n.type._context,l=n.pendingProps.children,Ta(n),u=Bt(u),l=l(u),n.flags|=1,qt(e,n,l,i),n.child;case 14:return Mp(e,n,n.type,n.pendingProps,i);case 15:return Lp(e,n,n.type,n.pendingProps,i);case 19:return Hp(e,n,i);case 31:return Ub(e,n,i);case 22:return Dp(e,n,i,n.pendingProps);case 24:return Ta(n),l=Bt(bt),e===null?(u=Tu(),u===null&&(u=it,f=wu(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=i),u=f),n.memoizedState={parent:l,cache:u},Nu(n),qs(n,bt,u)):((e.lanes&i)!==0&&(Cu(e,n),Rr(n,null,null,i),Cr()),u=e.memoizedState,f=n.memoizedState,u.parent!==l?(u={parent:l,cache:l},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),qs(n,bt,l)):(l=f.cache,qs(n,bt,l),l!==u.cache&&Su(n,[bt],i,!0))),qt(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function ms(e){e.flags|=4}function cd(e,n,i,l,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(vg())e.flags|=8192;else throw Ca=Wl,ju}else e.flags&=-16777217}function Qp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ly(n))if(vg())e.flags|=8192;else throw Ca=Wl,ju}function yo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Th():536870912,e.lanes|=n,wi|=n)}function Lr(e,n){if(!qe)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function dt(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(n)for(var u=e.child;u!==null;)i|=u.lanes|u.childLanes,l|=u.subtreeFlags&65011712,l|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)i|=u.lanes|u.childLanes,l|=u.subtreeFlags,l|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=l,e.childLanes=i,n}function qb(e,n,i){var l=n.pendingProps;switch(yu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(n),null;case 1:return dt(n),null;case 3:return i=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),us(bt),Xe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ui(n)?ms(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,xu())),dt(n),null;case 26:var u=n.type,f=n.memoizedState;return e===null?(ms(n),f!==null?(dt(n),Qp(n,f)):(dt(n),cd(n,u,null,l,i))):f?f!==e.memoizedState?(ms(n),dt(n),Qp(n,f)):(dt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&ms(n),dt(n),cd(n,u,e,l,i)),null;case 27:if(sn(n),i=Ce.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&ms(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return dt(n),null}e=W.current,ui(n)?Tm(n):(e=Wg(u,l,i),n.stateNode=e,ms(n))}return dt(n),null;case 5:if(sn(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&ms(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return dt(n),null}if(f=W.current,ui(n))Tm(n);else{var y=zo(Ce.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?y.createElement(u,{is:l.is}):y.createElement(u)}}f[Dt]=n,f[Yt]=l;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch($t(f,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ms(n)}}return dt(n),cd(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&ms(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(e=Ce.current,ui(n)){if(e=n.stateNode,i=n.memoizedProps,l=null,u=Ut,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}e[Dt]=n,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Ig(e.nodeValue,i)),e||Bs(n,!0)}else e=zo(e).createTextNode(l),e[Dt]=n,n.stateNode=e}return dt(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(l=ui(n),i!==null){if(e===null){if(!l)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Dt]=n}else wa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dt(n),e=!1}else i=xu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(un(n),n):(un(n),null);if((n.flags&128)!==0)throw Error(r(558))}return dt(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ui(n),l!==null&&l.dehydrated!==null){if(e===null){if(!u)throw Error(r(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Dt]=n}else wa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dt(n),u=!1}else u=xu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(un(n),n):(un(n),null)}return un(n),(n.flags&128)!==0?(n.lanes=i,n):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=n.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==u&&(l.flags|=2048)),i!==e&&i&&(n.child.flags|=8192),yo(n,n.updateQueue),dt(n),null);case 4:return Xe(),e===null&&Ed(n.stateNode.containerInfo),dt(n),null;case 10:return us(n.type),dt(n),null;case 19:if(I(vt),l=n.memoizedState,l===null)return dt(n),null;if(u=(n.flags&128)!==0,f=l.rendering,f===null)if(u)Lr(l,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=so(e),f!==null){for(n.flags|=128,Lr(l,!1),e=f.updateQueue,n.updateQueue=e,yo(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)bm(i,e),i=i.sibling;return Y(vt,vt.current&1|2),qe&&os(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Pt()>So&&(n.flags|=128,u=!0,Lr(l,!1),n.lanes=4194304)}else{if(!u)if(e=so(f),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,yo(n,e),Lr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!f.alternate&&!qe)return dt(n),null}else 2*Pt()-l.renderingStartTime>So&&i!==536870912&&(n.flags|=128,u=!0,Lr(l,!1),n.lanes=4194304);l.isBackwards?(f.sibling=n.child,n.child=f):(e=l.last,e!==null?e.sibling=f:n.child=f,l.last=f)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Pt(),e.sibling=null,i=vt.current,Y(vt,u?i&1|2:i&1),qe&&os(n,l.treeForkCount),e):(dt(n),null);case 22:case 23:return un(n),zu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(i&536870912)!==0&&(n.flags&128)===0&&(dt(n),n.subtreeFlags&6&&(n.flags|=8192)):dt(n),i=n.updateQueue,i!==null&&yo(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==i&&(n.flags|=2048),e!==null&&I(ja),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),us(bt),dt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function $b(e,n){switch(yu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return us(bt),Xe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return sn(n),null;case 31:if(n.memoizedState!==null){if(un(n),n.alternate===null)throw Error(r(340));wa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(un(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));wa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return I(vt),null;case 4:return Xe(),null;case 10:return us(n.type),null;case 22:case 23:return un(n),zu(),e!==null&&I(ja),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return us(bt),null;case 25:return null;default:return null}}function Gp(e,n){switch(yu(n),n.tag){case 3:us(bt),Xe();break;case 26:case 27:case 5:sn(n);break;case 4:Xe();break;case 31:n.memoizedState!==null&&un(n);break;case 13:un(n);break;case 19:I(vt);break;case 10:us(n.type);break;case 22:case 23:un(n),zu(),e!==null&&I(ja);break;case 24:us(bt)}}function Dr(e,n){try{var i=n.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var u=l.next;i=u;do{if((i.tag&e)===e){l=void 0;var f=i.create,y=i.inst;l=f(),y.destroy=l}i=i.next}while(i!==u)}}catch(b){Je(n,n.return,b)}}function Ps(e,n,i){try{var l=n.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var f=u.next;l=f;do{if((l.tag&e)===e){var y=l.inst,b=y.destroy;if(b!==void 0){y.destroy=void 0,u=n;var T=i,z=b;try{z()}catch(B){Je(u,T,B)}}}l=l.next}while(l!==f)}}catch(B){Je(n,n.return,B)}}function Yp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Bm(n,i)}catch(l){Je(e,e.return,l)}}}function Xp(e,n,i){i.props=Ea(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){Je(e,n,l)}}function Ur(e,n){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(u){Je(e,n,u)}}function Qn(e,n){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(u){Je(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(u){Je(e,n,u)}else i.current=null}function Kp(e){var n=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(u){Je(e,e.return,u)}}function ud(e,n,i){try{var l=e.stateNode;o_(l,e.type,i,n),l[Yt]=n}catch(u){Je(e,e.return,u)}}function Fp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Js(e.type)||e.tag===4}function dd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Js(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fd(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=is));else if(l!==4&&(l===27&&Js(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(fd(e,n,i),e=e.sibling;e!==null;)fd(e,n,i),e=e.sibling}function vo(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(l===27&&Js(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(vo(e,n,i),e=e.sibling;e!==null;)vo(e,n,i),e=e.sibling}function Jp(e){var n=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);$t(n,l,i),n[Dt]=e,n[Yt]=i}catch(f){Je(e,e.return,f)}}var ps=!1,wt=!1,hd=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Vb(e,n){if(e=e.containerInfo,Md=qo,e=dm(e),ru(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var u=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{i.nodeType,f.nodeType}catch{i=null;break e}var y=0,b=-1,T=-1,z=0,B=0,Z=e,O=null;t:for(;;){for(var U;Z!==i||u!==0&&Z.nodeType!==3||(b=y+u),Z!==f||l!==0&&Z.nodeType!==3||(T=y+l),Z.nodeType===3&&(y+=Z.nodeValue.length),(U=Z.firstChild)!==null;)O=Z,Z=U;for(;;){if(Z===e)break t;if(O===i&&++z===u&&(b=y),O===f&&++B===l&&(T=y),(U=Z.nextSibling)!==null)break;Z=O,O=Z.parentNode}Z=U}i=b===-1||T===-1?null:{start:b,end:T}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ld={focusedElem:e,selectionRange:i},qo=!1,Mt=n;Mt!==null;)if(n=Mt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Mt=e;else for(;Mt!==null;){switch(n=Mt,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)u=e[i],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,i=n,u=f.memoizedProps,f=f.memoizedState,l=i.stateNode;try{var ae=Ea(i.type,u);e=l.getSnapshotBeforeUpdate(ae,f),l.__reactInternalSnapshotBeforeUpdate=e}catch(be){Je(i,i.return,be)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)Bd(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=n.sibling,e!==null){e.return=n.return,Mt=e;break}Mt=n.return}}function eg(e,n,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ys(e,i),l&4&&Dr(5,i);break;case 1:if(ys(e,i),l&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(y){Je(i,i.return,y)}else{var u=Ea(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Je(i,i.return,y)}}l&64&&Yp(i),l&512&&Ur(i,i.return);break;case 3:if(ys(e,i),l&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{Bm(e,n)}catch(y){Je(i,i.return,y)}}break;case 27:n===null&&l&4&&Jp(i);case 26:case 5:ys(e,i),n===null&&l&4&&Kp(i),l&512&&Ur(i,i.return);break;case 12:ys(e,i);break;case 31:ys(e,i),l&4&&sg(e,i);break;case 13:ys(e,i),l&4&&ag(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Kb.bind(null,i),g_(e,i))));break;case 22:if(l=i.memoizedState!==null||ps,!l){n=n!==null&&n.memoizedState!==null||wt,u=ps;var f=wt;ps=l,(wt=n)&&!f?vs(e,i,(i.subtreeFlags&8772)!==0):ys(e,i),ps=u,wt=f}break;case 30:break;default:ys(e,i)}}function tg(e){var n=e.alternate;n!==null&&(e.alternate=null,tg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Zc(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,Kt=!1;function gs(e,n,i){for(i=i.child;i!==null;)ng(e,n,i),i=i.sibling}function ng(e,n,i){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(lr,i)}catch{}switch(i.tag){case 26:wt||Qn(i,n),gs(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:wt||Qn(i,n);var l=ft,u=Kt;Js(i.type)&&(ft=i.stateNode,Kt=!1),gs(e,n,i),Qr(i.stateNode),ft=l,Kt=u;break;case 5:wt||Qn(i,n);case 6:if(l=ft,u=Kt,ft=null,gs(e,n,i),ft=l,Kt=u,ft!==null)if(Kt)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(i.stateNode)}catch(f){Je(i,n,f)}else try{ft.removeChild(i.stateNode)}catch(f){Je(i,n,f)}break;case 18:ft!==null&&(Kt?(e=ft,Yg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ei(e)):Yg(ft,i.stateNode));break;case 4:l=ft,u=Kt,ft=i.stateNode.containerInfo,Kt=!0,gs(e,n,i),ft=l,Kt=u;break;case 0:case 11:case 14:case 15:Ps(2,i,n),wt||Ps(4,i,n),gs(e,n,i);break;case 1:wt||(Qn(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Xp(i,n,l)),gs(e,n,i);break;case 21:gs(e,n,i);break;case 22:wt=(l=wt)||i.memoizedState!==null,gs(e,n,i),wt=l;break;default:gs(e,n,i)}}function sg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ei(e)}catch(i){Je(n,n.return,i)}}}function ag(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ei(e)}catch(i){Je(n,n.return,i)}}function Ib(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Wp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Wp),n;default:throw Error(r(435,e.tag))}}function xo(e,n){var i=Ib(e);n.forEach(function(l){if(!i.has(l)){i.add(l);var u=Fb.bind(null,e,l);l.then(u,u)}})}function Ft(e,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var u=i[l],f=e,y=n,b=y;e:for(;b!==null;){switch(b.tag){case 27:if(Js(b.type)){ft=b.stateNode,Kt=!1;break e}break;case 5:ft=b.stateNode,Kt=!1;break e;case 3:case 4:ft=b.stateNode.containerInfo,Kt=!0;break e}b=b.return}if(ft===null)throw Error(r(160));ng(f,y,u),ft=null,Kt=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ig(n,e),n=n.sibling}var $n=null;function ig(e,n){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(n,e),Jt(e),l&4&&(Ps(3,e,e.return),Dr(3,e),Ps(5,e,e.return));break;case 1:Ft(n,e),Jt(e),l&512&&(wt||i===null||Qn(i,i.return)),l&64&&ps&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var u=$n;if(Ft(n,e),Jt(e),l&512&&(wt||i===null||Qn(i,i.return)),l&4){var f=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,u=u.ownerDocument||u;t:switch(l){case"title":f=u.getElementsByTagName("title")[0],(!f||f[ur]||f[Dt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(l),u.head.insertBefore(f,u.querySelector("head > title"))),$t(f,l,i),f[Dt]=e,Ot(f),l=f;break e;case"link":var y=iy("link","href",u).get(l+(i.href||""));if(y){for(var b=0;b<y.length;b++)if(f=y[b],f.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&f.getAttribute("rel")===(i.rel==null?null:i.rel)&&f.getAttribute("title")===(i.title==null?null:i.title)&&f.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){y.splice(b,1);break t}}f=u.createElement(l),$t(f,l,i),u.head.appendChild(f);break;case"meta":if(y=iy("meta","content",u).get(l+(i.content||""))){for(b=0;b<y.length;b++)if(f=y[b],f.getAttribute("content")===(i.content==null?null:""+i.content)&&f.getAttribute("name")===(i.name==null?null:i.name)&&f.getAttribute("property")===(i.property==null?null:i.property)&&f.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&f.getAttribute("charset")===(i.charSet==null?null:i.charSet)){y.splice(b,1);break t}}f=u.createElement(l),$t(f,l,i),u.head.appendChild(f);break;default:throw Error(r(468,l))}f[Dt]=e,Ot(f),l=f}e.stateNode=l}else ry(u,e.type,e.stateNode);else e.stateNode=ay(u,l,e.memoizedProps);else f!==l?(f===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):f.count--,l===null?ry(u,e.type,e.stateNode):ay(u,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ud(e,e.memoizedProps,i.memoizedProps)}break;case 27:Ft(n,e),Jt(e),l&512&&(wt||i===null||Qn(i,i.return)),i!==null&&l&4&&ud(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Ft(n,e),Jt(e),l&512&&(wt||i===null||Qn(i,i.return)),e.flags&32){u=e.stateNode;try{ei(u,"")}catch(ae){Je(e,e.return,ae)}}l&4&&e.stateNode!=null&&(u=e.memoizedProps,ud(e,u,i!==null?i.memoizedProps:u)),l&1024&&(hd=!0);break;case 6:if(Ft(n,e),Jt(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(ae){Je(e,e.return,ae)}}break;case 3:if(Lo=null,u=$n,$n=Oo(n.containerInfo),Ft(n,e),$n=u,Jt(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ei(n.containerInfo)}catch(ae){Je(e,e.return,ae)}hd&&(hd=!1,rg(e));break;case 4:l=$n,$n=Oo(e.stateNode.containerInfo),Ft(n,e),Jt(e),$n=l;break;case 12:Ft(n,e),Jt(e);break;case 31:Ft(n,e),Jt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xo(e,l)));break;case 13:Ft(n,e),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(_o=Pt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xo(e,l)));break;case 22:u=e.memoizedState!==null;var T=i!==null&&i.memoizedState!==null,z=ps,B=wt;if(ps=z||u,wt=B||T,Ft(n,e),wt=B,ps=z,Jt(e),l&8192)e:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(i===null||T||ps||wt||za(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){T=i=n;try{if(f=T.stateNode,u)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{b=T.stateNode;var Z=T.memoizedProps.style,O=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;b.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(ae){Je(T,T.return,ae)}}}else if(n.tag===6){if(i===null){T=n;try{T.stateNode.nodeValue=u?"":T.memoizedProps}catch(ae){Je(T,T.return,ae)}}}else if(n.tag===18){if(i===null){T=n;try{var U=T.stateNode;u?Xg(U,!0):Xg(T.stateNode,!1)}catch(ae){Je(T,T.return,ae)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,xo(e,i))));break;case 19:Ft(n,e),Jt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xo(e,l)));break;case 30:break;case 21:break;default:Ft(n,e),Jt(e)}}function Jt(e){var n=e.flags;if(n&2){try{for(var i,l=e.return;l!==null;){if(Fp(l)){i=l;break}l=l.return}if(i==null)throw Error(r(160));switch(i.tag){case 27:var u=i.stateNode,f=dd(e);vo(e,f,u);break;case 5:var y=i.stateNode;i.flags&32&&(ei(y,""),i.flags&=-33);var b=dd(e);vo(e,b,y);break;case 3:case 4:var T=i.stateNode.containerInfo,z=dd(e);fd(e,z,T);break;default:throw Error(r(161))}}catch(B){Je(e,e.return,B)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function rg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;rg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ys(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)eg(e,n.alternate,n),n=n.sibling}function za(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ps(4,n,n.return),za(n);break;case 1:Qn(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Xp(n,n.return,i),za(n);break;case 27:Qr(n.stateNode);case 26:case 5:Qn(n,n.return),za(n);break;case 22:n.memoizedState===null&&za(n);break;case 30:za(n);break;default:za(n)}e=e.sibling}}function vs(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,u=e,f=n,y=f.flags;switch(f.tag){case 0:case 11:case 15:vs(u,f,i),Dr(4,f);break;case 1:if(vs(u,f,i),l=f,u=l.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(z){Je(l,l.return,z)}if(l=f,u=l.updateQueue,u!==null){var b=l.stateNode;try{var T=u.shared.hiddenCallbacks;if(T!==null)for(u.shared.hiddenCallbacks=null,u=0;u<T.length;u++)Um(T[u],b)}catch(z){Je(l,l.return,z)}}i&&y&64&&Yp(f),Ur(f,f.return);break;case 27:Jp(f);case 26:case 5:vs(u,f,i),i&&l===null&&y&4&&Kp(f),Ur(f,f.return);break;case 12:vs(u,f,i);break;case 31:vs(u,f,i),i&&y&4&&sg(u,f);break;case 13:vs(u,f,i),i&&y&4&&ag(u,f);break;case 22:f.memoizedState===null&&vs(u,f,i),Ur(f,f.return);break;case 30:break;default:vs(u,f,i)}n=n.sibling}}function md(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&wr(i))}function pd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&wr(e))}function Vn(e,n,i,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)lg(e,n,i,l),n=n.sibling}function lg(e,n,i,l){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Vn(e,n,i,l),u&2048&&Dr(9,n);break;case 1:Vn(e,n,i,l);break;case 3:Vn(e,n,i,l),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&wr(e)));break;case 12:if(u&2048){Vn(e,n,i,l),e=n.stateNode;try{var f=n.memoizedProps,y=f.id,b=f.onPostCommit;typeof b=="function"&&b(y,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Je(n,n.return,T)}}else Vn(e,n,i,l);break;case 31:Vn(e,n,i,l);break;case 13:Vn(e,n,i,l);break;case 23:break;case 22:f=n.stateNode,y=n.alternate,n.memoizedState!==null?f._visibility&2?Vn(e,n,i,l):Br(e,n):f._visibility&2?Vn(e,n,i,l):(f._visibility|=2,bi(e,n,i,l,(n.subtreeFlags&10256)!==0||!1)),u&2048&&md(y,n);break;case 24:Vn(e,n,i,l),u&2048&&pd(n.alternate,n);break;default:Vn(e,n,i,l)}}function bi(e,n,i,l,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,y=n,b=i,T=l,z=y.flags;switch(y.tag){case 0:case 11:case 15:bi(f,y,b,T,u),Dr(8,y);break;case 23:break;case 22:var B=y.stateNode;y.memoizedState!==null?B._visibility&2?bi(f,y,b,T,u):Br(f,y):(B._visibility|=2,bi(f,y,b,T,u)),u&&z&2048&&md(y.alternate,y);break;case 24:bi(f,y,b,T,u),u&&z&2048&&pd(y.alternate,y);break;default:bi(f,y,b,T,u)}n=n.sibling}}function Br(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,l=n,u=l.flags;switch(l.tag){case 22:Br(i,l),u&2048&&md(l.alternate,l);break;case 24:Br(i,l),u&2048&&pd(l.alternate,l);break;default:Br(i,l)}n=n.sibling}}var qr=8192;function _i(e,n,i){if(e.subtreeFlags&qr)for(e=e.child;e!==null;)og(e,n,i),e=e.sibling}function og(e,n,i){switch(e.tag){case 26:_i(e,n,i),e.flags&qr&&e.memoizedState!==null&&C_(i,$n,e.memoizedState,e.memoizedProps);break;case 5:_i(e,n,i);break;case 3:case 4:var l=$n;$n=Oo(e.stateNode.containerInfo),_i(e,n,i),$n=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=qr,qr=16777216,_i(e,n,i),qr=l):_i(e,n,i));break;default:_i(e,n,i)}}function cg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function $r(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var l=n[i];Mt=l,dg(l,e)}cg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ug(e),e=e.sibling}function ug(e){switch(e.tag){case 0:case 11:case 15:$r(e),e.flags&2048&&Ps(9,e,e.return);break;case 3:$r(e);break;case 12:$r(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,bo(e)):$r(e);break;default:$r(e)}}function bo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var l=n[i];Mt=l,dg(l,e)}cg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ps(8,n,n.return),bo(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,bo(n));break;default:bo(n)}e=e.sibling}}function dg(e,n){for(;Mt!==null;){var i=Mt;switch(i.tag){case 0:case 11:case 15:Ps(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:wr(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Mt=l;else e:for(i=e;Mt!==null;){l=Mt;var u=l.sibling,f=l.return;if(tg(l),l===i){Mt=null;break e}if(u!==null){u.return=f,Mt=u;break e}Mt=f}}}var Zb={getCacheForType:function(e){var n=Bt(bt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return Bt(bt).controller.signal}},Hb=typeof WeakMap=="function"?WeakMap:Map,Ye=0,it=null,Le=null,Ue=0,Fe=0,dn=null,Qs=!1,Si=!1,gd=!1,xs=0,pt=0,Gs=0,Oa=0,yd=0,fn=0,wi=0,Vr=null,Wt=null,vd=!1,_o=0,fg=0,So=1/0,wo=null,Ys=null,Rt=0,Xs=null,ki=null,bs=0,xd=0,bd=null,hg=null,Ir=0,_d=null;function hn(){return(Ye&2)!==0&&Ue!==0?Ue&-Ue:M.T!==null?Nd():Rh()}function mg(){if(fn===0)if((Ue&536870912)===0||qe){var e=Al;Al<<=1,(Al&3932160)===0&&(Al=262144),fn=e}else fn=536870912;return e=cn.current,e!==null&&(e.flags|=32),fn}function en(e,n,i){(e===it&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(Ti(e,0),Ks(e,Ue,fn,!1)),cr(e,i),((Ye&2)===0||e!==it)&&(e===it&&((Ye&2)===0&&(Oa|=i),pt===4&&Ks(e,Ue,fn,!1)),Gn(e))}function pg(e,n,i){if((Ye&6)!==0)throw Error(r(327));var l=!i&&(n&127)===0&&(n&e.expiredLanes)===0||or(e,n),u=l?Gb(e,n):wd(e,n,!0),f=l;do{if(u===0){Si&&!l&&Ks(e,n,0,!1);break}else{if(i=e.current.alternate,f&&!Pb(i)){u=wd(e,n,!1),f=!1;continue}if(u===2){if(f=n,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var b=e;u=Vr;var T=b.current.memoizedState.isDehydrated;if(T&&(Ti(b,y).flags|=256),y=wd(b,y,!1),y!==2){if(gd&&!T){b.errorRecoveryDisabledLanes|=f,Oa|=f,u=4;break e}f=Wt,Wt=u,f!==null&&(Wt===null?Wt=f:Wt.push.apply(Wt,f))}u=y}if(f=!1,u!==2)continue}}if(u===1){Ti(e,0),Ks(e,n,0,!0);break}e:{switch(l=e,f=u,f){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Ks(l,n,fn,!Qs);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(u=_o+300-Pt(),10<u)){if(Ks(l,n,fn,!Qs),zl(l,0,!0)!==0)break e;bs=n,l.timeoutHandle=Qg(gg.bind(null,l,i,Wt,wo,vd,n,fn,Oa,wi,Qs,f,"Throttled",-0,0),u);break e}gg(l,i,Wt,wo,vd,n,fn,Oa,wi,Qs,f,null,-0,0)}}break}while(!0);Gn(e)}function gg(e,n,i,l,u,f,y,b,T,z,B,Z,O,U){if(e.timeoutHandle=-1,Z=n.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},og(n,f,Z);var ae=(f&62914560)===f?_o-Pt():(f&4194048)===f?fg-Pt():0;if(ae=R_(Z,ae),ae!==null){bs=f,e.cancelPendingCommit=ae(kg.bind(null,e,n,f,i,l,u,y,b,T,B,Z,null,O,U)),Ks(e,f,y,!z);return}}kg(e,n,f,i,l,u,y,b,T)}function Pb(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var u=i[l],f=u.getSnapshot;u=u.value;try{if(!ln(f(),u))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ks(e,n,i,l){n&=~yd,n&=~Oa,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var u=n;0<u;){var f=31-rn(u),y=1<<f;l[f]=-1,u&=~y}i!==0&&jh(e,i,n)}function ko(){return(Ye&6)===0?(Zr(0),!1):!0}function Sd(){if(Le!==null){if(Fe===0)var e=Le.return;else e=Le,cs=ka=null,Bu(e),pi=null,Tr=0,e=Le;for(;e!==null;)Gp(e.alternate,e),e=e.return;Le=null}}function Ti(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,d_(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),bs=0,Sd(),it=e,Le=i=ls(e.current,null),Ue=n,Fe=0,dn=null,Qs=!1,Si=or(e,n),gd=!1,wi=fn=yd=Oa=Gs=pt=0,Wt=Vr=null,vd=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var u=31-rn(l),f=1<<u;n|=e[u],l&=~f}return xs=n,Hl(),i}function yg(e,n){Re=null,M.H=Or,n===mi||n===Jl?(n=Om(),Fe=3):n===ju?(n=Om(),Fe=4):Fe=n===ed?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,dn=n,Le===null&&(pt=1,ho(e,Sn(n,e.current)))}function vg(){var e=cn.current;return e===null?!0:(Ue&4194048)===Ue?jn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===jn:!1}function xg(){var e=M.H;return M.H=Or,e===null?Or:e}function bg(){var e=M.A;return M.A=Zb,e}function To(){pt=4,Qs||(Ue&4194048)!==Ue&&cn.current!==null||(Si=!0),(Gs&134217727)===0&&(Oa&134217727)===0||it===null||Ks(it,Ue,fn,!1)}function wd(e,n,i){var l=Ye;Ye|=2;var u=xg(),f=bg();(it!==e||Ue!==n)&&(wo=null,Ti(e,n)),n=!1;var y=pt;e:do try{if(Fe!==0&&Le!==null){var b=Le,T=dn;switch(Fe){case 8:Sd(),y=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(n=!0);var z=Fe;if(Fe=0,dn=null,ji(e,b,T,z),i&&Si){y=0;break e}break;default:z=Fe,Fe=0,dn=null,ji(e,b,T,z)}}Qb(),y=pt;break}catch(B){yg(e,B)}while(!0);return n&&e.shellSuspendCounter++,cs=ka=null,Ye=l,M.H=u,M.A=f,Le===null&&(it=null,Ue=0,Hl()),y}function Qb(){for(;Le!==null;)_g(Le)}function Gb(e,n){var i=Ye;Ye|=2;var l=xg(),u=bg();it!==e||Ue!==n?(wo=null,So=Pt()+500,Ti(e,n)):Si=or(e,n);e:do try{if(Fe!==0&&Le!==null){n=Le;var f=dn;t:switch(Fe){case 1:Fe=0,dn=null,ji(e,n,f,1);break;case 2:case 9:if(Em(f)){Fe=0,dn=null,Sg(n);break}n=function(){Fe!==2&&Fe!==9||it!==e||(Fe=7),Gn(e)},f.then(n,n);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:Em(f)?(Fe=0,dn=null,Sg(n)):(Fe=0,dn=null,ji(e,n,f,7));break;case 5:var y=null;switch(Le.tag){case 26:y=Le.memoizedState;case 5:case 27:var b=Le;if(y?ly(y):b.stateNode.complete){Fe=0,dn=null;var T=b.sibling;if(T!==null)Le=T;else{var z=b.return;z!==null?(Le=z,jo(z)):Le=null}break t}}Fe=0,dn=null,ji(e,n,f,5);break;case 6:Fe=0,dn=null,ji(e,n,f,6);break;case 8:Sd(),pt=6;break e;default:throw Error(r(462))}}Yb();break}catch(B){yg(e,B)}while(!0);return cs=ka=null,M.H=l,M.A=u,Ye=i,Le!==null?0:(it=null,Ue=0,Hl(),pt)}function Yb(){for(;Le!==null&&!Nl();)_g(Le)}function _g(e){var n=Pp(e.alternate,e,xs);e.memoizedProps=e.pendingProps,n===null?jo(e):Le=n}function Sg(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=qp(i,n,n.pendingProps,n.type,void 0,Ue);break;case 11:n=qp(i,n,n.pendingProps,n.type.render,n.ref,Ue);break;case 5:Bu(n);default:Gp(i,n),n=Le=bm(n,xs),n=Pp(i,n,xs)}e.memoizedProps=e.pendingProps,n===null?jo(e):Le=n}function ji(e,n,i,l){cs=ka=null,Bu(n),pi=null,Tr=0;var u=n.return;try{if(Db(e,u,n,i,Ue)){pt=1,ho(e,Sn(i,e.current)),Le=null;return}}catch(f){if(u!==null)throw Le=u,f;pt=1,ho(e,Sn(i,e.current)),Le=null;return}n.flags&32768?(qe||l===1?e=!0:Si||(Ue&536870912)!==0?e=!1:(Qs=e=!0,(l===2||l===9||l===3||l===6)&&(l=cn.current,l!==null&&l.tag===13&&(l.flags|=16384))),wg(n,e)):jo(n)}function jo(e){var n=e;do{if((n.flags&32768)!==0){wg(n,Qs);return}e=n.return;var i=qb(n.alternate,n,xs);if(i!==null){Le=i;return}if(n=n.sibling,n!==null){Le=n;return}Le=n=e}while(n!==null);pt===0&&(pt=5)}function wg(e,n){do{var i=$b(e.alternate,e);if(i!==null){i.flags&=32767,Le=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Le=e;return}Le=e=i}while(e!==null);pt=6,Le=null}function kg(e,n,i,l,u,f,y,b,T){e.cancelPendingCommit=null;do No();while(Rt!==0);if((Ye&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(f=n.lanes|n.childLanes,f|=du,N0(e,i,f,y,b,T),e===it&&(Le=it=null,Ue=0),ki=n,Xs=e,bs=i,xd=f,bd=u,hg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jb(Vt,function(){return Rg(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,u=J.p,J.p=2,y=Ye,Ye|=4;try{Vb(e,n,i)}finally{Ye=y,J.p=u,M.T=l}}Rt=1,Tg(),jg(),Ng()}}function Tg(){if(Rt===1){Rt=0;var e=Xs,n=ki,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=M.T,M.T=null;var l=J.p;J.p=2;var u=Ye;Ye|=4;try{ig(n,e);var f=Ld,y=dm(e.containerInfo),b=f.focusedElem,T=f.selectionRange;if(y!==b&&b&&b.ownerDocument&&um(b.ownerDocument.documentElement,b)){if(T!==null&&ru(b)){var z=T.start,B=T.end;if(B===void 0&&(B=z),"selectionStart"in b)b.selectionStart=z,b.selectionEnd=Math.min(B,b.value.length);else{var Z=b.ownerDocument||document,O=Z&&Z.defaultView||window;if(O.getSelection){var U=O.getSelection(),ae=b.textContent.length,be=Math.min(T.start,ae),nt=T.end===void 0?be:Math.min(T.end,ae);!U.extend&&be>nt&&(y=nt,nt=be,be=y);var C=cm(b,be),j=cm(b,nt);if(C&&j&&(U.rangeCount!==1||U.anchorNode!==C.node||U.anchorOffset!==C.offset||U.focusNode!==j.node||U.focusOffset!==j.offset)){var E=Z.createRange();E.setStart(C.node,C.offset),U.removeAllRanges(),be>nt?(U.addRange(E),U.extend(j.node,j.offset)):(E.setEnd(j.node,j.offset),U.addRange(E))}}}}for(Z=[],U=b;U=U.parentNode;)U.nodeType===1&&Z.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<Z.length;b++){var V=Z[b];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}qo=!!Md,Ld=Md=null}finally{Ye=u,J.p=l,M.T=i}}e.current=n,Rt=2}}function jg(){if(Rt===2){Rt=0;var e=Xs,n=ki,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=M.T,M.T=null;var l=J.p;J.p=2;var u=Ye;Ye|=4;try{eg(e,n.alternate,n)}finally{Ye=u,J.p=l,M.T=i}}Rt=3}}function Ng(){if(Rt===4||Rt===3){Rt=0,Uc();var e=Xs,n=ki,i=bs,l=hg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Rt=5:(Rt=0,ki=Xs=null,Cg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ys=null),Vc(i),n=n.stateNode,an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(lr,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=M.T,u=J.p,J.p=2,M.T=null;try{for(var f=e.onRecoverableError,y=0;y<l.length;y++){var b=l[y];f(b.value,{componentStack:b.stack})}}finally{M.T=n,J.p=u}}(bs&3)!==0&&No(),Gn(e),u=e.pendingLanes,(i&261930)!==0&&(u&42)!==0?e===_d?Ir++:(Ir=0,_d=e):Ir=0,Zr(0)}}function Cg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,wr(n)))}function No(){return Tg(),jg(),Ng(),Rg()}function Rg(){if(Rt!==5)return!1;var e=Xs,n=xd;xd=0;var i=Vc(bs),l=M.T,u=J.p;try{J.p=32>i?32:i,M.T=null,i=bd,bd=null;var f=Xs,y=bs;if(Rt=0,ki=Xs=null,bs=0,(Ye&6)!==0)throw Error(r(331));var b=Ye;if(Ye|=4,ug(f.current),lg(f,f.current,y,i),Ye=b,Zr(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(lr,f)}catch{}return!0}finally{J.p=u,M.T=l,Cg(e,n)}}function Ag(e,n,i){n=Sn(i,n),n=Wu(e.stateNode,n,2),e=Is(e,n,2),e!==null&&(cr(e,2),Gn(e))}function Je(e,n,i){if(e.tag===3)Ag(e,e,i);else for(;n!==null;){if(n.tag===3){Ag(n,e,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ys===null||!Ys.has(l))){e=Sn(i,e),i=Ep(2),l=Is(n,i,2),l!==null&&(zp(i,l,n,e),cr(l,2),Gn(l));break}}n=n.return}}function kd(e,n,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Hb;var u=new Set;l.set(n,u)}else u=l.get(n),u===void 0&&(u=new Set,l.set(n,u));u.has(i)||(gd=!0,u.add(i),e=Xb.bind(null,e,n,i),n.then(e,e))}function Xb(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,it===e&&(Ue&i)===i&&(pt===4||pt===3&&(Ue&62914560)===Ue&&300>Pt()-_o?(Ye&2)===0&&Ti(e,0):yd|=i,wi===Ue&&(wi=0)),Gn(e)}function Eg(e,n){n===0&&(n=Th()),e=_a(e,n),e!==null&&(cr(e,n),Gn(e))}function Kb(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Eg(e,i)}function Fb(e,n){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,u=e.memoizedState;u!==null&&(i=u.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(n),Eg(e,i)}function Jb(e,n){return ir(e,n)}var Co=null,Ni=null,Td=!1,Ro=!1,jd=!1,Fs=0;function Gn(e){e!==Ni&&e.next===null&&(Ni===null?Co=Ni=e:Ni=Ni.next=e),Ro=!0,Td||(Td=!0,e_())}function Zr(e,n){if(!jd&&Ro){jd=!0;do for(var i=!1,l=Co;l!==null;){if(e!==0){var u=l.pendingLanes;if(u===0)var f=0;else{var y=l.suspendedLanes,b=l.pingedLanes;f=(1<<31-rn(42|e)+1)-1,f&=u&~(y&~b),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(i=!0,Lg(l,f))}else f=Ue,f=zl(l,l===it?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||or(l,f)||(i=!0,Lg(l,f));l=l.next}while(i);jd=!1}}function Wb(){zg()}function zg(){Ro=Td=!1;var e=0;Fs!==0&&u_()&&(e=Fs);for(var n=Pt(),i=null,l=Co;l!==null;){var u=l.next,f=Og(l,n);f===0?(l.next=null,i===null?Co=u:i.next=u,u===null&&(Ni=i)):(i=l,(e!==0||(f&3)!==0)&&(Ro=!0)),l=u}Rt!==0&&Rt!==5||Zr(e),Fs!==0&&(Fs=0)}function Og(e,n){for(var i=e.suspendedLanes,l=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-rn(f),b=1<<y,T=u[y];T===-1?((b&i)===0||(b&l)!==0)&&(u[y]=j0(b,n)):T<=n&&(e.expiredLanes|=b),f&=~b}if(n=it,i=Ue,i=zl(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===n&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&rr(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||or(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(l!==null&&rr(l),Vc(i)){case 2:case 8:i=Lt;break;case 32:i=Vt;break;case 268435456:i=kh;break;default:i=Vt}return l=Mg.bind(null,e),i=ir(i,l),e.callbackPriority=n,e.callbackNode=i,n}return l!==null&&l!==null&&rr(l),e.callbackPriority=2,e.callbackNode=null,2}function Mg(e,n){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(No()&&e.callbackNode!==i)return null;var l=Ue;return l=zl(e,e===it?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(pg(e,l,n),Og(e,Pt()),e.callbackNode!=null&&e.callbackNode===i?Mg.bind(null,e):null)}function Lg(e,n){if(No())return null;pg(e,n,!0)}function e_(){f_(function(){(Ye&6)!==0?ir(ct,Wb):zg()})}function Nd(){if(Fs===0){var e=fi;e===0&&(e=Rl,Rl<<=1,(Rl&261888)===0&&(Rl=256)),Fs=e}return Fs}function Dg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Dl(""+e)}function Ug(e,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function t_(e,n,i,l,u){if(n==="submit"&&i&&i.stateNode===u){var f=Dg((u[Yt]||null).action),y=l.submitter;y&&(n=(n=y[Yt]||null)?Dg(n.formAction):y.getAttribute("formAction"),n!==null&&(f=n,y=null));var b=new $l("action","action",null,l,u);e.push({event:b,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Fs!==0){var T=y?Ug(u,y):new FormData(u);Gu(i,{pending:!0,data:T,method:u.method,action:f},null,T)}}else typeof f=="function"&&(b.preventDefault(),T=y?Ug(u,y):new FormData(u),Gu(i,{pending:!0,data:T,method:u.method,action:f},f,T))},currentTarget:u}]})}}for(var Cd=0;Cd<uu.length;Cd++){var Rd=uu[Cd],n_=Rd.toLowerCase(),s_=Rd[0].toUpperCase()+Rd.slice(1);qn(n_,"on"+s_)}qn(mm,"onAnimationEnd"),qn(pm,"onAnimationIteration"),qn(gm,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(xb,"onTransitionRun"),qn(bb,"onTransitionStart"),qn(_b,"onTransitionCancel"),qn(ym,"onTransitionEnd"),Ja("onMouseEnter",["mouseout","mouseover"]),Ja("onMouseLeave",["mouseout","mouseover"]),Ja("onPointerEnter",["pointerout","pointerover"]),Ja("onPointerLeave",["pointerout","pointerover"]),ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hr="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(" "),a_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hr));function Bg(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],u=l.event;l=l.listeners;e:{var f=void 0;if(n)for(var y=l.length-1;0<=y;y--){var b=l[y],T=b.instance,z=b.currentTarget;if(b=b.listener,T!==f&&u.isPropagationStopped())break e;f=b,u.currentTarget=z;try{f(u)}catch(B){Zl(B)}u.currentTarget=null,f=T}else for(y=0;y<l.length;y++){if(b=l[y],T=b.instance,z=b.currentTarget,b=b.listener,T!==f&&u.isPropagationStopped())break e;f=b,u.currentTarget=z;try{f(u)}catch(B){Zl(B)}u.currentTarget=null,f=T}}}}function De(e,n){var i=n[Ic];i===void 0&&(i=n[Ic]=new Set);var l=e+"__bubble";i.has(l)||(qg(n,e,2,!1),i.add(l))}function Ad(e,n,i){var l=0;n&&(l|=4),qg(i,e,l,n)}var Ao="_reactListening"+Math.random().toString(36).slice(2);function Ed(e){if(!e[Ao]){e[Ao]=!0,zh.forEach(function(i){i!=="selectionchange"&&(a_.has(i)||Ad(i,!1,e),Ad(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ao]||(n[Ao]=!0,Ad("selectionchange",!1,n))}}function qg(e,n,i,l){switch(my(n)){case 2:var u=z_;break;case 8:u=O_;break;default:u=Qd}i=u.bind(null,n,i,e),u=void 0,!Fc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),l?u!==void 0?e.addEventListener(n,i,{capture:!0,passive:u}):e.addEventListener(n,i,!0):u!==void 0?e.addEventListener(n,i,{passive:u}):e.addEventListener(n,i,!1)}function zd(e,n,i,l,u){var f=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var b=l.stateNode.containerInfo;if(b===u)break;if(y===4)for(y=l.return;y!==null;){var T=y.tag;if((T===3||T===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;b!==null;){if(y=Xa(b),y===null)return;if(T=y.tag,T===5||T===6||T===26||T===27){l=f=y;continue e}b=b.parentNode}}l=l.return}Hh(function(){var z=f,B=Xc(i),Z=[];e:{var O=vm.get(e);if(O!==void 0){var U=$l,ae=e;switch(e){case"keypress":if(Bl(i)===0)break e;case"keydown":case"keyup":U=F0;break;case"focusin":ae="focus",U=tu;break;case"focusout":ae="blur",U=tu;break;case"beforeblur":case"afterblur":U=tu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=Gh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=eb;break;case mm:case pm:case gm:U=I0;break;case ym:U=nb;break;case"scroll":case"scrollend":U=U0;break;case"wheel":U=ab;break;case"copy":case"cut":case"paste":U=H0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=Xh;break;case"toggle":case"beforetoggle":U=rb}var be=(n&4)!==0,nt=!be&&(e==="scroll"||e==="scrollend"),C=be?O!==null?O+"Capture":null:O;be=[];for(var j=z,E;j!==null;){var V=j;if(E=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||E===null||C===null||(V=fr(j,C),V!=null&&be.push(Pr(j,V,E))),nt)break;j=j.return}0<be.length&&(O=new U(O,ae,null,i,B),Z.push({event:O,listeners:be}))}}if((n&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",O&&i!==Yc&&(ae=i.relatedTarget||i.fromElement)&&(Xa(ae)||ae[Ya]))break e;if((U||O)&&(O=B.window===B?B:(O=B.ownerDocument)?O.defaultView||O.parentWindow:window,U?(ae=i.relatedTarget||i.toElement,U=z,ae=ae?Xa(ae):null,ae!==null&&(nt=c(ae),be=ae.tag,ae!==nt||be!==5&&be!==27&&be!==6)&&(ae=null)):(U=null,ae=z),U!==ae)){if(be=Gh,V="onMouseLeave",C="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(be=Xh,V="onPointerLeave",C="onPointerEnter",j="pointer"),nt=U==null?O:dr(U),E=ae==null?O:dr(ae),O=new be(V,j+"leave",U,i,B),O.target=nt,O.relatedTarget=E,V=null,Xa(B)===z&&(be=new be(C,j+"enter",ae,i,B),be.target=E,be.relatedTarget=nt,V=be),nt=V,U&&ae)t:{for(be=i_,C=U,j=ae,E=0,V=C;V;V=be(V))E++;V=0;for(var ve=j;ve;ve=be(ve))V++;for(;0<E-V;)C=be(C),E--;for(;0<V-E;)j=be(j),V--;for(;E--;){if(C===j||j!==null&&C===j.alternate){be=C;break t}C=be(C),j=be(j)}be=null}else be=null;U!==null&&$g(Z,O,U,be,!1),ae!==null&&nt!==null&&$g(Z,nt,ae,be,!0)}}e:{if(O=z?dr(z):window,U=O.nodeName&&O.nodeName.toLowerCase(),U==="select"||U==="input"&&O.type==="file")var He=sm;else if(tm(O))if(am)He=gb;else{He=mb;var he=hb}else U=O.nodeName,!U||U.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?z&&Gc(z.elementType)&&(He=sm):He=pb;if(He&&(He=He(e,z))){nm(Z,He,i,B);break e}he&&he(e,O,z),e==="focusout"&&z&&O.type==="number"&&z.memoizedProps.value!=null&&Qc(O,"number",O.value)}switch(he=z?dr(z):window,e){case"focusin":(tm(he)||he.contentEditable==="true")&&(ai=he,lu=z,br=null);break;case"focusout":br=lu=ai=null;break;case"mousedown":ou=!0;break;case"contextmenu":case"mouseup":case"dragend":ou=!1,fm(Z,i,B);break;case"selectionchange":if(vb)break;case"keydown":case"keyup":fm(Z,i,B)}var Ae;if(su)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else si?Wh(e,i)&&(Be="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Be="onCompositionStart");Be&&(Kh&&i.locale!=="ko"&&(si||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&si&&(Ae=Ph()):(Ls=B,Jc="value"in Ls?Ls.value:Ls.textContent,si=!0)),he=Eo(z,Be),0<he.length&&(Be=new Yh(Be,e,null,i,B),Z.push({event:Be,listeners:he}),Ae?Be.data=Ae:(Ae=em(i),Ae!==null&&(Be.data=Ae)))),(Ae=ob?cb(e,i):ub(e,i))&&(Be=Eo(z,"onBeforeInput"),0<Be.length&&(he=new Yh("onBeforeInput","beforeinput",null,i,B),Z.push({event:he,listeners:Be}),he.data=Ae)),t_(Z,e,z,i,B)}Bg(Z,n)})}function Pr(e,n,i){return{instance:e,listener:n,currentTarget:i}}function Eo(e,n){for(var i=n+"Capture",l=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=fr(e,i),u!=null&&l.unshift(Pr(e,u,f)),u=fr(e,n),u!=null&&l.push(Pr(e,u,f))),e.tag===3)return l;e=e.return}return[]}function i_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $g(e,n,i,l,u){for(var f=n._reactName,y=[];i!==null&&i!==l;){var b=i,T=b.alternate,z=b.stateNode;if(b=b.tag,T!==null&&T===l)break;b!==5&&b!==26&&b!==27||z===null||(T=z,u?(z=fr(i,f),z!=null&&y.unshift(Pr(i,z,T))):u||(z=fr(i,f),z!=null&&y.push(Pr(i,z,T)))),i=i.return}y.length!==0&&e.push({event:n,listeners:y})}var r_=/\r\n?/g,l_=/\u0000|\uFFFD/g;function Vg(e){return(typeof e=="string"?e:""+e).replace(r_,`
|
|
9
|
+
`).replace(l_,"")}function Ig(e,n){return n=Vg(n),Vg(e)===n}function tt(e,n,i,l,u,f){switch(i){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||ei(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&ei(e,""+l);break;case"className":Ml(e,"class",l);break;case"tabIndex":Ml(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(e,i,l);break;case"style":Ih(e,l,f);break;case"data":if(n!=="object"){Ml(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Dl(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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 f=="function"&&(i==="formAction"?(n!=="input"&&tt(e,n,"name",u.name,u,null),tt(e,n,"formEncType",u.formEncType,u,null),tt(e,n,"formMethod",u.formMethod,u,null),tt(e,n,"formTarget",u.formTarget,u,null)):(tt(e,n,"encType",u.encType,u,null),tt(e,n,"method",u.method,u,null),tt(e,n,"target",u.target,u,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Dl(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=is);break;case"onScroll":l!=null&&De("scroll",e);break;case"onScrollEnd":l!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(i=l.__html,i!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=Dl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":De("beforetoggle",e),De("toggle",e),Ol(e,"popover",l);break;case"xlinkActuate":as(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":as(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":as(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":as(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":as(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":as(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":as(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":as(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":as(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ol(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=L0.get(i)||i,Ol(e,i,l))}}function Od(e,n,i,l,u,f){switch(i){case"style":Ih(e,l,f);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(i=l.__html,i!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=i}}break;case"children":typeof l=="string"?ei(e,l):(typeof l=="number"||typeof l=="bigint")&&ei(e,""+l);break;case"onScroll":l!=null&&De("scroll",e);break;case"onScrollEnd":l!=null&&De("scrollend",e);break;case"onClick":l!=null&&(e.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oh.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(u=i.endsWith("Capture"),n=i.slice(2,u?i.length-7:void 0),f=e[Yt]||null,f=f!=null?f[i]:null,typeof f=="function"&&e.removeEventListener(n,f,u),typeof l=="function")){typeof f!="function"&&f!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,l,u);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):Ol(e,i,l)}}}function $t(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var l=!1,u=!1,f;for(f in i)if(i.hasOwnProperty(f)){var y=i[f];if(y!=null)switch(f){case"src":l=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:tt(e,n,f,y,i,null)}}u&&tt(e,n,"srcSet",i.srcSet,i,null),l&&tt(e,n,"src",i.src,i,null);return;case"input":De("invalid",e);var b=f=y=u=null,T=null,z=null;for(l in i)if(i.hasOwnProperty(l)){var B=i[l];if(B!=null)switch(l){case"name":u=B;break;case"type":y=B;break;case"checked":T=B;break;case"defaultChecked":z=B;break;case"value":f=B;break;case"defaultValue":b=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,n));break;default:tt(e,n,l,B,i,null)}}Bh(e,f,b,T,z,y,u,!1);return;case"select":De("invalid",e),l=y=f=null;for(u in i)if(i.hasOwnProperty(u)&&(b=i[u],b!=null))switch(u){case"value":f=b;break;case"defaultValue":y=b;break;case"multiple":l=b;default:tt(e,n,u,b,i,null)}n=f,i=y,e.multiple=!!l,n!=null?Wa(e,!!l,n,!1):i!=null&&Wa(e,!!l,i,!0);return;case"textarea":De("invalid",e),f=u=l=null;for(y in i)if(i.hasOwnProperty(y)&&(b=i[y],b!=null))switch(y){case"value":l=b;break;case"defaultValue":u=b;break;case"children":f=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:tt(e,n,y,b,i,null)}$h(e,l,u,f);return;case"option":for(T in i)i.hasOwnProperty(T)&&(l=i[T],l!=null)&&(T==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":tt(e,n,T,l,i,null));return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(l=0;l<Hr.length;l++)De(Hr[l],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in i)if(i.hasOwnProperty(z)&&(l=i[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:tt(e,n,z,l,i,null)}return;default:if(Gc(n)){for(B in i)i.hasOwnProperty(B)&&(l=i[B],l!==void 0&&Od(e,n,B,l,i,void 0));return}}for(b in i)i.hasOwnProperty(b)&&(l=i[b],l!=null&&tt(e,n,b,l,i,null))}function o_(e,n,i,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,y=null,b=null,T=null,z=null,B=null;for(U in i){var Z=i[U];if(i.hasOwnProperty(U)&&Z!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":T=Z;default:l.hasOwnProperty(U)||tt(e,n,U,null,l,Z)}}for(var O in l){var U=l[O];if(Z=i[O],l.hasOwnProperty(O)&&(U!=null||Z!=null))switch(O){case"type":f=U;break;case"name":u=U;break;case"checked":z=U;break;case"defaultChecked":B=U;break;case"value":y=U;break;case"defaultValue":b=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,n));break;default:U!==Z&&tt(e,n,O,U,l,Z)}}Pc(e,y,b,T,z,B,f,u);return;case"select":U=y=b=O=null;for(f in i)if(T=i[f],i.hasOwnProperty(f)&&T!=null)switch(f){case"value":break;case"multiple":U=T;default:l.hasOwnProperty(f)||tt(e,n,f,null,l,T)}for(u in l)if(f=l[u],T=i[u],l.hasOwnProperty(u)&&(f!=null||T!=null))switch(u){case"value":O=f;break;case"defaultValue":b=f;break;case"multiple":y=f;default:f!==T&&tt(e,n,u,f,l,T)}n=b,i=y,l=U,O!=null?Wa(e,!!i,O,!1):!!l!=!!i&&(n!=null?Wa(e,!!i,n,!0):Wa(e,!!i,i?[]:"",!1));return;case"textarea":U=O=null;for(b in i)if(u=i[b],i.hasOwnProperty(b)&&u!=null&&!l.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:tt(e,n,b,null,l,u)}for(y in l)if(u=l[y],f=i[y],l.hasOwnProperty(y)&&(u!=null||f!=null))switch(y){case"value":O=u;break;case"defaultValue":U=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==f&&tt(e,n,y,u,l,f)}qh(e,O,U);return;case"option":for(var ae in i)O=i[ae],i.hasOwnProperty(ae)&&O!=null&&!l.hasOwnProperty(ae)&&(ae==="selected"?e.selected=!1:tt(e,n,ae,null,l,O));for(T in l)O=l[T],U=i[T],l.hasOwnProperty(T)&&O!==U&&(O!=null||U!=null)&&(T==="selected"?e.selected=O&&typeof O!="function"&&typeof O!="symbol":tt(e,n,T,O,l,U));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 be in i)O=i[be],i.hasOwnProperty(be)&&O!=null&&!l.hasOwnProperty(be)&&tt(e,n,be,null,l,O);for(z in l)if(O=l[z],U=i[z],l.hasOwnProperty(z)&&O!==U&&(O!=null||U!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(137,n));break;default:tt(e,n,z,O,l,U)}return;default:if(Gc(n)){for(var nt in i)O=i[nt],i.hasOwnProperty(nt)&&O!==void 0&&!l.hasOwnProperty(nt)&&Od(e,n,nt,void 0,l,O);for(B in l)O=l[B],U=i[B],!l.hasOwnProperty(B)||O===U||O===void 0&&U===void 0||Od(e,n,B,O,l,U);return}}for(var C in i)O=i[C],i.hasOwnProperty(C)&&O!=null&&!l.hasOwnProperty(C)&&tt(e,n,C,null,l,O);for(Z in l)O=l[Z],U=i[Z],!l.hasOwnProperty(Z)||O===U||O==null&&U==null||tt(e,n,Z,O,l,U)}function Zg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var u=i[l],f=u.transferSize,y=u.initiatorType,b=u.duration;if(f&&b&&Zg(y)){for(y=0,b=u.responseEnd,l+=1;l<i.length;l++){var T=i[l],z=T.startTime;if(z>b)break;var B=T.transferSize,Z=T.initiatorType;B&&Zg(Z)&&(T=T.responseEnd,y+=B*(T<b?1:(b-z)/(T-z)))}if(--l,n+=8*(f+y)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Md=null,Ld=null;function zo(e){return e.nodeType===9?e:e.ownerDocument}function Hg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Pg(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Dd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ud=null;function u_(){var e=window.event;return e&&e.type==="popstate"?e===Ud?!1:(Ud=e,!0):(Ud=null,!1)}var Qg=typeof setTimeout=="function"?setTimeout:void 0,d_=typeof clearTimeout=="function"?clearTimeout:void 0,Gg=typeof Promise=="function"?Promise:void 0,f_=typeof queueMicrotask=="function"?queueMicrotask:typeof Gg<"u"?function(e){return Gg.resolve(null).then(e).catch(h_)}:Qg;function h_(e){setTimeout(function(){throw e})}function Js(e){return e==="head"}function Yg(e,n){var i=n,l=0;do{var u=i.nextSibling;if(e.removeChild(i),u&&u.nodeType===8)if(i=u.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(u),Ei(n);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Qr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Qr(i);for(var f=i.firstChild;f;){var y=f.nextSibling,b=f.nodeName;f[ur]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&f.rel.toLowerCase()==="stylesheet"||i.removeChild(f),f=y}}else i==="body"&&Qr(e.ownerDocument.body);i=u}while(i);Ei(n)}function Xg(e,n){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Bd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Bd(i),Zc(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function m_(e,n,i,l){for(;e.nodeType===1;){var u=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ur])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Nn(e.nextSibling),e===null)break}return null}function p_(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Nn(e.nextSibling),e===null))return null;return e}function Kg(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Nn(e.nextSibling),e===null))return null;return e}function qd(e){return e.data==="$?"||e.data==="$~"}function $d(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function g_(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var l=function(){n(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Nn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Vd=null;function Fg(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(n===0)return Nn(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function Jg(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function Wg(e,n,i){switch(n=zo(i),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Qr(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Zc(e)}var Cn=new Map,ey=new Set;function Oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _s=J.d;J.d={f:y_,r:v_,D:x_,C:b_,L:__,m:S_,X:k_,S:w_,M:T_};function y_(){var e=_s.f(),n=ko();return e||n}function v_(e){var n=Ka(e);n!==null&&n.tag===5&&n.type==="form"?yp(n):_s.r(e)}var Ci=typeof document>"u"?null:document;function ty(e,n,i){var l=Ci;if(l&&typeof n=="string"&&n){var u=bn(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),ey.has(u)||(ey.add(u),e={rel:e,crossOrigin:i,href:n},l.querySelector(u)===null&&(n=l.createElement("link"),$t(n,"link",e),Ot(n),l.head.appendChild(n)))}}function x_(e){_s.D(e),ty("dns-prefetch",e,null)}function b_(e,n){_s.C(e,n),ty("preconnect",e,n)}function __(e,n,i){_s.L(e,n,i);var l=Ci;if(l&&e&&n){var u='link[rel="preload"][as="'+bn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+bn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+bn(i.imageSizes)+'"]')):u+='[href="'+bn(e)+'"]';var f=u;switch(n){case"style":f=Ri(e);break;case"script":f=Ai(e)}Cn.has(f)||(e=x({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Cn.set(f,e),l.querySelector(u)!==null||n==="style"&&l.querySelector(Gr(f))||n==="script"&&l.querySelector(Yr(f))||(n=l.createElement("link"),$t(n,"link",e),Ot(n),l.head.appendChild(n)))}}function S_(e,n){_s.m(e,n);var i=Ci;if(i&&e){var l=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+bn(l)+'"][href="'+bn(e)+'"]',f=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Ai(e)}if(!Cn.has(f)&&(e=x({rel:"modulepreload",href:e},n),Cn.set(f,e),i.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Yr(f)))return}l=i.createElement("link"),$t(l,"link",e),Ot(l),i.head.appendChild(l)}}}function w_(e,n,i){_s.S(e,n,i);var l=Ci;if(l&&e){var u=Fa(l).hoistableStyles,f=Ri(e);n=n||"default";var y=u.get(f);if(!y){var b={loading:0,preload:null};if(y=l.querySelector(Gr(f)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Cn.get(f))&&Id(e,i);var T=y=l.createElement("link");Ot(T),$t(T,"link",e),T._p=new Promise(function(z,B){T.onload=z,T.onerror=B}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Mo(y,n,l)}y={type:"stylesheet",instance:y,count:1,state:b},u.set(f,y)}}}function k_(e,n){_s.X(e,n);var i=Ci;if(i&&e){var l=Fa(i).hoistableScripts,u=Ai(e),f=l.get(u);f||(f=i.querySelector(Yr(u)),f||(e=x({src:e,async:!0},n),(n=Cn.get(u))&&Zd(e,n),f=i.createElement("script"),Ot(f),$t(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(u,f))}}function T_(e,n){_s.M(e,n);var i=Ci;if(i&&e){var l=Fa(i).hoistableScripts,u=Ai(e),f=l.get(u);f||(f=i.querySelector(Yr(u)),f||(e=x({src:e,async:!0,type:"module"},n),(n=Cn.get(u))&&Zd(e,n),f=i.createElement("script"),Ot(f),$t(f,"link",e),i.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(u,f))}}function ny(e,n,i,l){var u=(u=Ce.current)?Oo(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Ri(i.href),i=Fa(u).hoistableStyles,l=i.get(n),l||(l={type:"style",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ri(i.href);var f=Fa(u).hoistableStyles,y=f.get(e);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=u.querySelector(Gr(e)))&&!f._p&&(y.instance=f,y.state.loading=5),Cn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Cn.set(e,i),f||j_(u,e,i,y.state))),n&&l===null)throw Error(r(528,""));return y}if(n&&l!==null)throw Error(r(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ai(i),i=Fa(u).hoistableScripts,l=i.get(n),l||(l={type:"script",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ri(e){return'href="'+bn(e)+'"'}function Gr(e){return'link[rel="stylesheet"]['+e+"]"}function sy(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function j_(e,n,i,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),$t(n,"link",i),Ot(n),e.head.appendChild(n))}function Ai(e){return'[src="'+bn(e)+'"]'}function Yr(e){return"script[async]"+e}function ay(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+bn(i.href)+'"]');if(l)return n.instance=l,Ot(l),l;var u=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ot(l),$t(l,"style",u),Mo(l,i.precedence,e),n.instance=l;case"stylesheet":u=Ri(i.href);var f=e.querySelector(Gr(u));if(f)return n.state.loading|=4,n.instance=f,Ot(f),f;l=sy(i),(u=Cn.get(u))&&Id(l,u),f=(e.ownerDocument||e).createElement("link"),Ot(f);var y=f;return y._p=new Promise(function(b,T){y.onload=b,y.onerror=T}),$t(f,"link",l),n.state.loading|=4,Mo(f,i.precedence,e),n.instance=f;case"script":return f=Ai(i.src),(u=e.querySelector(Yr(f)))?(n.instance=u,Ot(u),u):(l=i,(u=Cn.get(f))&&(l=x({},i),Zd(l,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ot(u),$t(u,"link",l),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Mo(l,i.precedence,e));return n.instance}function Mo(e,n,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,f=u,y=0;y<l.length;y++){var b=l[y];if(b.dataset.precedence===n)f=b;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function Id(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Zd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Lo=null;function iy(e,n,i){if(Lo===null){var l=new Map,u=Lo=new Map;u.set(i,l)}else u=Lo,l=u.get(i),l||(l=new Map,u.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),u=0;u<i.length;u++){var f=i[u];if(!(f[ur]||f[Dt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(n)||"";y=e+y;var b=l.get(y);b?b.push(f):l.set(y,[f])}}return l}function ry(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function N_(e,n,i){if(i===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function ly(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function C_(e,n,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var u=Ri(l.href),f=n.querySelector(Gr(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Do.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=f,Ot(f);return}f=n.ownerDocument||n,l=sy(l),(u=Cn.get(u))&&Id(l,u),f=f.createElement("link"),Ot(f);var y=f;y._p=new Promise(function(b,T){y.onload=b,y.onerror=T}),$t(f,"link",l),i.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Do.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var Hd=0;function R_(e,n){return e.stylesheets&&e.count===0&&Bo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&Bo(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&Hd===0&&(Hd=62500*c_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bo(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Hd?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function Do(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Uo=null;function Bo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Uo=new Map,n.forEach(A_,e),Uo=null,Do.call(e))}function A_(e,n){if(!(n.state.loading&4)){var i=Uo.get(e);if(i)var l=i.get(null);else{i=new Map,Uo.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var y=u[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(i.set(y.dataset.precedence,y),l=y)}l&&i.set(null,l)}u=n.instance,y=u.getAttribute("data-precedence"),f=i.get(y)||l,f===l&&i.set(null,u),i.set(y,u),this.count++,l=Do.bind(this),u.addEventListener("load",l),u.addEventListener("error",l),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var Xr={$$typeof:P,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function E_(e,n,i,l,u,f,y,b,T){this.tag=1,this.containerInfo=e,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=qc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qc(0),this.hiddenUpdates=qc(null),this.identifierPrefix=l,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function oy(e,n,i,l,u,f,y,b,T,z,B,Z){return e=new E_(e,n,i,y,T,z,B,Z,b),n=1,f===!0&&(n|=24),f=on(3,null,null,n),e.current=f,f.stateNode=e,n=wu(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:l,isDehydrated:i,cache:n},Nu(f),e}function cy(e){return e?(e=li,e):li}function uy(e,n,i,l,u,f){u=cy(u),l.context===null?l.context=u:l.pendingContext=u,l=Vs(n),l.payload={element:i},f=f===void 0?null:f,f!==null&&(l.callback=f),i=Is(e,l,n),i!==null&&(en(i,e,n),Nr(i,e,n))}function dy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Pd(e,n){dy(e,n),(e=e.alternate)&&dy(e,n)}function fy(e){if(e.tag===13||e.tag===31){var n=_a(e,67108864);n!==null&&en(n,e,67108864),Pd(e,67108864)}}function hy(e){if(e.tag===13||e.tag===31){var n=hn();n=$c(n);var i=_a(e,n);i!==null&&en(i,e,n),Pd(e,n)}}var qo=!0;function z_(e,n,i,l){var u=M.T;M.T=null;var f=J.p;try{J.p=2,Qd(e,n,i,l)}finally{J.p=f,M.T=u}}function O_(e,n,i,l){var u=M.T;M.T=null;var f=J.p;try{J.p=8,Qd(e,n,i,l)}finally{J.p=f,M.T=u}}function Qd(e,n,i,l){if(qo){var u=Gd(l);if(u===null)zd(e,n,l,$o,i),py(e,l);else if(L_(u,e,n,i,l))l.stopPropagation();else if(py(e,l),n&4&&-1<M_.indexOf(e)){for(;u!==null;){var f=Ka(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=ga(f.pendingLanes);if(y!==0){var b=f;for(b.pendingLanes|=2,b.entangledLanes|=2;y;){var T=1<<31-rn(y);b.entanglements[1]|=T,y&=~T}Gn(f),(Ye&6)===0&&(So=Pt()+500,Zr(0))}}break;case 31:case 13:b=_a(f,2),b!==null&&en(b,f,2),ko(),Pd(f,2)}if(f=Gd(l),f===null&&zd(e,n,l,$o,i),f===u)break;u=f}u!==null&&l.stopPropagation()}else zd(e,n,l,null,i)}}function Gd(e){return e=Xc(e),Yd(e)}var $o=null;function Yd(e){if($o=null,e=Xa(e),e!==null){var n=c(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=h(n),e!==null)return e;e=null}else if(i===31){if(e=m(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return $o=e,null}function my(e){switch(e){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(Bc()){case ct:return 2;case Lt:return 8;case Vt:case Cl:return 32;case kh:return 268435456;default:return 32}default:return 32}}var Xd=!1,Ws=null,ea=null,ta=null,Kr=new Map,Fr=new Map,na=[],M_="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 py(e,n){switch(e){case"focusin":case"focusout":Ws=null;break;case"dragenter":case"dragleave":ea=null;break;case"mouseover":case"mouseout":ta=null;break;case"pointerover":case"pointerout":Kr.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fr.delete(n.pointerId)}}function Jr(e,n,i,l,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:f,targetContainers:[u]},n!==null&&(n=Ka(n),n!==null&&fy(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function L_(e,n,i,l,u){switch(n){case"focusin":return Ws=Jr(Ws,e,n,i,l,u),!0;case"dragenter":return ea=Jr(ea,e,n,i,l,u),!0;case"mouseover":return ta=Jr(ta,e,n,i,l,u),!0;case"pointerover":var f=u.pointerId;return Kr.set(f,Jr(Kr.get(f)||null,e,n,i,l,u)),!0;case"gotpointercapture":return f=u.pointerId,Fr.set(f,Jr(Fr.get(f)||null,e,n,i,l,u)),!0}return!1}function gy(e){var n=Xa(e.target);if(n!==null){var i=c(n);if(i!==null){if(n=i.tag,n===13){if(n=h(i),n!==null){e.blockedOn=n,Ah(e.priority,function(){hy(i)});return}}else if(n===31){if(n=m(i),n!==null){e.blockedOn=n,Ah(e.priority,function(){hy(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Gd(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Yc=l,i.target.dispatchEvent(l),Yc=null}else return n=Ka(i),n!==null&&fy(n),e.blockedOn=i,!1;n.shift()}return!0}function yy(e,n,i){Vo(e)&&i.delete(n)}function D_(){Xd=!1,Ws!==null&&Vo(Ws)&&(Ws=null),ea!==null&&Vo(ea)&&(ea=null),ta!==null&&Vo(ta)&&(ta=null),Kr.forEach(yy),Fr.forEach(yy)}function Io(e,n){e.blockedOn===n&&(e.blockedOn=null,Xd||(Xd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,D_)))}var Zo=null;function vy(e){Zo!==e&&(Zo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Zo===e&&(Zo=null);for(var n=0;n<e.length;n+=3){var i=e[n],l=e[n+1],u=e[n+2];if(typeof l!="function"){if(Yd(l||i)===null)continue;break}var f=Ka(i);f!==null&&(e.splice(n,3),n-=3,Gu(f,{pending:!0,data:u,method:i.method,action:l},l,u))}}))}function Ei(e){function n(T){return Io(T,e)}Ws!==null&&Io(Ws,e),ea!==null&&Io(ea,e),ta!==null&&Io(ta,e),Kr.forEach(n),Fr.forEach(n);for(var i=0;i<na.length;i++){var l=na[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<na.length&&(i=na[0],i.blockedOn===null);)gy(i),i.blockedOn===null&&na.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var u=i[l],f=i[l+1],y=u[Yt]||null;if(typeof f=="function")y||vy(i);else if(y){var b=null;if(f&&f.hasAttribute("formAction")){if(u=f,y=f[Yt]||null)b=y.formAction;else if(Yd(u)!==null)continue}else b=y.action;typeof b=="function"?i[l+1]=b:(i.splice(l,3),l-=3),vy(i)}}}function xy(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Kd(e){this._internalRoot=e}Ho.prototype.render=Kd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var i=n.current,l=hn();uy(i,l,e,n,null,null)},Ho.prototype.unmount=Kd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;uy(e.current,2,null,e,null,null),ko(),n[Ya]=null}};function Ho(e){this._internalRoot=e}Ho.prototype.unstable_scheduleHydration=function(e){if(e){var n=Rh();e={blockedOn:null,target:e,priority:n};for(var i=0;i<na.length&&n!==0&&n<na[i].priority;i++);na.splice(i,0,e),i===0&&gy(e)}};var by=t.version;if(by!=="19.2.4")throw Error(r(527,by,"19.2.4"));J.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var U_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{lr=Po.inject(U_),an=Po}catch{}}return el.createRoot=function(e,n){if(!o(e))throw Error(r(299));var i=!1,l="",u=Np,f=Cp,y=Rp;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=oy(e,1,!1,null,null,i,l,null,u,f,y,xy),e[Ya]=n.current,Ed(e),new Kd(n)},el.hydrateRoot=function(e,n,i){if(!o(e))throw Error(r(299));var l=!1,u="",f=Np,y=Cp,b=Rp,T=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError),i.formState!==void 0&&(T=i.formState)),n=oy(e,1,!0,n,i??null,l,u,T,f,y,b,xy),n.context=cy(null),i=n.current,l=hn(),l=$c(l),u=Vs(l),u.callback=null,Is(i,u,l),i=l,n.current.lanes=i,cr(n,i),Gn(n),e[Ya]=n.current,Ed(e),new Ho(n)},el.version="19.2.4",el}var Ay;function G_(){if(Ay)return Wd.exports;Ay=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(t){console.error(t)}}return a(),Wd.exports=Q_(),Wd.exports}var Y_=G_();const Mf=new WeakMap,X_=new WeakMap,lc={current:[]};let sf=!1,fl=0;const ll=new Set,Qo=new Map;function ix(a){for(const t of a){if(lc.current.includes(t))continue;lc.current.push(t),t.recompute();const s=X_.get(t);if(s)for(const r of s){const o=Mf.get(r);o?.length&&ix(o)}}}function K_(a){const t={prevVal:a.prevState,currentVal:a.state};for(const s of a.listeners)s(t)}function F_(a){const t={prevVal:a.prevState,currentVal:a.state};for(const s of a.listeners)s(t)}function rx(a){if(fl>0&&!Qo.has(a)&&Qo.set(a,a.prevState),ll.add(a),!(fl>0)&&!sf)try{for(sf=!0;ll.size>0;){const t=Array.from(ll);ll.clear();for(const s of t){const r=Qo.get(s)??s.prevState;s.prevState=r,K_(s)}for(const s of t){const r=Mf.get(s);r&&(lc.current.push(s),ix(r))}for(const s of t){const r=Mf.get(s);if(r)for(const o of r)F_(o)}}}finally{sf=!1,lc.current=[],Qo.clear()}}function J_(a){fl++;try{a()}finally{if(fl--,fl===0){const t=ll.values().next().value;t&&rx(t)}}}function W_(a){return typeof a=="function"}class eS{constructor(t,s){this.listeners=new Set,this.subscribe=r=>{var o,c;this.listeners.add(r);const h=(c=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:c.call(o,r,this);return()=>{this.listeners.delete(r),h?.()}},this.prevState=t,this.state=t,this.options=s}setState(t){var s,r,o;this.prevState=this.state,(s=this.options)!=null&&s.updateFn?this.state=this.options.updateFn(this.prevState)(t):W_(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),rx(this)}}const ua="__TSR_index",Ey="popstate",zy="beforeunload";function tS(a){let t=a.getLocation();const s=new Set,r=h=>{t=a.getLocation(),s.forEach(m=>m({location:t,action:h}))},o=h=>{a.notifyOnIndexChange??!0?r(h):t=a.getLocation()},c=async({task:h,navigateOpts:m,...p})=>{if(m?.ignoreBlocker??!1){h();return}const v=a.getBlockers?.()??[],x=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&v.length&&x)for(const _ of v){const S=oc(p.path,p.state);if(await _.blockerFn({currentLocation:t,nextLocation:S,action:p.type})){a.onBlocked?.();return}}h()};return{get location(){return t},get length(){return a.getLength()},subscribers:s,subscribe:h=>(s.add(h),()=>{s.delete(h)}),push:(h,m,p)=>{const g=t.state[ua];m=Oy(g+1,m),c({task:()=>{a.pushState(h,m),r({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:h,state:m})},replace:(h,m,p)=>{const g=t.state[ua];m=Oy(g,m),c({task:()=>{a.replaceState(h,m),r({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:h,state:m})},go:(h,m)=>{c({task:()=>{a.go(h),o({type:"GO",index:h})},navigateOpts:m,type:"GO"})},back:h=>{c({task:()=>{a.back(h?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:h,type:"BACK"})},forward:h=>{c({task:()=>{a.forward(h?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:h,type:"FORWARD"})},canGoBack:()=>t.state[ua]!==0,createHref:h=>a.createHref(h),block:h=>{if(!a.setBlockers)return()=>{};const m=a.getBlockers?.()??[];return a.setBlockers([...m,h]),()=>{const p=a.getBlockers?.()??[];a.setBlockers?.(p.filter(g=>g!==h))}},flush:()=>a.flush?.(),destroy:()=>a.destroy?.(),notify:r}}function Oy(a,t){t||(t={});const s=lh();return{...t,key:s,__TSR_key:s,[ua]:a}}function nS(a){const t=typeof document<"u"?window:void 0,s=t.history.pushState,r=t.history.replaceState;let o=[];const c=()=>o,h=L=>o=L,m=(L=>L),p=(()=>oc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=lh();t.history.replaceState({[ua]:0,key:L,__TSR_key:L},"")}let g=p(),v,x=!1,_=!1,S=!1,k=!1;const w=()=>g;let A,H;const X=()=>{A&&(D._ignoreSubscribers=!0,(A.isPush?t.history.pushState:t.history.replaceState)(A.state,"",A.href),D._ignoreSubscribers=!1,A=void 0,H=void 0,v=void 0)},P=(L,R,se)=>{const fe=m(R);H||(v=g),g=oc(R,se),A={href:fe,state:se,isPush:A?.isPush||L==="push"},H||(H=Promise.resolve().then(()=>X()))},q=L=>{g=p(),D.notify({type:L})},ie=async()=>{if(_){_=!1;return}const L=p(),R=L.state[ua]-g.state[ua],se=R===1,fe=R===-1,ge=!se&&!fe||x;x=!1;const Ee=ge?"GO":fe?"BACK":"FORWARD",$=ge?{type:"GO",index:R}:{type:fe?"BACK":"FORWARD"};if(S)S=!1;else{const xe=c();if(typeof document<"u"&&xe.length){for(const M of xe)if(await M.blockerFn({currentLocation:g,nextLocation:L,action:Ee})){_=!0,t.history.go(1),D.notify($);return}}}g=p(),D.notify($)},ee=L=>{if(k){k=!1;return}let R=!1;const se=c();if(typeof document<"u"&&se.length)for(const fe of se){const ge=fe.enableBeforeUnload??!0;if(ge===!0){R=!0;break}if(typeof ge=="function"&&ge()===!0){R=!0;break}}if(R)return L.preventDefault(),L.returnValue=""},D=tS({getLocation:w,getLength:()=>t.history.length,pushState:(L,R)=>P("push",L,R),replaceState:(L,R)=>P("replace",L,R),back:L=>(L&&(S=!0),k=!0,t.history.back()),forward:L=>{L&&(S=!0),k=!0,t.history.forward()},go:L=>{x=!0,t.history.go(L)},createHref:L=>m(L),flush:X,destroy:()=>{t.history.pushState=s,t.history.replaceState=r,t.removeEventListener(zy,ee,{capture:!0}),t.removeEventListener(Ey,ie)},onBlocked:()=>{v&&g!==v&&(g=v)},getBlockers:c,setBlockers:h,notifyOnIndexChange:!1});return t.addEventListener(zy,ee,{capture:!0}),t.addEventListener(Ey,ie),t.history.pushState=function(...L){const R=s.apply(t.history,L);return D._ignoreSubscribers||q("PUSH"),R},t.history.replaceState=function(...L){const R=r.apply(t.history,L);return D._ignoreSubscribers||q("REPLACE"),R},D}function sS(a){let t=a.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function oc(a,t){const s=sS(a),r=s.indexOf("#"),o=s.indexOf("?"),c=lh();return{href:s,pathname:s.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:s.length),hash:r>-1?s.substring(r):"",search:o>-1?s.slice(o,r===-1?void 0:r):"",state:t||{[ua]:0,key:c,__TSR_key:c}}}function lh(){return(Math.random()+1).toString(36).substring(7)}const aS=!1;function hl(a){let t;return J_(()=>{t=a()}),t}function gl(a){return a[a.length-1]}function iS(a){return typeof a=="function"}function oa(a,t){return iS(a)?a(t):a}const rS=Object.prototype.hasOwnProperty,My=Object.prototype.propertyIsEnumerable;function mn(a,t,s=0){if(a===t)return a;if(s>500)return t;const r=t,o=Uy(a)&&Uy(r);if(!o&&!(cc(a)&&cc(r)))return r;const c=o?a:Ly(a);if(!c)return r;const h=o?r:Ly(r);if(!h)return r;const m=c.length,p=h.length,g=o?new Array(p):{};let v=0;for(let x=0;x<p;x++){const _=o?x:h[x],S=a[_],k=r[_];if(S===k){g[_]=S,(o?x<m:rS.call(a,_))&&v++;continue}if(S===null||k===null||typeof S!="object"||typeof k!="object"){g[_]=k;continue}const w=mn(S,k,s+1);g[_]=w,w===S&&v++}return m===p&&v===m?a:g}function Ly(a){const t=Object.getOwnPropertyNames(a);for(const o of t)if(!My.call(a,o))return!1;const s=Object.getOwnPropertySymbols(a);if(s.length===0)return t;const r=t;for(const o of s){if(!My.call(a,o))return!1;r.push(o)}return r}function cc(a){if(!Dy(a))return!1;const t=a.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!Dy(s)||!s.hasOwnProperty("isPrototypeOf"))}function Dy(a){return Object.prototype.toString.call(a)==="[object Object]"}function Uy(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function Ua(a,t,s){if(a===t)return!0;if(typeof a!=typeof t)return!1;if(Array.isArray(a)&&Array.isArray(t)){if(a.length!==t.length)return!1;for(let r=0,o=a.length;r<o;r++)if(!Ua(a[r],t[r],s))return!1;return!0}if(cc(a)&&cc(t)){const r=s?.ignoreUndefined??!0;if(s?.partial){for(const h in t)if((!r||t[h]!==void 0)&&!Ua(a[h],t[h],s))return!1;return!0}let o=0;if(!r)o=Object.keys(a).length;else for(const h in a)a[h]!==void 0&&o++;let c=0;for(const h in t)if((!r||t[h]!==void 0)&&(c++,c>o||!Ua(a[h],t[h],s)))return!1;return o===c}return!1}function Ii(a){let t,s;const r=new Promise((o,c)=>{t=o,s=c});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),a?.(o)},r.reject=o=>{r.status="rejected",s(o)},r}function $i(a){return!!(a&&typeof a=="object"&&typeof a.then=="function")}function lS(a){return a.replace(/[\x00-\x1f\x7f]/g,"")}function By(a){let t;try{t=decodeURI(a)}catch{t=a.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return lS(t)}const lx=["http:","https:","mailto:","tel:"];function uc(a){if(!a)return!1;try{const t=new URL(a);return!lx.includes(t.protocol)}catch{return!1}}const oS={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},cS=/[&><\u2028\u2029]/g;function uS(a){return a.replace(cS,t=>oS[t])}function tl(a){if(!a)return{path:a,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(a)&&!a.startsWith("//"))return{path:a,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,r="",o;for(;(o=t.exec(a))!==null;)r+=By(a.slice(s,o.index))+o[0],s=t.lastIndex;r=r+By(s?a.slice(s):a);let c=!1;return r.startsWith("//")&&(c=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:c}}function dS(a){return/\s|[^\u0000-\u007F]/.test(a)?a.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):a}var fS="Invariant failed";function Rs(a,t){if(!a)throw new Error(fS)}function dc(a){const t=new Map;let s,r;const o=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,r&&(r.next=c,c.prev=r)):(c.next.prev=void 0,s=c.next,c.next=void 0,r&&(c.prev=r,r.next=c)),r=c)};return{get(c){const h=t.get(c);if(h)return o(h),h.value},set(c,h){if(t.size>=a&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===r&&(r=void 0)}const m=t.get(c);if(m)m.value=h,o(m);else{const p={key:c,value:h,prev:r};r&&(r.next=p),r=p,s||(s=p),t.set(c,p)}},clear(){t.clear(),s=void 0,r=void 0}}}const Zi=0,$a=1,Va=2,yl=3,La=4,ox=5;function hS(a){const t=a.indexOf("{");if(t===-1)return null;const s=a.indexOf("}",t);return s===-1||t+1>=a.length?null:[t,s]}function oh(a,t,s=new Uint16Array(6)){const r=a.indexOf("/",t),o=r===-1?a.length:r,c=a.substring(t,o);if(!c||!c.includes("$"))return s[0]=Zi,s[1]=t,s[2]=t,s[3]=o,s[4]=o,s[5]=o,s;if(c==="$"){const m=a.length;return s[0]=Va,s[1]=t,s[2]=t,s[3]=m,s[4]=m,s[5]=m,s}if(c.charCodeAt(0)===36)return s[0]=$a,s[1]=t,s[2]=t+1,s[3]=o,s[4]=o,s[5]=o,s;const h=hS(c);if(h){const[m,p]=h,g=c.charCodeAt(m+1);if(g===45){if(m+2<c.length&&c.charCodeAt(m+2)===36){const v=m+3,x=p;if(v<x)return s[0]=yl,s[1]=t+m,s[2]=t+v,s[3]=t+x,s[4]=t+p+1,s[5]=o,s}}else if(g===36){const v=m+1,x=m+2;return x===p?(s[0]=Va,s[1]=t+m,s[2]=t+v,s[3]=t+x,s[4]=t+p+1,s[5]=a.length,s):(s[0]=$a,s[1]=t+m,s[2]=t+x,s[3]=t+p,s[4]=t+p+1,s[5]=o,s)}}return s[0]=Zi,s[1]=t,s[2]=t,s[3]=o,s[4]=o,s[5]=o,s}function Mc(a,t,s,r,o,c,h){h?.(s);let m=r;{const p=s.fullPath??s.from,g=p.length,v=s.options?.caseSensitive??a,x=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;m<g;){const S=oh(p,m,t);let k;const w=m,A=S[5];switch(m=A+1,c++,S[0]){case Zi:{const X=p.substring(S[2],S[3]);if(v){const P=o.static?.get(X);if(P)k=P;else{o.static??=new Map;const q=Da(s.fullPath??s.from);q.parent=o,q.depth=c,k=q,o.static.set(X,q)}}else{const P=X.toLowerCase(),q=o.staticInsensitive?.get(P);if(q)k=q;else{o.staticInsensitive??=new Map;const ie=Da(s.fullPath??s.from);ie.parent=o,ie.depth=c,k=ie,o.staticInsensitive.set(P,ie)}}break}case $a:{const X=p.substring(w,S[1]),P=p.substring(S[4],A),q=v&&!!(X||P),ie=X?q?X:X.toLowerCase():void 0,ee=P?q?P:P.toLowerCase():void 0,D=!x&&o.dynamic?.find(L=>!L.skipOnParamError&&L.caseSensitive===q&&L.prefix===ie&&L.suffix===ee);if(D)k=D;else{const L=rf($a,s.fullPath??s.from,q,ie,ee);k=L,L.depth=c,L.parent=o,o.dynamic??=[],o.dynamic.push(L)}break}case yl:{const X=p.substring(w,S[1]),P=p.substring(S[4],A),q=v&&!!(X||P),ie=X?q?X:X.toLowerCase():void 0,ee=P?q?P:P.toLowerCase():void 0,D=!x&&o.optional?.find(L=>!L.skipOnParamError&&L.caseSensitive===q&&L.prefix===ie&&L.suffix===ee);if(D)k=D;else{const L=rf(yl,s.fullPath??s.from,q,ie,ee);k=L,L.parent=o,L.depth=c,o.optional??=[],o.optional.push(L)}break}case Va:{const X=p.substring(w,S[1]),P=p.substring(S[4],A),q=v&&!!(X||P),ie=X?q?X:X.toLowerCase():void 0,ee=P?q?P:P.toLowerCase():void 0,D=rf(Va,s.fullPath??s.from,q,ie,ee);k=D,D.parent=o,D.depth=c,o.wildcard??=[],o.wildcard.push(D)}}o=k}if(x&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const S=Da(s.fullPath??s.from);S.kind=ox,S.parent=o,c++,S.depth=c,o.pathless??=[],o.pathless.push(S),o=S}const _=(s.path||!s.children)&&!s.isRoot;if(_&&p.endsWith("/")){const S=Da(s.fullPath??s.from);S.kind=La,S.parent=o,c++,S.depth=c,o.index=S,o=S}o.parse=s.options?.params?.parse??null,o.skipOnParamError=x,o.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,_&&!o.route&&(o.route=s,o.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Mc(a,t,p,m,o,c,h)}function af(a,t){if(a.skipOnParamError&&!t.skipOnParamError)return-1;if(!a.skipOnParamError&&t.skipOnParamError)return 1;if(a.skipOnParamError&&t.skipOnParamError&&(a.parsingPriority||t.parsingPriority))return t.parsingPriority-a.parsingPriority;if(a.prefix&&t.prefix&&a.prefix!==t.prefix){if(a.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(a.prefix))return 1}if(a.suffix&&t.suffix&&a.suffix!==t.suffix){if(a.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(a.suffix))return 1}return a.prefix&&!t.prefix?-1:!a.prefix&&t.prefix?1:a.suffix&&!t.suffix?-1:!a.suffix&&t.suffix?1:a.caseSensitive&&!t.caseSensitive?-1:!a.caseSensitive&&t.caseSensitive?1:0}function ia(a){if(a.pathless)for(const t of a.pathless)ia(t);if(a.static)for(const t of a.static.values())ia(t);if(a.staticInsensitive)for(const t of a.staticInsensitive.values())ia(t);if(a.dynamic?.length){a.dynamic.sort(af);for(const t of a.dynamic)ia(t)}if(a.optional?.length){a.optional.sort(af);for(const t of a.optional)ia(t)}if(a.wildcard?.length){a.wildcard.sort(af);for(const t of a.wildcard)ia(t)}}function Da(a){return{kind:Zi,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:a,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function rf(a,t,s,r,o){return{kind:a,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:r,suffix:o}}function mS(a,t){const s=Da("/"),r=new Uint16Array(6);for(const o of a)Mc(!1,r,o,1,s,0);ia(s),t.masksTree=s,t.flatCache=dc(1e3)}function pS(a,t){a||="/";const s=t.flatCache.get(a);if(s)return s;const r=ch(a,t.masksTree);return t.flatCache.set(a,r),r}function gS(a,t,s,r,o){a||="/",r||="/";const c=t?`case\0${a}`:a;let h=o.singleCache.get(c);if(!h){h=Da("/");const m=new Uint16Array(6);Mc(t,m,{from:a},1,h,0),o.singleCache.set(c,h)}return ch(r,h,s)}function yS(a,t,s=!1){const r=s?a:`nofuzz\0${a}`,o=t.matchCache.get(r);if(o!==void 0)return o;a||="/";let c;try{c=ch(a,t.segmentTree,s)}catch(h){if(h instanceof URIError)c=null;else throw h}return c&&(c.branch=bS(c.route)),t.matchCache.set(r,c),c}function vS(a){return a==="/"?a:a.replace(/\/{1,}$/,"")}function xS(a,t=!1,s){const r=Da(a.fullPath),o=new Uint16Array(6),c={},h={};let m=0;return Mc(t,o,a,1,r,0,g=>{if(s?.(g,m),Rs(!(g.id in c),`Duplicate routes found with id: ${String(g.id)}`),c[g.id]=g,m!==0&&g.path){const v=vS(g.fullPath);(!h[v]||g.fullPath.endsWith("/"))&&(h[v]=g)}m++}),ia(r),{processedTree:{segmentTree:r,singleCache:dc(1e3),matchCache:dc(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:h}}function ch(a,t,s=!1){const r=a.split("/"),o=SS(a,r,t,s);if(!o)return null;const[c]=cx(a,r,o);return{route:o.node.route,rawParams:c,parsedParams:o.parsedParams}}function cx(a,t,s){const r=_S(s.node);let o=null;const c={};let h=s.extract?.part??0,m=s.extract?.node??0,p=s.extract?.path??0,g=s.extract?.segment??0;for(;m<r.length;h++,m++,p++,g++){const v=r[m];if(v.kind===La)break;if(v.kind===ox){g--,h--,p--;continue}const x=t[h],_=p;if(x&&(p+=x.length),v.kind===$a){o??=s.node.fullPath.split("/");const S=o[g],k=v.prefix?.length??0;if(S.charCodeAt(k)===123){const A=v.suffix?.length??0,H=S.substring(k+2,S.length-A-1),X=x.substring(k,x.length-A);c[H]=decodeURIComponent(X)}else{const A=S.substring(1);c[A]=decodeURIComponent(x)}}else if(v.kind===yl){if(s.skipped&1<<m){h--,p=_-1;continue}o??=s.node.fullPath.split("/");const S=o[g],k=v.prefix?.length??0,w=v.suffix?.length??0,A=S.substring(k+3,S.length-w-1),H=v.suffix||v.prefix?x.substring(k,x.length-w):x;H&&(c[A]=decodeURIComponent(H))}else if(v.kind===Va){const S=v,k=a.substring(_+(S.prefix?.length??0),a.length-(S.suffix?.length??0)),w=decodeURIComponent(k);c["*"]=w,c._splat=w;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:h,node:m,path:p,segment:g}]}function bS(a){const t=[a];for(;a.parentRoute;)a=a.parentRoute,t.push(a);return t.reverse(),t}function _S(a){const t=Array(a.depth+1);do t[a.depth]=a,a=a.parent;while(a);return t}function SS(a,t,s,r){if(a==="/"&&s.index)return{node:s.index,skipped:0};const o=!gl(t),c=o&&a!=="/",h=t.length-(o?1:0),m=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,g=null,v=null;for(;m.length;){const x=m.pop(),{node:_,index:S,skipped:k,depth:w,statics:A,dynamics:H,optionals:X}=x;let{extract:P,rawParams:q,parsedParams:ie}=x;if(_.skipOnParamError){if(!lf(a,t,x))continue;q=x.rawParams,P=x.extract,ie=x.parsedParams}r&&_.route&&_.kind!==La&&nl(g,x)&&(g=x);const ee=S===h;if(ee&&(_.route&&!c&&nl(v,x)&&(v=x),!_.optional&&!_.wildcard&&!_.index&&!_.pathless))continue;const D=ee?void 0:t[S];let L;if(ee&&_.index){const R={node:_.index,index:S,skipped:k,depth:w+1,statics:A,dynamics:H,optionals:X,extract:P,rawParams:q,parsedParams:ie};let se=!0;if(_.index.skipOnParamError&&(lf(a,t,R)||(se=!1)),se){if(A===h&&!H&&!X&&!k)return R;nl(v,R)&&(v=R)}}if(_.wildcard&&nl(p,x))for(const R of _.wildcard){const{prefix:se,suffix:fe}=R;if(se&&(ee||!(R.caseSensitive?D:L??=D.toLowerCase()).startsWith(se)))continue;if(fe){if(ee)continue;const Ee=t.slice(S).join("/").slice(-fe.length);if((R.caseSensitive?Ee:Ee.toLowerCase())!==fe)continue}const ge={node:R,index:h,skipped:k,depth:w,statics:A,dynamics:H,optionals:X,extract:P,rawParams:q,parsedParams:ie};if(!(R.skipOnParamError&&!lf(a,t,ge))){p=ge;break}}if(_.optional){const R=k|1<<w,se=w+1;for(let fe=_.optional.length-1;fe>=0;fe--){const ge=_.optional[fe];m.push({node:ge,index:S,skipped:R,depth:se,statics:A,dynamics:H,optionals:X,extract:P,rawParams:q,parsedParams:ie})}if(!ee)for(let fe=_.optional.length-1;fe>=0;fe--){const ge=_.optional[fe],{prefix:Ee,suffix:$}=ge;if(Ee||$){const xe=ge.caseSensitive?D:L??=D.toLowerCase();if(Ee&&!xe.startsWith(Ee)||$&&!xe.endsWith($))continue}m.push({node:ge,index:S+1,skipped:k,depth:se,statics:A,dynamics:H,optionals:X+1,extract:P,rawParams:q,parsedParams:ie})}}if(!ee&&_.dynamic&&D)for(let R=_.dynamic.length-1;R>=0;R--){const se=_.dynamic[R],{prefix:fe,suffix:ge}=se;if(fe||ge){const Ee=se.caseSensitive?D:L??=D.toLowerCase();if(fe&&!Ee.startsWith(fe)||ge&&!Ee.endsWith(ge))continue}m.push({node:se,index:S+1,skipped:k,depth:w+1,statics:A,dynamics:H+1,optionals:X,extract:P,rawParams:q,parsedParams:ie})}if(!ee&&_.staticInsensitive){const R=_.staticInsensitive.get(L??=D.toLowerCase());R&&m.push({node:R,index:S+1,skipped:k,depth:w+1,statics:A+1,dynamics:H,optionals:X,extract:P,rawParams:q,parsedParams:ie})}if(!ee&&_.static){const R=_.static.get(D);R&&m.push({node:R,index:S+1,skipped:k,depth:w+1,statics:A+1,dynamics:H,optionals:X,extract:P,rawParams:q,parsedParams:ie})}if(_.pathless){const R=w+1;for(let se=_.pathless.length-1;se>=0;se--){const fe=_.pathless[se];m.push({node:fe,index:S,skipped:k,depth:R,statics:A,dynamics:H,optionals:X,extract:P,rawParams:q,parsedParams:ie})}}}if(v&&p)return nl(p,v)?v:p;if(v)return v;if(p)return p;if(r&&g){let x=g.index;for(let S=0;S<g.index;S++)x+=t[S].length;const _=x===a.length?"/":a.slice(x);return g.rawParams??={},g.rawParams["**"]=decodeURIComponent(_),g}return null}function lf(a,t,s){try{const[r,o]=cx(a,t,s);s.rawParams=r,s.extract=o;const c=s.node.parse(r);return s.parsedParams=Object.assign({},s.parsedParams,c),!0}catch{return null}}function nl(a,t){return a?t.statics>a.statics||t.statics===a.statics&&(t.dynamics>a.dynamics||t.dynamics===a.dynamics&&(t.optionals>a.optionals||t.optionals===a.optionals&&((t.node.kind===La)>(a.node.kind===La)||t.node.kind===La==(a.node.kind===La)&&t.depth>a.depth))):!0}function nc(a){return uh(a.filter(t=>t!==void 0).join("/"))}function uh(a){return a.replace(/\/{2,}/g,"/")}function ux(a){return a==="/"?a:a.replace(/^\/{1,}/,"")}function Ns(a){const t=a.length;return t>1&&a[t-1]==="/"?a.replace(/\/{1,}$/,""):a}function dx(a){return Ns(ux(a))}function fc(a,t){return a?.endsWith("/")&&a!=="/"&&a!==`${t}/`?a.slice(0,-1):a}function wS(a,t,s){return fc(a,s)===fc(t,s)}function kS({base:a,to:t,trailingSlash:s="never",cache:r}){const o=t.startsWith("/"),c=!o&&t===".";let h;if(r){h=o?t:c?a:a+"\0"+t;const x=r.get(h);if(x)return x}let m;if(c)m=a.split("/");else if(o)m=t.split("/");else{for(m=a.split("/");m.length>1&&gl(m)==="";)m.pop();const x=t.split("/");for(let _=0,S=x.length;_<S;_++){const k=x[_];k===""?_?_===S-1&&m.push(k):m=[k]:k===".."?m.pop():k==="."||m.push(k)}}m.length>1&&(gl(m)===""?s==="never"&&m.pop():s==="always"&&m.push(""));let p,g="";for(let x=0;x<m.length;x++){x>0&&(g+="/");const _=m[x];if(!_)continue;p=oh(_,0,p);const S=p[0];if(S===Zi){g+=_;continue}const k=p[5],w=_.substring(0,p[1]),A=_.substring(p[4],k),H=_.substring(p[2],p[3]);S===$a?g+=w||A?`${w}{$${H}}${A}`:`$${H}`:S===Va?g+=w||A?`${w}{$}${A}`:"$":g+=`${w}{-$${H}}${A}`}g=uh(g);const v=g||"/";return h&&r&&r.set(h,v),v}function TS(a){const t=new Map(a.map(o=>[encodeURIComponent(o),o])),s=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(s,"g");return o=>o.replace(r,c=>t.get(c)??c)}function of(a,t,s){const r=t[a];return typeof r!="string"?r:a==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>qy(o,s)).join("/"):qy(r,s)}function cf({path:a,params:t,decoder:s,...r}){let o=!1;const c={};if(!a||a==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:o};if(!a.includes("$"))return{interpolatedPath:a,usedParams:c,isMissingParams:o};const h=a.length;let m=0,p,g="";for(;m<h;){const x=m;p=oh(a,x,p);const _=p[5];if(m=_+1,x===_)continue;const S=p[0];if(S===Zi){g+="/"+a.substring(x,_);continue}if(S===Va){const k=t._splat;c._splat=k,c["*"]=k;const w=a.substring(x,p[1]),A=a.substring(p[4],_);if(!k){o=!0,(w||A)&&(g+="/"+w+A);continue}const H=of("_splat",t,s);g+="/"+w+H+A;continue}if(S===$a){const k=a.substring(p[2],p[3]);!o&&!(k in t)&&(o=!0),c[k]=t[k];const w=a.substring(x,p[1]),A=a.substring(p[4],_),H=of(k,t,s)??"undefined";g+="/"+w+H+A;continue}if(S===yl){const k=a.substring(p[2],p[3]),w=t[k];if(w==null)continue;c[k]=w;const A=a.substring(x,p[1]),H=a.substring(p[4],_),X=of(k,t,s)??"";g+="/"+A+X+H;continue}}return a.endsWith("/")&&(g+="/"),{usedParams:c,interpolatedPath:g||"/",isMissingParams:o}}function qy(a,t){const s=encodeURIComponent(a);return t?.(s)??s}function pn(a){return!!a?.isNotFound}function jS(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Lf="tsr-scroll-restoration-v1_3",NS=(a,t)=>{let s;return(...r)=>{s||(s=setTimeout(()=>{a(...r),s=null},t))}};function CS(){const a=jS();if(!a)return null;const t=a.getItem(Lf);let s=t?JSON.parse(t):{};return{state:s,set:r=>{s=oa(r,s)||s;try{a.setItem(Lf,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Go=CS(),RS=a=>a.state.__TSR_key||a.href;function AS(a){const t=[];let s;for(;s=a.parentNode;)t.push(`${a.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,a)+1})`),a=s;return`${t.reverse().join(" > ")}`.toLowerCase()}let hc=!1;function ES({storageKey:a,key:t,behavior:s,shouldScrollRestoration:r,scrollToTopSelectors:o,location:c}){let h;try{h=JSON.parse(sessionStorage.getItem(a)||"{}")}catch(g){console.error(g);return}const m=t||window.history.state?.__TSR_key,p=h[m];hc=!0;e:{if(r&&p&&Object.keys(p).length>0){for(const x in p){const _=p[x];if(x==="window")window.scrollTo({top:_.scrollY,left:_.scrollX,behavior:s});else if(x){const S=document.querySelector(x);S&&(S.scrollLeft=_.scrollX,S.scrollTop=_.scrollY)}}break e}const g=(c??window.location).hash.split("#",2)[1];if(g){const x=window.history.state?.__hashScrollIntoViewOptions??!0;if(x){const _=document.getElementById(g);_&&_.scrollIntoView(x)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),o)for(const x of o){if(x==="window")continue;const _=typeof x=="function"?x():document.querySelector(x);_&&_.scrollTo(v)}}hc=!1}function zS(a,t){if(!Go||((a.options.scrollRestoration??!1)&&(a.isScrollRestoring=!0),a.isScrollRestorationSetup||!Go))return;a.isScrollRestorationSetup=!0,hc=!1;const r=a.options.getScrollRestorationKey||RS;window.history.scrollRestoration="manual";const o=c=>{if(hc||!a.isScrollRestoring)return;let h="";if(c.target===document||c.target===window)h="window";else{const p=c.target.getAttribute("data-scroll-restoration-id");p?h=`[data-scroll-restoration-id="${p}"]`:h=AS(c.target)}const m=r(a.state.location);Go.set(p=>{const g=p[m]||={},v=g[h]||={};if(h==="window")v.scrollX=window.scrollX||0,v.scrollY=window.scrollY||0;else if(h){const x=document.querySelector(h);x&&(v.scrollX=x.scrollLeft||0,v.scrollY=x.scrollTop||0)}return p})};typeof document<"u"&&document.addEventListener("scroll",NS(o,100),!0),a.subscribe("onRendered",c=>{const h=r(c.toLocation);if(!a.resetNextScroll){a.resetNextScroll=!0;return}typeof a.options.scrollRestoration=="function"&&!a.options.scrollRestoration({location:a.latestLocation})||(ES({storageKey:Lf,key:h,behavior:a.options.scrollRestorationBehavior,shouldScrollRestoration:a.isScrollRestoring,scrollToTopSelectors:a.options.scrollToTopSelectors,location:a.history.location}),a.isScrollRestoring&&Go.set(m=>(m[h]||={},m)))})}function OS(a){if(typeof document<"u"&&document.querySelector){const t=a.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&a.state.location.hash!==""){const s=document.getElementById(a.state.location.hash);s&&s.scrollIntoView(t)}}}function MS(a,t=String){const s=new URLSearchParams;for(const r in a){const o=a[r];o!==void 0&&s.set(r,t(o))}return s.toString()}function uf(a){return a?a==="false"?!1:a==="true"?!0:+a*0===0&&+a+""===a?+a:a:""}function LS(a){const t=new URLSearchParams(a),s={};for(const[r,o]of t.entries()){const c=s[r];c==null?s[r]=uf(o):Array.isArray(c)?c.push(uf(o)):s[r]=[c,uf(o)]}return s}const DS=BS(JSON.parse),US=qS(JSON.stringify,JSON.parse);function BS(a){return t=>{t[0]==="?"&&(t=t.substring(1));const s=LS(t);for(const r in s){const o=s[r];if(typeof o=="string")try{s[r]=a(o)}catch{}}return s}}function qS(a,t){const s=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return a(o)}catch{}else if(s&&typeof o=="string")try{return t(o),a(o)}catch{}return o}return o=>{const c=MS(o,r);return c?`?${c}`:""}}const En="__root__";function $S(a){if(a.statusCode=a.statusCode||a.code||307,!a._builtLocation&&typeof a.href=="string"&&uc(a.href))throw new Error(`Redirect blocked: unsafe protocol in href "${a.href}". Only ${lx.join(", ")} protocols are allowed.`);if(!a._builtLocation&&!a.reloadDocument&&typeof a.href=="string")try{new URL(a.href),a.reloadDocument=!0}catch{}const t=new Headers(a.headers);a.href&&t.get("Location")===null&&t.set("Location",a.href);const s=new Response(null,{status:a.statusCode,headers:t});if(s.options=a,a.throw)throw s;return s}function zn(a){return a instanceof Response&&!!a.options}const sc=a=>{if(!a.rendered)return a.rendered=!0,a.onReady?.()},Lc=(a,t)=>!!(a.preload&&!a.router.state.matches.some(s=>s.id===t)),Vi=(a,t,s=!0)=>{const r={...a.router.options.context??{}},o=s?t:t-1;for(let c=0;c<=o;c++){const h=a.matches[c];if(!h)continue;const m=a.router.getMatch(h.id);m&&Object.assign(r,m.__routeContext,m.__beforeLoadContext)}return r},fx=(a,t,s)=>{const r=a.router.routesById[t.routeId??""]??a.router.routeTree;!r.options.notFoundComponent&&a.router.options?.defaultNotFoundComponent&&(r.options.notFoundComponent=a.router.options.defaultNotFoundComponent);const o=s==="BEFORE_LOAD"&&r.parentRoute;o||Rs(r.options.notFoundComponent);const c=a.matches.find(h=>h.routeId===r.id);Rs(c,"Could not find match for route: "+r.id),a.updateMatch(c.id,h=>({...h,status:"notFound",error:t,isFetching:!1})),o&&(t.routeId=r.parentRoute.id,fx(a,t,s))},ca=(a,t,s,r)=>{if(!(!zn(s)&&!pn(s))){if(zn(s)&&s.redirectHandled&&!s.options.reloadDocument)throw s;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const o=zn(s)?"redirected":"notFound";t._nonReactive.error=s,a.updateMatch(t.id,c=>({...c,status:o,context:Vi(a,t.index),isFetching:!1,error:s})),pn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw zn(s)?(a.rendered=!0,s.options._fromLocation=a.location,s.redirectHandled=!0,s=a.router.resolveRedirect(s),s):(fx(a,s,r),s)}},hx=(a,t)=>!!a.router.getMatch(t)._nonReactive.dehydrated,sl=(a,t,s,r)=>{const{id:o,routeId:c}=a.matches[t],h=a.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=r,a.firstBadMatchIndex??=t,ca(a,a.router.getMatch(o),s,r);try{h.options.onError?.(s)}catch(m){s=m,ca(a,a.router.getMatch(o),s,r)}a.updateMatch(o,m=>(m._nonReactive.beforeLoadPromise?.resolve(),m._nonReactive.beforeLoadPromise=void 0,m._nonReactive.loadPromise?.resolve(),{...m,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},mx=(a,t,s,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=s.options.pendingMs??a.router.options.defaultPendingMs;if(!!(a.onReady&&!Lc(a,t)&&(s.options.loader||s.options.beforeLoad||yx(s))&&typeof o=="number"&&o!==1/0&&(s.options.pendingComponent??a.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{sc(a)},o);r._nonReactive.pendingTimeout=h}},VS=(a,t,s)=>{const r=a.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;mx(a,t,s,r);const o=()=>{const c=a.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&ca(a,c,c.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},IS=(a,t,s,r)=>{const o=a.router.getMatch(t),c=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Ii(()=>{c?.resolve()});const{paramsError:h,searchError:m}=o;h&&sl(a,s,h,"PARSE_PARAMS"),m&&sl(a,s,m,"VALIDATE_SEARCH"),mx(a,t,r,o);const p=new AbortController;let g=!1;const v=()=>{g||(g=!0,a.updateMatch(t,q=>({...q,isFetching:"beforeLoad",fetchCount:q.fetchCount+1,abortController:p})))},x=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,a.updateMatch(t,q=>({...q,isFetching:!1}))};if(!r.options.beforeLoad){hl(()=>{v(),x()});return}o._nonReactive.beforeLoadPromise=Ii();const _={...Vi(a,s,!1),...o.__routeContext},{search:S,params:k,cause:w}=o,A=Lc(a,t),H={search:S,abortController:p,params:k,preload:A,context:_,location:a.location,navigate:q=>a.router.navigate({...q,_fromLocation:a.location}),buildLocation:a.router.buildLocation,cause:A?"preload":w,matches:a.matches,routeId:r.id,...a.router.options.additionalContext},X=q=>{if(q===void 0){hl(()=>{v(),x()});return}(zn(q)||pn(q))&&(v(),sl(a,s,q,"BEFORE_LOAD")),hl(()=>{v(),a.updateMatch(t,ie=>({...ie,__beforeLoadContext:q})),x()})};let P;try{if(P=r.options.beforeLoad(H),$i(P))return v(),P.catch(q=>{sl(a,s,q,"BEFORE_LOAD")}).then(X)}catch(q){v(),sl(a,s,q,"BEFORE_LOAD")}X(P)},ZS=(a,t)=>{const{id:s,routeId:r}=a.matches[t],o=a.router.looseRoutesById[r],c=()=>m(),h=()=>IS(a,s,t,o),m=()=>{if(hx(a,s))return;const p=VS(a,s,o);return $i(p)?p.then(h):h()};return c()},HS=(a,t,s)=>{const r=a.router.getMatch(t);if(!r||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const o={ssr:a.router.options.ssr,matches:a.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([s.options.head?.(o),s.options.scripts?.(o),s.options.headers?.(o)]).then(([c,h,m])=>{const p=c?.meta,g=c?.links,v=c?.scripts,x=c?.styles;return{meta:p,links:g,headScripts:v,headers:m,scripts:h,styles:x}})},px=(a,t,s,r)=>{const o=a.matchPromises[s-1],{params:c,loaderDeps:h,abortController:m,cause:p}=a.router.getMatch(t),g=Vi(a,s),v=Lc(a,t);return{params:c,deps:h,preload:!!v,parentMatchPromise:o,abortController:m,context:g,location:a.location,navigate:x=>a.router.navigate({...x,_fromLocation:a.location}),cause:v?"preload":p,route:r,...a.router.options.additionalContext}},$y=async(a,t,s,r)=>{try{const o=a.router.getMatch(t);try{(!(aS??a.router.isServer)||o.ssr===!0)&&gx(r);const c=r.options.loader?.(px(a,t,s,r)),h=r.options.loader&&$i(c);if((h||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||o._nonReactive.minPendingPromise)&&a.updateMatch(t,g=>({...g,isFetching:"loader"})),r.options.loader){const g=h?await c:c;ca(a,a.router.getMatch(t),g),g!==void 0&&a.updateMatch(t,v=>({...v,loaderData:g}))}r._lazyPromise&&await r._lazyPromise;const p=o._nonReactive.minPendingPromise;p&&await p,r._componentsPromise&&await r._componentsPromise,a.updateMatch(t,g=>({...g,error:void 0,context:Vi(a,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let h=c;if(h?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}a.updateMatch(t,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:Vi(a,s)}));return}const m=o._nonReactive.minPendingPromise;m&&await m,pn(c)&&await r.options.notFoundComponent?.preload?.(),ca(a,a.router.getMatch(t),c);try{r.options.onError?.(c)}catch(p){h=p,ca(a,a.router.getMatch(t),p)}a.updateMatch(t,p=>({...p,error:h,context:Vi(a,s),status:"error",isFetching:!1}))}}catch(o){const c=a.router.getMatch(t);c&&(c._nonReactive.loaderPromise=void 0),ca(a,c,o)}},PS=async(a,t)=>{async function s(v,x,_,S){const k=Date.now()-x.updatedAt,w=v?S.options.preloadStaleTime??a.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??a.router.options.defaultStaleTime??0,A=S.options.shouldReload,H=typeof A=="function"?A(px(a,r,t,S)):A,{status:X,invalid:P}=_;c=X==="success"&&(P||(H??k>w)),v&&S.options.preload===!1||(c&&!a.sync?(h=!0,(async()=>{try{await $y(a,r,t,S);const q=a.router.getMatch(r);q._nonReactive.loaderPromise?.resolve(),q._nonReactive.loadPromise?.resolve(),q._nonReactive.loaderPromise=void 0}catch(q){zn(q)&&await a.router.navigate(q.options)}})()):(X!=="success"||c&&a.sync)&&await $y(a,r,t,S))}const{id:r,routeId:o}=a.matches[t];let c=!1,h=!1;const m=a.router.looseRoutesById[o];if(!hx(a,r)){const v=a.router.getMatch(r),x=Lc(a,r);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!a.sync&&!v.preload)return v;await v._nonReactive.loaderPromise;const _=a.router.getMatch(r),S=_._nonReactive.error||_.error;S&&ca(a,_,S),_.status==="pending"&&await s(x,v,_,m)}else{const _=x&&!a.router.state.matches.some(k=>k.id===r),S=a.router.getMatch(r);S._nonReactive.loaderPromise=Ii(),_!==S.preload&&a.updateMatch(r,k=>({...k,preload:_})),await s(x,v,S,m)}}const p=a.router.getMatch(r);h||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve()),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,h||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const g=h?p.isFetching:!1;return g!==p.isFetching||p.invalid!==!1?(a.updateMatch(r,v=>({...v,isFetching:g,invalid:!1})),a.router.getMatch(r)):p};async function Vy(a){const t=Object.assign(a,{matchPromises:[]});t.router.state.matches.some(s=>s._forcePending)&&sc(t);try{for(let m=0;m<t.matches.length;m++){const p=ZS(t,m);$i(p)&&await p}const s=t.firstBadMatchIndex??t.matches.length;for(let m=0;m<s;m++)t.matchPromises.push(PS(t,m));const o=(await Promise.allSettled(t.matchPromises)).filter(m=>m.status==="rejected").map(m=>m.reason);let c;for(const m of o){if(zn(m))throw m;!c&&pn(m)&&(c=m)}for(const m of t.matches){const{id:p,routeId:g}=m,v=t.router.looseRoutesById[g];try{const x=HS(t,p,v);if(x){const _=await x;t.updateMatch(p,S=>({...S,..._}))}}catch(x){console.error(`Error executing head for route ${g}:`,x)}}if(c)throw c;const h=sc(t);$i(h)&&await h}catch(s){if(pn(s)&&!t.preload){const r=sc(t);throw $i(r)&&await r,s}if(zn(s))throw s}return t.matches}async function gx(a){if(!a._lazyLoaded&&a._lazyPromise===void 0&&(a.lazyFn?a._lazyPromise=a.lazyFn().then(t=>{const{id:s,...r}=t.options;Object.assign(a.options,r),a._lazyLoaded=!0,a._lazyPromise=void 0}):a._lazyLoaded=!0),!a._componentsLoaded&&a._componentsPromise===void 0){const t=()=>{const s=[];for(const r of vx){const o=a.options[r]?.preload;o&&s.push(o())}if(s.length)return Promise.all(s).then(()=>{a._componentsLoaded=!0,a._componentsPromise=void 0});a._componentsLoaded=!0,a._componentsPromise=void 0};a._componentsPromise=a._lazyPromise?a._lazyPromise.then(t):t()}return a._componentsPromise}function yx(a){for(const t of vx)if(a.options[t]?.preload)return!0;return!1}const vx=["component","errorComponent","pendingComponent","notFoundComponent"];function QS(a){return{input:({url:t})=>{for(const s of a)t=Df(s,t);return t},output:({url:t})=>{for(let s=a.length-1;s>=0;s--)t=xx(a[s],t);return t}}}function GS(a){const t=dx(a.basepath),s=`/${t}`,r=`${s}/`,o=a.caseSensitive?s:s.toLowerCase(),c=a.caseSensitive?r:r.toLowerCase();return{input:({url:h})=>{const m=a.caseSensitive?h.pathname:h.pathname.toLowerCase();return m===o?h.pathname="/":m.startsWith(c)&&(h.pathname=h.pathname.slice(s.length)),h},output:({url:h})=>(h.pathname=nc(["/",t,h.pathname]),h)}}function Df(a,t){const s=a?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function xx(a,t){const s=a?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function Ba(a){const t=a.resolvedLocation,s=a.location,r=t?.pathname!==s.pathname,o=t?.href!==s.href,c=t?.hash!==s.hash;return{fromLocation:t,toLocation:s,pathChanged:r,hrefChanged:o,hashChanged:c}}class YS{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=s=>s(),this.update=s=>{s.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,o=this.basepath??r?.basepath??"/",c=this.basepath===void 0,h=r?.rewrite;if(this.options={...r,...s},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=TS(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=nS()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let _;this.resolvePathCache=dc(1e3),_=this.buildRouteTree(),this.setRoutes(_)}!this.__store&&this.latestLocation&&(this.__store=new eS(KS(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(_=>!["redirected"].includes(_.status))}}}),zS(this));let m=!1;const p=this.options.basepath??"/",g=this.options.rewrite;if(c||o!==p||h!==g){this.basepath=p;const _=[],S=dx(p);S&&S!=="/"&&_.push(GS({basepath:p})),g&&_.push(g),this.rewrite=_.length===0?void 0:_.length===1?_[0]:QS(_),this.history&&this.updateLatestLocation(),m=!0}m&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=xS(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&mS(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,r)=>{const o={eventType:s,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=s=>{this.subscribers.forEach(r=>{r.eventType===s.type&&r.fn(s)})},this.parseLocation=(s,r)=>{const o=({pathname:p,search:g,hash:v,href:x,state:_})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(p)){const X=this.options.parseSearch(g),P=this.options.stringifySearch(X);return{href:p+P+v,publicHref:x,pathname:tl(p).path,external:!1,searchStr:P,search:mn(r?.search,X),hash:tl(v.slice(1)).path,state:mn(r?.state,_)}}const S=new URL(x,this.origin),k=Df(this.rewrite,S),w=this.options.parseSearch(k.search),A=this.options.stringifySearch(w);return k.search=A,{href:k.href.replace(k.origin,""),publicHref:x,pathname:tl(k.pathname).path,external:!!this.rewrite&&k.origin!==this.origin,searchStr:A,search:mn(r?.search,w),hash:tl(k.hash.slice(1)).path,state:mn(r?.state,_)}},c=o(s),{__tempLocation:h,__tempKey:m}=c.state;if(h&&(!m||m===this.tempLocationKey)){const p=o(h);return p.state.key=c.state.key,p.state.__TSR_key=c.state.__TSR_key,delete p.state.__tempLocation,{...p,maskedLocation:c}}return c},this.resolvePathWithBase=(s,r)=>kS({base:s,to:uh(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,r,o)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:r},o):this.matchRoutesInternal(s,r),this.getMatchedRoutes=s=>FS({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const r=this.getMatch(s);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const s=this.state.matches.filter(c=>c.status==="pending"),r=this.state.matches.filter(c=>c.isFetching==="loader");new Set([...this.state.pendingMatches??[],...s,...r]).forEach(c=>{this.cancelMatch(c.id)})},this.buildLocation=s=>{const r=(c={})=>{const h=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,m=this.matchRoutesLightweight(h);c.from;const p=c.unsafeRelative==="path"?h.pathname:c.from??m.fullPath,g=this.resolvePathWithBase(p,"."),v=m.search,x={...m.params},_=c.to?this.resolvePathWithBase(g,`${c.to}`):this.resolvePathWithBase(g,"."),S=c.params===!1||c.params===null?{}:(c.params??!0)===!0?x:Object.assign(x,oa(c.params,x)),k=cf({path:_,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(k);let A=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Ns(k))&&this.options.notFoundRoute&&(A=[...A,this.options.notFoundRoute]);let X=!1;if(Object.keys(S).length>0)for(const Ee of A){const $=Ee.options.params?.stringify??Ee.options.stringifyParams;$&&(X=!0,Object.assign(S,$(S)))}const P=s.leaveParams?_:tl(X?cf({path:_,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:k).path;let q=v;if(s._includeValidateSearch&&this.options.search?.strict){const Ee={};A.forEach($=>{if($.options.validateSearch)try{Object.assign(Ee,ac($.options.validateSearch,{...Ee,...q}))}catch{}}),q=Ee}q=JS({search:q,dest:c,destRoutes:A,_includeValidateSearch:s._includeValidateSearch}),q=mn(v,q);const ie=this.options.stringifySearch(q),ee=c.hash===!0?h.hash:c.hash?oa(c.hash,h.hash):void 0,D=ee?`#${ee}`:"";let L=c.state===!0?h.state:c.state?oa(c.state,h.state):{};L=mn(h.state,L);const R=`${P}${ie}${D}`;let se,fe,ge=!1;if(this.rewrite){const Ee=new URL(R,this.origin),$=xx(this.rewrite,Ee);se=Ee.href.replace(Ee.origin,""),$.origin!==this.origin?(fe=$.href,ge=!0):fe=$.pathname+$.search+$.hash}else se=dS(R),fe=se;return{publicHref:fe,href:se,pathname:P,search:q,searchStr:ie,state:L,hash:ee??"",external:ge,unmaskOnReload:c.unmaskOnReload}},o=(c={},h)=>{const m=r(c);let p=h?r(h):void 0;if(!p){const g={};if(this.options.routeMasks){const v=pS(m.pathname,this.processedTree);if(v){Object.assign(g,v.rawParams);const{from:x,params:_,...S}=v.route,k=_===!1||_===null?{}:(_??!0)===!0?g:Object.assign(g,oa(_,g));h={from:s.from,...S,params:k},p=r(h)}}}return p&&(m.maskedLocation=p),m};return s.mask?o(s,{from:s.from,...s.mask}):o(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:r,...o})=>{const c=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(v=>{o.state[v]=this.latestLocation.state[v]});const g=Ua(o.state,this.latestLocation.state);return p.forEach(v=>{delete o.state[v]}),g},h=Ns(this.latestLocation.href)===Ns(o.href),m=this.commitLocationPromise;if(this.commitLocationPromise=Ii(()=>{m?.resolve()}),h&&c())this.load();else{let{maskedLocation:p,hashScrollIntoView:g,...v}=o;p&&(v={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=g??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[o.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:r,hashScrollIntoView:o,viewTransition:c,ignoreBlocker:h,href:m,...p}={})=>{if(m){const x=this.history.location.state.__TSR_index,_=oc(m,{__TSR_index:s?x:x+1}),S=new URL(_.pathname,this.origin),k=Df(this.rewrite,S);p.to=k.pathname,p.search=this.options.parseSearch(_.search),p.hash=_.hash.slice(1)}const g=this.buildLocation({...p,_includeValidateSearch:!0});this.pendingBuiltLocation=g;const v=this.commitLocation({...g,viewTransition:c,replace:s,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:h});return Promise.resolve().then(()=>{this.pendingBuiltLocation===g&&(this.pendingBuiltLocation=void 0)}),v},this.navigate=async({to:s,reloadDocument:r,href:o,publicHref:c,...h})=>{let m=!1;if(o)try{new URL(`${o}`),m=!0}catch{}if(m&&!r&&(r=!0),r){if(s!==void 0||!o){const g=this.buildLocation({to:s,...h});o=o??g.publicHref,c=c??g.publicHref}const p=!m&&c?c:o;if(uc(p))return Promise.resolve();if(!h.ignoreBlocker){const v=this.history.getBlockers?.()??[];for(const x of v)if(x?.blockerFn&&await x.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return h.replace?window.location.replace(p):window.location.href=p,Promise.resolve()}return this.buildAndCommitLocation({...h,href:o,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:s,cachedMatches:r.cachedMatches.filter(o=>!s.some(c=>c.id===o.id))}))},this.load=async s=>{let r,o,c;for(c=new Promise(m=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,g=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ba({resolvedLocation:g,location:p})}),this.emit({type:"onBeforeLoad",...Ba({resolvedLocation:g,location:p})}),await Vy({router:this,sync:s?.sync,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],x=[],_=[];hl(()=>{this.__store.setState(S=>{const k=S.matches,w=S.pendingMatches||S.matches;return v=k.filter(A=>!w.some(H=>H.id===A.id)),x=w.filter(A=>!k.some(H=>H.id===A.id)),_=w.filter(A=>k.some(H=>H.id===A.id)),{...S,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...v.filter(A=>A.status!=="error"&&A.status!=="notFound")]}}),this.clearExpiredCache()}),[[v,"onLeave"],[x,"onEnter"],[_,"onStay"]].forEach(([S,k])=>{S.forEach(w=>{this.looseRoutesById[w.routeId].options[k]?.(w)})})})})}})}catch(p){zn(p)?(r=p,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):pn(p)&&(o=p),this.__store.setState(g=>({...g,statusCode:r?r.status:o?404:g.matches.some(v=>v.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===c&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),m()})}),this.latestLoadPromise=c,await c;this.latestLoadPromise&&c!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.__store.state.matches.some(m=>m.status==="error")&&(h=500),h!==void 0&&this.__store.setState(m=>({...m,statusCode:h}))},this.startViewTransition=s=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,h=this.state.resolvedLocation,m=typeof r.types=="function"?r.types(Ba({resolvedLocation:h,location:c})):r.types;if(m===!1){s();return}o={update:s,types:m}}else o=s;document.startViewTransition(o)}else s()},this.updateMatch=(s,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(c=>c.id===s)?"pendingMatches":this.state.matches.some(c=>c.id===s)?"matches":this.state.cachedMatches.some(c=>c.id===s)?"cachedMatches":"";o&&this.__store.setState(c=>({...c,[o]:c[o]?.map(h=>h.id===s?r(h):h)}))})},this.getMatch=s=>{const r=o=>o.id===s;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=s=>{const r=o=>s?.filter?.(o)??!0?{...o,invalid:!0,...s?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const r=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const o=s.options._builtLocation??this.buildLocation(s.options),c=this.getParsedLocationHref(o);s.options.href=c,s.headers.set("Location",c)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const c=o.pathname+o.search+o.hash;s.options.href=c,s.headers.set("Location",c)}}catch{}return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const r=s?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(c=>!r(c))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const s=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const c=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=c};this.clearCache({filter:s})},this.loadRouteChunk=gx,this.preloadRoute=async s=>{const r=this.buildLocation(s);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:s});const c=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(m=>m.id)),h=new Set([...c,...this.state.cachedMatches.map(m=>m.id)]);hl(()=>{o.forEach(m=>{h.has(m.id)||this.__store.setState(p=>({...p,cachedMatches:[...p.cachedMatches,m]}))})});try{return o=await Vy({router:this,matches:o,location:r,preload:!0,updateMatch:(m,p)=>{c.has(m)?o=o.map(g=>g.id===m?p(g):g):this.updateMatch(m,p)}}),o}catch(m){if(zn(m))return m.options.reloadDocument?void 0:await this.preloadRoute({...m.options,_fromLocation:r});pn(m)||console.error(m);return}},this.matchRoute=(s,r)=>{const o={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},c=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const m=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,p=gS(c.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,m.pathname,this.processedTree);return!p||s.params&&!Ua(p.rawParams,s.params,{partial:!0})?!1:r?.includeSearch??!0?Ua(m.search,c.search,{partial:!0})?p.rawParams:!1:p.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(s=>s.status==="notFound"||s.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??US,parseSearch:t.parseSearch??DS}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:s,processedTree:r}){this.routesById=t,this.routesByPath=s,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,s){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:c,parsedParams:h}=r;let{matchedRoutes:m}=r,p=!1;(o?o.path!=="/"&&c["**"]:Ns(t.pathname))&&(this.options.notFoundRoute?m=[...m,this.options.notFoundRoute]:p=!0);const g=p?e1(this.options.notFoundMode,m):void 0,v=new Array(m.length),x=new Map(this.state.matches.map(_=>[_.routeId,_]));for(let _=0;_<m.length;_++){const S=m[_],k=v[_-1];let w,A,H;{const $=k?.search??t.search,xe=k?._strictSearch??void 0;try{const M=ac(S.options.validateSearch,{...$})??void 0;w={...$,...M},A={...xe,...M},H=void 0}catch(M){let J=M;if(M instanceof mc||(J=new mc(M.message,{cause:M})),s?.throwOnError)throw J;w=$,A={},H=J}}const X=S.options.loaderDeps?.({search:w})??"",P=X?JSON.stringify(X):"",{interpolatedPath:q,usedParams:ie}=cf({path:S.fullPath,params:c,decoder:this.pathParamsDecoder,server:this.isServer}),ee=S.id+q+P,D=this.getMatch(ee),L=x.get(S.id),R=D?._strictParams??ie;let se;if(!D)try{Iy(S,ie,h,R)}catch($){if(pn($)||zn($)?se=$:se=new XS($.message,{cause:$}),s?.throwOnError)throw se}Object.assign(c,R);const fe=L?"stay":"enter";let ge;if(D)ge={...D,cause:fe,params:L?.params??c,_strictParams:R,search:mn(L?L.search:D.search,w),_strictSearch:A};else{const $=S.options.loader||S.options.beforeLoad||S.lazyFn||yx(S)?"pending":"success";ge={id:ee,ssr:S.options.ssr,index:_,routeId:S.id,params:L?.params??c,_strictParams:R,pathname:q,updatedAt:Date.now(),search:L?mn(L.search,w):w,_strictSearch:A,searchError:void 0,status:$,isFetching:!1,error:void 0,paramsError:se,__routeContext:void 0,_nonReactive:{loadPromise:Ii()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:fe,loaderDeps:L?mn(L.loaderDeps,X):X,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:S.options.staticData||{},fullPath:S.fullPath}}s?.preload||(ge.globalNotFound=g===S.id),ge.searchError=H;const Ee=this.getParentContext(k);ge.context={...Ee,...ge.__routeContext,...ge.__beforeLoadContext},v[_]=ge}for(let _=0;_<v.length;_++){const S=v[_],k=this.looseRoutesById[S.routeId],w=this.getMatch(S.id),A=x.get(S.routeId);if(S.params=A?mn(A.params,c):c,!w){const H=v[_-1],X=this.getParentContext(H);if(k.options.context){const P={deps:S.loaderDeps,params:S.params,context:X??{},location:t,navigate:q=>this.navigate({...q,_fromLocation:t}),buildLocation:this.buildLocation,cause:S.cause,abortController:S.abortController,preload:!!S.preload,matches:v,routeId:k.id};S.__routeContext=k.options.context(P)??void 0}S.context={...X,...S.__routeContext,...S.__beforeLoadContext}}}return v}matchRoutesLightweight(t){const{matchedRoutes:s,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),c=gl(s),h={...t.search};for(const v of s)try{Object.assign(h,ac(v.options.validateSearch,h))}catch{}const m=gl(this.state.matches),p=m&&m.routeId===c.id&&t.pathname===this.state.location.pathname;let g;if(p)g=m.params;else{const v={...r};for(const x of s)try{Iy(x,r,o??{},v)}catch{}g=v}return{matchedRoutes:s,fullPath:c.fullPath,search:h,params:g}}}class mc extends Error{}class XS extends Error{}function KS(a){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:a,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ac(a,t){if(a==null)return{};if("~standard"in a){const s=a["~standard"].validate(t);if(s instanceof Promise)throw new mc("Async validation not supported");if(s.issues)throw new mc(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in a?a.parse(t):typeof a=="function"?a(t):{}}function FS({pathname:a,routesById:t,processedTree:s}){const r={},o=Ns(a);let c,h;const m=yS(o,s,!0);return m&&(c=m.route,Object.assign(r,m.rawParams),h=Object.assign({},m.parsedParams)),{matchedRoutes:m?.branch||[t[En]],routeParams:r,foundRoute:c,parsedParams:h}}function JS({search:a,dest:t,destRoutes:s,_includeValidateSearch:r}){return WS(s)(a,t,r??!1)}function WS(a){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of a){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const c=({search:h,next:m})=>{let p=h;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(p=o.options.preSearchFilters.reduce((v,x)=>x(v),h));const g=m(p);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,x)=>x(v),g):g};t.middlewares.push(c)}if(o.options.validateSearch){const c=({search:h,next:m})=>{const p=m(h);if(!t._includeValidateSearch)return p;try{return{...p,...ac(o.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(c)}}const s=({search:o})=>{const c=t.dest;return c.search?c.search===!0?o:oa(c.search,o):{}};t.middlewares.push(s);const r=(o,c,h)=>{if(o>=h.length)return c;const m=h[o];return m({search:c,next:g=>r(o+1,g,h)})};return function(c,h,m){return t.dest=h,t._includeValidateSearch=m,r(0,c,t.middlewares)}}function e1(a,t){if(a!=="root")for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.children)return r.id}return En}function Iy(a,t,s,r){const o=a.options.params?.parse??a.options.parseParams;if(o)if(a.options.skipRouteOnParseError)for(const c in t)c in s&&(r[c]=s[c]);else{const c=o(r);Object.assign(r,c)}}const t1="Error preloading route! ☝️";class bx{constructor(t){if(this.init=s=>{this.originalIndex=s.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=En:this.parentRoute||Rs(!1);let c=o?En:r?.path;c&&c!=="/"&&(c=ux(c));const h=r?.id||c;let m=o?En:nc([this.parentRoute.id===En?"":this.parentRoute.id,h]);c===En&&(c="/"),m!==En&&(m=nc(["/",m]));const p=m===En?"/":nc([this.parentRoute.fullPath,c]);this._path=c,this._id=m,this._fullPath=p,this._to=Ns(p)},this.addChildren=s=>this._addFileChildren(s),this._addFileChildren=s=>(Array.isArray(s)&&(this.children=s),typeof s=="object"&&s!==null&&(this.children=Object.values(s)),this),this._addFileTypes=()=>this,this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.redirect=s=>$S({from:this.fullPath,...s}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class n1 extends bx{constructor(t){super(t)}}const Yo=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function df(a){const t=Q.useRef({value:a,prev:null}),s=t.current.value;return a!==s&&(t.current={value:a,prev:s}),t.current.prev}function s1(a,t,s={},r={}){Q.useEffect(()=>{if(!a.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([c])=>{t(c)},s);return o.observe(a.current),()=>{o.disconnect()}},[t,s,r.disabled,a])}function a1(a){const t=Q.useRef(null);return Q.useImperativeHandle(a,()=>t.current,[]),t}function dh(a){const t=a.errorComponent??fh;return d.jsx(i1,{getResetKey:a.getResetKey,onCatch:a.onCatch,children:({error:s,reset:r})=>s?Q.createElement(t,{error:s,reset:r}):a.children})}class i1 extends Q.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,s){s.error&&s.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,s){this.props.onCatch&&this.props.onCatch(t,s)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function fh({error:a}){const[t,s]=Q.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:t?"Hide Error":"Show Error"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:a.message?d.jsx("code",{children:a.message}):null})}):null]})}function r1({children:a,fallback:t=null}){return _x()?d.jsx(ha.Fragment,{children:a}):d.jsx(ha.Fragment,{children:t})}function _x(){return ha.useSyncExternalStore(l1,()=>!0,()=>!1)}function l1(){return()=>{}}var ff={exports:{}},hf={},mf={exports:{}},pf={};var Zy;function o1(){if(Zy)return pf;Zy=1;var a=Tl();function t(x,_){return x===_&&(x!==0||1/x===1/_)||x!==x&&_!==_}var s=typeof Object.is=="function"?Object.is:t,r=a.useState,o=a.useEffect,c=a.useLayoutEffect,h=a.useDebugValue;function m(x,_){var S=_(),k=r({inst:{value:S,getSnapshot:_}}),w=k[0].inst,A=k[1];return c(function(){w.value=S,w.getSnapshot=_,p(w)&&A({inst:w})},[x,S,_]),o(function(){return p(w)&&A({inst:w}),x(function(){p(w)&&A({inst:w})})},[x]),h(S),S}function p(x){var _=x.getSnapshot;x=x.value;try{var S=_();return!s(x,S)}catch{return!0}}function g(x,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:m;return pf.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:v,pf}var Hy;function c1(){return Hy||(Hy=1,mf.exports=o1()),mf.exports}var Py;function u1(){if(Py)return hf;Py=1;var a=Tl(),t=c1();function s(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:s,o=t.useSyncExternalStore,c=a.useRef,h=a.useEffect,m=a.useMemo,p=a.useDebugValue;return hf.useSyncExternalStoreWithSelector=function(g,v,x,_,S){var k=c(null);if(k.current===null){var w={hasValue:!1,value:null};k.current=w}else w=k.current;k=m(function(){function H(ee){if(!X){if(X=!0,P=ee,ee=_(ee),S!==void 0&&w.hasValue){var D=w.value;if(S(D,ee))return q=D}return q=ee}if(D=q,r(P,ee))return D;var L=_(ee);return S!==void 0&&S(D,L)?(P=ee,D):(P=ee,q=L)}var X=!1,P,q,ie=x===void 0?null:x;return[function(){return H(v())},ie===null?void 0:function(){return H(ie())}]},[v,x,_,S]);var A=o(g,k[0],k[1]);return h(function(){w.hasValue=!0,w.value=A},[A]),p(A),A},hf}var Qy;function d1(){return Qy||(Qy=1,ff.exports=u1()),ff.exports}var f1=d1();function h1(a,t=r=>r,s={}){const r=s.equal??m1;return f1.useSyncExternalStoreWithSelector(a.subscribe,()=>a.state,()=>a.state,t,r)}function m1(a,t){if(Object.is(a,t))return!0;if(typeof a!="object"||a===null||typeof t!="object"||t===null)return!1;if(a instanceof Map&&t instanceof Map){if(a.size!==t.size)return!1;for(const[r,o]of a)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(a instanceof Set&&t instanceof Set){if(a.size!==t.size)return!1;for(const r of a)if(!t.has(r))return!1;return!0}if(a instanceof Date&&t instanceof Date)return a.getTime()===t.getTime();const s=Gy(a);if(s.length!==Gy(t).length)return!1;for(let r=0;r<s.length;r++)if(!Object.prototype.hasOwnProperty.call(t,s[r])||!Object.is(a[s[r]],t[s[r]]))return!1;return!0}function Gy(a){return Object.keys(a).concat(Object.getOwnPropertySymbols(a))}const gf=Q.createContext(null);function Sx(){return typeof document>"u"?gf:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=gf,gf)}function Zt(a){const t=Q.useContext(Sx());return a?.warn,t}function Nt(a){const t=Zt({warn:a?.router===void 0}),s=a?.router||t,r=Q.useRef(void 0);return h1(s.__store,o=>{if(a?.select){if(a.structuralSharing??s.options.defaultStructuralSharing){const c=mn(r.current,a.select(o));return r.current=c,c}return a.select(o)}return o})}const Dc=Q.createContext(void 0),p1=Q.createContext(void 0);function Jn(a){const t=Q.useContext(a.from?p1:Dc);return Nt({select:r=>{const o=r.matches.find(c=>a.from?a.from===c.routeId:c.id===t);if(Rs(!((a.shouldThrow??!0)&&!o),`Could not find ${a.from?`an active match from "${a.from}"`:"a nearest match!"}`),o!==void 0)return a.select?a.select(o):o},structuralSharing:a.structuralSharing})}function hh(a){return Jn({from:a.from,strict:a.strict,structuralSharing:a.structuralSharing,select:t=>a.select?a.select(t.loaderData):t.loaderData})}function mh(a){const{select:t,...s}=a;return Jn({...s,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function ph(a){return Jn({from:a.from,shouldThrow:a.shouldThrow,structuralSharing:a.structuralSharing,strict:a.strict,select:t=>{const s=a.strict===!1?t.params:t._strictParams;return a.select?a.select(s):s}})}function gh(a){return Jn({from:a.from,strict:a.strict,shouldThrow:a.shouldThrow,structuralSharing:a.structuralSharing,select:t=>a.select?a.select(t.search):t.search})}function jl(a){const t=Zt();return Q.useCallback(s=>t.navigate({...s,from:s.from??a?.from}),[a?.from,t])}var g1=ax();function y1(a,t){const s=Zt(),r=a1(t),{activeProps:o,inactiveProps:c,activeOptions:h,to:m,preload:p,preloadDelay:g,hashScrollIntoView:v,replace:x,startTransition:_,resetScroll:S,viewTransition:k,children:w,target:A,disabled:H,style:X,className:P,onClick:q,onFocus:ie,onMouseEnter:ee,onMouseLeave:D,onTouchStart:L,ignoreBlocker:R,params:se,search:fe,hash:ge,state:Ee,mask:$,reloadDocument:xe,unsafeRelative:M,from:J,_fromLocation:G,...Ie}=a,Ze=_x(),N=Nt({select:ct=>ct.location.search,structuralSharing:!0}),I=a.from,Y=Q.useMemo(()=>({...a,from:I}),[s,N,I,a._fromLocation,a.hash,a.to,a.search,a.params,a.state,a.mask,a.unsafeRelative]),W=Q.useMemo(()=>s.buildLocation({...Y}),[s,Y]),_e=W.maskedLocation?W.maskedLocation.publicHref:W.publicHref,Ce=W.maskedLocation?W.maskedLocation.external:W.external,ye=Q.useMemo(()=>w1(_e,Ce,s.history,H),[H,Ce,_e,s.history]),ht=Q.useMemo(()=>{if(ye?.external)return uc(ye.href)?void 0:ye.href;if(!k1(m)&&!(typeof m!="string"||m.indexOf(":")===-1))try{return new URL(m),uc(m)?void 0:m}catch{}},[m,ye]),Xe=Nt({select:ct=>{if(ht)return!1;if(h?.exact){if(!wS(ct.location.pathname,W.pathname,s.basepath))return!1}else{const Lt=fc(ct.location.pathname,s.basepath),Vt=fc(W.pathname,s.basepath);if(!(Lt.startsWith(Vt)&&(Lt.length===Vt.length||Lt[Vt.length]==="/")))return!1}return(h?.includeSearch??!0)&&!Ua(ct.location.search,W.search,{partial:!h?.exact,ignoreUndefined:!h?.explicitUndefined})?!1:h?.includeHash?Ze&&ct.location.hash===W.hash:!0}}),Ht=Xe?oa(o,{})??v1:yf,sn=Xe?yf:oa(c,{})??yf,Un=[P,Ht.className,sn.className].filter(Boolean).join(" "),ar=(X||Ht.style||sn.style)&&{...X,...Ht.style,...sn.style},[ss,Pa]=Q.useState(!1),Qa=Q.useRef(!1),zs=a.reloadDocument||ht?!1:p??s.options.defaultPreload,Ga=g??s.options.defaultPreloadDelay??0,Bn=Q.useCallback(()=>{s.preloadRoute({...Y}).catch(ct=>{console.warn(ct),console.warn(t1)})},[s,Y]),ir=Q.useCallback(ct=>{ct?.isIntersecting&&Bn()},[Bn]);s1(r,ir,S1,{disabled:!!H||zs!=="viewport"}),Q.useEffect(()=>{Qa.current||!H&&zs==="render"&&(Bn(),Qa.current=!0)},[H,Bn,zs]);const rr=ct=>{const Lt=ct.currentTarget.getAttribute("target"),Vt=A!==void 0?A:Lt;if(!H&&!T1(ct)&&!ct.defaultPrevented&&(!Vt||Vt==="_self")&&ct.button===0){ct.preventDefault(),g1.flushSync(()=>{Pa(!0)});const Cl=s.subscribe("onResolved",()=>{Cl(),Pa(!1)});s.navigate({...Y,replace:x,resetScroll:S,hashScrollIntoView:v,startTransition:_,viewTransition:k,ignoreBlocker:R})}};if(ht)return{...Ie,ref:r,href:ht,...w&&{children:w},...A&&{target:A},...H&&{disabled:H},...X&&{style:X},...P&&{className:P},...q&&{onClick:q},...ie&&{onFocus:ie},...ee&&{onMouseEnter:ee},...D&&{onMouseLeave:D},...L&&{onTouchStart:L}};const Nl=ct=>{H||zs&&Bn()},Uc=Nl,Pt=ct=>{if(!(H||!zs))if(!Ga)Bn();else{const Lt=ct.target;if(al.has(Lt))return;const Vt=setTimeout(()=>{al.delete(Lt),Bn()},Ga);al.set(Lt,Vt)}},Bc=ct=>{if(H||!zs||!Ga)return;const Lt=ct.target,Vt=al.get(Lt);Vt&&(clearTimeout(Vt),al.delete(Lt))};return{...Ie,...Ht,...sn,href:ye?.href,ref:r,onClick:il([q,rr]),onFocus:il([ie,Nl]),onMouseEnter:il([ee,Pt]),onMouseLeave:il([D,Bc]),onTouchStart:il([L,Uc]),disabled:!!H,target:A,...ar&&{style:ar},...Un&&{className:Un},...H&&x1,...Xe&&b1,...Ze&&ss&&_1}}const yf={},v1={className:"active"},x1={role:"link","aria-disabled":!0},b1={"data-status":"active","aria-current":"page"},_1={"data-transitioning":"transitioning"},al=new WeakMap,S1={rootMargin:"100px"},il=a=>t=>{for(const s of a)if(s){if(t.defaultPrevented)return;s(t)}};function w1(a,t,s,r){if(!r)return t?{href:a,external:!0}:{href:s.createHref(a)||"/",external:!1}}function k1(a){if(typeof a!="string")return!1;const t=a.charCodeAt(0);return t===47?a.charCodeAt(1)!==47:t===46}const yh=Q.forwardRef((a,t)=>{const{_asChild:s,...r}=a,{type:o,...c}=y1(r,t),h=typeof r.children=="function"?r.children({isActive:c["data-status"]==="active"}):r.children;if(!s){const{disabled:m,...p}=c;return Q.createElement("a",p,h)}return Q.createElement(s,c,h)});function T1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}let j1=class extends bx{constructor(t){super(t),this.useMatch=s=>Jn({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Jn({...s,from:this.id,select:r=>s?.select?s.select(r.context):r.context}),this.useSearch=s=>gh({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>ph({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>mh({...s,from:this.id}),this.useLoaderData=s=>hh({...s,from:this.id}),this.useNavigate=()=>jl({from:this.fullPath}),this.Link=ha.forwardRef((s,r)=>d.jsx(yh,{ref:r,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}};function N1(a){return new j1(a)}class C1 extends n1{constructor(t){super(t),this.useMatch=s=>Jn({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Jn({...s,from:this.id,select:r=>s?.select?s.select(r.context):r.context}),this.useSearch=s=>gh({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>ph({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>mh({...s,from:this.id}),this.useLoaderData=s=>hh({...s,from:this.id}),this.useNavigate=()=>jl({from:this.fullPath}),this.Link=ha.forwardRef((s,r)=>d.jsx(yh,{ref:r,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function R1(a){return new C1(a)}function Zn(a){return typeof a=="object"?new Yy(a,{silent:!0}).createRoute(a):new Yy(a,{silent:!0}).createRoute}class Yy{constructor(t,s){this.path=t,this.createRoute=r=>{this.silent;const o=N1(r);return o.isRoot=!1,o},this.silent=s?.silent}}class Xy{constructor(t){this.useMatch=s=>Jn({select:s?.select,from:this.options.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Jn({from:this.options.id,select:r=>s?.select?s.select(r.context):r.context}),this.useSearch=s=>gh({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useParams=s=>ph({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>mh({...s,from:this.options.id}),this.useLoaderData=s=>hh({...s,from:this.options.id}),this.useNavigate=()=>{const s=Zt();return jl({from:s.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Ky(a){return typeof a=="object"?new Xy(a):t=>new Xy({id:a,...t})}function A1(){const a=Zt(),t=Q.useRef({router:a,mounted:!1}),[s,r]=Q.useState(!1),{hasPendingMatches:o,isLoading:c}=Nt({select:x=>({isLoading:x.isLoading,hasPendingMatches:x.matches.some(_=>_.status==="pending")}),structuralSharing:!0}),h=df(c),m=c||s||o,p=df(m),g=c||o,v=df(g);return a.startTransition=x=>{r(!0),Q.startTransition(()=>{x(),r(!1)})},Q.useEffect(()=>{const x=a.history.subscribe(a.load),_=a.buildLocation({to:a.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ns(a.latestLocation.publicHref)!==Ns(_.publicHref)&&a.commitLocation({..._,replace:!0}),()=>{x()}},[a,a.history]),Yo(()=>{if(typeof window<"u"&&a.ssr||t.current.router===a&&t.current.mounted)return;t.current={router:a,mounted:!0},(async()=>{try{await a.load()}catch(_){console.error(_)}})()},[a]),Yo(()=>{h&&!c&&a.emit({type:"onLoad",...Ba(a.state)})},[h,a,c]),Yo(()=>{v&&!g&&a.emit({type:"onBeforeRouteMount",...Ba(a.state)})},[g,v,a]),Yo(()=>{if(p&&!m){const x=Ba(a.state);a.emit({type:"onResolved",...x}),a.__store.setState(_=>({..._,status:"idle",resolvedLocation:_.location})),x.hrefChanged&&OS(a)}},[m,p,a]),null}function E1(a){const t=Nt({select:s=>`not-found-${s.location.pathname}-${s.status}`});return d.jsx(dh,{getResetKey:()=>t,onCatch:(s,r)=>{if(pn(s))a.onCatch?.(s,r);else throw s},errorComponent:({error:s})=>{if(pn(s))return a.fallback?.(s);throw s},children:a.children})}function z1(){return d.jsx("p",{children:"Not Found"})}function Mi(a){return d.jsx(d.Fragment,{children:a.children})}function wx(a,t,s){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...s}):a.options.defaultNotFoundComponent?d.jsx(a.options.defaultNotFoundComponent,{...s}):d.jsx(z1,{})}function O1(){return Zt().isScrollRestoring,null}const kx=Q.memo(function({matchId:t}){const s=Zt(),r=Nt({select:w=>{const A=w.matches.findIndex(X=>X.id===t),H=w.matches[A];return Rs(H),{routeId:H.routeId,ssr:H.ssr,_displayPending:H._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[A-1]?.routeId}},structuralSharing:!0}),o=s.routesById[r.routeId],c=o.options.pendingComponent??s.options.defaultPendingComponent,h=c?d.jsx(c,{}):null,m=o.options.errorComponent??s.options.defaultErrorComponent,p=o.options.onCatch??s.options.defaultOnCatch,g=o.isRoot?o.options.notFoundComponent??s.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=r.ssr===!1||r.ssr==="data-only",x=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??c??(o.options.errorComponent?.preload||v))?Q.Suspense:Mi,_=m?dh:Mi,S=g?E1:Mi,k=o.isRoot?o.options.shellComponent??Mi:Mi;return d.jsxs(k,{children:[d.jsx(Dc.Provider,{value:t,children:d.jsx(x,{fallback:h,children:d.jsx(_,{getResetKey:()=>r.resetKey,errorComponent:m||fh,onCatch:(w,A)=>{if(pn(w))throw w;p?.(w,A)},children:d.jsx(S,{fallback:w=>{if(!g||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!o.isRoot)throw w;return Q.createElement(g,w)},children:v||r._displayPending?d.jsx(r1,{fallback:h,children:d.jsx(Fy,{matchId:t})}):d.jsx(Fy,{matchId:t})})})})}),r.parentRouteId===En&&s.options.scrollRestoration?d.jsxs(d.Fragment,{children:[d.jsx(M1,{}),d.jsx(O1,{})]}):null]})});function M1(){const a=Zt(),t=Q.useRef(void 0);return d.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==a.latestLocation.href)&&(a.emit({type:"onRendered",...Ba(a.state)}),t.current=a.latestLocation)}},a.latestLocation.state.__TSR_key)}const Fy=Q.memo(function({matchId:t}){const s=Zt(),{match:r,key:o,routeId:c}=Nt({select:p=>{const g=p.matches.find(k=>k.id===t),v=g.routeId,_=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:g.loaderDeps,params:g._strictParams,search:g._strictSearch});return{key:_?JSON.stringify(_):void 0,routeId:v,match:{id:g.id,status:g.status,error:g.error,invalid:g.invalid,_forcePending:g._forcePending,_displayPending:g._displayPending}}},structuralSharing:!0}),h=s.routesById[c],m=Q.useMemo(()=>{const p=h.options.component??s.options.defaultComponent;return p?d.jsx(p,{},o):d.jsx(Tx,{})},[o,h.options.component,s.options.defaultComponent]);if(r._displayPending)throw s.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw s.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const p=h.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const g=s.getMatch(r.id);if(g&&!g._nonReactive.minPendingPromise){const v=Ii();g._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),g._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Rs(pn(r.error)),wx(s,h,r.error);if(r.status==="redirected")throw Rs(zn(r.error)),s.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return m}),Tx=Q.memo(function(){const t=Zt(),s=Q.useContext(Dc),r=Nt({select:g=>g.matches.find(v=>v.id===s)?.routeId}),o=t.routesById[r],c=Nt({select:g=>{const x=g.matches.find(_=>_.id===s);return Rs(x),x.globalNotFound}}),h=Nt({select:g=>{const v=g.matches,x=v.findIndex(_=>_.id===s);return v[x+1]?.id}}),m=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(c)return wx(t,o,void 0);if(!h)return null;const p=d.jsx(kx,{matchId:h});return r===En?d.jsx(Q.Suspense,{fallback:m,children:p}):p});function L1(){const a=Zt(),s=a.routesById[En].options.pendingComponent??a.options.defaultPendingComponent,r=s?d.jsx(s,{}):null,o=typeof document<"u"&&a.ssr?Mi:Q.Suspense,c=d.jsxs(o,{fallback:r,children:[d.jsx(A1,{}),d.jsx(D1,{})]});return a.options.InnerWrap?d.jsx(a.options.InnerWrap,{children:c}):c}function D1(){const a=Zt(),t=Nt({select:o=>o.matches[0]?.id}),s=Nt({select:o=>o.loadedAt}),r=t?d.jsx(kx,{matchId:t}):null;return d.jsx(Dc.Provider,{value:t,children:a.options.disableGlobalCatchBoundary?r:d.jsx(dh,{getResetKey:()=>s,errorComponent:fh,onCatch:o=>{o.message||o.toString()},children:r})})}const U1=a=>new B1(a);class B1 extends YS{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Zn,globalThis.createLazyFileRoute=Ky):typeof window<"u"&&(window.createFileRoute=Zn,window.createLazyFileRoute=Ky);function q1({router:a,children:t,...s}){Object.keys(s).length>0&&a.update({...a.options,...s,context:{...a.options.context,...s.context}});const r=Sx(),o=d.jsx(r.Provider,{value:a,children:t});return a.options.Wrap?d.jsx(a.options.Wrap,{children:o}):o}function $1({router:a,...t}){return d.jsx(q1,{router:a,...t,children:d.jsx(L1,{})})}function jx({tag:a,attrs:t,children:s,nonce:r}){switch(a){case"title":return d.jsx("title",{...t,suppressHydrationWarning:!0,children:s});case"meta":return d.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return d.jsx("link",{...t,nonce:r,suppressHydrationWarning:!0});case"style":return d.jsx("style",{...t,dangerouslySetInnerHTML:{__html:s},nonce:r});case"script":return d.jsx(V1,{attrs:t,children:s});default:return null}}function V1({attrs:a,children:t}){Zt();const s=typeof a?.type=="string"&&a.type!==""&&a.type!=="text/javascript"&&a.type!=="module";Q.useEffect(()=>{if(!s){if(a?.src){const r=(()=>{try{const h=document.baseURI||window.location.href;return new URL(a.src,h).href}catch{return a.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(h=>h.src===r))return;const c=document.createElement("script");for(const[h,m]of Object.entries(a))h!=="suppressHydrationWarning"&&m!==void 0&&m!==!1&&c.setAttribute(h,typeof m=="boolean"?"":String(m));return document.head.appendChild(c),()=>{c.parentNode&&c.parentNode.removeChild(c)}}if(typeof t=="string"){const r=typeof a?.type=="string"?a.type:"text/javascript",o=typeof a?.nonce=="string"?a.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(m=>{if(!(m instanceof HTMLScriptElement))return!1;const p=m.getAttribute("type")??"text/javascript",g=m.getAttribute("nonce")??void 0;return m.textContent===t&&p===r&&g===o}))return;const h=document.createElement("script");if(h.textContent=t,a)for(const[m,p]of Object.entries(a))m!=="suppressHydrationWarning"&&p!==void 0&&p!==!1&&h.setAttribute(m,typeof p=="boolean"?"":String(p));return document.head.appendChild(h),()=>{h.parentNode&&h.parentNode.removeChild(h)}}}},[a,t,s]);{if(s&&typeof t=="string")return d.jsx("script",{...a,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});const{src:r,...o}=a||{};return d.jsx("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:""},...o})}}const I1=()=>{const a=Zt(),t=a.options.ssr?.nonce,s=Nt({select:p=>p.matches.map(g=>g.meta).filter(Boolean)}),r=Q.useMemo(()=>{const p=[],g={};let v;for(let x=s.length-1;x>=0;x--){const _=s[x];for(let S=_.length-1;S>=0;S--){const k=_[S];if(k)if(k.title)v||(v={tag:"title",children:k.title});else if("script:ld+json"in k)try{const w=JSON.stringify(k["script:ld+json"]);p.push({tag:"script",attrs:{type:"application/ld+json"},children:uS(w)})}catch{}else{const w=k.name??k.property;if(w){if(g[w])continue;g[w]=!0}p.push({tag:"meta",attrs:{...k,nonce:t}})}}}return v&&p.push(v),t&&p.push({tag:"meta",attrs:{property:"csp-nonce",content:t}}),p.reverse(),p},[s,t]),o=Nt({select:p=>{const g=p.matches.map(_=>_.links).filter(Boolean).flat(1).map(_=>({tag:"link",attrs:{..._,nonce:t}})),v=a.ssr?.manifest,x=p.matches.map(_=>v?.routes[_.routeId]?.assets??[]).filter(Boolean).flat(1).filter(_=>_.tag==="link").map(_=>({tag:"link",attrs:{..._.attrs,suppressHydrationWarning:!0,nonce:t}}));return[...g,...x]},structuralSharing:!0}),c=Nt({select:p=>{const g=[];return p.matches.map(v=>a.looseRoutesById[v.routeId]).forEach(v=>a.ssr?.manifest?.routes[v.id]?.preloads?.filter(Boolean).forEach(x=>{g.push({tag:"link",attrs:{rel:"modulepreload",href:x,nonce:t}})})),g},structuralSharing:!0}),h=Nt({select:p=>p.matches.map(g=>g.styles).flat(1).filter(Boolean).map(({children:g,...v})=>({tag:"style",attrs:{...v,nonce:t},children:g})),structuralSharing:!0}),m=Nt({select:p=>p.matches.map(g=>g.headScripts).flat(1).filter(Boolean).map(({children:g,...v})=>({tag:"script",attrs:{...v,nonce:t},children:g})),structuralSharing:!0});return Z1([...r,...c,...o,...h,...m],p=>JSON.stringify(p))};function Z1(a,t){const s=new Set;return a.filter(r=>{const o=t(r);return s.has(o)?!1:(s.add(o),!0)})}function H1(){const a=I1(),s=Zt().options.ssr?.nonce;return d.jsx(d.Fragment,{children:a.map(r=>Q.createElement(jx,{...r,key:`tsr-meta-${JSON.stringify(r)}`,nonce:s}))})}const P1=()=>{const a=Zt(),t=a.options.ssr?.nonce,s=Nt({select:h=>{const m=[],p=a.ssr?.manifest;return p?(h.matches.map(g=>a.looseRoutesById[g.routeId]).forEach(g=>p.routes[g.id]?.assets?.filter(v=>v.tag==="script").forEach(v=>{m.push({tag:"script",attrs:{...v.attrs,nonce:t},children:v.children})})),m):[]},structuralSharing:!0}),{scripts:r}=Nt({select:h=>({scripts:h.matches.map(m=>m.scripts).flat(1).filter(Boolean).map(({children:m,...p})=>({tag:"script",attrs:{...p,suppressHydrationWarning:!0,nonce:t},children:m}))}),structuralSharing:!0});let o;a.serverSsr&&(o=a.serverSsr.takeBufferedScripts());const c=[...r,...s];return o&&c.unshift(o),d.jsx(d.Fragment,{children:c.map((h,m)=>Q.createElement(jx,{...h,key:`tsr-scripts-${h.tag}-${m}`}))})};var Kn=[],An=[],Q1=Uint8Array,vf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var zi=0,G1=vf.length;zi<G1;++zi)Kn[zi]=vf[zi],An[vf.charCodeAt(zi)]=zi;An[45]=62;An[95]=63;function Y1(a){var t=a.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=a.indexOf("=");s===-1&&(s=t);var r=s===t?0:4-s%4;return[s,r]}function X1(a,t,s){return(t+s)*3/4-s}function vl(a){var t,s=Y1(a),r=s[0],o=s[1],c=new Q1(X1(a,r,o)),h=0,m=o>0?r-4:r,p;for(p=0;p<m;p+=4)t=An[a.charCodeAt(p)]<<18|An[a.charCodeAt(p+1)]<<12|An[a.charCodeAt(p+2)]<<6|An[a.charCodeAt(p+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=t&255;return o===2&&(t=An[a.charCodeAt(p)]<<2|An[a.charCodeAt(p+1)]>>4,c[h++]=t&255),o===1&&(t=An[a.charCodeAt(p)]<<10|An[a.charCodeAt(p+1)]<<4|An[a.charCodeAt(p+2)]>>2,c[h++]=t>>8&255,c[h++]=t&255),c}function K1(a){return Kn[a>>18&63]+Kn[a>>12&63]+Kn[a>>6&63]+Kn[a&63]}function F1(a,t,s){for(var r,o=[],c=t;c<s;c+=3)r=(a[c]<<16&16711680)+(a[c+1]<<8&65280)+(a[c+2]&255),o.push(K1(r));return o.join("")}function xl(a){for(var t,s=a.length,r=s%3,o=[],c=16383,h=0,m=s-r;h<m;h+=c)o.push(F1(a,h,h+c>m?m:h+c));return r===1?(t=a[s-1],o.push(Kn[t>>2]+Kn[t<<4&63]+"==")):r===2&&(t=(a[s-2]<<8)+a[s-1],o.push(Kn[t>>10]+Kn[t>>4&63]+Kn[t<<2&63]+"=")),o.join("")}function js(a){if(a===void 0)return{};if(!Nx(a))throw new Error(`The arguments to a Convex function must be an object. Received: ${a}`);return a}function J1(a){if(typeof a>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof a!="string")throw new Error(`Invalid deployment address: found ${a}".`);if(!(a.startsWith("http:")||a.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${a}".`);try{new URL(a)}catch{throw new Error(`Invalid deployment address: "${a}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(a.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${a}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function Nx(a){const t=typeof a=="object",s=Object.getPrototypeOf(a),r=s===null||s===Object.prototype||s?.constructor?.name==="Object";return t&&r}const Cx=!0,Hi=BigInt("-9223372036854775808"),vh=BigInt("9223372036854775807"),Uf=BigInt("0"),W1=BigInt("8"),ew=BigInt("256");function Rx(a){return Number.isNaN(a)||!Number.isFinite(a)||Object.is(a,-0)}function tw(a){a<Uf&&(a-=Hi+Hi);let t=a.toString(16);t.length%2===1&&(t="0"+t);const s=new Uint8Array(new ArrayBuffer(8));let r=0;for(const o of t.match(/.{2}/g).reverse())s.set([parseInt(o,16)],r++),a>>=W1;return xl(s)}function nw(a){const t=vl(a);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let s=Uf,r=Uf;for(const o of t)s+=BigInt(o)*ew**r,r++;return s>vh&&(s+=Hi+Hi),s}function sw(a){if(a<Hi||vh<a)throw new Error(`BigInt ${a} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,a,!0),xl(new Uint8Array(t))}function aw(a){const t=vl(a);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}const iw=DataView.prototype.setBigInt64?sw:tw,rw=DataView.prototype.getBigInt64?aw:nw,Jy=1024;function Ax(a){if(a.length>Jy)throw new Error(`Field name ${a} exceeds maximum field name length ${Jy}.`);if(a.startsWith("$"))throw new Error(`Field name ${a} starts with a '$', which is reserved.`);for(let t=0;t<a.length;t+=1){const s=a.charCodeAt(t);if(s<32||s>=127)throw new Error(`Field name ${a} has invalid character '${a[t]}': Field names can only contain non-control ASCII characters`)}}function Pi(a){if(a===null||typeof a=="boolean"||typeof a=="number"||typeof a=="string")return a;if(Array.isArray(a))return a.map(r=>Pi(r));if(typeof a!="object")throw new Error(`Unexpected type of ${a}`);const t=Object.entries(a);if(t.length===1){const r=t[0][0];if(r==="$bytes"){if(typeof a.$bytes!="string")throw new Error(`Malformed $bytes field on ${a}`);return vl(a.$bytes).buffer}if(r==="$integer"){if(typeof a.$integer!="string")throw new Error(`Malformed $integer field on ${a}`);return rw(a.$integer)}if(r==="$float"){if(typeof a.$float!="string")throw new Error(`Malformed $float field on ${a}`);const o=vl(a.$float);if(o.byteLength!==8)throw new Error(`Received ${o.byteLength} bytes, expected 8 for $float`);const h=new DataView(o.buffer).getFloat64(0,Cx);if(!Rx(h))throw new Error(`Float ${h} should be encoded as a number`);return h}if(r==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(r==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const s={};for(const[r,o]of Object.entries(a))Ax(r),s[r]=Pi(o);return s}const Wy=16384;function ml(a){const t=JSON.stringify(a,(s,r)=>r===void 0?"undefined":typeof r=="bigint"?`${r.toString()}n`:r);if(t.length>Wy){const s="[...truncated]";let r=Wy-s.length;const o=t.codePointAt(r-1);return o!==void 0&&o>65535&&(r-=1),t.substring(0,r)+s}return t}function Bf(a,t,s,r){if(a===void 0){const h=s&&` (present at path ${s} in original object ${ml(t)})`;throw new Error(`undefined is not a valid Convex value${h}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(a===null)return a;if(typeof a=="bigint"){if(a<Hi||vh<a)throw new Error(`BigInt ${a} does not fit into a 64-bit signed integer.`);return{$integer:iw(a)}}if(typeof a=="number")if(Rx(a)){const h=new ArrayBuffer(8);return new DataView(h).setFloat64(0,a,Cx),{$float:xl(new Uint8Array(h))}}else return a;if(typeof a=="boolean"||typeof a=="string")return a;if(a instanceof ArrayBuffer)return{$bytes:xl(new Uint8Array(a))};if(Array.isArray(a))return a.map((h,m)=>Bf(h,t,s+`[${m}]`));if(a instanceof Set)throw new Error(xf(s,"Set",[...a],t));if(a instanceof Map)throw new Error(xf(s,"Map",[...a],t));if(!Nx(a)){const h=a?.constructor?.name,m=h?`${h} `:"";throw new Error(xf(s,m,a,t))}const o={},c=Object.entries(a);c.sort(([h,m],[p,g])=>h===p?0:h<p?-1:1);for(const[h,m]of c)m!==void 0&&(Ax(h),o[h]=Bf(m,t,s+`.${h}`));return o}function xf(a,t,s,r){return a?`${t}${ml(s)} is not a supported Convex type (present at path ${a} in original object ${ml(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${ml(s)} is not a supported Convex type.`}function Wn(a){return Bf(a,a,"")}var lw=Object.defineProperty,ow=(a,t,s)=>t in a?lw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,bf=(a,t,s)=>ow(a,typeof t!="symbol"?t+"":t,s),ev,tv;const cw=Symbol.for("ConvexError");class qf extends(tv=Error,ev=cw,tv){constructor(t){super(typeof t=="string"?t:ml(t)),bf(this,"name","ConvexError"),bf(this,"data"),bf(this,ev,!0),this.data=t}}const Ex=()=>Array.from({length:4},()=>0);Ex();Ex();const nv="1.31.7";var uw=Object.defineProperty,dw=(a,t,s)=>t in a?uw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,sv=(a,t,s)=>dw(a,typeof t!="symbol"?t+"":t,s);const fw="color:rgb(0, 145, 255)";function zx(a){switch(a){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class Ox{constructor(t){sv(this,"_onLogLineFuncs"),sv(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let s=Math.random().toString(36).substring(2,15);for(let r=0;r<10&&this._onLogLineFuncs[s]!==void 0;r++)s=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[s]=t,()=>{delete this._onLogLineFuncs[s]}}logVerbose(...t){if(this._verbose)for(const s of Object.values(this._onLogLineFuncs))s("debug",`${new Date().toISOString()}`,...t)}log(...t){for(const s of Object.values(this._onLogLineFuncs))s("info",...t)}warn(...t){for(const s of Object.values(this._onLogLineFuncs))s("warn",...t)}error(...t){for(const s of Object.values(this._onLogLineFuncs))s("error",...t)}}function Mx(a){const t=new Ox(a);return t.addLogLineListener((s,...r)=>{switch(s){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.log(...r)}}),t}function Lx(a){return new Ox(a)}function pc(a,t,s,r,o){const c=zx(s);if(typeof o=="object"&&(o=`ConvexError ${JSON.stringify(o.errorData,null,2)}`),t==="info"){const h=o.match(/^\[.*?\] /);if(h===null){a.error(`[CONVEX ${c}(${r})] Could not parse console.log`);return}const m=o.slice(1,h[0].length-2),p=o.slice(h[0].length);a.log(`%c[CONVEX ${c}(${r})] [${m}]`,fw,p)}else a.error(`[CONVEX ${c}(${r})] ${o}`)}function hw(a,t){const s=`[CONVEX FATAL ERROR] ${t}`;return a.error(s),new Error(s)}function Bi(a,t,s){return`[CONVEX ${zx(a)}(${t})] ${s.errorMessage}
|
|
10
|
+
Called by client`}function $f(a,t){return t.data=a.errorData,t}function Ia(a){const t=a.split(":");let s,r;return t.length===1?(s=t[0],r="default"):(s=t.slice(0,t.length-1).join(":"),r=t[t.length-1]),s.endsWith(".js")&&(s=s.slice(0,-3)),`${s}:${r}`}function qa(a,t){return JSON.stringify({udfPath:Ia(a),args:Wn(t)})}function av(a,t,s){const{initialNumItems:r,id:o}=s;return JSON.stringify({type:"paginated",udfPath:Ia(a),args:Wn(t),options:Wn({initialNumItems:r,id:o})})}var mw=Object.defineProperty,pw=(a,t,s)=>t in a?mw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,Yn=(a,t,s)=>pw(a,typeof t!="symbol"?t+"":t,s);class gw{constructor(){Yn(this,"nextQueryId"),Yn(this,"querySetVersion"),Yn(this,"querySet"),Yn(this,"queryIdToToken"),Yn(this,"identityVersion"),Yn(this,"auth"),Yn(this,"outstandingQueriesOlderThanRestart"),Yn(this,"outstandingAuthOlderThanRestart"),Yn(this,"paused"),Yn(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,s,r,o){const c=Ia(t),h=qa(c,s),m=this.querySet.get(h);if(m!==void 0)return m.numSubscribers+=1,{queryToken:h,modification:null,unsubscribe:()=>this.removeSubscriber(h)};{const p=this.nextQueryId++,g={id:p,canonicalizedUdfPath:c,args:s,numSubscribers:1,journal:r,componentPath:o};this.querySet.set(h,g),this.queryIdToToken.set(p,h);const v=this.querySetVersion,x=this.querySetVersion+1,_={type:"Add",queryId:p,udfPath:c,args:[Wn(s)],journal:r,componentPath:o};return this.paused?this.pendingQuerySetModifications.set(p,_):this.querySetVersion=x,{queryToken:h,modification:{type:"ModifyQuerySet",baseVersion:v,newVersion:x,modifications:[_]},unsubscribe:()=>this.removeSubscriber(h)}}}transition(t){for(const s of t.modifications)switch(s.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(s.queryId);const r=s.journal;if(r!==void 0){const o=this.queryIdToToken.get(s.queryId);o!==void 0&&(this.querySet.get(o).journal=r)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(s.queryId);break}default:throw new Error(`Invalid modification ${s.type}`)}}queryId(t,s){const r=Ia(t),o=qa(r,s),c=this.querySet.get(o);return c!==void 0?c.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const s=this.identityVersion;return this.paused||(this.identityVersion=s+1),{type:"Authenticate",baseVersion:s,...this.auth}}setAdminAuth(t,s){const r={tokenType:"Admin",value:t,impersonating:s};this.auth=r;const o=this.identityVersion;return this.paused||(this.identityVersion=o+1),{type:"Authenticate",baseVersion:o,...r}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const s=this.queryIdToToken.get(t);return s?this.querySet.get(s).canonicalizedUdfPath:null}queryArgs(t){const s=this.queryIdToToken.get(t);return s?this.querySet.get(s).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(t){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const s=[];for(const c of this.querySet.values()){const h={type:"Add",queryId:c.id,udfPath:c.canonicalizedUdfPath,args:[Wn(c.args)],journal:c.journal,componentPath:c.componentPath};s.push(h),t.has(c.id)||this.outstandingQueriesOlderThanRestart.add(c.id)}this.querySetVersion=1;const r={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:s};if(!this.auth)return this.identityVersion=0,[r,void 0];this.outstandingAuthOlderThanRestart=!0;const o={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[r,o]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,s=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,s]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const s=this.querySet.get(t);if(s.numSubscribers>1)return s.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(s.id),this.outstandingQueriesOlderThanRestart.delete(s.id);const r=this.querySetVersion,o=this.querySetVersion+1,c={type:"Remove",queryId:s.id};return this.paused?this.pendingQuerySetModifications.has(s.id)?this.pendingQuerySetModifications.delete(s.id):this.pendingQuerySetModifications.set(s.id,c):this.querySetVersion=o,{type:"ModifyQuerySet",baseVersion:r,newVersion:o,modifications:[c]}}}}var yw=Object.defineProperty,vw=(a,t,s)=>t in a?yw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,Xo=(a,t,s)=>vw(a,typeof t!="symbol"?t+"":t,s);class xw{constructor(t,s){this.logger=t,this.markConnectionStateDirty=s,Xo(this,"inflightRequests"),Xo(this,"requestsOlderThanRestart"),Xo(this,"inflightMutationsCount",0),Xo(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,s){const r=new Promise(o=>{const c=s?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:c,requestedAt:new Date,onResult:o}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),r}onResponse(t){const s=this.inflightRequests.get(t.requestId);if(s===void 0||s.status.status==="Completed")return null;const r=s.message.type==="Mutation"?"mutation":"action",o=s.message.udfPath;for(const p of t.logLines)pc(this.logger,"info",r,o,p);const c=s.status;let h,m;if(t.success)h={success:!0,logLines:t.logLines,value:Pi(t.result)},m=()=>c.onResult(h);else{const p=t.result,{errorData:g}=t;pc(this.logger,"error",r,o,p),h={success:!1,errorMessage:p,errorData:g!==void 0?Pi(g):void 0,logLines:t.logLines},m=()=>c.onResult(h)}return t.type==="ActionResponse"||!t.success?(m(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),s.message.type==="Action"?this.inflightActionsCount--:s.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:h}):(s.status={status:"Completed",result:h,ts:t.ts,onResolve:m},null)}removeCompleted(t){const s=new Map;for(const[r,o]of this.inflightRequests.entries()){const c=o.status;c.status==="Completed"&&c.ts.lessThanOrEqual(t)&&(c.onResolve(),s.set(r,c.result),o.message.type==="Mutation"?this.inflightMutationsCount--:o.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r))}return s.size>0&&this.markConnectionStateDirty(),s}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[s,r]of this.inflightRequests){if(r.status.status==="NotSent"){r.status.status="Requested",t.push(r.message);continue}if(r.message.type==="Mutation")t.push(r.message);else if(r.message.type==="Action"){if(this.inflightRequests.delete(s),this.requestsOlderThanRestart.delete(s),this.inflightActionsCount--,r.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");r.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,s]of this.inflightRequests)if(s.status.status==="NotSent"){s.status.status="Requested",t.push(s.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const s of this.inflightRequests.values())s.status.status!=="Completed"&&s.status.requestedAt.getTime()<t&&(t=s.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const bl=Symbol.for("functionName"),Dx=Symbol.for("toReferencePath");function bw(a){return a[Dx]??null}function _w(a){return a.startsWith("function://")}function Sw(a){let t;if(typeof a=="string")_w(a)?t={functionHandle:a}:t={name:a};else if(a[bl])t={name:a[bl]};else{const s=bw(a);if(!s)throw new Error(`${a} is not a functionReference`);t={reference:s}}return t}function nn(a){const t=Sw(a);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof a=="string")return a;const s=a[bl];if(!s)throw new Error(`${a} is not a functionReference`);return s}function Ux(a){return{[bl]:a}}function Bx(a=[]){const t={get(s,r){if(typeof r=="string"){const o=[...a,r];return Bx(o)}else if(r===bl){if(a.length<2){const h=["api",...a].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${h}\``)}const o=a.slice(0,-1).join("/"),c=a[a.length-1];return c==="default"?o:o+":"+c}else return r===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}const ww=Bx();var kw=Object.defineProperty,Tw=(a,t,s)=>t in a?kw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,gc=(a,t,s)=>Tw(a,typeof t!="symbol"?t+"":t,s);class _l{constructor(t){gc(this,"queryResults"),gc(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...s){const r=js(s[0]),o=nn(t),c=this.queryResults.get(qa(o,r));if(c!==void 0)return _l.queryValue(c.result)}getAllQueries(t){const s=[],r=nn(t);for(const o of this.queryResults.values())o.udfPath===Ia(r)&&s.push({args:o.args,value:_l.queryValue(o.result)});return s}setQuery(t,s,r){const o=js(s),c=nn(t),h=qa(c,o);let m;r===void 0?m=void 0:m={success:!0,value:r,logLines:[]};const p={udfPath:c,args:o,result:m};this.queryResults.set(h,p),this.modifiedQueries.push(h)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class jw{constructor(){gc(this,"queryResults"),gc(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,s){this.optimisticUpdates=this.optimisticUpdates.filter(h=>!s.has(h.mutationId));const r=this.queryResults;this.queryResults=new Map(t);const o=new _l(this.queryResults);for(const h of this.optimisticUpdates)h.update(o);const c=[];for(const[h,m]of this.queryResults){const p=r.get(h);(p===void 0||p.result!==m.result)&&c.push(h)}return c}applyOptimisticUpdate(t,s){this.optimisticUpdates.push({update:t,mutationId:s});const r=new _l(this.queryResults);return t(r),r.modifiedQueries}rawQueryResult(t){const s=this.queryResults.get(t);if(s!==void 0)return s.result}queryResult(t){const s=this.queryResults.get(t);if(s===void 0)return;const r=s.result;if(r!==void 0){if(r.success)return r.value;throw r.errorData!==void 0?$f(r,new qf(Bi("query",s.udfPath,r))):new Error(Bi("query",s.udfPath,r))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var Nw=Object.defineProperty,Cw=(a,t,s)=>t in a?Nw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,_f=(a,t,s)=>Cw(a,typeof t!="symbol"?t+"":t,s);class tn{constructor(t,s){_f(this,"low"),_f(this,"high"),_f(this,"__isUnsignedLong__"),this.low=t|0,this.high=s|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new tn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,s=this.low;return[s&255,s>>>8&255,s>>>16&255,s>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?iv:t>=Rw?Aw:new tn(t%pl|0,t/pl|0)}toString(){return(BigInt(this.high)*BigInt(pl)+BigInt(this.low)).toString()}equals(t){return tn.isLong(t)||(t=tn.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return tn.isLong(t)||(t=tn.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?tn.fromNumber(t):new tn(t.low,t.high)}}const iv=new tn(0,0),rv=65536,pl=rv*rv,Rw=pl*pl,Aw=new tn(-1,-1);var Ew=Object.defineProperty,zw=(a,t,s)=>t in a?Ew(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,Ko=(a,t,s)=>zw(a,typeof t!="symbol"?t+"":t,s);class lv{constructor(t,s){Ko(this,"version"),Ko(this,"remoteQuerySet"),Ko(this,"queryPath"),Ko(this,"logger"),this.version={querySet:0,ts:tn.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=s}transition(t){const s=t.startVersion;if(this.version.querySet!==s.querySet||this.version.ts.notEquals(s.ts)||this.version.identity!==s.identity)throw new Error(`Invalid start version: ${s.ts.toString()}:${s.querySet}:${s.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const r of t.modifications)switch(r.type){case"QueryUpdated":{const o=this.queryPath(r.queryId);if(o)for(const h of r.logLines)pc(this.logger,"info","query",o,h);const c=Pi(r.value??null);this.remoteQuerySet.set(r.queryId,{success:!0,value:c,logLines:r.logLines});break}case"QueryFailed":{const o=this.queryPath(r.queryId);if(o)for(const h of r.logLines)pc(this.logger,"info","query",o,h);const{errorData:c}=r;this.remoteQuerySet.set(r.queryId,{success:!1,errorMessage:r.errorMessage,errorData:c!==void 0?Pi(c):void 0,logLines:r.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function Sf(a){const t=vl(a);return tn.fromBytesLE(Array.from(t))}function Ow(a){const t=new Uint8Array(a.toBytesLE());return xl(t)}function ov(a){switch(a.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...a};case"MutationResponse":return a.success?{...a,ts:Sf(a.ts)}:{...a};case"Transition":return{...a,startVersion:{...a.startVersion,ts:Sf(a.startVersion.ts)},endVersion:{...a.endVersion,ts:Sf(a.endVersion.ts)}}}}function Mw(a){switch(a.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...a};case"Connect":return a.maxObservedTimestamp!==void 0?{...a,maxObservedTimestamp:Ow(a.maxObservedTimestamp)}:{...a,maxObservedTimestamp:void 0}}}var Lw=Object.defineProperty,Dw=(a,t,s)=>t in a?Lw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,kt=(a,t,s)=>Dw(a,typeof t!="symbol"?t+"":t,s);const Uw=1e3,Bw=1001,qw=1005,$w=4040;let ic;function Li(){return ic===void 0&&(ic=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(ic+performance.now())}function cv(){return`t=${Math.round((Li()-ic)/100)/10}s`}const qx={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function Vw(a){if(a===void 0)return"Unknown";for(const t of Object.keys(qx))if(a.startsWith(t))return t;return"Unknown"}class Iw{constructor(t,s,r,o,c,h){this.markConnectionStateDirty=c,this.debug=h,kt(this,"socket"),kt(this,"connectionCount"),kt(this,"_hasEverConnected",!1),kt(this,"lastCloseReason"),kt(this,"transitionChunkBuffer",null),kt(this,"defaultInitialBackoff"),kt(this,"maxBackoff"),kt(this,"retries"),kt(this,"serverInactivityThreshold"),kt(this,"reconnectDueToServerInactivityTimeout"),kt(this,"scheduledReconnect",null),kt(this,"networkOnlineHandler",null),kt(this,"pendingNetworkRecoveryInfo",null),kt(this,"uri"),kt(this,"onOpen"),kt(this,"onResume"),kt(this,"onMessage"),kt(this,"webSocketConstructor"),kt(this,"logger"),kt(this,"onServerDisconnectError"),this.webSocketConstructor=r,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=s.onOpen,this.onResume=s.onResume,this.onMessage=s.onMessage,this.onServerDisconnectError=s.onServerDisconnectError,this.logger=o,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const s=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${s}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const s=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const r=ov(JSON.parse(s));if(r.type!=="Transition")throw new Error(`Expected Transition, got ${r.type} after assembling chunks`);return r}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Li()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",cv(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",cv())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:s}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:s}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(s/1e3)}s of waiting`)}},t.onerror=s=>{this.transitionChunkBuffer=null;const r=s.message;r&&this.logger.log(`WebSocket error message: ${r}`)},t.onmessage=s=>{this.resetServerInactivityTimeout();const r=s.data.length;let o=ov(JSON.parse(s.data));if(this._logVerbose(`received ws message with type ${o.type}`),o.type==="Ping")return;if(o.type==="TransitionChunk"){const h=this.assembleTransition(o);if(!h)return;o=h,this._logVerbose(`assembled full ws message of type ${o.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${o.type} while buffering TransitionChunks`)),o.type==="Transition"&&this.reportLargeTransition({messageLength:r,transition:o}),this.onMessage(o).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=s=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=s.reason||`closed with code ${s.code}`),s.code!==Uw&&s.code!==Bw&&s.code!==qw&&s.code!==$w){let o=`WebSocket closed with code ${s.code}`;s.reason&&(o+=`: ${s.reason}`),this.logger.log(o),this.onServerDisconnectError&&s.reason&&this.onServerDisconnectError(o)}const r=Vw(s.reason);this.scheduleReconnect(r)}}socketState(){return this.socket.state}sendMessage(t){const s={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const r=Mw(t),o=JSON.stringify(r);let c=!1;try{this.socket.ws.send(o),c=!0}catch(h){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${h}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${c?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(s)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(s)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const s=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(s)}ms`);const r=Li(),o=setTimeout(()=>{this.scheduledReconnect?.timeout===o&&(this.scheduledReconnect=null,this.connect())},s);this.scheduledReconnect={timeout:o,scheduledAt:r,backoffMs:s}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=s=>{this._logVerbose("Ignoring message received after close")},new Promise(s=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),s()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=r=>{this._logVerbose("Ignoring message received after close")};const s=new Promise(r=>{t.onclose=()=>{r()}});return t.close(),s}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const s=Li()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-s),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(s)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Li()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const r=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:qx[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const o=Math.min(r,this.maxBackoff),c=o*(Math.random()-.5);return o+c}reportLargeTransition({transition:t,messageLength:s}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const r=Li()-t.clientClockSkew-t.serverTs/1e6,o=`${Math.round(r)}ms`,c=`${Math.round(s/1e4)/100}MB`,h=s/(r/1e3),m=`${Math.round(h/1e4)/100}MB per second`;this._logVerbose(`received ${c} transition in ${o} at ${m}`),s>2e7?this.logger.log(`received query results totaling more that 20MB (${c}) which will take a long time to download on slower connections`):r>2e4&&this.logger.log(`received query results totaling ${c} which took more than 20s to arrive (${o})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:r,messageLength:s}})}}function Zw(){return Hw()}function Hw(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a==="x"?t:t&3|8).toString(16)})}class ol extends Error{}ol.prototype.name="InvalidTokenError";function Pw(a){return decodeURIComponent(atob(a).replace(/(.)/g,(t,s)=>{let r=s.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Qw(a){let t=a.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Pw(t)}catch{return atob(t)}}function $x(a,t){if(typeof a!="string")throw new ol("Invalid token specified: must be a string");t||(t={});const s=t.header===!0?0:1,r=a.split(".")[s];if(typeof r!="string")throw new ol(`Invalid token specified: missing part #${s+1}`);let o;try{o=Qw(r)}catch(c){throw new ol(`Invalid token specified: invalid base64 for part #${s+1} (${c.message})`)}try{return JSON.parse(o)}catch(c){throw new ol(`Invalid token specified: invalid json for part #${s+1} (${c.message})`)}}var Gw=Object.defineProperty,Yw=(a,t,s)=>t in a?Gw(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,Rn=(a,t,s)=>Yw(a,typeof t!="symbol"?t+"":t,s);const Xw=480*60*60*1e3,uv=2;class Kw{constructor(t,s,r){Rn(this,"authState",{state:"noAuth"}),Rn(this,"configVersion",0),Rn(this,"syncState"),Rn(this,"authenticate"),Rn(this,"stopSocket"),Rn(this,"tryRestartSocket"),Rn(this,"pauseSocket"),Rn(this,"resumeSocket"),Rn(this,"clearAuth"),Rn(this,"logger"),Rn(this,"refreshTokenLeewaySeconds"),Rn(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=s.authenticate,this.stopSocket=s.stopSocket,this.tryRestartSocket=s.tryRestartSocket,this.pauseSocket=s.pauseSocket,this.resumeSocket=s.resumeSocket,this.clearAuth=s.clearAuth,this.logger=r.logger,this.refreshTokenLeewaySeconds=r.refreshTokenLeewaySeconds}async setConfig(t,s){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});r.isFromOutdatedConfig||(r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:s},hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:s}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:s}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(s+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=uv){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${uv-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const s=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});s.isFromOutdatedConfig||(s.value&&this.syncState.isNewAuth(s.value)?(this.authenticate(s.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:s.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const s=this.decodeToken(t);if(!s){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:o}=s;if(!r||!o){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const c=o-r;if(c<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let h=Math.min(Xw,(c-this.refreshTokenLeewaySeconds)*1e3);h<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${c}s`),h=0);const m=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},h);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:m,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${h}ms`)}async fetchTokenAndGuardAgainstRace(t,s){const r=++this.configVersion;this._logVerbose(`fetching token with config version ${r}`);const o=await t(s);return this.configVersion!==r?(this._logVerbose(`stale config version, expected ${r}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:o}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const s=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(s)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=t}decodeToken(t){try{return $x(t)}catch(s){return this._logVerbose(`Error decoding token: ${s instanceof Error?s.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const Fw=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function Jw(a,t){const s={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(a,{detail:s})}function Ww(a){let t=a.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:a.startTime}}function ek(a){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const s of Fw){const r=performance.getEntriesByName(s).filter(o=>o.entryType==="mark").filter(o=>o.detail.sessionId===a);t.push(...r)}return t.map(Ww)}var tk=Object.defineProperty,nk=(a,t,s)=>t in a?tk(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,Tt=(a,t,s)=>nk(a,typeof t!="symbol"?t+"":t,s);class sk{constructor(t,s,r){if(Tt(this,"address"),Tt(this,"state"),Tt(this,"requestManager"),Tt(this,"webSocketManager"),Tt(this,"authenticationManager"),Tt(this,"remoteQuerySet"),Tt(this,"optimisticQueryResults"),Tt(this,"_transitionHandlerCounter",0),Tt(this,"_nextRequestId"),Tt(this,"_onTransitionFns",new Map),Tt(this,"_sessionId"),Tt(this,"firstMessageReceived",!1),Tt(this,"debug"),Tt(this,"logger"),Tt(this,"maxObservedTimestamp"),Tt(this,"connectionStateSubscribers",new Map),Tt(this,"nextConnectionStateSubscriberId",0),Tt(this,"_lastPublishedConnectionState"),Tt(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const S=this.connectionState();if(JSON.stringify(S)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=S;for(const k of this.connectionStateSubscribers.values())k(S)}})}),Tt(this,"mark",S=>{this.debug&&Jw(S,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");r?.skipConvexDeploymentUrlCheck!==!0&&J1(t),r={...r};const o=r.authRefreshTokenLeewaySeconds??2;let c=r.webSocketConstructor;if(!c&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");c=c||WebSocket,this.debug=r.reportDebugInfoToConvex??!1,this.address=t,this.logger=r.logger===!1?Lx({verbose:r.verbose??!1}):r.logger!==!0&&r.logger?r.logger:Mx({verbose:r.verbose??!1});const h=t.search("://");if(h===-1)throw new Error("Provided address was not an absolute URL.");const m=t.substring(h+3),p=t.substring(0,h);let g;if(p==="http")g="ws";else if(p==="https")g="wss";else throw new Error(`Unknown parent protocol ${p}`);const v=`${g}://${m}/api/${nv}/sync`;this.state=new gw,this.remoteQuerySet=new lv(S=>this.state.queryPath(S),this.logger),this.requestManager=new xw(this.logger,this.markConnectionStateDirty);const x=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new Kw(this.state,{authenticate:S=>{const k=this.state.setAuth(S);return this.webSocketManager.sendMessage(k),k.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:x,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:o}),this.optimisticQueryResults=new jw,this.addOnTransitionHandler(S=>{s(S.queries.map(k=>k.token))}),this._nextRequestId=0,this._sessionId=Zw();const{unsavedChangesWarning:_}=r;if(typeof window>"u"||typeof window.addEventListener>"u"){if(_===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else _!==!1&&window.addEventListener("beforeunload",S=>{if(this.requestManager.hasIncompleteRequests()){S.preventDefault();const k="Are you sure you want to leave? Your changes may not be saved.";return(S||window.event).returnValue=k,k}});this.webSocketManager=new Iw(v,{onOpen:S=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...S,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const k=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new lv(H=>this.state.queryPath(H),this.logger);const[w,A]=this.state.restart(k);A&&this.webSocketManager.sendMessage(A),this.webSocketManager.sendMessage(w);for(const H of this.requestManager.restart())this.webSocketManager.sendMessage(H)},onResume:()=>{const[S,k]=this.state.resume();k&&this.webSocketManager.sendMessage(k),S&&this.webSocketManager.sendMessage(S);for(const w of this.requestManager.resume())this.webSocketManager.sendMessage(w)},onMessage:S=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),S.type){case"Transition":{this.observedTimestamp(S.endVersion.ts),this.authenticationManager.onTransition(S),this.remoteQuerySet.transition(S),this.state.transition(S);const k=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(k);break}case"MutationResponse":{S.success&&this.observedTimestamp(S.ts);const k=this.requestManager.onResponse(S);k!==null&&this.notifyOnQueryResultChanges(new Map([[k.requestId,k.result]]));break}case"ActionResponse":{this.requestManager.onResponse(S);break}case"AuthError":{this.authenticationManager.onAuthError(S);break}case"FatalError":{const k=hw(this.logger,S.error);throw this.webSocketManager.terminate(),k}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:r.onServerDisconnectError},c,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),r.expectAuth&&x()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const s=this.remoteQuerySet.remoteQueryResults(),r=new Map;for(const[c,h]of s){const m=this.state.queryToken(c);if(m!==null){const p={result:h,udfPath:this.state.queryPath(c),args:this.state.queryArgs(c)};r.set(m,p)}}const o=this.optimisticQueryResults.ingestQueryResultsFromServer(r,new Set(t.keys()));this.handleTransition({queries:o.map(c=>{const h=this.optimisticQueryResults.rawQueryResult(c);return{token:c,modification:{kind:"Updated",result:h}}}),reflectedMutations:Array.from(t).map(([c,h])=>({requestId:c,result:h})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const s of this._onTransitionFns.values())s(t)}addOnTransitionHandler(t){const s=this._transitionHandlerCounter++;return this._onTransitionFns.set(s,t),()=>this._onTransitionFns.delete(s)}getCurrentAuthClaims(){const t=this.state.getAuth();let s={};if(t&&t.tokenType==="User")try{s=t?$x(t.value):{}}catch{s={}}else return;return{token:t.value,decoded:s}}setAuth(t,s){this.authenticationManager.setConfig(t,s)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,s){const r=this.state.setAdminAuth(t,s);this.webSocketManager.sendMessage(r)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,s,r){const o=js(s),{modification:c,queryToken:h,unsubscribe:m}=this.state.subscribe(t,o,r?.journal,r?.componentPath);return c!==null&&this.webSocketManager.sendMessage(c),{queryToken:h,unsubscribe:()=>{const p=m();p&&this.webSocketManager.sendMessage(p)}}}localQueryResult(t,s){const r=js(s),o=qa(t,r);return this.optimisticQueryResults.queryResult(o)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,s){const r=js(s),o=qa(t,r);return this.optimisticQueryResults.queryLogs(o)}queryJournal(t,s){const r=js(s),o=qa(t,r);return this.state.queryJournal(o)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const s=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(s,t),()=>{this.connectionStateSubscribers.delete(s)}}async mutation(t,s,r){const o=await this.mutationInternal(t,s,r);if(!o.success)throw o.errorData!==void 0?$f(o,new qf(Bi("mutation",t,o))):new Error(Bi("mutation",t,o));return o.value}async mutationInternal(t,s,r,o){const{mutationPromise:c}=this.enqueueMutation(t,s,r,o);return c}enqueueMutation(t,s,r,o){const c=js(s);this.tryReportLongDisconnect();const h=this.nextRequestId;if(this._nextRequestId++,r!==void 0){const v=r.optimisticUpdate;if(v!==void 0){const x=k=>{v(k,c)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},S=this.optimisticQueryResults.applyOptimisticUpdate(x,h).map(k=>{const w=this.localQueryResultByToken(k);return{token:k,modification:{kind:"Updated",result:w===void 0?void 0:{success:!0,value:w,logLines:[]}}}});this.handleTransition({queries:S,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const m={type:"Mutation",requestId:h,udfPath:t,componentPath:o,args:[Wn(c)]},p=this.webSocketManager.sendMessage(m),g=this.requestManager.request(m,p);return{requestId:h,mutationPromise:g}}async action(t,s){const r=await this.actionInternal(t,s);if(!r.success)throw r.errorData!==void 0?$f(r,new qf(Bi("action",t,r))):new Error(Bi("action",t,r));return r.value}async actionInternal(t,s,r){const o=js(s),c=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const h={type:"Action",requestId:c,udfPath:t,componentPath:r,args:[Wn(o)]},m=this.webSocketManager.sendMessage(h);return this.requestManager.request(h,m)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=ek(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const s=`${this.address}/api/debug_event`;fetch(s,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${nv}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(r=>{r.ok||this.logger.warn("Analytics request failed with response:",r.body)}).catch(r=>{this.logger.warn("Analytics response failed with error:",r)})}}function wf(a){if(typeof a!="object"||a===null||!Array.isArray(a.page)||typeof a.isDone!="boolean"||typeof a.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${a?.toString()}`);return a}var ak=Object.defineProperty,ik=(a,t,s)=>t in a?ak(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,dv=(a,t,s)=>ik(a,typeof t!="symbol"?t+"":t,s);class rk{constructor(t,s){this.client=t,this.onTransition=s,dv(this,"paginatedQuerySet",new Map),dv(this,"lastTransitionTs"),this.lastTransitionTs=tn.fromNumber(0),this.client.addOnTransitionHandler(r=>this.onBaseTransition(r))}subscribe(t,s,r){const o=Ia(t),c=av(o,s,r),h=()=>this.removePaginatedQuerySubscriber(c),m=this.paginatedQuerySet.get(c);return m?(m.numSubscribers+=1,{paginatedQueryToken:c,unsubscribe:h}):(this.paginatedQuerySet.set(c,{token:c,canonicalizedUdfPath:o,args:s,numSubscribers:1,options:{initialNumItems:r.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:r.id}),this.addPageToPaginatedQuery(c,null,r.initialNumItems),{paginatedQueryToken:c,unsubscribe:h})}localQueryResult(t,s,r){const o=Ia(t),c=av(o,s,r);return this.localQueryResultByToken(c)}localQueryResultByToken(t){const s=this.paginatedQuerySet.get(t);if(!s)return;const r=this.activePageQueryTokens(s);if(r.length===0)return{results:[],status:"LoadingFirstPage",loadMore:p=>this.loadMoreOfPaginatedQuery(t,p)};let o=[],c=!1,h=!1;for(const p of r){const g=this.client.localQueryResultByToken(p);if(g===void 0){c=!0,h=!1;continue}const v=wf(g);o=o.concat(v.page),h=!!v.isDone}let m;return c?m=o.length===0?"LoadingFirstPage":"LoadingMore":h?m="Exhausted":m="CanLoadMore",{results:o,status:m,loadMore:p=>this.loadMoreOfPaginatedQuery(t,p)}}onBaseTransition(t){const s=t.queries.map(h=>h.token),r=this.queriesContainingTokens(s);let o=[];r.length>0&&(this.processPaginatedQuerySplits(r,h=>this.client.localQueryResultByToken(h)),o=r.map(h=>({token:h,modification:{kind:"Updated",result:this.localQueryResultByToken(h)}})));const c={...t,paginatedQueries:o};this.onTransition(c)}loadMoreOfPaginatedQuery(t,s){this.mustGetPaginatedQuery(t);const r=this.queryTokenForLastPageOfPaginatedQuery(t),o=this.client.localQueryResultByToken(r);if(!o)return!1;const c=wf(o);if(c.isDone)return!1;this.addPageToPaginatedQuery(t,c.continueCursor,s);const h={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(h),!0}queriesContainingTokens(t){if(t.length===0)return[];const s=[],r=new Set(t);for(const[o,c]of this.paginatedQuerySet)for(const h of this.allQueryTokens(c))if(r.has(h)){s.push(o);break}return s}processPaginatedQuerySplits(t,s){for(const r of t){const o=this.mustGetPaginatedQuery(r),{ongoingSplits:c,pageKeyToQuery:h,pageKeys:m}=o;for(const[p,[g,v]]of c)s(h.get(g).queryToken)!==void 0&&s(h.get(v).queryToken)!==void 0&&this.completePaginatedQuerySplit(o,p,g,v);for(const p of m){if(c.has(p))continue;const g=h.get(p).queryToken,v=s(g);if(!v)continue;const x=wf(v);x.splitCursor&&(x.pageStatus==="SplitRecommended"||x.pageStatus==="SplitRequired"||x.page.length>o.options.initialNumItems*2)&&this.splitPaginatedQueryPage(o,p,x.splitCursor,x.continueCursor)}}}splitPaginatedQueryPage(t,s,r,o){const c=t.nextPageKey++,h=t.nextPageKey++,m={cursor:o,numItems:t.options.initialNumItems,id:t.id},p=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...m,cursor:null,endCursor:r}});t.pageKeyToQuery.set(c,p);const g=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...m,cursor:r,endCursor:o}});t.pageKeyToQuery.set(h,g),t.ongoingSplits.set(s,[c,h])}addPageToPaginatedQuery(t,s,r){const o=this.mustGetPaginatedQuery(t),c=o.nextPageKey++,h={cursor:s,numItems:r,id:o.id},m={...o.args,paginationOpts:h},p=this.client.subscribe(o.canonicalizedUdfPath,m);return o.pageKeys.push(c),o.pageKeyToQuery.set(c,p),p}removePaginatedQuerySubscriber(t){const s=this.paginatedQuerySet.get(t);if(s&&(s.numSubscribers-=1,!(s.numSubscribers>0))){for(const r of s.pageKeyToQuery.values())r.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,s,r,o){const c=t.pageKeyToQuery.get(s);t.pageKeyToQuery.delete(s);const h=t.pageKeys.indexOf(s);t.pageKeys.splice(h,1,r,o),t.ongoingSplits.delete(s),c.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(s=>t.pageKeyToQuery.get(s).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(s=>s.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const s=this.mustGetPaginatedQuery(t),r=s.pageKeys[s.pageKeys.length-1];if(r===void 0)throw new Error(`No pages for paginated query ${t}`);return s.pageKeyToQuery.get(r).queryToken}mustGetPaginatedQuery(t){const s=this.paginatedQuerySet.get(t);if(!s)throw new Error("paginated query no longer exists for token "+t);return s}}function lk({getCurrentValue:a,subscribe:t}){const[s,r]=Q.useState(()=>({getCurrentValue:a,subscribe:t,value:a()}));let o=s.value;return(s.getCurrentValue!==a||s.subscribe!==t)&&(o=a(),r({getCurrentValue:a,subscribe:t,value:o})),Q.useEffect(()=>{let c=!1;const h=()=>{c||r(p=>{if(p.getCurrentValue!==a||p.subscribe!==t)return p;const g=a();return p.value===g?p:{...p,value:g}})},m=t(h);return h(),()=>{c=!0,m()}},[a,t]),o}var ok=Object.defineProperty,ck=(a,t,s)=>t in a?ok(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,Ss=(a,t,s)=>ck(a,typeof t!="symbol"?t+"":t,s);const uk=5e3;if(typeof ha>"u")throw new Error("Required dependency 'react' not found");function Vx(a,t,s){function r(o){return mk(o),t.mutation(a,o,{optimisticUpdate:s})}return r.withOptimisticUpdate=function(c){if(s!==void 0)throw new Error(`Already specified optimistic update for mutation ${nn(a)}`);return Vx(a,t,c)},r}class dk{constructor(t,s){if(Ss(this,"address"),Ss(this,"cachedSync"),Ss(this,"cachedPaginatedQueryClient"),Ss(this,"listeners"),Ss(this,"options"),Ss(this,"closed",!1),Ss(this,"_logger"),Ss(this,"adminAuth"),Ss(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=s?.logger===!1?Lx({verbose:s?.verbose??!1}):s?.logger!==!0&&s?.logger?s.logger:Mx({verbose:s?.verbose??!1}),this.options={...s,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new sk(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new rk(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,s){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,s??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,s){if(this.adminAuth=t,this.fakeUserIdentity=s,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,s)}watchQuery(t,...s){const[r,o]=s,c=nn(t);return{onUpdate:h=>{const{queryToken:m,unsubscribe:p}=this.sync.subscribe(c,r,o),g=this.listeners.get(m);return g!==void 0?g.add(h):this.listeners.set(m,new Set([h])),()=>{if(this.closed)return;const v=this.listeners.get(m);v.delete(h),v.size===0&&this.listeners.delete(m),p()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(c,r)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(c,r)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(c,r)}}}prewarmQuery(t){const s=t.extendSubscriptionFor??uk,o=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(o,s)}watchPaginatedQuery(t,s,r){const o=nn(t);return{onUpdate:c=>{const{paginatedQueryToken:h,unsubscribe:m}=this.paginatedQueryClient.subscribe(o,s||{},r),p=this.listeners.get(h);return p!==void 0?p.add(c):this.listeners.set(h,new Set([c])),()=>{if(this.closed)return;const g=this.listeners.get(h);g.delete(c),g.size===0&&this.listeners.delete(h),m()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(o,s,r)}}mutation(t,...s){const[r,o]=s,c=nn(t);return this.sync.mutation(c,r,o)}action(t,...s){const r=nn(t);return this.sync.action(r,...s)}query(t,...s){const r=this.watchQuery(t,...s),o=r.localQueryResult();return o!==void 0?Promise.resolve(o):new Promise((c,h)=>{const m=r.onUpdate(()=>{m();try{c(r.localQueryResult())}catch(p){h(p)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const s=t.queries.map(o=>o.token),r=t.paginatedQueries.map(o=>o.token);this.transition([...s,...r])}transition(t){for(const s of t){const r=this.listeners.get(s);if(r)for(const o of r)o()}}}const xh=ha.createContext(void 0);function fk(){return Q.useContext(xh)}const hk=({client:a,children:t})=>ha.createElement(xh.Provider,{value:a},t);function st(a,...t){const s=t[0]==="skip",r=t[0]==="skip"?{}:js(t[0]),o=typeof a=="string"?Ux(a):a,c=nn(o),h=Q.useMemo(()=>s?{}:{query:{query:o,args:r}},[JSON.stringify(Wn(r)),c,s]),p=vk(h).query;if(p instanceof Error)throw p;return p}function Ct(a){const t=typeof a=="string"?Ux(a):a,s=Q.useContext(xh);if(s===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return Q.useMemo(()=>Vx(t,s),[s,nn(t)])}function mk(a){if(typeof a=="object"&&a!==null&&"bubbles"in a&&"persist"in a&&"isDefaultPrevented"in a)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var pk=Object.defineProperty,gk=(a,t,s)=>t in a?pk(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,kf=(a,t,s)=>gk(a,typeof t!="symbol"?t+"":t,s);class yk{constructor(t){kf(this,"createWatch"),kf(this,"queries"),kf(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const s of Object.keys(t)){const{query:r,args:o,paginationOptions:c}=t[s];if(nn(r),this.queries[s]===void 0)this.addQuery(s,r,o,c?{paginationOptions:c}:{});else{const h=this.queries[s];(nn(r)!==nn(h.query)||JSON.stringify(Wn(o))!==JSON.stringify(Wn(h.args))||JSON.stringify(c)!==JSON.stringify(h.paginationOptions))&&(this.removeQuery(s),this.addQuery(s,r,o,c?{paginationOptions:c}:{}))}}for(const s of Object.keys(this.queries))t[s]===void 0&&this.removeQuery(s)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const s={};for(const r of Object.keys(t)){const{query:o,args:c}=t[r],h=t[r].paginationOptions;nn(o);const m=this.createWatch(o,c,h?{paginationOptions:h}:{});let p;try{p=m.localQueryResult()}catch(g){if(g instanceof Error)p=g;else throw g}s[r]=p}return s}setCreateWatch(t){this.createWatch=t;for(const s of Object.keys(this.queries)){const{query:r,args:o,watch:c,paginationOptions:h}=this.queries[s],m="journal"in c?c.journal():void 0;this.removeQuery(s),this.addQuery(s,r,o,{...m?{journal:m}:[],...h?{paginationOptions:h}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,s,r,{paginationOptions:o,journal:c}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const h=this.createWatch(s,r,{...c?{journal:c}:[],...o?{paginationOptions:o}:{}}),m=h.onUpdate(()=>this.notifyListeners());this.queries[t]={query:s,args:r,watch:h,unsubscribe:m,...o?{paginationOptions:o}:{}}}removeQuery(t){const s=this.queries[t];if(s===void 0)throw new Error(`No query found with identifier ${t}.`);s.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function vk(a){const t=fk();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const s=Q.useMemo(()=>(r,o,{journal:c,paginationOptions:h})=>h?t.watchPaginatedQuery(r,o,h):t.watchQuery(r,o,c?{journal:c}:{}),[t]);return xk(a,s)}function xk(a,t){const[s]=Q.useState(()=>new yk(t));s.createWatch!==t&&s.setCreateWatch(t),Q.useEffect(()=>()=>s.destroy(),[s]);const r=Q.useMemo(()=>({getCurrentValue:()=>s.getLocalResults(a),subscribe:o=>(s.setQueries(a),s.subscribe(o))}),[s,a]);return lk(r)}function bk(){return typeof window<"u"&&window.__CONVEX_URL__?window.__CONVEX_URL__:"https://modest-owl-858.convex.cloud"}const fv=bk(),hv=fv?new dk(fv):null;function _k({children:a}){return hv?d.jsx(hk,{client:hv,children:a}):d.jsx(d.Fragment,{children:a})}const Sk="/assets/styles-CAIFwsCh.css",ns=R1({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"UCA Demo — Task System"}],links:[{rel:"stylesheet",href:Sk}]}),component:kk}),wk=[{to:"/",label:"Cockpit",icon:"grid"},{to:"/tasks",label:"Kanban",icon:"columns"},{to:"/context",label:"Context Tiers",icon:"layers"},{to:"/drift",label:"Drift Events",icon:"alert"},{to:"/agents",label:"Agents",icon:"users"},{to:"/agent-ops",label:"Agent Ops",icon:"activity"},{to:"/skills",label:"Skills & Hooks",icon:"zap"},{to:"/export",label:"Project Map",icon:"map"},{to:"/mnemonics",label:"Mnemonics",icon:"image"}];function kk(){return d.jsx(Tk,{children:d.jsx(_k,{children:d.jsx(Tx,{})})})}function mv({children:a}){const t=Nt({select:s=>s.location.pathname});return d.jsxs("div",{className:"flex h-screen",children:[d.jsxs("aside",{className:"w-64 border-r border-zinc-200 bg-white flex flex-col",children:[d.jsxs("div",{className:"p-6 border-b border-zinc-200",children:[d.jsx("h1",{className:"text-lg font-bold tracking-tight",children:"UCA"}),d.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Unified Context Accelerator"})]}),d.jsx("nav",{className:"flex-1 p-3 space-y-1",children:wk.map(s=>{const r=s.to==="/"?t==="/":t.startsWith(s.to);return d.jsx(yh,{to:s.to,className:`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${r?"bg-zinc-900 text-white":"text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900"}`,children:s.label},s.to)})}),d.jsx("div",{className:"p-4 border-t border-zinc-200",children:d.jsx("p",{className:"text-xs text-zinc-400",children:"@yattalo/task-system v0.5.0"})})]}),d.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:a})]})}function Tk({children:a}){return typeof window<"u"&&window.__SPA_MODE__?d.jsx(mv,{children:a}):d.jsxs("html",{lang:"en",children:[d.jsx("head",{children:d.jsx(H1,{})}),d.jsxs("body",{className:"bg-zinc-50 text-zinc-900 antialiased",children:[d.jsx(mv,{children:a}),d.jsx(P1,{})]})]})}function Ix(a,t){const s={get(r,o){if(typeof o=="string"){const c=[...t,o];return Ix(a,c)}else if(o===Dx){if(t.length<1){const c=[a,...t].join(".");throw new Error(`API path is expected to be of the form \`${a}.childComponent.functionName\`. Found: \`${c}\``)}return"_reference/childComponent/"+t.join("/")}else return}};return new Proxy({},s)}const jk=()=>Ix("components",[]),Se=ww;jk();function Zx(a){var t,s,r="";if(typeof a=="string"||typeof a=="number")r+=a;else if(typeof a=="object")if(Array.isArray(a)){var o=a.length;for(t=0;t<o;t++)a[t]&&(s=Zx(a[t]))&&(r&&(r+=" "),r+=s)}else for(s in a)a[s]&&(r&&(r+=" "),r+=s);return r}function Hx(){for(var a,t,s=0,r="",o=arguments.length;s<o;s++)(a=arguments[s])&&(t=Zx(a))&&(r&&(r+=" "),r+=t);return r}const Nk=(a,t)=>{const s=new Array(a.length+t.length);for(let r=0;r<a.length;r++)s[r]=a[r];for(let r=0;r<t.length;r++)s[a.length+r]=t[r];return s},Ck=(a,t)=>({classGroupId:a,validator:t}),Px=(a=new Map,t=null,s)=>({nextPart:a,validators:t,classGroupId:s}),yc="-",pv=[],Rk="arbitrary..",Ak=a=>{const t=zk(a),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=a;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return Ek(h);const m=h.split(yc),p=m[0]===""&&m.length>1?1:0;return Qx(m,p,t)},getConflictingClassGroupIds:(h,m)=>{if(m){const p=r[h],g=s[h];return p?g?Nk(g,p):p:g||pv}return s[h]||pv}}},Qx=(a,t,s)=>{if(a.length-t===0)return s.classGroupId;const o=a[t],c=s.nextPart.get(o);if(c){const g=Qx(a,t+1,c);if(g)return g}const h=s.validators;if(h===null)return;const m=t===0?a.join(yc):a.slice(t).join(yc),p=h.length;for(let g=0;g<p;g++){const v=h[g];if(v.validator(m))return v.classGroupId}},Ek=a=>a.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=a.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?Rk+r:void 0})(),zk=a=>{const{theme:t,classGroups:s}=a;return Ok(s,t)},Ok=(a,t)=>{const s=Px();for(const r in a){const o=a[r];bh(o,s,r,t)}return s},bh=(a,t,s,r)=>{const o=a.length;for(let c=0;c<o;c++){const h=a[c];Mk(h,t,s,r)}},Mk=(a,t,s,r)=>{if(typeof a=="string"){Lk(a,t,s);return}if(typeof a=="function"){Dk(a,t,s,r);return}Uk(a,t,s,r)},Lk=(a,t,s)=>{const r=a===""?t:Gx(t,a);r.classGroupId=s},Dk=(a,t,s,r)=>{if(Bk(a)){bh(a(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ck(s,a))},Uk=(a,t,s,r)=>{const o=Object.entries(a),c=o.length;for(let h=0;h<c;h++){const[m,p]=o[h];bh(p,Gx(t,m),s,r)}},Gx=(a,t)=>{let s=a;const r=t.split(yc),o=r.length;for(let c=0;c<o;c++){const h=r[c];let m=s.nextPart.get(h);m||(m=Px(),s.nextPart.set(h,m)),s=m}return s},Bk=a=>"isThemeGetter"in a&&a.isThemeGetter===!0,qk=a=>{if(a<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(c,h)=>{s[c]=h,t++,t>a&&(t=0,r=s,s=Object.create(null))};return{get(c){let h=s[c];if(h!==void 0)return h;if((h=r[c])!==void 0)return o(c,h),h},set(c,h){c in s?s[c]=h:o(c,h)}}},Vf="!",gv=":",$k=[],yv=(a,t,s,r,o)=>({modifiers:a,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),Vk=a=>{const{prefix:t,experimentalParseClassName:s}=a;let r=o=>{const c=[];let h=0,m=0,p=0,g;const v=o.length;for(let w=0;w<v;w++){const A=o[w];if(h===0&&m===0){if(A===gv){c.push(o.slice(p,w)),p=w+1;continue}if(A==="/"){g=w;continue}}A==="["?h++:A==="]"?h--:A==="("?m++:A===")"&&m--}const x=c.length===0?o:o.slice(p);let _=x,S=!1;x.endsWith(Vf)?(_=x.slice(0,-1),S=!0):x.startsWith(Vf)&&(_=x.slice(1),S=!0);const k=g&&g>p?g-p:void 0;return yv(c,S,_,k)};if(t){const o=t+gv,c=r;r=h=>h.startsWith(o)?c(h.slice(o.length)):yv($k,!1,h,void 0,!0)}if(s){const o=r;r=c=>s({className:c,parseClassName:o})}return r},Ik=a=>{const t=new Map;return a.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let c=0;c<s.length;c++){const h=s[c],m=h[0]==="[",p=t.has(h);m||p?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(h)):o.push(h)}return o.length>0&&(o.sort(),r.push(...o)),r}},Zk=a=>({cache:qk(a.cacheSize),parseClassName:Vk(a),sortModifiers:Ik(a),...Ak(a)}),Hk=/\s+/,Pk=(a,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:c}=t,h=[],m=a.trim().split(Hk);let p="";for(let g=m.length-1;g>=0;g-=1){const v=m[g],{isExternal:x,modifiers:_,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:w}=s(v);if(x){p=v+(p.length>0?" "+p:p);continue}let A=!!w,H=r(A?k.substring(0,w):k);if(!H){if(!A){p=v+(p.length>0?" "+p:p);continue}if(H=r(k),!H){p=v+(p.length>0?" "+p:p);continue}A=!1}const X=_.length===0?"":_.length===1?_[0]:c(_).join(":"),P=S?X+Vf:X,q=P+H;if(h.indexOf(q)>-1)continue;h.push(q);const ie=o(H,A);for(let ee=0;ee<ie.length;++ee){const D=ie[ee];h.push(P+D)}p=v+(p.length>0?" "+p:p)}return p},Qk=(...a)=>{let t=0,s,r,o="";for(;t<a.length;)(s=a[t++])&&(r=Yx(s))&&(o&&(o+=" "),o+=r);return o},Yx=a=>{if(typeof a=="string")return a;let t,s="";for(let r=0;r<a.length;r++)a[r]&&(t=Yx(a[r]))&&(s&&(s+=" "),s+=t);return s},Gk=(a,...t)=>{let s,r,o,c;const h=p=>{const g=t.reduce((v,x)=>x(v),a());return s=Zk(g),r=s.cache.get,o=s.cache.set,c=m,m(p)},m=p=>{const g=r(p);if(g)return g;const v=Pk(p,s);return o(p,v),v};return c=h,(...p)=>c(Qk(...p))},Yk=[],At=a=>{const t=s=>s[a]||Yk;return t.isThemeGetter=!0,t},Xx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xk=/^\d+\/\d+$/,Kk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fk=/\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$/,Jk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oi=a=>Xk.test(a),Me=a=>!!a&&!Number.isNaN(Number(a)),aa=a=>!!a&&Number.isInteger(Number(a)),Tf=a=>a.endsWith("%")&&Me(a.slice(0,-1)),ws=a=>Kk.test(a),tT=()=>!0,nT=a=>Fk.test(a)&&!Jk.test(a),Fx=()=>!1,sT=a=>Wk.test(a),aT=a=>eT.test(a),iT=a=>!re(a)&&!le(a),rT=a=>tr(a,e0,Fx),re=a=>Xx.test(a),Ma=a=>tr(a,t0,nT),jf=a=>tr(a,dT,Me),vv=a=>tr(a,Jx,Fx),lT=a=>tr(a,Wx,aT),Fo=a=>tr(a,n0,sT),le=a=>Kx.test(a),rl=a=>nr(a,t0),oT=a=>nr(a,fT),xv=a=>nr(a,Jx),cT=a=>nr(a,e0),uT=a=>nr(a,Wx),Jo=a=>nr(a,n0,!0),tr=(a,t,s)=>{const r=Xx.exec(a);return r?r[1]?t(r[1]):s(r[2]):!1},nr=(a,t,s=!1)=>{const r=Kx.exec(a);return r?r[1]?t(r[1]):s:!1},Jx=a=>a==="position"||a==="percentage",Wx=a=>a==="image"||a==="url",e0=a=>a==="length"||a==="size"||a==="bg-size",t0=a=>a==="length",dT=a=>a==="number",fT=a=>a==="family-name",n0=a=>a==="shadow",hT=()=>{const a=At("color"),t=At("font"),s=At("text"),r=At("font-weight"),o=At("tracking"),c=At("leading"),h=At("breakpoint"),m=At("container"),p=At("spacing"),g=At("radius"),v=At("shadow"),x=At("inset-shadow"),_=At("text-shadow"),S=At("drop-shadow"),k=At("blur"),w=At("perspective"),A=At("aspect"),H=At("ease"),X=At("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ie=()=>[...q(),le,re],ee=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],L=()=>[le,re,p],R=()=>[Oi,"full","auto",...L()],se=()=>[aa,"none","subgrid",le,re],fe=()=>["auto",{span:["full",aa,le,re]},aa,le,re],ge=()=>[aa,"auto",le,re],Ee=()=>["auto","min","max","fr",le,re],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],xe=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...L()],J=()=>[Oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],G=()=>[a,le,re],Ie=()=>[...q(),xv,vv,{position:[le,re]}],Ze=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",cT,rT,{size:[le,re]}],I=()=>[Tf,rl,Ma],Y=()=>["","none","full",g,le,re],W=()=>["",Me,rl,Ma],_e=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Me,Tf,xv,vv],ht=()=>["","none",k,le,re],Xe=()=>["none",Me,le,re],Ht=()=>["none",Me,le,re],sn=()=>[Me,le,re],Un=()=>[Oi,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ws],breakpoint:[ws],color:[tT],container:[ws],"drop-shadow":[ws],ease:["in","out","in-out"],font:[iT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ws],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ws],shadow:[ws],spacing:["px",Me],text:[ws],"text-shadow":[ws],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Oi,re,le,A]}],container:["container"],columns:[{columns:[Me,re,le,m]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:ie()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[aa,"auto",le,re]}],basis:[{basis:[Oi,"full","auto",m,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,Oi,"auto","initial","none",re]}],grow:[{grow:["",Me,le,re]}],shrink:[{shrink:["",Me,le,re]}],order:[{order:[aa,"first","last","none",le,re]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":ge()}],"col-end":[{"col-end":ge()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":ge()}],"row-end":[{"row-end":ge()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...xe(),"normal"]}],"justify-self":[{"justify-self":["auto",...xe()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...xe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...xe(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...xe(),"baseline"]}],"place-self":[{"place-self":["auto",...xe()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[m,"screen",...J()]}],"min-w":[{"min-w":[m,"screen","none",...J()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[h]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",s,rl,Ma]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,le,jf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Tf,re]}],"font-family":[{font:[oT,re,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:[o,le,re]}],"line-clamp":[{"line-clamp":[Me,"none",le,jf]}],leading:[{leading:[c,...L()]}],"list-image":[{"list-image":["none",le,re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",le,Ma]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[Me,"auto",le,re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,re]}],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",le,re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ie()}],"bg-repeat":[{bg:Ze()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},aa,le,re],radial:["",le,re],conic:[aa,le,re]},uT,lT]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,le,re]}],"outline-w":[{outline:["",Me,rl,Ma]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",v,Jo,Fo]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",x,Jo,Fo]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[Me,Ma]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",_,Jo,Fo]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[Me,le,re]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"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":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[le,re]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":q()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ie()}],"mask-repeat":[{mask:Ze()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,re]}],filter:[{filter:["","none",le,re]}],blur:[{blur:ht()}],brightness:[{brightness:[Me,le,re]}],contrast:[{contrast:[Me,le,re]}],"drop-shadow":[{"drop-shadow":["","none",S,Jo,Fo]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",Me,le,re]}],"hue-rotate":[{"hue-rotate":[Me,le,re]}],invert:[{invert:["",Me,le,re]}],saturate:[{saturate:[Me,le,re]}],sepia:[{sepia:["",Me,le,re]}],"backdrop-filter":[{"backdrop-filter":["","none",le,re]}],"backdrop-blur":[{"backdrop-blur":ht()}],"backdrop-brightness":[{"backdrop-brightness":[Me,le,re]}],"backdrop-contrast":[{"backdrop-contrast":[Me,le,re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,le,re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,le,re]}],"backdrop-invert":[{"backdrop-invert":["",Me,le,re]}],"backdrop-opacity":[{"backdrop-opacity":[Me,le,re]}],"backdrop-saturate":[{"backdrop-saturate":[Me,le,re]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,le,re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",le,re]}],ease:[{ease:["linear","initial",H,le,re]}],delay:[{delay:[Me,le,re]}],animate:[{animate:["none",X,le,re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,le,re]}],"perspective-origin":[{"perspective-origin":ie()}],rotate:[{rotate:Xe()}],"rotate-x":[{"rotate-x":Xe()}],"rotate-y":[{"rotate-y":Xe()}],"rotate-z":[{"rotate-z":Xe()}],scale:[{scale:Ht()}],"scale-x":[{"scale-x":Ht()}],"scale-y":[{"scale-y":Ht()}],"scale-z":[{"scale-z":Ht()}],"scale-3d":["scale-3d"],skew:[{skew:sn()}],"skew-x":[{"skew-x":sn()}],"skew-y":[{"skew-y":sn()}],transform:[{transform:[le,re,"","none","gpu","cpu"]}],"transform-origin":[{origin:ie()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Un()}],"translate-x":[{"translate-x":Un()}],"translate-y":[{"translate-y":Un()}],"translate-z":[{"translate-z":Un()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le,re]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",le,re]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[Me,rl,Ma,jf]}],stroke:[{stroke:["none",...G()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},mT=Gk(hT);function sr(...a){return mT(Hx(a))}function We({className:a,...t}){return d.jsx("div",{className:sr("rounded-xl border bg-white shadow-sm",a),...t})}function gt({className:a,...t}){return d.jsx("div",{className:sr("flex flex-col gap-1.5 p-6",a),...t})}function yt({className:a,...t}){return d.jsx("h3",{className:sr("text-lg font-semibold leading-none tracking-tight",a),...t})}function rt({className:a,...t}){return d.jsx("div",{className:sr("p-6 pt-0",a),...t})}const bv=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,_v=Hx,s0=(a,t)=>s=>{var r;if(t?.variants==null)return _v(a,s?.class,s?.className);const{variants:o,defaultVariants:c}=t,h=Object.keys(o).map(g=>{const v=s?.[g],x=c?.[g];if(v===null)return null;const _=bv(v)||bv(x);return o[g][_]}),m=s&&Object.entries(s).reduce((g,v)=>{let[x,_]=v;return _===void 0||(g[x]=_),g},{}),p=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((g,v)=>{let{class:x,className:_,...S}=v;return Object.entries(S).every(k=>{let[w,A]=k;return Array.isArray(A)?A.includes({...c,...m}[w]):{...c,...m}[w]===A})?[...g,x,_]:g},[]);return _v(a,h,p,s?.class,s?.className)},pT=s0("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-zinc-900 text-white",secondary:"border-transparent bg-zinc-100 text-zinc-900",destructive:"border-transparent bg-red-500 text-white",outline:"text-zinc-950",success:"border-transparent bg-emerald-500 text-white",warning:"border-transparent bg-amber-500 text-white"}},defaultVariants:{variant:"default"}});function at({className:a,variant:t,...s}){return d.jsx("div",{className:sr(pT({variant:t}),a),...s})}const gT=s0("inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 cursor-pointer",{variants:{variant:{default:"bg-zinc-900 text-white hover:bg-zinc-800",outline:"border border-zinc-200 bg-white hover:bg-zinc-50",ghost:"hover:bg-zinc-100",destructive:"bg-red-500 text-white hover:bg-red-600"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}});function Ke({className:a,variant:t,size:s,...r}){return d.jsx("button",{className:sr(gT({variant:t,size:s}),a),...r})}const yT={draft:{bg:"bg-zinc-100",border:"border-zinc-300",text:"text-zinc-600",opacity:.6},reviewed:{bg:"bg-blue-50",border:"border-blue-300",text:"text-blue-700",opacity:.8},curated:{bg:"bg-emerald-50",border:"border-emerald-300",text:"text-emerald-700",opacity:1}},Nf={high:{bg:"bg-red-50",border:"border-red-300",text:"text-red-700",dot:"bg-red-500",badge:"destructive"},medium:{bg:"bg-amber-50",border:"border-amber-300",text:"text-amber-700",dot:"bg-amber-500",badge:"warning"},low:{bg:"bg-zinc-50",border:"border-zinc-300",text:"text-zinc-600",dot:"bg-zinc-400",badge:"secondary"}},Sv={open:{bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500",badge:"destructive"},acknowledged:{bg:"bg-amber-50",text:"text-amber-700",dot:"bg-amber-500",badge:"warning"},resolved:{bg:"bg-emerald-50",text:"text-emerald-700",dot:"bg-emerald-500",badge:"success"},dismissed:{bg:"bg-zinc-50",text:"text-zinc-500",dot:"bg-zinc-400",badge:"outline"}},wv=[{bg:"bg-sky-100",text:"text-sky-800",dot:"bg-sky-500",hex:"#0ea5e9"},{bg:"bg-orange-100",text:"text-orange-800",dot:"bg-orange-500",hex:"#f97316"},{bg:"bg-teal-100",text:"text-teal-800",dot:"bg-teal-500",hex:"#14b8a6"},{bg:"bg-pink-100",text:"text-pink-800",dot:"bg-pink-500",hex:"#ec4899"},{bg:"bg-indigo-100",text:"text-indigo-800",dot:"bg-indigo-500",hex:"#6366f1"},{bg:"bg-lime-100",text:"text-lime-800",dot:"bg-lime-500",hex:"#84cc16"},{bg:"bg-fuchsia-100",text:"text-fuchsia-800",dot:"bg-fuchsia-500",hex:"#d946ef"},{bg:"bg-cyan-100",text:"text-cyan-800",dot:"bg-cyan-500",hex:"#06b6d4"}];function qi(a){let t=0;for(let r=0;r<a.length;r++)t=(t<<5)-t+a.charCodeAt(r)|0;const s=Math.abs(t)%wv.length;return wv[s]}const vT=Zn("/tasks")({component:bT}),Xn=["backlog","todo","in_progress","review","done"],kv={critical:"destructive",high:"warning",medium:"secondary",low:"outline"},xT={critical:"bg-red-100 text-red-700 border-red-300",high:"bg-amber-100 text-amber-700 border-amber-300",medium:"bg-zinc-100 text-zinc-700 border-zinc-300",low:"bg-zinc-50 text-zinc-500 border-zinc-200"};function bT(){const a=st(Se.tasks.list),t=Ct(Se.tasks.updateStatus),s=Ct(Se.tasks.addBlocker),r=Ct(Se.tasks.resolveBlocker),o=Ct(Se.tasks.updateNotes),[c,h]=Q.useState(null),[m,p]=Q.useState(null),[g,v]=Q.useState(null),[x,_]=Q.useState(null),[S,k]=Q.useState(!1),[w,A]=Q.useState(!1),[H,X]=Q.useState(!1),[P,q]=Q.useState(""),[ie,ee]=Q.useState(""),D=st(Se.tasks.getByTaskId,x?{taskId:x}:"skip");Q.useEffect(()=>{D?.notes!=null&&q(D.notes)},[D]),Q.useEffect(()=>(x?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[x]);const L=()=>{_(null),k(!1),A(!1),X(!1),ee("")};if(!a)return d.jsx("div",{className:"text-zinc-400",children:"Loading..."});const R=[...new Set(a.map($=>$.phaseId).filter(Boolean))],se=[...new Set(a.map($=>$.agent))],fe=["critical","high","medium","low"],ge=a.filter($=>!(c&&$.phaseId!==c||m&&$.agent!==m||g&&$.priority!==g)),Ee=Xn.map($=>({status:$,tasks:ge.filter(xe=>xe.status===$)}));return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Kanban Board"}),d.jsxs("p",{className:"text-zinc-500 mt-1",children:[ge.length," tasks across ",Xn.length," columns",(c||m||g)&&d.jsxs("span",{className:"text-blue-600",children:[" (filtered from ",a.length,")"]})]})]}),d.jsxs("div",{className:"flex flex-wrap gap-4",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xs text-zinc-400",children:"Phase:"}),R.map($=>d.jsx("button",{onClick:()=>h(c===$?null:$),className:`text-xs px-2 py-1 rounded-full border cursor-pointer transition-colors ${c===$?"bg-zinc-900 text-white border-zinc-900":"bg-white text-zinc-600 border-zinc-200 hover:border-zinc-400"}`,children:$},$))]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xs text-zinc-400",children:"Agent:"}),se.map($=>d.jsx("button",{onClick:()=>p(m===$?null:$),className:`text-xs px-2 py-1 rounded-full border cursor-pointer transition-colors ${m===$?"bg-zinc-900 text-white border-zinc-900":"bg-white text-zinc-600 border-zinc-200 hover:border-zinc-400"}`,children:$},$))]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"text-xs text-zinc-400",children:"Priority:"}),fe.map($=>d.jsx("button",{onClick:()=>v(g===$?null:$),className:`text-xs px-2 py-1 rounded-full border cursor-pointer transition-colors ${g===$?"bg-zinc-900 text-white border-zinc-900":`${xT[$]} hover:opacity-80`}`,children:$},$))]})]}),d.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4",children:Ee.map($=>d.jsxs("div",{className:"flex-shrink-0 w-64",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h3",{className:"text-sm font-semibold text-zinc-700 uppercase tracking-wider",children:$.status.replace("_"," ")}),d.jsx(at,{variant:"secondary",children:$.tasks.length})]}),d.jsx("div",{className:"space-y-3",children:$.tasks.map(xe=>d.jsxs(We,{className:"p-4 hover:shadow-md transition-shadow cursor-pointer",onClick:()=>_(xe.taskId),children:[d.jsxs("div",{className:"flex items-start justify-between mb-2",children:[d.jsx("span",{className:"text-xs font-mono text-zinc-400",children:xe.taskId}),d.jsx("div",{className:`w-6 h-6 rounded-full ${qi(xe.agent).bg} ${qi(xe.agent).text} flex items-center justify-center text-xs font-bold`,children:xe.agent[0].toUpperCase()})]}),d.jsx("p",{className:"text-sm font-medium mb-2",children:xe.title}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(at,{variant:kv[xe.priority]??"secondary",className:"text-[10px]",children:xe.priority}),xe.phaseId&&d.jsx(at,{variant:"outline",className:"text-[10px]",children:xe.phaseId}),xe.category&&d.jsx("span",{className:"text-[10px] text-zinc-400",children:xe.category})]}),d.jsxs("div",{className:"flex items-center justify-between mt-3",children:[$.status!=="backlog"&&d.jsxs("button",{onClick:()=>{const M=Xn.indexOf($.status);t({taskId:xe.taskId,status:Xn[M-1]})},className:"text-xs text-zinc-400 hover:text-zinc-700 cursor-pointer",children:["← ",Xn[Xn.indexOf($.status)-1]?.replace("_"," ")]}),$.status==="backlog"&&d.jsx("span",{}),$.status!=="done"&&d.jsxs("button",{onClick:()=>{const M=Xn.indexOf($.status);t({taskId:xe.taskId,status:Xn[M+1]})},className:"text-xs text-blue-600 hover:text-blue-800 cursor-pointer",children:[Xn[Xn.indexOf($.status)+1]?.replace("_"," ")," →"]})]})]},xe.taskId))})]},$.status))}),x&&D&&d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:L}),d.jsxs("div",{className:"relative bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[d.jsxs("div",{className:"p-6 border-b",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-xs font-mono text-zinc-400",children:D.taskId}),d.jsx("h3",{className:"text-xl font-semibold mt-1",children:D.title})]}),d.jsx(Ke,{variant:"ghost",size:"icon",onClick:L,children:"✕"})]}),d.jsxs("div",{className:"flex items-center gap-2 mt-3 flex-wrap",children:[d.jsx(at,{variant:kv[D.priority]??"secondary",children:D.priority}),d.jsx(at,{variant:"outline",children:D.status.replace("_"," ")}),d.jsx("div",{className:`w-6 h-6 rounded-full ${qi(D.agent).bg} ${qi(D.agent).text} flex items-center justify-center text-xs font-bold`,children:D.agent[0]?.toUpperCase()}),d.jsx("span",{className:"text-sm text-zinc-500",children:D.agent})]})]}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("button",{onClick:()=>k(!S),className:"flex items-center gap-2 text-sm font-medium text-zinc-700 hover:text-zinc-900 cursor-pointer",children:[d.jsx("span",{className:"transform transition-transform",children:S?"▼":"▶"}),"Details ",S?"(click to collapse)":"(click to expand)"]}),S&&d.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-zinc-200",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Description"}),d.jsx("p",{className:"text-sm text-zinc-700",children:D.description||"No description"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Created"}),d.jsx("p",{className:"text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString():"—"})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Started"}),d.jsx("p",{className:"text-sm",children:D.startedAt?new Date(D.startedAt).toLocaleString():"—"})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Completed"}),d.jsx("p",{className:"text-sm",children:D.completedAt?new Date(D.completedAt).toLocaleString():"—"})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Phase"}),d.jsx("p",{className:"text-sm",children:D.phaseId||"—"})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Category"}),d.jsx("p",{className:"text-sm",children:D.category||"—"})]}),D.dependencies&&D.dependencies.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Dependencies"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:D.dependencies.map($=>d.jsx(at,{variant:"outline",className:"text-xs",children:$},$))})]}),D.tags&&D.tags.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Tags"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:D.tags.map($=>d.jsx("span",{className:"text-xs bg-zinc-100 text-zinc-600 px-2 py-0.5 rounded",children:$},$))})]})]}),d.jsxs("button",{onClick:()=>A(!w),className:"flex items-center gap-2 text-sm font-medium text-zinc-700 hover:text-zinc-900 cursor-pointer",children:[d.jsx("span",{className:"transform transition-transform",children:w?"▼":"▶"}),"History & Activity ",w?"(click to collapse)":"(click to expand)"]}),w&&d.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-zinc-200",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-2",children:"Status History"}),D.statusHistory&&D.statusHistory.length>0?d.jsx("div",{className:"space-y-2",children:D.statusHistory.map(($,xe)=>d.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[d.jsx("div",{className:"w-2 h-2 rounded-full bg-zinc-400"}),d.jsx("span",{className:"font-medium",children:$.status}),d.jsx("span",{className:"text-zinc-400",children:new Date($.timestamp).toLocaleString()}),$.agent&&d.jsxs("span",{className:"text-zinc-500",children:["by ",$.agent]}),$.note&&d.jsxs("span",{className:"text-zinc-500",children:["— ",$.note]}),$.commitHash&&d.jsx("span",{className:"font-mono text-xs text-blue-600",children:$.commitHash.slice(0,7)})]},xe))}):d.jsx("p",{className:"text-sm text-zinc-400",children:"No status history"})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-2",children:"Commits"}),D.commits&&D.commits.length>0?d.jsx("div",{className:"space-y-2",children:D.commits.map(($,xe)=>d.jsxs("div",{className:"text-sm",children:[d.jsx("span",{className:"font-mono text-xs text-blue-600",children:$.hash.slice(0,7)}),d.jsx("span",{className:"ml-2",children:$.message})]},xe))}):d.jsx("p",{className:"text-sm text-zinc-400",children:"No commits linked"})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase",children:"Blockers"}),d.jsx(Ke,{size:"sm",variant:"outline",onClick:()=>{const $=prompt("Enter blocker reason:");$&&D._id&&s({id:D._id,reason:$})},children:"+ Add Blocker"})]}),D.blockers&&D.blockers.length>0?d.jsx("div",{className:"space-y-2",children:D.blockers.map(($,xe)=>d.jsxs("div",{className:`p-2 rounded border ${$.resolvedAt?"bg-green-50 border-green-200":"bg-red-50 border-red-200"}`,children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("span",{className:"text-sm",children:$.reason}),!$.resolvedAt&&D._id&&d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>r({id:D._id,blockerIndex:xe,resolvedBy:"human"}),children:"Resolve"})]}),d.jsxs("div",{className:"text-xs text-zinc-400 mt-1",children:[new Date($.createdAt).toLocaleString(),$.resolvedAt&&` — resolved by ${$.resolvedBy} at ${new Date($.resolvedAt).toLocaleString()}`]})]},xe))}):d.jsx("p",{className:"text-sm text-zinc-400",children:"No blockers"})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase",children:"Notes"}),d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>{H?(D._id&&o({id:D._id,notes:P}),X(!1)):X(!0)},children:H?"Save":"Edit"})]}),H?d.jsx("textarea",{value:P,onChange:$=>q($.target.value),className:"w-full h-24 p-2 text-sm border rounded-lg resize-none",placeholder:"Add notes..."}):d.jsx("p",{className:"text-sm text-zinc-600",children:D.notes||"No notes"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Estimated Hours"}),d.jsx("p",{className:"text-sm",children:D.estimatedHours??"—"})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-400 uppercase mb-1",children:"Actual Hours"}),d.jsx("p",{className:"text-sm",children:D.actualHours??"—"})]})]})]})]})]})]})]})}const _T=Zn("/skills")({component:TT});function ST({skills:a,agents:t,toggleSkill:s}){const[r,o]=Q.useState(""),c=st(Se.skills.listAgentSkills,{agentId:r});return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("select",{className:"rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:r,onChange:h=>o(h.target.value),children:[d.jsx("option",{value:"",children:"Select agent to manage skills..."}),t.map(h=>d.jsxs("option",{value:h.agentId,children:[h.label," (",h.agentId,")"]},h.agentId))]})}),r&&d.jsxs("div",{className:"border rounded-lg divide-y",children:[a.map(h=>{const p=c?.find(g=>g.skillId===h.skillId)?.enabled??!1;return d.jsxs("div",{className:"flex items-center justify-between p-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium text-sm",children:h.name}),d.jsxs("p",{className:"text-xs text-zinc-400",children:[h.skillId," — v",h.version]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(at,{variant:p?"success":"secondary",children:p?"enabled":"disabled"}),d.jsx(Ke,{variant:p?"outline":"default",size:"sm",onClick:()=>s(r,h.skillId,!p),children:p?"Disable":"Enable"})]})]},h.skillId)}),a.length===0&&d.jsx("p",{className:"p-4 text-sm text-zinc-400",children:"No skills registered"})]}),!r&&d.jsx("p",{className:"text-sm text-zinc-400",children:"Select an agent to manage their skills"})]})}function wT({webhooks:a,registerWebhook:t,setWebhookEnabled:s}){const[r,o]=Q.useState(!1),[c,h]=Q.useState(""),[m,p]=Q.useState("task_completed"),[g,v]=Q.useState(""),x=()=>{c&&(t({path:c,eventType:m,secret:g||void 0,name:c,createdBy:"human"}),h(""),p("task_completed"),v(""),o(!1))};return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex justify-end",children:d.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>o(!r),children:r?"Cancel":"Register Webhook"})}),r&&d.jsxs("div",{className:"border rounded-lg p-4 space-y-3 bg-zinc-50",children:[d.jsx("input",{type:"text",placeholder:"Webhook name",className:"w-full rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:c,onChange:_=>h(_.target.value)}),d.jsx("input",{type:"text",placeholder:"Event type (e.g., task_completed)",className:"w-full rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:m,onChange:_=>p(_.target.value)}),d.jsx("input",{type:"text",placeholder:"Secret (optional)",className:"w-full rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:g,onChange:_=>v(_.target.value)}),d.jsx(Ke,{onClick:x,className:"w-full",children:"Register"})]}),d.jsxs("div",{className:"border rounded-lg divide-y",children:[a.map(_=>d.jsxs("div",{className:"flex items-center justify-between p-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium text-sm",children:_.name}),d.jsx("p",{className:"text-xs text-zinc-400 font-mono",children:_.path}),d.jsxs("div",{className:"flex gap-1 mt-1",children:[d.jsx(at,{variant:"secondary",className:"text-[10px]",children:_.eventType}),_.targetAgent&&d.jsx(at,{variant:"outline",className:"text-[10px]",children:_.targetAgent})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(at,{variant:_.enabled?"success":"destructive",children:_.enabled?"enabled":"disabled"}),d.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>s({webhookId:_.webhookId,enabled:!_.enabled}),children:"Toggle"})]})]},_.webhookId)),a.length===0&&d.jsx("p",{className:"p-4 text-sm text-zinc-400",children:"No webhooks registered"})]})]})}function kT({schedules:a,createSchedule:t}){const[s,r]=Q.useState(!1),[o,c]=Q.useState(""),[h,m]=Q.useState("* * * * *"),[p,g]=Q.useState(""),v=()=>{!o||!h||(t(o,h,p),c(""),m("* * * * *"),g(""),r(!1))};return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex justify-end",children:d.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>r(!s),children:s?"Cancel":"Create Schedule"})}),s&&d.jsxs("div",{className:"border rounded-lg p-4 space-y-3 bg-zinc-50",children:[d.jsx("input",{type:"text",placeholder:"Schedule name",className:"w-full rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:o,onChange:x=>c(x.target.value)}),d.jsx("input",{type:"text",placeholder:"Cron pattern (e.g., 0 * * * *)",className:"w-full rounded-lg border border-zinc-200 px-3 py-2 text-sm font-mono",value:h,onChange:x=>m(x.target.value)}),d.jsx("input",{type:"text",placeholder:"Job ID (optional)",className:"w-full rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:p,onChange:x=>g(x.target.value)}),d.jsx(Ke,{onClick:v,className:"w-full",children:"Create"})]}),d.jsxs("div",{className:"border rounded-lg divide-y",children:[a.map(x=>d.jsxs("div",{className:"flex items-center justify-between p-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium text-sm",children:x.name}),d.jsx("p",{className:"text-xs text-zinc-400 font-mono",children:x.cronExpression}),d.jsxs("div",{className:"flex gap-1 mt-1",children:[d.jsx(at,{variant:"secondary",className:"text-[10px]",children:x.lane}),x.nextRunAt&&d.jsxs(at,{variant:"outline",className:"text-[10px]",children:["next: ",new Date(x.nextRunAt).toLocaleString()]})]})]}),d.jsx(at,{variant:x.enabled?"success":"destructive",children:x.enabled?"active":"paused"})]},x.scheduleId)),a.length===0&&d.jsx("p",{className:"p-4 text-sm text-zinc-400",children:"No schedules configured"})]})]})}function TT(){const a=st(Se.skills.listSkills,{}),t=st(Se.agents.list,{}),s=st(Se.hooks.listWebhooks,{}),r=st(Se.cronManager.listSchedules,{}),o=Ct(Se.skills.toggleAgentSkill),c=Ct(Se.hooks.registerWebhook),h=Ct(Se.hooks.setWebhookEnabled),m=Ct(Se.cronManager.createSchedule),[p,g]=Q.useState("skills");return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Skills & Hooks Management"}),d.jsx("p",{className:"text-zinc-500 mt-1",children:"Configure agent skills, webhooks, and cron schedules"})]}),d.jsxs("div",{className:"flex gap-1 border-b",children:[d.jsx("button",{onClick:()=>g("skills"),className:`px-4 py-2 text-sm font-medium transition-colors ${p==="skills"?"border-b-2 border-zinc-900 text-zinc-900":"text-zinc-500 hover:text-zinc-900"}`,children:"Skills"}),d.jsx("button",{onClick:()=>g("hooks"),className:`px-4 py-2 text-sm font-medium transition-colors ${p==="hooks"?"border-b-2 border-zinc-900 text-zinc-900":"text-zinc-500 hover:text-zinc-900"}`,children:"Webhooks"}),d.jsx("button",{onClick:()=>g("cron"),className:`px-4 py-2 text-sm font-medium transition-colors ${p==="cron"?"border-b-2 border-zinc-900 text-zinc-900":"text-zinc-500 hover:text-zinc-900"}`,children:"Cron Schedules"})]}),p==="skills"&&d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Skills Panel"})}),d.jsx(rt,{children:a&&t?d.jsx(ST,{skills:a,agents:t,toggleSkill:(v,x,_)=>o({agentId:v,skillId:x,enabled:_})}):d.jsx("p",{className:"text-zinc-400",children:"Loading..."})})]}),p==="hooks"&&d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Hooks Panel"})}),d.jsx(rt,{children:s?d.jsx(wT,{webhooks:s,registerWebhook:v=>c(v),setWebhookEnabled:v=>h(v)}):d.jsx("p",{className:"text-zinc-400",children:"Loading..."})})]}),p==="cron"&&d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Cron Visualizer"})}),d.jsx(rt,{children:r?d.jsx(kT,{schedules:r,createSchedule:(v,x,_)=>m({name:v,cronExpression:x,jobId:_,lane:"cron",createdBy:"human"})}):d.jsx("p",{className:"text-zinc-400",children:"Loading..."})})]})]})}function vc(a){return{title:"Session Closed",subtitle:`${a.agentName} — ${new Date().toLocaleDateString()}`,items:[{icon:"✓",label:"Tasks Done",value:a.tasksCompleted.toString()},{icon:"📝",label:"Files Changed",value:a.filesChanged.toString()},{icon:"🔢",label:"Tokens",value:a.tokensUsed.toLocaleString()}],footer:`Duration: ${a.duration} • UCA Session`,colorScheme:"green"}}function xc(a){return{title:"Daily Summary",subtitle:a.date,items:[{icon:"📋",label:"Tasks",value:a.totalTasks.toString()},{icon:"🤖",label:"Agents",value:a.activeAgents.toString()},{icon:"⚠️",label:"Drift",value:a.driftEvents.toString()}],footer:"UCA Daily Report",colorScheme:"blue"}}function bc(a){return{title:`🎉 ${a.phaseName}`,subtitle:a.projectName,items:[{icon:"🚀",label:"Phase",value:a.phaseName},{icon:"✓",label:"Completed",value:a.tasksCompleted.toString()},{icon:"⏱️",label:"Duration",value:a.duration}],footer:"Milestone Reached",colorScheme:"orange"}}const jT=Zn("/mnemonics")({component:ET}),a0={blue:{bg:"bg-blue-50",border:"border-blue-200",text:"text-blue-900",accent:"text-blue-600"},green:{bg:"bg-emerald-50",border:"border-emerald-200",text:"text-emerald-900",accent:"text-emerald-600"},purple:{bg:"bg-purple-50",border:"border-purple-200",text:"text-purple-900",accent:"text-purple-600"},orange:{bg:"bg-orange-50",border:"border-orange-200",text:"text-orange-900",accent:"text-orange-600"}},NT=[{id:"1",type:"started",title:"Session Started",description:"claude initialized with UCA context",timestamp:"09:00 AM",color:"blue"},{id:"2",type:"taskCompleted",title:"Task Completed",description:"C1: Schema design completed",timestamp:"10:30 AM",color:"green"},{id:"3",type:"taskCompleted",title:"Task Completed",description:"C2: API endpoints implemented",timestamp:"11:45 AM",color:"green"},{id:"4",type:"milestone",title:"Milestone Reached",description:"Foundation phase 50% complete",timestamp:"02:00 PM",color:"orange"},{id:"5",type:"taskCompleted",title:"Task Completed",description:"C3: Frontend components built",timestamp:"03:30 PM",color:"green"},{id:"6",type:"closed",title:"Session Closed",description:"12 tasks completed, 47 files changed",timestamp:"05:00 PM",color:"purple"}];function _h({data:a}){const t=a0[a.colorScheme];return d.jsxs("div",{className:`rounded-xl border-2 ${t.border} ${t.bg} p-6 space-y-4`,children:[d.jsxs("div",{children:[d.jsx("h3",{className:`text-lg font-bold ${t.text}`,children:a.title}),d.jsx("p",{className:`text-sm ${t.accent}`,children:a.subtitle})]}),d.jsx("div",{className:"grid grid-cols-2 gap-3",children:a.items.map((s,r)=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xl",children:s.icon}),d.jsxs("div",{children:[d.jsx("div",{className:`text-xs ${t.accent}`,children:s.label}),d.jsx("div",{className:`text-sm font-semibold ${t.text}`,children:s.value})]})]},r))}),d.jsx("div",{className:`text-xs ${t.accent} pt-2 border-t ${t.border}`,children:a.footer})]})}function CT(){return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Session Timeline"})}),d.jsx(rt,{children:d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute left-3 top-0 bottom-0 w-0.5 bg-zinc-200"}),d.jsx("div",{className:"space-y-6",children:NT.map(a=>{const t=a0[a.color];return d.jsxs("div",{className:"relative flex items-start gap-4 pl-8",children:[d.jsx("div",{className:`absolute left-1.5 w-3 h-3 rounded-full border-2 border-white shadow-sm ${t.bg} ${t.border.replace("border-","bg-")}`,style:{backgroundColor:a.color==="blue"?"#2563eb":a.color==="green"?"#10b981":a.color==="orange"?"#f97316":"#a855f7"}}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h4",{className:"font-medium text-zinc-900",children:a.title}),d.jsx("span",{className:"text-xs text-zinc-400",children:a.timestamp})]}),d.jsx("p",{className:"text-sm text-zinc-500 mt-0.5",children:a.description})]})]},a.id)})})]})})]})}function RT(){const[a,t]=Q.useState("sessionClose"),[s,r]=Q.useState({agentName:"claude",tasksCompleted:12,filesChanged:47,tokensUsed:125e3,duration:"2h 15m",date:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),totalTasks:24,activeAgents:3,driftEvents:1,phaseName:"Foundation",projectName:"UCA Demo"}),o=()=>{switch(a){case"sessionClose":return vc({agentName:s.agentName,tasksCompleted:Number(s.tasksCompleted),filesChanged:Number(s.filesChanged),tokensUsed:Number(s.tokensUsed),duration:s.duration});case"dailySummary":return xc({date:s.date,totalTasks:Number(s.totalTasks),activeAgents:Number(s.activeAgents),driftEvents:Number(s.driftEvents)});case"milestone":return bc({phaseName:s.phaseName,projectName:s.projectName,tasksCompleted:Number(s.tasksCompleted),duration:s.duration})}};return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Card Generator"})}),d.jsx(rt,{children:d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Card Type"}),d.jsxs("select",{value:a,onChange:c=>t(c.target.value),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg bg-white",children:[d.jsx("option",{value:"sessionClose",children:"Session Close"}),d.jsx("option",{value:"dailySummary",children:"Daily Summary"}),d.jsx("option",{value:"milestone",children:"Milestone"})]})]}),a==="sessionClose"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Agent Name"}),d.jsx("input",{type:"text",value:s.agentName,onChange:c=>r({...s,agentName:c.target.value}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Tasks Completed"}),d.jsx("input",{type:"number",value:s.tasksCompleted,onChange:c=>r({...s,tasksCompleted:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Files Changed"}),d.jsx("input",{type:"number",value:s.filesChanged,onChange:c=>r({...s,filesChanged:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Tokens Used"}),d.jsx("input",{type:"number",value:s.tokensUsed,onChange:c=>r({...s,tokensUsed:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Duration"}),d.jsx("input",{type:"text",value:s.duration,onChange:c=>r({...s,duration:c.target.value}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]})]})]}),a==="dailySummary"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Date"}),d.jsx("input",{type:"text",value:s.date,onChange:c=>r({...s,date:c.target.value}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Total Tasks"}),d.jsx("input",{type:"number",value:s.totalTasks,onChange:c=>r({...s,totalTasks:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Active Agents"}),d.jsx("input",{type:"number",value:s.activeAgents,onChange:c=>r({...s,activeAgents:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Drift Events"}),d.jsx("input",{type:"number",value:s.driftEvents,onChange:c=>r({...s,driftEvents:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]})]})]}),a==="milestone"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Phase Name"}),d.jsx("input",{type:"text",value:s.phaseName,onChange:c=>r({...s,phaseName:c.target.value}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Project Name"}),d.jsx("input",{type:"text",value:s.projectName,onChange:c=>r({...s,projectName:c.target.value}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Tasks Completed"}),d.jsx("input",{type:"number",value:s.tasksCompleted,onChange:c=>r({...s,tasksCompleted:Number(c.target.value)}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-1",children:"Duration"}),d.jsx("input",{type:"text",value:s.duration,onChange:c=>r({...s,duration:c.target.value}),className:"w-full px-3 py-2 border border-zinc-300 rounded-lg"})]})]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-zinc-700 mb-2",children:"Preview"}),d.jsx(_h,{data:o()})]})]})})]})}function AT(){const[a,t]=Q.useState("all"),s=[{type:"sessionClose",data:vc({agentName:"claude",tasksCompleted:12,filesChanged:47,tokensUsed:125e3,duration:"2h 15m"})},{type:"dailySummary",data:xc({date:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),totalTasks:24,activeAgents:3,driftEvents:1})},{type:"milestone",data:bc({phaseName:"Foundation",projectName:"UCA Demo",tasksCompleted:18,duration:"3 days"})},{type:"sessionClose",data:vc({agentName:"opencode",tasksCompleted:8,filesChanged:23,tokensUsed:85e3,duration:"1h 45m"})},{type:"dailySummary",data:xc({date:"2026-02-15",totalTasks:18,activeAgents:2,driftEvents:0})},{type:"milestone",data:bc({phaseName:"Core Features",projectName:"UCA Demo",tasksCompleted:35,duration:"1 week"})}],r=a==="all"?s:s.filter(o=>o.type===a);return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Gallery"})}),d.jsxs(rt,{children:[d.jsx("div",{className:"flex gap-2 mb-4",children:["all","sessionClose","dailySummary","milestone"].map(o=>d.jsx("button",{onClick:()=>t(o),className:`px-3 py-1.5 text-sm rounded-lg transition-colors ${a===o?"bg-zinc-900 text-white":"bg-zinc-100 text-zinc-600 hover:bg-zinc-200"}`,children:o==="all"?"All":o==="sessionClose"?"Session Close":o==="dailySummary"?"Daily Summary":"Milestone"},o))}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.map((o,c)=>d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-xs font-medium text-zinc-500 uppercase",children:o.type==="sessionClose"?"Session Close":o.type==="dailySummary"?"Daily Summary":"Milestone"}),d.jsx("button",{onClick:()=>alert(`PNG generation for "${o.data.title}" — API endpoint coming soon!`),className:"text-xs px-2 py-1 bg-zinc-900 text-white rounded hover:bg-zinc-700 transition-colors",children:"Generate PNG"})]}),d.jsx(_h,{data:o.data})]},c))})]})]})}function ET(){const a=[vc({agentName:"claude",tasksCompleted:12,filesChanged:47,tokensUsed:125e3,duration:"2h 15m"}),xc({date:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),totalTasks:24,activeAgents:3,driftEvents:1}),bc({phaseName:"Foundation",projectName:"UCA Demo",tasksCompleted:18,duration:"3 days"})];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Mnemonics"}),d.jsx("p",{className:"text-zinc-500 mt-1",children:"Mnemonic image card templates — CSS preview (Satori SVG rendering available server-side)"})]}),d.jsx(CT,{}),d.jsx(RT,{}),d.jsx(AT,{}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Gallery Preview"})}),d.jsxs(rt,{children:[d.jsx("p",{className:"text-sm text-zinc-500 mb-4",children:"These cards show the template data as CSS previews. Server-side Satori rendering produces SVG/PNG versions via the API."}),d.jsx("div",{className:"grid grid-cols-1 gap-6",children:a.map((t,s)=>d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"font-medium text-zinc-700",children:t.title}),d.jsx("button",{onClick:()=>alert(`PNG generation for "${t.title}" — API endpoint coming soon!`),className:"text-sm px-3 py-1.5 bg-zinc-900 text-white rounded-lg hover:bg-zinc-700 transition-colors",children:"Generate PNG"})]}),d.jsx(_h,{data:t})]},s))})]})]})]})}const zT=["backlog","todo","in_progress","blocked","review","done","archived"],OT=["critical","high","medium","low"],If=["draft","reviewed","curated"],MT=["task_output","decision","learning","insight","test_result","error","milestone","drift_event","note"],LT=["scope_creep","time_overrun","context_switch","quality_drop","assumption_introduced"],DT=["low","medium","high"],UT=["open","acknowledged","resolved","dismissed"],BT=["pattern","decision","lesson_learned","best_practice","anti_pattern","reference"],qT=["ai","human"],$T=["active","idle","offline"];var Qe;(function(a){a.assertEqual=o=>{};function t(o){}a.assertIs=t;function s(o){throw new Error}a.assertNever=s,a.arrayToEnum=o=>{const c={};for(const h of o)c[h]=h;return c},a.getValidEnumValues=o=>{const c=a.objectKeys(o).filter(m=>typeof o[o[m]]!="number"),h={};for(const m of c)h[m]=o[m];return a.objectValues(h)},a.objectValues=o=>a.objectKeys(o).map(function(c){return o[c]}),a.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const c=[];for(const h in o)Object.prototype.hasOwnProperty.call(o,h)&&c.push(h);return c},a.find=(o,c)=>{for(const h of o)if(c(h))return h},a.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,c=" | "){return o.map(h=>typeof h=="string"?`'${h}'`:h).join(c)}a.joinValues=r,a.jsonStringifyReplacer=(o,c)=>typeof c=="bigint"?c.toString():c})(Qe||(Qe={}));var Tv;(function(a){a.mergeShapes=(t,s)=>({...t,...s})})(Tv||(Tv={}));const oe=Qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ra=a=>{switch(typeof a){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return Number.isNaN(a)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(a)?oe.array:a===null?oe.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?oe.promise:typeof Map<"u"&&a instanceof Map?oe.map:typeof Set<"u"&&a instanceof Set?oe.set:typeof Date<"u"&&a instanceof Date?oe.date:oe.object;default:return oe.unknown}},K=Qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Za=class i0 extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(c){return c.message},r={_errors:[]},o=c=>{for(const h of c.issues)if(h.code==="invalid_union")h.unionErrors.map(o);else if(h.code==="invalid_return_type")o(h.returnTypeError);else if(h.code==="invalid_arguments")o(h.argumentsError);else if(h.path.length===0)r._errors.push(s(h));else{let m=r,p=0;for(;p<h.path.length;){const g=h.path[p];p===h.path.length-1?(m[g]=m[g]||{_errors:[]},m[g]._errors.push(s(h))):m[g]=m[g]||{_errors:[]},m=m[g],p++}}};return o(this),r}static assert(t){if(!(t instanceof i0))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Qe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},r=[];for(const o of this.issues)if(o.path.length>0){const c=o.path[0];s[c]=s[c]||[],s[c].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}};Za.create=a=>new Za(a);const Zf=(a,t)=>{let s;switch(a.code){case K.invalid_type:a.received===oe.undefined?s="Required":s=`Expected ${a.expected}, received ${a.received}`;break;case K.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(a.expected,Qe.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:s=`Unrecognized key(s) in object: ${Qe.joinValues(a.keys,", ")}`;break;case K.invalid_union:s="Invalid input";break;case K.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Qe.joinValues(a.options)}`;break;case K.invalid_enum_value:s=`Invalid enum value. Expected ${Qe.joinValues(a.options)}, received '${a.received}'`;break;case K.invalid_arguments:s="Invalid function arguments";break;case K.invalid_return_type:s="Invalid function return type";break;case K.invalid_date:s="Invalid date";break;case K.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(s=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?s=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?s=`Invalid input: must end with "${a.validation.endsWith}"`:Qe.assertNever(a.validation):a.validation!=="regex"?s=`Invalid ${a.validation}`:s="Invalid";break;case K.too_small:a.type==="array"?s=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?s=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?s=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?s=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?s=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:s="Invalid input";break;case K.too_big:a.type==="array"?s=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?s=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?s=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?s=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?s=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:s="Invalid input";break;case K.custom:s="Invalid input";break;case K.invalid_intersection_types:s="Intersection results could not be merged";break;case K.not_multiple_of:s=`Number must be a multiple of ${a.multipleOf}`;break;case K.not_finite:s="Number must be finite";break;default:s=t.defaultError,Qe.assertNever(a)}return{message:s}};let VT=Zf;function IT(){return VT}const ZT=a=>{const{data:t,path:s,errorMaps:r,issueData:o}=a,c=[...s,...o.path||[]],h={...o,path:c};if(o.message!==void 0)return{...o,path:c,message:o.message};let m="";const p=r.filter(g=>!!g).slice().reverse();for(const g of p)m=g(h,{data:t,defaultError:m}).message;return{...o,path:c,message:m}};function te(a,t){const s=IT(),r=ZT({issueData:t,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,s,s===Zf?void 0:Zf].filter(o=>!!o)});a.common.issues.push(r)}let vn=class r0{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const r=[];for(const o of s){if(o.status==="aborted")return Te;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,s){const r=[];for(const o of s){const c=await o.key,h=await o.value;r.push({key:c,value:h})}return r0.mergeObjectSync(t,r)}static mergeObjectSync(t,s){const r={};for(const o of s){const{key:c,value:h}=o;if(c.status==="aborted"||h.status==="aborted")return Te;c.status==="dirty"&&t.dirty(),h.status==="dirty"&&t.dirty(),c.value!=="__proto__"&&(typeof h.value<"u"||o.alwaysSet)&&(r[c.value]=h.value)}return{status:t.value,value:r}}};const Te=Object.freeze({status:"aborted"}),cl=a=>({status:"dirty",value:a}),On=a=>({status:"valid",value:a}),jv=a=>a.status==="aborted",Nv=a=>a.status==="dirty",Qi=a=>a.status==="valid",_c=a=>typeof Promise<"u"&&a instanceof Promise;var me;(function(a){a.errToObj=t=>typeof t=="string"?{message:t}:t||{},a.toString=t=>typeof t=="string"?t:t?.message})(me||(me={}));let es=class{constructor(t,s,r,o){this._cachedPath=[],this.parent=t,this.data=s,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const Cv=(a,t)=>{if(Qi(t))return{success:!0,data:t.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Za(a.common.issues);return this._error=s,this._error}}};function ze(a){if(!a)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:o}=a;if(t&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(h,m)=>{const{message:p}=a;return h.code==="invalid_enum_value"?{message:p??m.defaultError}:typeof m.data>"u"?{message:p??r??m.defaultError}:h.code!=="invalid_type"?{message:m.defaultError}:{message:p??s??m.defaultError}},description:o}}let $e=class{get description(){return this._def.description}_getType(t){return ra(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:ra(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new vn,ctx:{common:t.parent.common,data:t.data,parsedType:ra(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(_c(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const r=this.safeParse(t,s);if(r.success)return r.data;throw r.error}safeParse(t,s){const r={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ra(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Cv(r,o)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ra(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Qi(r)?{value:r.value}:{issues:s.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(r=>Qi(r)?{value:r.value}:{issues:s.common.issues})}async parseAsync(t,s){const r=await this.safeParseAsync(t,s);if(r.success)return r.data;throw r.error}async safeParseAsync(t,s){const r={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ra(t)},o=this._parse({data:t,path:r.path,parent:r}),c=await(_c(o)?o:Promise.resolve(o));return Cv(r,c)}refine(t,s){const r=o=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(o):s;return this._refinement((o,c)=>{const h=t(o),m=()=>c.addIssue({code:K.custom,...r(o)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(m(),!1)):h?!0:(m(),!1)})}refinement(t,s){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof s=="function"?s(r,o):s),!1))}_refinement(t){return new Yi({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return da.create(this,this._def)}nullable(){return Xi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gi.create(this)}promise(){return Tc.create(this,this._def)}or(t){return wc.create([this,t],this._def)}and(t){return kc.create(this,t,this._def)}transform(t){return new Yi({...ze(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Jf({...ze(this._def),innerType:this,defaultValue:s,typeName:we.ZodDefault})}brand(){return new hj({typeName:we.ZodBranded,type:this,...ze(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Wf({...ze(this._def),innerType:this,catchValue:s,typeName:we.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return mj.create(this,t)}readonly(){return eh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const HT=/^c[^\s-]{8,}$/i,PT=/^[0-9a-z]+$/,QT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GT=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,YT=/^[a-z0-9_-]{21}$/i,XT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,FT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,JT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cf;const WT=/^(?:(?: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])$/,ej=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tj=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nj=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,sj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,l0="((\\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])))",ij=new RegExp(`^${l0}$`);function o0(a){let t="[0-5]\\d";a.precision?t=`${t}\\.\\d{${a.precision}}`:a.precision==null&&(t=`${t}(\\.\\d+)?`);const s=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function rj(a){return new RegExp(`^${o0(a)}$`)}function lj(a){let t=`${l0}T${o0(a)}`;const s=[];return s.push(a.local?"Z?":"Z"),a.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function oj(a,t){return!!((t==="v4"||!t)&&WT.test(a)||(t==="v6"||!t)&&tj.test(a))}function cj(a,t){if(!XT.test(a))return!1;try{const[s]=a.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function uj(a,t){return!!((t==="v4"||!t)&&ej.test(a)||(t==="v6"||!t)&&nj.test(a))}let Sc=class ul extends $e{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const c=this._getOrReturnCtx(t);return te(c,{code:K.invalid_type,expected:oe.string,received:c.parsedType}),Te}const r=new vn;let o;for(const c of this._def.checks)if(c.kind==="min")t.data.length<c.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:K.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="max")t.data.length>c.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:K.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="length"){const h=t.data.length>c.value,m=t.data.length<c.value;(h||m)&&(o=this._getOrReturnCtx(t,o),h?te(o,{code:K.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):m&&te(o,{code:K.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),r.dirty())}else if(c.kind==="email")FT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"email",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="emoji")Cf||(Cf=new RegExp(JT,"u")),Cf.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"emoji",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="uuid")GT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"uuid",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="nanoid")YT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"nanoid",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid")HT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"cuid",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid2")PT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"cuid2",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="ulid")QT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"ulid",code:K.invalid_string,message:c.message}),r.dirty());else if(c.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),te(o,{validation:"url",code:K.invalid_string,message:c.message}),r.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"regex",code:K.invalid_string,message:c.message}),r.dirty())):c.kind==="trim"?t.data=t.data.trim():c.kind==="includes"?t.data.includes(c.value,c.position)||(o=this._getOrReturnCtx(t,o),te(o,{code:K.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),r.dirty()):c.kind==="toLowerCase"?t.data=t.data.toLowerCase():c.kind==="toUpperCase"?t.data=t.data.toUpperCase():c.kind==="startsWith"?t.data.startsWith(c.value)||(o=this._getOrReturnCtx(t,o),te(o,{code:K.invalid_string,validation:{startsWith:c.value},message:c.message}),r.dirty()):c.kind==="endsWith"?t.data.endsWith(c.value)||(o=this._getOrReturnCtx(t,o),te(o,{code:K.invalid_string,validation:{endsWith:c.value},message:c.message}),r.dirty()):c.kind==="datetime"?lj(c).test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{code:K.invalid_string,validation:"datetime",message:c.message}),r.dirty()):c.kind==="date"?ij.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{code:K.invalid_string,validation:"date",message:c.message}),r.dirty()):c.kind==="time"?rj(c).test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{code:K.invalid_string,validation:"time",message:c.message}),r.dirty()):c.kind==="duration"?KT.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"duration",code:K.invalid_string,message:c.message}),r.dirty()):c.kind==="ip"?oj(t.data,c.version)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"ip",code:K.invalid_string,message:c.message}),r.dirty()):c.kind==="jwt"?cj(t.data,c.alg)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"jwt",code:K.invalid_string,message:c.message}),r.dirty()):c.kind==="cidr"?uj(t.data,c.version)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"cidr",code:K.invalid_string,message:c.message}),r.dirty()):c.kind==="base64"?sj.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"base64",code:K.invalid_string,message:c.message}),r.dirty()):c.kind==="base64url"?aj.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"base64url",code:K.invalid_string,message:c.message}),r.dirty()):Qe.assertNever(c);return{status:r.value,value:t.data}}_regex(t,s,r){return this.refinement(o=>t.test(o),{validation:s,code:K.invalid_string,...me.errToObj(r)})}_addCheck(t){return new ul({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...me.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...me.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...me.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...me.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...me.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...me.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...me.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...me.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...me.errToObj(s)})}nonempty(t){return this.min(1,me.errToObj(t))}trim(){return new ul({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ul({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ul({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};Sc.create=a=>new Sc({checks:[],typeName:we.ZodString,coerce:a?.coerce??!1,...ze(a)});function dj(a,t){const s=(a.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=s>r?s:r,c=Number.parseInt(a.toFixed(o).replace(".","")),h=Number.parseInt(t.toFixed(o).replace(".",""));return c%h/10**o}let Hf=class Pf extends $e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const c=this._getOrReturnCtx(t);return te(c,{code:K.invalid_type,expected:oe.number,received:c.parsedType}),Te}let r;const o=new vn;for(const c of this._def.checks)c.kind==="int"?Qe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),te(r,{code:K.invalid_type,expected:"integer",received:"float",message:c.message}),o.dirty()):c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:K.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:K.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="multipleOf"?dj(t.data,c.value)!==0&&(r=this._getOrReturnCtx(t,r),te(r,{code:K.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):c.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),te(r,{code:K.not_finite,message:c.message}),o.dirty()):Qe.assertNever(c);return{status:o.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,me.toString(s))}gt(t,s){return this.setLimit("min",t,!1,me.toString(s))}lte(t,s){return this.setLimit("max",t,!0,me.toString(s))}lt(t,s){return this.setLimit("max",t,!1,me.toString(s))}setLimit(t,s,r,o){return new Pf({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:me.toString(o)}]})}_addCheck(t){return new Pf({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Qe.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(s)&&Number.isFinite(t)}};Hf.create=a=>new Hf({checks:[],typeName:we.ZodNumber,coerce:a?.coerce||!1,...ze(a)});let Rv=class Qf extends $e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==oe.bigint)return this._getInvalidInput(t);let r;const o=new vn;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:K.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:K.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="multipleOf"?t.data%c.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),te(r,{code:K.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):Qe.assertNever(c);return{status:o.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return te(s,{code:K.invalid_type,expected:oe.bigint,received:s.parsedType}),Te}gte(t,s){return this.setLimit("min",t,!0,me.toString(s))}gt(t,s){return this.setLimit("min",t,!1,me.toString(s))}lte(t,s){return this.setLimit("max",t,!0,me.toString(s))}lt(t,s){return this.setLimit("max",t,!1,me.toString(s))}setLimit(t,s,r,o){return new Qf({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:me.toString(o)}]})}_addCheck(t){return new Qf({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};Rv.create=a=>new Rv({checks:[],typeName:we.ZodBigInt,coerce:a?.coerce??!1,...ze(a)});let Gf=class extends $e{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return te(r,{code:K.invalid_type,expected:oe.boolean,received:r.parsedType}),Te}return On(t.data)}};Gf.create=a=>new Gf({typeName:we.ZodBoolean,coerce:a?.coerce||!1,...ze(a)});let Av=class c0 extends $e{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const c=this._getOrReturnCtx(t);return te(c,{code:K.invalid_type,expected:oe.date,received:c.parsedType}),Te}if(Number.isNaN(t.data.getTime())){const c=this._getOrReturnCtx(t);return te(c,{code:K.invalid_date}),Te}const r=new vn;let o;for(const c of this._def.checks)c.kind==="min"?t.data.getTime()<c.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:K.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),r.dirty()):c.kind==="max"?t.data.getTime()>c.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:K.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),r.dirty()):Qe.assertNever(c);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new c0({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}};Av.create=a=>new Av({checks:[],coerce:a?.coerce||!1,typeName:we.ZodDate,...ze(a)});let Ev=class extends $e{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return te(r,{code:K.invalid_type,expected:oe.symbol,received:r.parsedType}),Te}return On(t.data)}};Ev.create=a=>new Ev({typeName:we.ZodSymbol,...ze(a)});let zv=class extends $e{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return te(r,{code:K.invalid_type,expected:oe.undefined,received:r.parsedType}),Te}return On(t.data)}};zv.create=a=>new zv({typeName:we.ZodUndefined,...ze(a)});let Ov=class extends $e{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return te(r,{code:K.invalid_type,expected:oe.null,received:r.parsedType}),Te}return On(t.data)}};Ov.create=a=>new Ov({typeName:we.ZodNull,...ze(a)});let Mv=class extends $e{constructor(){super(...arguments),this._any=!0}_parse(t){return On(t.data)}};Mv.create=a=>new Mv({typeName:we.ZodAny,...ze(a)});let Lv=class extends $e{constructor(){super(...arguments),this._unknown=!0}_parse(t){return On(t.data)}};Lv.create=a=>new Lv({typeName:we.ZodUnknown,...ze(a)});let ma=class extends $e{_parse(t){const s=this._getOrReturnCtx(t);return te(s,{code:K.invalid_type,expected:oe.never,received:s.parsedType}),Te}};ma.create=a=>new ma({typeName:we.ZodNever,...ze(a)});let Dv=class extends $e{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return te(r,{code:K.invalid_type,expected:oe.void,received:r.parsedType}),Te}return On(t.data)}};Dv.create=a=>new Dv({typeName:we.ZodVoid,...ze(a)});let Gi=class rc extends $e{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),o=this._def;if(s.parsedType!==oe.array)return te(s,{code:K.invalid_type,expected:oe.array,received:s.parsedType}),Te;if(o.exactLength!==null){const h=s.data.length>o.exactLength.value,m=s.data.length<o.exactLength.value;(h||m)&&(te(s,{code:h?K.too_big:K.too_small,minimum:m?o.exactLength.value:void 0,maximum:h?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&s.data.length<o.minLength.value&&(te(s,{code:K.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&s.data.length>o.maxLength.value&&(te(s,{code:K.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((h,m)=>o.type._parseAsync(new es(s,h,s.path,m)))).then(h=>vn.mergeArray(r,h));const c=[...s.data].map((h,m)=>o.type._parseSync(new es(s,h,s.path,m)));return vn.mergeArray(r,c)}get element(){return this._def.type}min(t,s){return new rc({...this._def,minLength:{value:t,message:me.toString(s)}})}max(t,s){return new rc({...this._def,maxLength:{value:t,message:me.toString(s)}})}length(t,s){return new rc({...this._def,exactLength:{value:t,message:me.toString(s)}})}nonempty(t){return this.min(1,t)}};Gi.create=(a,t)=>new Gi({type:a,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...ze(t)});function Di(a){if(a instanceof As){const t={};for(const s in a.shape){const r=a.shape[s];t[s]=da.create(Di(r))}return new As({...a._def,shape:()=>t})}else return a instanceof Gi?new Gi({...a._def,type:Di(a.element)}):a instanceof da?da.create(Di(a.unwrap())):a instanceof Xi?Xi.create(Di(a.unwrap())):a instanceof Sl?Sl.create(a.items.map(t=>Di(t))):a}let As=class In extends $e{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=Qe.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==oe.object){const g=this._getOrReturnCtx(t);return te(g,{code:K.invalid_type,expected:oe.object,received:g.parsedType}),Te}const{status:r,ctx:o}=this._processInputParams(t),{shape:c,keys:h}=this._getCached(),m=[];if(!(this._def.catchall instanceof ma&&this._def.unknownKeys==="strip"))for(const g in o.data)h.includes(g)||m.push(g);const p=[];for(const g of h){const v=c[g],x=o.data[g];p.push({key:{status:"valid",value:g},value:v._parse(new es(o,x,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof ma){const g=this._def.unknownKeys;if(g==="passthrough")for(const v of m)p.push({key:{status:"valid",value:v},value:{status:"valid",value:o.data[v]}});else if(g==="strict")m.length>0&&(te(o,{code:K.unrecognized_keys,keys:m}),r.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const v of m){const x=o.data[v];p.push({key:{status:"valid",value:v},value:g._parse(new es(o,x,o.path,v)),alwaysSet:v in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const g=[];for(const v of p){const x=await v.key,_=await v.value;g.push({key:x,value:_,alwaysSet:v.alwaysSet})}return g}).then(g=>vn.mergeObjectSync(r,g)):vn.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new In({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,r)=>{const o=this._def.errorMap?.(s,r).message??r.defaultError;return s.code==="unrecognized_keys"?{message:me.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new In({...this._def,unknownKeys:"strip"})}passthrough(){return new In({...this._def,unknownKeys:"passthrough"})}extend(t){return new In({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new In({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new In({...this._def,catchall:t})}pick(t){const s={};for(const r of Qe.objectKeys(t))t[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new In({...this._def,shape:()=>s})}omit(t){const s={};for(const r of Qe.objectKeys(this.shape))t[r]||(s[r]=this.shape[r]);return new In({...this._def,shape:()=>s})}deepPartial(){return Di(this)}partial(t){const s={};for(const r of Qe.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?s[r]=o:s[r]=o.optional()}return new In({...this._def,shape:()=>s})}required(t){const s={};for(const r of Qe.objectKeys(this.shape))if(t&&!t[r])s[r]=this.shape[r];else{let c=this.shape[r];for(;c instanceof da;)c=c._def.innerType;s[r]=c}return new In({...this._def,shape:()=>s})}keyof(){return d0(Qe.objectKeys(this.shape))}};As.create=(a,t)=>new As({shape:()=>a,unknownKeys:"strip",catchall:ma.create(),typeName:we.ZodObject,...ze(t)});As.strictCreate=(a,t)=>new As({shape:()=>a,unknownKeys:"strict",catchall:ma.create(),typeName:we.ZodObject,...ze(t)});As.lazycreate=(a,t)=>new As({shape:a,unknownKeys:"strip",catchall:ma.create(),typeName:we.ZodObject,...ze(t)});let wc=class extends $e{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function o(c){for(const m of c)if(m.result.status==="valid")return m.result;for(const m of c)if(m.result.status==="dirty")return s.common.issues.push(...m.ctx.common.issues),m.result;const h=c.map(m=>new Za(m.ctx.common.issues));return te(s,{code:K.invalid_union,unionErrors:h}),Te}if(s.common.async)return Promise.all(r.map(async c=>{const h={...s,common:{...s.common,issues:[]},parent:null};return{result:await c._parseAsync({data:s.data,path:s.path,parent:h}),ctx:h}})).then(o);{let c;const h=[];for(const p of r){const g={...s,common:{...s.common,issues:[]},parent:null},v=p._parseSync({data:s.data,path:s.path,parent:g});if(v.status==="valid")return v;v.status==="dirty"&&!c&&(c={result:v,ctx:g}),g.common.issues.length&&h.push(g.common.issues)}if(c)return s.common.issues.push(...c.ctx.common.issues),c.result;const m=h.map(p=>new Za(p));return te(s,{code:K.invalid_union,unionErrors:m}),Te}}get options(){return this._def.options}};wc.create=(a,t)=>new wc({options:a,typeName:we.ZodUnion,...ze(t)});function Yf(a,t){const s=ra(a),r=ra(t);if(a===t)return{valid:!0,data:a};if(s===oe.object&&r===oe.object){const o=Qe.objectKeys(t),c=Qe.objectKeys(a).filter(m=>o.indexOf(m)!==-1),h={...a,...t};for(const m of c){const p=Yf(a[m],t[m]);if(!p.valid)return{valid:!1};h[m]=p.data}return{valid:!0,data:h}}else if(s===oe.array&&r===oe.array){if(a.length!==t.length)return{valid:!1};const o=[];for(let c=0;c<a.length;c++){const h=a[c],m=t[c],p=Yf(h,m);if(!p.valid)return{valid:!1};o.push(p.data)}return{valid:!0,data:o}}else return s===oe.date&&r===oe.date&&+a==+t?{valid:!0,data:a}:{valid:!1}}let kc=class extends $e{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),o=(c,h)=>{if(jv(c)||jv(h))return Te;const m=Yf(c.value,h.value);return m.valid?((Nv(c)||Nv(h))&&s.dirty(),{status:s.value,value:m.data}):(te(r,{code:K.invalid_intersection_types}),Te)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([c,h])=>o(c,h)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};kc.create=(a,t,s)=>new kc({left:a,right:t,typeName:we.ZodIntersection,...ze(s)});let Sl=class u0 extends $e{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return te(r,{code:K.invalid_type,expected:oe.array,received:r.parsedType}),Te;if(r.data.length<this._def.items.length)return te(r,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Te;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...r.data].map((h,m)=>{const p=this._def.items[m]||this._def.rest;return p?p._parse(new es(r,h,r.path,m)):null}).filter(h=>!!h);return r.common.async?Promise.all(c).then(h=>vn.mergeArray(s,h)):vn.mergeArray(s,c)}get items(){return this._def.items}rest(t){return new u0({...this._def,rest:t})}};Sl.create=(a,t)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sl({items:a,typeName:we.ZodTuple,rest:null,...ze(t)})};let fj=class Xf extends $e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return te(r,{code:K.invalid_type,expected:oe.object,received:r.parsedType}),Te;const o=[],c=this._def.keyType,h=this._def.valueType;for(const m in r.data)o.push({key:c._parse(new es(r,m,r.path,m)),value:h._parse(new es(r,r.data[m],r.path,m)),alwaysSet:m in r.data});return r.common.async?vn.mergeObjectAsync(s,o):vn.mergeObjectSync(s,o)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof $e?new Xf({keyType:t,valueType:s,typeName:we.ZodRecord,...ze(r)}):new Xf({keyType:Sc.create(),valueType:t,typeName:we.ZodRecord,...ze(s)})}},Uv=class extends $e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return te(r,{code:K.invalid_type,expected:oe.map,received:r.parsedType}),Te;const o=this._def.keyType,c=this._def.valueType,h=[...r.data.entries()].map(([m,p],g)=>({key:o._parse(new es(r,m,r.path,[g,"key"])),value:c._parse(new es(r,p,r.path,[g,"value"]))}));if(r.common.async){const m=new Map;return Promise.resolve().then(async()=>{for(const p of h){const g=await p.key,v=await p.value;if(g.status==="aborted"||v.status==="aborted")return Te;(g.status==="dirty"||v.status==="dirty")&&s.dirty(),m.set(g.value,v.value)}return{status:s.value,value:m}})}else{const m=new Map;for(const p of h){const g=p.key,v=p.value;if(g.status==="aborted"||v.status==="aborted")return Te;(g.status==="dirty"||v.status==="dirty")&&s.dirty(),m.set(g.value,v.value)}return{status:s.value,value:m}}}};Uv.create=(a,t,s)=>new Uv({valueType:t,keyType:a,typeName:we.ZodMap,...ze(s)});let Bv=class Kf extends $e{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return te(r,{code:K.invalid_type,expected:oe.set,received:r.parsedType}),Te;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(te(r,{code:K.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),s.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(te(r,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),s.dirty());const c=this._def.valueType;function h(p){const g=new Set;for(const v of p){if(v.status==="aborted")return Te;v.status==="dirty"&&s.dirty(),g.add(v.value)}return{status:s.value,value:g}}const m=[...r.data.values()].map((p,g)=>c._parse(new es(r,p,r.path,g)));return r.common.async?Promise.all(m).then(p=>h(p)):h(m)}min(t,s){return new Kf({...this._def,minSize:{value:t,message:me.toString(s)}})}max(t,s){return new Kf({...this._def,maxSize:{value:t,message:me.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}};Bv.create=(a,t)=>new Bv({valueType:a,minSize:null,maxSize:null,typeName:we.ZodSet,...ze(t)});let qv=class extends $e{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};qv.create=(a,t)=>new qv({getter:a,typeName:we.ZodLazy,...ze(t)});let $v=class extends $e{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return te(s,{received:s.data,code:K.invalid_literal,expected:this._def.value}),Te}return{status:"valid",value:t.data}}get value(){return this._def.value}};$v.create=(a,t)=>new $v({value:a,typeName:we.ZodLiteral,...ze(t)});function d0(a,t){return new Sh({values:a,typeName:we.ZodEnum,...ze(t)})}let Sh=class Ff extends $e{_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),r=this._def.values;return te(s,{expected:Qe.joinValues(r),received:s.parsedType,code:K.invalid_type}),Te}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const s=this._getOrReturnCtx(t),r=this._def.values;return te(s,{received:s.data,code:K.invalid_enum_value,options:r}),Te}return On(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return Ff.create(t,{...this._def,...s})}exclude(t,s=this._def){return Ff.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}};Sh.create=d0;let Vv=class extends $e{_parse(t){const s=Qe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const o=Qe.objectValues(s);return te(r,{expected:Qe.joinValues(o),received:r.parsedType,code:K.invalid_type}),Te}if(this._cache||(this._cache=new Set(Qe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=Qe.objectValues(s);return te(r,{received:r.data,code:K.invalid_enum_value,options:o}),Te}return On(t.data)}get enum(){return this._def.values}};Vv.create=(a,t)=>new Vv({values:a,typeName:we.ZodNativeEnum,...ze(t)});let Tc=class extends $e{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==oe.promise&&s.common.async===!1)return te(s,{code:K.invalid_type,expected:oe.promise,received:s.parsedType}),Te;const r=s.parsedType===oe.promise?s.data:Promise.resolve(s.data);return On(r.then(o=>this._def.type.parseAsync(o,{path:s.path,errorMap:s.common.contextualErrorMap})))}};Tc.create=(a,t)=>new Tc({type:a,typeName:we.ZodPromise,...ze(t)});let Yi=class extends $e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:r}=this._processInputParams(t),o=this._def.effect||null,c={addIssue:h=>{te(r,h),h.fatal?s.abort():s.dirty()},get path(){return r.path}};if(c.addIssue=c.addIssue.bind(c),o.type==="preprocess"){const h=o.transform(r.data,c);if(r.common.async)return Promise.resolve(h).then(async m=>{if(s.value==="aborted")return Te;const p=await this._def.schema._parseAsync({data:m,path:r.path,parent:r});return p.status==="aborted"?Te:p.status==="dirty"||s.value==="dirty"?cl(p.value):p});{if(s.value==="aborted")return Te;const m=this._def.schema._parseSync({data:h,path:r.path,parent:r});return m.status==="aborted"?Te:m.status==="dirty"||s.value==="dirty"?cl(m.value):m}}if(o.type==="refinement"){const h=m=>{const p=o.refinement(m,c);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(r.common.async===!1){const m=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return m.status==="aborted"?Te:(m.status==="dirty"&&s.dirty(),h(m.value),{status:s.value,value:m.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(m=>m.status==="aborted"?Te:(m.status==="dirty"&&s.dirty(),h(m.value).then(()=>({status:s.value,value:m.value}))))}if(o.type==="transform")if(r.common.async===!1){const h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Qi(h))return Te;const m=o.transform(h.value,c);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:m}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>Qi(h)?Promise.resolve(o.transform(h.value,c)).then(m=>({status:s.value,value:m})):Te);Qe.assertNever(o)}};Yi.create=(a,t,s)=>new Yi({schema:a,typeName:we.ZodEffects,effect:t,...ze(s)});Yi.createWithPreprocess=(a,t,s)=>new Yi({schema:t,effect:{type:"preprocess",transform:a},typeName:we.ZodEffects,...ze(s)});let da=class extends $e{_parse(t){return this._getType(t)===oe.undefined?On(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};da.create=(a,t)=>new da({innerType:a,typeName:we.ZodOptional,...ze(t)});let Xi=class extends $e{_parse(t){return this._getType(t)===oe.null?On(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Xi.create=(a,t)=>new Xi({innerType:a,typeName:we.ZodNullable,...ze(t)});let Jf=class extends $e{_parse(t){const{ctx:s}=this._processInputParams(t);let r=s.data;return s.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};Jf.create=(a,t)=>new Jf({innerType:a,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});let Wf=class extends $e{_parse(t){const{ctx:s}=this._processInputParams(t),r={...s,common:{...s.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return _c(o)?o.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Wf.create=(a,t)=>new Wf({innerType:a,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});let Iv=class extends $e{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return te(r,{code:K.invalid_type,expected:oe.nan,received:r.parsedType}),Te}return{status:"valid",value:t.data}}};Iv.create=a=>new Iv({typeName:we.ZodNaN,...ze(a)});let hj=class extends $e{_parse(t){const{ctx:s}=this._processInputParams(t),r=s.data;return this._def.type._parse({data:r,path:s.path,parent:s})}unwrap(){return this._def.type}},mj=class f0 extends $e{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Te:c.status==="dirty"?(s.dirty(),cl(c.value)):this._def.out._parseAsync({data:c.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Te:o.status==="dirty"?(s.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,s){return new f0({in:t,out:s,typeName:we.ZodPipeline})}},eh=class extends $e{_parse(t){const s=this._def.innerType._parse(t),r=o=>(Qi(o)&&(o.value=Object.freeze(o.value)),o);return _c(s)?s.then(o=>r(o)):r(s)}unwrap(){return this._def.innerType}};eh.create=(a,t)=>new eh({innerType:a,typeName:we.ZodReadonly,...ze(t)});var we;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(we||(we={}));const ue=Sc.create,lt=Hf.create,ks=Gf.create;ma.create;const Et=Gi.create,Mn=As.create;wc.create;kc.create;Sl.create;const h0=fj.create,gn=Sh.create;Tc.create;da.create;Xi.create;const pj=Mn({label:ue().min(1),icon:ue().min(1).max(3),color:ue().regex(/^#[0-9a-fA-F]{6}$/)}),gj=Mn({id:ue().min(1).regex(/^[a-z][a-z0-9_-]*$/),label:ue().min(1),wave:lt().int().positive()}),yj=Mn({commitTracking:ks().optional().default(!1),scopeCreepDetection:ks().optional().default(!1),reviewFindings:ks().optional().default(!1),confidenceTracking:ks().optional().default(!1),evidenceTracker:ks().optional().default(!1),handoffLog:ks().optional().default(!1),checkpointLog:ks().optional().default(!1),agentOps:ks().optional().default(!1)}),vj=Mn({pollingInterval:lt().int().min(1e3).optional().default(5e3),theme:gn(["dark","light"]).optional().default("dark")}),xj=Mn({pollInterval:lt().int().min(5e3).optional().default(3e4),maxConcurrentRuns:lt().int().min(1).max(10).optional().default(3),maxRunsPerDay:lt().int().min(1).optional().default(100),defaultTimeoutMinutes:lt().int().min(1).optional().default(30),protectedBranches:Et(ue()).optional().default(["main","master"]),agentCommands:h0(ue(),ue()).optional().default({})});Mn({projectName:ue().min(1),projectId:ue().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/).optional(),tableName:ue().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/).optional().default("agentTasks"),agents:h0(ue().min(1),pj).refine(a=>Object.keys(a).length>=1,{message:"At least one agent is required"}),categories:Et(ue().min(1)).min(1,"At least one category is required"),phases:Et(gj).min(1,"At least one phase is required"),taskIdPattern:ue().min(1),extensions:yj,dashboard:vj.optional(),agentOps:xj.optional()});const bj=Mn({taskId:ue().min(1),agent:ue().min(1),title:ue().min(1),description:ue(),status:gn(zT).optional(),priority:gn(OT).optional(),category:ue().optional(),phaseId:ue().optional(),wave:lt().int().optional(),estimatedHours:lt().positive().optional(),dependencies:Et(ue()).optional(),tags:Et(ue()).optional(),acceptanceCriteria:Et(ue()).optional(),filesExpected:Et(ue()).optional(),confidenceLevel:lt().int().min(0).max(5).optional(),sourceIds:Et(ue()).optional()});Et(bj);const _j=Mn({from:gn(If),to:gn(If),promotedBy:ue().min(1),reason:ue().optional(),timestamp:lt()});Mn({entryId:ue().min(1),projectId:ue().min(1),type:gn(MT),content:ue().min(1),summary:ue().optional(),tier:gn(If),promotionHistory:Et(_j),confidenceScore:lt().min(0).max(5).optional(),validatedBy:Et(ue()).optional(),taskId:ue().optional(),linksTo:Et(ue()),propagateTo:Et(ue()),tags:Et(ue()),createdBy:ue().min(1),createdAt:lt(),updatedAt:lt(),nlmSynced:ks().optional(),nlmNotebookId:ue().optional(),nlmSourceId:ue().optional()});Mn({entryId:ue().min(1),projectId:ue().optional(),title:ue().min(1),content:ue().min(1),category:gn(BT),confidenceScore:lt().min(0).max(5),sourceEntryIds:Et(ue()),nlmNotebookId:ue().optional(),nlmSourceId:ue().optional(),tags:Et(ue()),createdBy:ue().min(1),createdAt:lt(),updatedAt:lt(),usageCount:lt().int().min(0)});Mn({eventId:ue().min(1),projectId:ue().min(1),taskId:ue().optional(),agent:ue().min(1),driftType:gn(LT),description:ue().min(1),severity:gn(DT),toolCallCount:lt().int().optional(),originalEstimate:lt().optional(),actualTime:lt().optional(),status:gn(UT),resolvedBy:ue().optional(),resolvedAt:lt().optional(),resolution:ue().optional(),detectedAt:lt()});Mn({agentId:ue().min(1),label:ue().min(1),type:gn(qT),capabilities:Et(ue()),preferredCategories:Et(ue()),currentStatus:gn($T),currentTaskIds:Et(ue()),totalTasksCompleted:lt().int().min(0),totalHoursLogged:lt().min(0),avgCompletionRate:lt().min(0).max(1),driftEventsTriggered:lt().int().min(0),taskIdPrefix:ue().min(1).max(3),color:ue().regex(/^#[0-9a-fA-F]{6}$/),icon:ue().min(1).max(3)});const Rf=["draft","reviewed","curated"];function m0(a){const t=Rf.indexOf(a);return t===-1||t>=Rf.length-1?null:Rf[t+1]}function Sj(a,t,s){const r=m0(a.tier);if(r===null||t!==r)return!1;const o=s==="human";return a.tier==="draft"&&t==="reviewed"?!0:a.tier==="reviewed"&&t==="curated"?o:!1}function wj(a){if(a.tier!=="draft")return!1;const t=a.validatedBy??[];return new Set(t).size>=2}function kj(a){var t,s;return{id:a.taskId,title:a.title,description:a.description,status:a.status??"backlog",priority:a.priority??"medium",agent:a.agent,phaseId:a.phaseId??null,category:a.category??null,wave:a.wave??null,tags:a.tags??[],dependencyCount:((t=a.dependencies)==null?void 0:t.length)??0,hasBlockers:(((s=a.dependencies)==null?void 0:s.length)??0)>0,estimatedHours:a.estimatedHours??null,confidenceLevel:a.confidenceLevel??null}}function Tj(a){return a.map(kj)}function jj(a){return{id:a.eventId,driftType:a.driftType,description:a.description,severity:a.severity,status:a.status,agent:a.agent,taskId:a.taskId??null,detectedAt:a.detectedAt,resolvedAt:a.resolvedAt??null,resolution:a.resolution??null,isHighSeverityOpen:a.severity==="high"&&a.status==="open"}}function Nj(a){return a.map(jj)}function Cj(a){return a.filter(t=>t.isHighSeverityOpen)}function Rj(a){var t;const s=m0(a.tier);return{id:a.entryId,type:a.type,content:a.content,summary:a.summary??null,tier:a.tier,confidenceScore:a.confidenceScore??null,validationCount:((t=a.validatedBy)==null?void 0:t.length)??0,promotionCount:a.promotionHistory.length,isAutoPromotable:wj(a),canPromoteToNext:s!==null&&Sj(a,s,"human"),tags:a.tags,createdBy:a.createdBy,createdAt:a.createdAt}}function Aj(a){return a.map(Rj)}function Ej(a){return{id:a.agentId,label:a.label,type:a.type,currentStatus:a.currentStatus,activeTaskCount:a.currentTaskIds.length,totalCompleted:a.totalTasksCompleted,totalHours:a.totalHoursLogged,avgCompletionRate:a.avgCompletionRate,driftCount:a.driftEventsTriggered,capabilities:a.capabilities,color:a.color,icon:a.icon}}function zj(a){return a.map(Ej)}function Af(a,t,s){const r={};for(const o of s)r[o]=0;for(const o of a){const c=t(o);r[c]=(r[c]??0)+1}return r}const Oj=["backlog","todo","in_progress","blocked","review","done","archived"],Mj=["critical","high","medium","low"],Lj=["draft","reviewed","curated"];function Dj(a,t,s,r){const o=a.length,c=t.length,h=t.filter(w=>w.status==="open").length,m=t.filter(w=>w.isHighSeverityOpen).length,p=a.filter(w=>w.status==="done"||w.status==="archived").length,g=t.filter(w=>w.status==="resolved"||w.status==="dismissed").length,v=s.filter(w=>w.tier==="curated").length,x=o>0?p/o*40:40,_=c>0?g/c*30:30,S=s.length>0?v/s.length*30:30,k=Math.round(x+_+S);return{totalTasks:o,tasksByStatus:Af(a,w=>w.status,Oj),tasksByPriority:Af(a,w=>w.priority,Mj),totalDrifts:c,openDrifts:h,highSeverityOpen:m,contextByTier:Af(s,w=>w.tier,Lj),totalAgents:r.length,activeAgents:r.filter(w=>w.currentStatus==="active").length,healthScore:k}}const Uj={infographic:{name:"infographic",width:1080,height:1920,label:"Infographic (9:16)"},slide:{name:"slide",width:1920,height:1080,label:"Slide (16:9)"},thumbnail:{name:"thumbnail",width:1080,height:1080,label:"Thumbnail (1:1)"},og:{name:"og",width:1200,height:630,label:"OG Image (1200x630)"}},Bj=Zn("/export")({component:Zj}),jc=[{id:"foundation",label:"Foundation",wave:1,deps:[]},{id:"runtime",label:"Runtime",wave:2,deps:["foundation"]},{id:"dashboard",label:"Dashboard",wave:3,deps:["runtime"]},{id:"publish",label:"Publish",wave:3,deps:["runtime"]},{id:"cli-ext",label:"CLI Ext",wave:4,deps:["runtime","publish"]},{id:"nlm",label:"NLM",wave:5,deps:["runtime"]},{id:"meta",label:"Meta",wave:6,deps:["cli-ext","nlm"]}],qj=["backend","frontend","uiux","devops","review","testing","documentation"];function $j(a,t){const s=jc.find(r=>r.id===a);return!s||s.deps.length===0?!0:s.deps.every(r=>{const o=t.filter(h=>h.phaseId===r),c=o.filter(h=>h.status==="done").length;return o.length>0&&c===o.length})}function Vj({tasks:a,taskStats:t,onCreateTask:s}){const[r,o]=Q.useState(null),c=m=>{const p=a.filter(_=>_.phaseId===m),g=p.filter(_=>_.status==="done").length,v=p.length,x=v>0?Math.round(g/v*100):0;return{done:g,total:v,pct:x,phaseTasks:p}},h=m=>{const p=a.filter(v=>v.phaseId===m),g=new Set(p.map(v=>v.category).filter(Boolean));return qj.filter(v=>!g.has(v))};return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsxs(yt,{className:"flex items-center justify-between",children:[d.jsx("span",{children:"Phase Dependencies"}),r&&d.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>o(null),children:"Clear filter"})]})}),d.jsxs(rt,{children:[d.jsx("div",{className:"flex gap-4 overflow-x-auto pb-2",children:jc.map(m=>{const p=$j(m.id,a),{done:g,total:v,pct:x}=c(m.id),_=h(m.id),S=p?x===100?"border-emerald-500 bg-emerald-50":x>0?"border-blue-500 bg-blue-50":"border-amber-300 bg-amber-50":"border-zinc-300 bg-zinc-100 opacity-60",k=r===m.id;return d.jsxs("div",{className:`flex-shrink-0 w-44 border-2 rounded-xl p-3 cursor-pointer transition-all ${S} ${k?"ring-2 ring-zinc-400":""}`,onClick:()=>o(k?null:m.id),children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"text-xs text-zinc-400 mb-1",children:["Wave ",m.wave]}),!p&&d.jsx("span",{className:"text-[10px] bg-zinc-200 px-1 rounded",children:"🔒"})]}),d.jsx("div",{className:"text-sm font-semibold",children:m.label}),d.jsxs("div",{className:"text-lg font-bold mt-1",children:[x,"%"]}),d.jsxs("div",{className:"text-[10px] text-zinc-500",children:[g,"/",v," tasks"]}),m.deps.length>0&&d.jsxs("div",{className:"text-[10px] text-zinc-400 mt-2",children:["needs: ",m.deps.join(", ")]}),_.length>0&&d.jsxs("div",{className:"mt-3 pt-2 border-t border-zinc-200",children:[d.jsx("div",{className:"text-[10px] text-amber-600 mb-1",children:"Gaps:"}),d.jsxs("div",{className:"flex flex-wrap gap-1",children:[_.slice(0,3).map(w=>d.jsxs("button",{onClick:A=>{A.stopPropagation(),s(m.id,w)},className:"text-[10px] bg-amber-100 hover:bg-amber-200 px-1.5 py-0.5 rounded transition-colors",title:`Create task for ${w}`,children:["+ ",w]},w)),_.length>3&&d.jsxs("span",{className:"text-[10px] text-zinc-400",children:["+",_.length-3]})]})]})]},m.id)})}),r&&d.jsxs("div",{className:"mt-4 pt-4 border-t border-zinc-200",children:[d.jsxs("h4",{className:"text-sm font-semibold mb-2",children:["Tasks in ",jc.find(m=>m.id===r)?.label]}),d.jsxs("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:[a.filter(m=>m.phaseId===r).map(m=>d.jsxs("div",{className:"flex items-center justify-between text-xs bg-zinc-50 rounded px-2 py-1",children:[d.jsx("span",{className:"font-mono",children:m.taskId}),d.jsx("span",{className:"truncate flex-1 mx-2",children:m.title}),d.jsx(at,{variant:m.status==="done"?"success":"secondary",children:m.status})]},m.taskId)),a.filter(m=>m.phaseId===r).length===0&&d.jsx("p",{className:"text-xs text-zinc-400",children:"No tasks in this phase"})]})]})]})]})}function Ij(){const a=["Context","Tools","Knowledge","Model"],t=["Types","Backend","Client API","CLI","Dashboard"],s={Context:{Types:"done",Backend:"done","Client API":"done",CLI:"missing",Dashboard:"done"},Tools:{Types:"done",Backend:"done","Client API":"done",CLI:"done",Dashboard:"partial"},Knowledge:{Types:"done",Backend:"missing","Client API":"missing",CLI:"missing",Dashboard:"missing"},Model:{Types:"done",Backend:"done","Client API":"done",CLI:"missing",Dashboard:"done"}},r={done:"bg-emerald-500",partial:"bg-amber-400",missing:"bg-zinc-200"};return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"4 Pillars Status"})}),d.jsx(rt,{children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:"text-left pb-2"}),a.map(o=>d.jsx("th",{className:"text-center pb-2 text-zinc-600",children:o},o))]})}),d.jsx("tbody",{children:t.map(o=>d.jsxs("tr",{children:[d.jsx("td",{className:"py-1.5 text-zinc-500",children:o}),a.map(c=>d.jsx("td",{className:"text-center py-1.5",children:d.jsx("div",{className:`w-4 h-4 rounded-full mx-auto ${r[s[c][o]]}`,title:s[c][o]})},c))]},o))})]})})]})}function Zj(){const a=st(Se.tasks.list),t=st(Se.driftEvents.list),s=st(Se.contextEntries.list),r=st(Se.agents.list),o=st(Se.tasks.stats),c=Ct(Se.tasks.create),h=async(k,w)=>{const A=jc.find(X=>X.id===k)?.label??k,H=`${w.charAt(0).toUpperCase()}${Date.now().toString(36).slice(-4)}`;await c({taskId:H,projectId:"uca",title:`Implement ${w} for ${A}`,description:`Gap detected: ${w} is missing in phase ${A}. Add implementation.`,agent:"claude",category:w,phaseId:k,priority:"medium",status:"todo"})};if(!a||!t||!s||!r)return d.jsx("div",{className:"text-zinc-400",children:"Loading project data..."});const m=Tj(a),p=Nj(t),g=Aj(s),v=zj(r),x=Dj(m,p,g,v),_=Cj(p),S=m.filter(k=>k.status==="in_progress"||k.status==="review");return d.jsxs("div",{className:"space-y-8",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Project Map"}),d.jsx("p",{className:"text-zinc-500 mt-1",children:"Phase dependencies, pillar coverage, and export tools"})]}),d.jsx(Vj,{tasks:a,taskStats:o,onCreateTask:h}),d.jsx(Ij,{}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Data Summary"})}),d.jsx(rt,{children:d.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[d.jsx(Wo,{label:"Tasks",value:x.totalTasks,detail:`${x.tasksByStatus.done} done, ${x.tasksByStatus.in_progress} active`}),d.jsx(Wo,{label:"Drifts",value:x.totalDrifts,detail:`${x.openDrifts} open, ${x.highSeverityOpen} critical`}),d.jsx(Wo,{label:"Context",value:x.contextByTier.draft+x.contextByTier.reviewed+x.contextByTier.curated,detail:`${x.contextByTier.curated} curated`}),d.jsx(Wo,{label:"Health",value:x.healthScore,detail:"0-100 score",accent:x.healthScore>=80?"text-emerald-600":x.healthScore>=50?"text-amber-600":"text-red-600"})]})})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Available Templates"}),d.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:Object.entries(Uj).map(([k,w])=>d.jsx(We,{className:"hover:shadow-md transition-shadow",children:d.jsxs(rt,{className:"p-4",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("span",{className:"text-sm font-medium",children:w.label}),d.jsx(at,{variant:"secondary",className:"text-[10px]",children:k})]}),d.jsx("div",{className:"bg-zinc-100 rounded-lg flex items-center justify-center mb-3",style:{aspectRatio:`${w.width}/${w.height}`,maxHeight:160},children:d.jsxs("span",{className:"text-xs text-zinc-400",children:[w.width,"x",w.height]})}),d.jsxs("p",{className:"text-xs text-zinc-500",children:[k==="infographic"&&`Bizarre Mnemonic Card — dark bg, emoji metaphors for ${_.length} critical drifts`,k==="slide"&&`Project Summary — 4-quadrant layout, health score ${x.healthScore}`,k==="thumbnail"&&`Daily Cockpit — compact snapshot, ${S.length} active tasks`,k==="og"&&"Open Graph — shareable project status"]})]})},k))})]}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Programmatic Export"})}),d.jsx(rt,{children:d.jsx("pre",{className:"bg-zinc-900 text-zinc-100 rounded-lg p-4 text-xs overflow-x-auto",children:`import { exportPipeline, InfographicTemplate } from "@yattalo/uca-visual";
|
|
11
|
+
|
|
12
|
+
const result = await exportPipeline(
|
|
13
|
+
<InfographicTemplate
|
|
14
|
+
projectName="My Project"
|
|
15
|
+
overview={overview}
|
|
16
|
+
criticalDrifts={criticalDrifts}
|
|
17
|
+
topTasks={activeTasks}
|
|
18
|
+
generatedAt={new Date().toISOString()}
|
|
19
|
+
/>,
|
|
20
|
+
{ template: "infographic", format: "png" }
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
// result.data is a Uint8Array PNG buffer
|
|
24
|
+
fs.writeFileSync("export.png", result.data);`})})]})]})}function Wo({label:a,value:t,detail:s,accent:r}){return d.jsxs("div",{className:"flex flex-col bg-zinc-50 rounded-lg p-3",children:[d.jsx("span",{className:"text-xs text-zinc-400",children:a}),d.jsx("span",{className:`text-2xl font-bold ${r??""}`,children:t}),d.jsx("span",{className:"text-[10px] text-zinc-400 mt-1",children:s})]})}const Hj=Zn("/drift")({component:Qj}),ec={scope_creep:"Scope Creep",time_overrun:"Time Overrun",context_switch:"Context Switch",quality_drop:"Quality Drop",assumption_introduced:"Assumption"};function Pj(a){const t=Date.now()-a,s=Math.floor(t/6e4);if(s<60)return`${s}m ago`;const r=Math.floor(s/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Qj(){const a=jl(),t=st(Se.driftEvents.list),s=Ct(Se.driftEvents.create),r=Ct(Se.driftEvents.resolve),o=Ct(Se.driftEvents.dismiss),c=Ct(Se.driftEvents.acknowledge),h=Ct(Se.agentOps.createJobFromTask),[m,p]=Q.useState(null),[g,v]=Q.useState(""),[x,_]=Q.useState(null),[S,k]=Q.useState({agent:"claude",prompt:""}),[w,A]=Q.useState(!1),[H,X]=Q.useState(null),[P,q]=Q.useState({driftType:"scope_creep",severity:"medium",description:"",agent:"claude",taskId:""});if(!t)return d.jsx("div",{className:"text-zinc-400",children:"Loading..."});const ie=t.filter(R=>R.status==="open").length,ee=["high","medium","low"],D=["scope_creep","time_overrun","context_switch","quality_drop","assumption_introduced"],L={};for(const R of ee){L[R]={};for(const se of D)L[R][se]=t.filter(fe=>fe.severity===R&&fe.driftType===se&&fe.status==="open").length}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Drift Events"}),d.jsxs("p",{className:"text-zinc-500 mt-1",children:[t.length," events detected"]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ke,{onClick:()=>A(!w),children:w?"Cancel":"+ Create Drift Event"}),ie>0&&d.jsxs(at,{variant:"destructive",className:"text-sm px-3 py-1",children:[ie," open"]})]})]}),d.jsxs("div",{className:"bg-zinc-50 rounded-lg p-4",children:[d.jsx("h4",{className:"text-xs font-semibold text-zinc-500 uppercase mb-3",children:"Severity × Drift Type Heatmap (Open)"}),d.jsxs("div",{className:"flex gap-1",children:[d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"h-6"}),ee.map(R=>d.jsx("div",{className:`h-8 w-16 flex items-center justify-center text-xs font-medium rounded ${Nf[R]?.bg||"bg-zinc-200"}`,children:R},R))]}),D.map(R=>d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"h-6 w-16 flex items-center justify-center text-[10px] text-zinc-500 truncate",children:ec[R]?.slice(0,8)||R.slice(0,8)}),ee.map(se=>{const fe=L[se]?.[R]??0,ge=fe>0?se==="high"?"bg-red-500 text-white":se==="medium"?"bg-amber-500 text-white":"bg-zinc-400 text-white":"bg-zinc-100 text-zinc-300";return d.jsx("div",{className:`h-8 w-16 flex items-center justify-center text-sm font-bold rounded ${ge}`,children:fe},`${se}-${R}`)})]},R))]})]}),d.jsx("div",{className:"flex gap-3",children:["high","medium","low"].map(R=>{const se=t.filter(fe=>fe.severity===R&&fe.status==="open").length;return se===0?null:d.jsxs(at,{variant:Nf[R]?.badge??"secondary",children:[se," ",R]},R)})}),w&&d.jsx(We,{className:"p-4 border-amber-300 bg-amber-50",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h4",{className:"font-semibold text-amber-900",children:"Create Drift Event"}),d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>A(!1),children:"Cancel"})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Drift Type"}),d.jsx("select",{value:P.driftType,onChange:R=>q({...P,driftType:R.target.value}),className:"w-full mt-1 p-2 text-sm border rounded-lg",children:D.map(R=>d.jsx("option",{value:R,children:ec[R]??R},R))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Severity"}),d.jsx("select",{value:P.severity,onChange:R=>q({...P,severity:R.target.value}),className:"w-full mt-1 p-2 text-sm border rounded-lg",children:ee.map(R=>d.jsx("option",{value:R,children:R},R))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Agent"}),d.jsx("input",{type:"text",value:P.agent,onChange:R=>q({...P,agent:R.target.value}),placeholder:"claude",className:"w-full mt-1 p-2 text-sm border rounded-lg"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Task ID (optional)"}),d.jsx("input",{type:"text",value:P.taskId,onChange:R=>q({...P,taskId:R.target.value}),placeholder:"C1, G2...",className:"w-full mt-1 p-2 text-sm border rounded-lg"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Description"}),d.jsx("textarea",{value:P.description,onChange:R=>q({...P,description:R.target.value}),placeholder:"Describe the drift event...",className:"w-full mt-1 p-2 text-sm border rounded-lg h-20 resize-none"})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Ke,{size:"sm",onClick:()=>{P.description.trim()&&(s({eventId:`drift-${Date.now()}`,projectId:"uca-demo",driftType:P.driftType,severity:P.severity,description:P.description,agent:P.agent,taskId:P.taskId||void 0}),q({driftType:"scope_creep",severity:"medium",description:"",agent:"claude",taskId:""}),A(!1))},children:"Create Event"})})]})}),d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute left-6 top-0 bottom-0 w-px bg-zinc-200"}),d.jsx("div",{className:"space-y-6",children:t.map(R=>d.jsxs("div",{className:"relative flex gap-4 pl-12",children:[d.jsx("div",{className:`absolute left-4 w-5 h-5 rounded-full border-2 border-white ${Sv[R.status]?.dot??"bg-amber-500"}`}),d.jsx(We,{className:"flex-1",children:d.jsxs(rt,{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(at,{variant:Nf[R.severity]?.badge??"secondary",children:R.severity}),d.jsx("span",{className:"text-sm font-medium",children:ec[R.driftType]??R.driftType})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(at,{variant:Sv[R.status]?.badge??"outline",children:R.status}),d.jsx("span",{className:"text-xs text-zinc-400",children:Pj(R.detectedAt)})]})]}),d.jsx("p",{className:"text-sm text-zinc-700",children:R.description}),d.jsxs("div",{className:"flex items-center gap-4 text-xs text-zinc-400",children:[d.jsxs("span",{children:["Agent: ",d.jsx("strong",{children:R.agent})]}),R.taskId&&d.jsxs("button",{onClick:()=>a({to:"/tasks",search:{highlight:R.taskId}}),className:"text-blue-600 hover:underline",children:["Task: ",d.jsx("strong",{children:R.taskId})]})]}),R.status==="open"&&d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>X(H===R.eventId?null:R.eventId),className:"text-xs text-amber-600 hover:text-amber-800 cursor-pointer flex items-center gap-1",children:[H===R.eventId?"▼":"▶"," Impact Analysis"]}),H===R.eventId&&d.jsxs("div",{className:"mt-2 p-3 bg-amber-50 rounded-lg border border-amber-200 space-y-2",children:[d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-zinc-500",children:"Drift Type:"})," ",d.jsx("strong",{children:ec[R.driftType]??R.driftType}),d.jsxs("span",{className:"text-zinc-400 ml-2",children:["(",t.filter(se=>se.driftType===R.driftType&&se.status==="open").length," open events)"]})]}),d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-zinc-500",children:"Responsible Agent:"})," ",d.jsx("strong",{children:R.agent})]}),R.taskId&&d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-zinc-500",children:"Linked Task:"})," ",d.jsx("button",{onClick:()=>a({to:"/tasks",search:{highlight:R.taskId}}),className:"text-blue-600 hover:underline",children:R.taskId})]})]})]}),R.status==="resolved"&&R.resolution&&d.jsxs("div",{className:"bg-emerald-50 rounded-lg p-3 text-sm text-emerald-800",children:[d.jsx("strong",{children:"Resolution:"})," ",R.resolution,R.resolvedBy&&d.jsxs("span",{className:"text-xs text-emerald-600 ml-2",children:["— by ",R.resolvedBy]})]}),R.status==="acknowledged"&&d.jsxs("div",{className:"bg-blue-50 rounded-lg p-3 text-sm text-blue-800",children:[d.jsx("strong",{children:"Acknowledged"})," — awaiting resolution"]}),R.status==="dismissed"&&d.jsxs("div",{className:"bg-zinc-50 rounded-lg p-3 text-sm text-zinc-500",children:[d.jsx("strong",{children:"Dismissed"}),R.resolvedBy&&d.jsxs("span",{className:"text-xs text-zinc-400 ml-2",children:["by ",R.resolvedBy]})]}),R.status==="open"&&d.jsx(d.Fragment,{children:m===R.eventId?d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",placeholder:"Resolution description...",value:g,onChange:se=>v(se.target.value),className:"flex-1 text-sm border rounded-lg px-3 py-1.5"}),d.jsx(Ke,{size:"sm",onClick:()=>{r({eventId:R.eventId,resolvedBy:"human",resolution:g}),p(null),v("")},children:"Confirm"}),d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>p(null),children:"Cancel"})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex gap-2 flex-wrap",children:[d.jsx(Ke,{size:"sm",variant:"outline",onClick:()=>p(R.eventId),children:"Resolve"}),d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>c({eventId:R.eventId,acknowledgedBy:"human"}),children:"Acknowledge"}),R.taskId&&d.jsx(Ke,{size:"sm",variant:"outline",onClick:()=>_(R.eventId),children:"Create Fix Job"}),d.jsx(Ke,{size:"sm",variant:"ghost",className:"text-zinc-400 hover:text-red-600",onClick:()=>{confirm("Dismiss this drift event?")&&o({eventId:R.eventId,dismissedBy:"human"})},children:"Dismiss"})]}),x===R.eventId&&R.taskId&&d.jsxs("div",{className:"p-3 bg-blue-50 rounded-lg border border-blue-200 space-y-2",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",placeholder:"Instructions for the agent...",value:S.prompt,onChange:se=>k({...S,prompt:se.target.value}),className:"flex-1 text-sm border rounded px-2 py-1"}),d.jsx(Ke,{size:"sm",onClick:()=>{h({taskId:R.taskId,prompt:S.prompt||`Fix drift event: ${R.description}`}),_(null),k({agent:"claude",prompt:""})},children:"Create"}),d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>_(null),children:"Cancel"})]}),d.jsxs("div",{className:"text-xs text-blue-600",children:["Job will be created for agent: ",R.agent]})]})]})}),R.status==="acknowledged"&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ke,{size:"sm",variant:"outline",onClick:()=>p(R.eventId),children:"Resolve"}),d.jsx(Ke,{size:"sm",variant:"ghost",className:"text-zinc-400 hover:text-red-600",onClick:()=>{confirm("Dismiss this drift event?")&&o({eventId:R.eventId,dismissedBy:"human"})},children:"Dismiss"})]})]})})]},R.eventId))})]})]})}const Gj=["backlog","todo","in_progress","blocked","review","done","archived"],Yj=["critical","high","medium","low"],Nc=["draft","reviewed","curated"],Xj=["task_output","decision","learning","insight","test_result","error","milestone","drift_event","note"],Kj=["scope_creep","time_overrun","context_switch","quality_drop","assumption_introduced"],Fj=["low","medium","high"],Jj=["open","acknowledged","resolved","dismissed"],Wj=["pattern","decision","lesson_learned","best_practice","anti_pattern","reference"],eN=["ai","human"],tN=["active","idle","offline"];var Ge;(function(a){a.assertEqual=o=>{};function t(o){}a.assertIs=t;function s(o){throw new Error}a.assertNever=s,a.arrayToEnum=o=>{const c={};for(const h of o)c[h]=h;return c},a.getValidEnumValues=o=>{const c=a.objectKeys(o).filter(m=>typeof o[o[m]]!="number"),h={};for(const m of c)h[m]=o[m];return a.objectValues(h)},a.objectValues=o=>a.objectKeys(o).map(function(c){return o[c]}),a.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const c=[];for(const h in o)Object.prototype.hasOwnProperty.call(o,h)&&c.push(h);return c},a.find=(o,c)=>{for(const h of o)if(c(h))return h},a.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,c=" | "){return o.map(h=>typeof h=="string"?`'${h}'`:h).join(c)}a.joinValues=r,a.jsonStringifyReplacer=(o,c)=>typeof c=="bigint"?c.toString():c})(Ge||(Ge={}));var Zv;(function(a){a.mergeShapes=(t,s)=>({...t,...s})})(Zv||(Zv={}));const ce=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),la=a=>{switch(typeof a){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return Number.isNaN(a)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(a)?ce.array:a===null?ce.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?ce.promise:typeof Map<"u"&&a instanceof Map?ce.map:typeof Set<"u"&&a instanceof Set?ce.set:typeof Date<"u"&&a instanceof Date?ce.date:ce.object;default:return ce.unknown}},F=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Es extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(c){return c.message},r={_errors:[]},o=c=>{for(const h of c.issues)if(h.code==="invalid_union")h.unionErrors.map(o);else if(h.code==="invalid_return_type")o(h.returnTypeError);else if(h.code==="invalid_arguments")o(h.argumentsError);else if(h.path.length===0)r._errors.push(s(h));else{let m=r,p=0;for(;p<h.path.length;){const g=h.path[p];p===h.path.length-1?(m[g]=m[g]||{_errors:[]},m[g]._errors.push(s(h))):m[g]=m[g]||{_errors:[]},m=m[g],p++}}};return o(this),r}static assert(t){if(!(t instanceof Es))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},r=[];for(const o of this.issues)if(o.path.length>0){const c=o.path[0];s[c]=s[c]||[],s[c].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}}Es.create=a=>new Es(a);const th=(a,t)=>{let s;switch(a.code){case F.invalid_type:a.received===ce.undefined?s="Required":s=`Expected ${a.expected}, received ${a.received}`;break;case F.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(a.expected,Ge.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:s=`Unrecognized key(s) in object: ${Ge.joinValues(a.keys,", ")}`;break;case F.invalid_union:s="Invalid input";break;case F.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Ge.joinValues(a.options)}`;break;case F.invalid_enum_value:s=`Invalid enum value. Expected ${Ge.joinValues(a.options)}, received '${a.received}'`;break;case F.invalid_arguments:s="Invalid function arguments";break;case F.invalid_return_type:s="Invalid function return type";break;case F.invalid_date:s="Invalid date";break;case F.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(s=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?s=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?s=`Invalid input: must end with "${a.validation.endsWith}"`:Ge.assertNever(a.validation):a.validation!=="regex"?s=`Invalid ${a.validation}`:s="Invalid";break;case F.too_small:a.type==="array"?s=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?s=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?s=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?s=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?s=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:s="Invalid input";break;case F.too_big:a.type==="array"?s=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?s=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?s=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?s=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?s=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:s="Invalid input";break;case F.custom:s="Invalid input";break;case F.invalid_intersection_types:s="Intersection results could not be merged";break;case F.not_multiple_of:s=`Number must be a multiple of ${a.multipleOf}`;break;case F.not_finite:s="Number must be finite";break;default:s=t.defaultError,Ge.assertNever(a)}return{message:s}};let nN=th;function sN(){return nN}const aN=a=>{const{data:t,path:s,errorMaps:r,issueData:o}=a,c=[...s,...o.path||[]],h={...o,path:c};if(o.message!==void 0)return{...o,path:c,message:o.message};let m="";const p=r.filter(g=>!!g).slice().reverse();for(const g of p)m=g(h,{data:t,defaultError:m}).message;return{...o,path:c,message:m}};function ne(a,t){const s=sN(),r=aN({issueData:t,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,s,s===th?void 0:th].filter(o=>!!o)});a.common.issues.push(r)}class Gt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const r=[];for(const o of s){if(o.status==="aborted")return je;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,s){const r=[];for(const o of s){const c=await o.key,h=await o.value;r.push({key:c,value:h})}return Gt.mergeObjectSync(t,r)}static mergeObjectSync(t,s){const r={};for(const o of s){const{key:c,value:h}=o;if(c.status==="aborted"||h.status==="aborted")return je;c.status==="dirty"&&t.dirty(),h.status==="dirty"&&t.dirty(),c.value!=="__proto__"&&(typeof h.value<"u"||o.alwaysSet)&&(r[c.value]=h.value)}return{status:t.value,value:r}}}const je=Object.freeze({status:"aborted"}),dl=a=>({status:"dirty",value:a}),Ln=a=>({status:"valid",value:a}),Hv=a=>a.status==="aborted",Pv=a=>a.status==="dirty",Ki=a=>a.status==="valid",Cc=a=>typeof Promise<"u"&&a instanceof Promise;var pe;(function(a){a.errToObj=t=>typeof t=="string"?{message:t}:t||{},a.toString=t=>typeof t=="string"?t:t?.message})(pe||(pe={}));class ts{constructor(t,s,r,o){this._cachedPath=[],this.parent=t,this.data=s,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Qv=(a,t)=>{if(Ki(t))return{success:!0,data:t.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Es(a.common.issues);return this._error=s,this._error}}};function Oe(a){if(!a)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:o}=a;if(t&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(h,m)=>{const{message:p}=a;return h.code==="invalid_enum_value"?{message:p??m.defaultError}:typeof m.data>"u"?{message:p??r??m.defaultError}:h.code!=="invalid_type"?{message:m.defaultError}:{message:p??s??m.defaultError}},description:o}}class Ve{get description(){return this._def.description}_getType(t){return la(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:la(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Gt,ctx:{common:t.parent.common,data:t.data,parsedType:la(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(Cc(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const r=this.safeParse(t,s);if(r.success)return r.data;throw r.error}safeParse(t,s){const r={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:la(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Qv(r,o)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:la(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Ki(r)?{value:r.value}:{issues:s.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(r=>Ki(r)?{value:r.value}:{issues:s.common.issues})}async parseAsync(t,s){const r=await this.safeParseAsync(t,s);if(r.success)return r.data;throw r.error}async safeParseAsync(t,s){const r={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:la(t)},o=this._parse({data:t,path:r.path,parent:r}),c=await(Cc(o)?o:Promise.resolve(o));return Qv(r,c)}refine(t,s){const r=o=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(o):s;return this._refinement((o,c)=>{const h=t(o),m=()=>c.addIssue({code:F.custom,...r(o)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(m(),!1)):h?!0:(m(),!1)})}refinement(t,s){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof s=="function"?s(r,o):s),!1))}_refinement(t){return new Wi({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return fa.create(this,this._def)}nullable(){return er.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fn.create(this)}promise(){return Oc.create(this,this._def)}or(t){return Ac.create([this,t],this._def)}and(t){return Ec.create(this,t,this._def)}transform(t){return new Wi({...Oe(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new ah({...Oe(this._def),innerType:this,defaultValue:s,typeName:ke.ZodDefault})}brand(){return new NN({typeName:ke.ZodBranded,type:this,...Oe(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new ih({...Oe(this._def),innerType:this,catchValue:s,typeName:ke.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return wh.create(this,t)}readonly(){return rh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const iN=/^c[^\s-]{8,}$/i,rN=/^[0-9a-z]+$/,lN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,oN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cN=/^[a-z0-9_-]{21}$/i,uN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ef;const mN=/^(?:(?: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])$/,pN=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,gN=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yN=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,p0="((\\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])))",bN=new RegExp(`^${p0}$`);function g0(a){let t="[0-5]\\d";a.precision?t=`${t}\\.\\d{${a.precision}}`:a.precision==null&&(t=`${t}(\\.\\d+)?`);const s=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function _N(a){return new RegExp(`^${g0(a)}$`)}function SN(a){let t=`${p0}T${g0(a)}`;const s=[];return s.push(a.local?"Z?":"Z"),a.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function wN(a,t){return!!((t==="v4"||!t)&&mN.test(a)||(t==="v6"||!t)&&gN.test(a))}function kN(a,t){if(!uN.test(a))return!1;try{const[s]=a.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function TN(a,t){return!!((t==="v4"||!t)&&pN.test(a)||(t==="v6"||!t)&&yN.test(a))}class Cs extends Ve{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ce.string){const c=this._getOrReturnCtx(t);return ne(c,{code:F.invalid_type,expected:ce.string,received:c.parsedType}),je}const r=new Gt;let o;for(const c of this._def.checks)if(c.kind==="min")t.data.length<c.value&&(o=this._getOrReturnCtx(t,o),ne(o,{code:F.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="max")t.data.length>c.value&&(o=this._getOrReturnCtx(t,o),ne(o,{code:F.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="length"){const h=t.data.length>c.value,m=t.data.length<c.value;(h||m)&&(o=this._getOrReturnCtx(t,o),h?ne(o,{code:F.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):m&&ne(o,{code:F.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),r.dirty())}else if(c.kind==="email")fN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"email",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="emoji")Ef||(Ef=new RegExp(hN,"u")),Ef.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"emoji",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="uuid")oN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"uuid",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="nanoid")cN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"nanoid",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid")iN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"cuid",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid2")rN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"cuid2",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="ulid")lN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"ulid",code:F.invalid_string,message:c.message}),r.dirty());else if(c.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ne(o,{validation:"url",code:F.invalid_string,message:c.message}),r.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"regex",code:F.invalid_string,message:c.message}),r.dirty())):c.kind==="trim"?t.data=t.data.trim():c.kind==="includes"?t.data.includes(c.value,c.position)||(o=this._getOrReturnCtx(t,o),ne(o,{code:F.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),r.dirty()):c.kind==="toLowerCase"?t.data=t.data.toLowerCase():c.kind==="toUpperCase"?t.data=t.data.toUpperCase():c.kind==="startsWith"?t.data.startsWith(c.value)||(o=this._getOrReturnCtx(t,o),ne(o,{code:F.invalid_string,validation:{startsWith:c.value},message:c.message}),r.dirty()):c.kind==="endsWith"?t.data.endsWith(c.value)||(o=this._getOrReturnCtx(t,o),ne(o,{code:F.invalid_string,validation:{endsWith:c.value},message:c.message}),r.dirty()):c.kind==="datetime"?SN(c).test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{code:F.invalid_string,validation:"datetime",message:c.message}),r.dirty()):c.kind==="date"?bN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{code:F.invalid_string,validation:"date",message:c.message}),r.dirty()):c.kind==="time"?_N(c).test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{code:F.invalid_string,validation:"time",message:c.message}),r.dirty()):c.kind==="duration"?dN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"duration",code:F.invalid_string,message:c.message}),r.dirty()):c.kind==="ip"?wN(t.data,c.version)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"ip",code:F.invalid_string,message:c.message}),r.dirty()):c.kind==="jwt"?kN(t.data,c.alg)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"jwt",code:F.invalid_string,message:c.message}),r.dirty()):c.kind==="cidr"?TN(t.data,c.version)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"cidr",code:F.invalid_string,message:c.message}),r.dirty()):c.kind==="base64"?vN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"base64",code:F.invalid_string,message:c.message}),r.dirty()):c.kind==="base64url"?xN.test(t.data)||(o=this._getOrReturnCtx(t,o),ne(o,{validation:"base64url",code:F.invalid_string,message:c.message}),r.dirty()):Ge.assertNever(c);return{status:r.value,value:t.data}}_regex(t,s,r){return this.refinement(o=>t.test(o),{validation:s,code:F.invalid_string,...pe.errToObj(r)})}_addCheck(t){return new Cs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...pe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...pe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...pe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...pe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...pe.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...pe.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...pe.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...pe.errToObj(s)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}Cs.create=a=>new Cs({checks:[],typeName:ke.ZodString,coerce:a?.coerce??!1,...Oe(a)});function jN(a,t){const s=(a.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=s>r?s:r,c=Number.parseInt(a.toFixed(o).replace(".","")),h=Number.parseInt(t.toFixed(o).replace(".",""));return c%h/10**o}class Fi extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ce.number){const c=this._getOrReturnCtx(t);return ne(c,{code:F.invalid_type,expected:ce.number,received:c.parsedType}),je}let r;const o=new Gt;for(const c of this._def.checks)c.kind==="int"?Ge.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ne(r,{code:F.invalid_type,expected:"integer",received:"float",message:c.message}),o.dirty()):c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:F.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:F.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="multipleOf"?jN(t.data,c.value)!==0&&(r=this._getOrReturnCtx(t,r),ne(r,{code:F.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):c.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ne(r,{code:F.not_finite,message:c.message}),o.dirty()):Ge.assertNever(c);return{status:o.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,pe.toString(s))}gt(t,s){return this.setLimit("min",t,!1,pe.toString(s))}lte(t,s){return this.setLimit("max",t,!0,pe.toString(s))}lt(t,s){return this.setLimit("max",t,!1,pe.toString(s))}setLimit(t,s,r,o){return new Fi({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:pe.toString(o)}]})}_addCheck(t){return new Fi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ge.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(s)&&Number.isFinite(t)}}Fi.create=a=>new Fi({checks:[],typeName:ke.ZodNumber,coerce:a?.coerce||!1,...Oe(a)});class wl extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ce.bigint)return this._getInvalidInput(t);let r;const o=new Gt;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:F.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:F.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="multipleOf"?t.data%c.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:F.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):Ge.assertNever(c);return{status:o.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return ne(s,{code:F.invalid_type,expected:ce.bigint,received:s.parsedType}),je}gte(t,s){return this.setLimit("min",t,!0,pe.toString(s))}gt(t,s){return this.setLimit("min",t,!1,pe.toString(s))}lte(t,s){return this.setLimit("max",t,!0,pe.toString(s))}lt(t,s){return this.setLimit("max",t,!1,pe.toString(s))}setLimit(t,s,r,o){return new wl({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:pe.toString(o)}]})}_addCheck(t){return new wl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}wl.create=a=>new wl({checks:[],typeName:ke.ZodBigInt,coerce:a?.coerce??!1,...Oe(a)});class nh extends Ve{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ce.boolean){const r=this._getOrReturnCtx(t);return ne(r,{code:F.invalid_type,expected:ce.boolean,received:r.parsedType}),je}return Ln(t.data)}}nh.create=a=>new nh({typeName:ke.ZodBoolean,coerce:a?.coerce||!1,...Oe(a)});class Rc extends Ve{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ce.date){const c=this._getOrReturnCtx(t);return ne(c,{code:F.invalid_type,expected:ce.date,received:c.parsedType}),je}if(Number.isNaN(t.data.getTime())){const c=this._getOrReturnCtx(t);return ne(c,{code:F.invalid_date}),je}const r=new Gt;let o;for(const c of this._def.checks)c.kind==="min"?t.data.getTime()<c.value&&(o=this._getOrReturnCtx(t,o),ne(o,{code:F.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),r.dirty()):c.kind==="max"?t.data.getTime()>c.value&&(o=this._getOrReturnCtx(t,o),ne(o,{code:F.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),r.dirty()):Ge.assertNever(c);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Rc({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}}Rc.create=a=>new Rc({checks:[],coerce:a?.coerce||!1,typeName:ke.ZodDate,...Oe(a)});class Gv extends Ve{_parse(t){if(this._getType(t)!==ce.symbol){const r=this._getOrReturnCtx(t);return ne(r,{code:F.invalid_type,expected:ce.symbol,received:r.parsedType}),je}return Ln(t.data)}}Gv.create=a=>new Gv({typeName:ke.ZodSymbol,...Oe(a)});class Yv extends Ve{_parse(t){if(this._getType(t)!==ce.undefined){const r=this._getOrReturnCtx(t);return ne(r,{code:F.invalid_type,expected:ce.undefined,received:r.parsedType}),je}return Ln(t.data)}}Yv.create=a=>new Yv({typeName:ke.ZodUndefined,...Oe(a)});class Xv extends Ve{_parse(t){if(this._getType(t)!==ce.null){const r=this._getOrReturnCtx(t);return ne(r,{code:F.invalid_type,expected:ce.null,received:r.parsedType}),je}return Ln(t.data)}}Xv.create=a=>new Xv({typeName:ke.ZodNull,...Oe(a)});class Kv extends Ve{constructor(){super(...arguments),this._any=!0}_parse(t){return Ln(t.data)}}Kv.create=a=>new Kv({typeName:ke.ZodAny,...Oe(a)});class Fv extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ln(t.data)}}Fv.create=a=>new Fv({typeName:ke.ZodUnknown,...Oe(a)});class pa extends Ve{_parse(t){const s=this._getOrReturnCtx(t);return ne(s,{code:F.invalid_type,expected:ce.never,received:s.parsedType}),je}}pa.create=a=>new pa({typeName:ke.ZodNever,...Oe(a)});class Jv extends Ve{_parse(t){if(this._getType(t)!==ce.undefined){const r=this._getOrReturnCtx(t);return ne(r,{code:F.invalid_type,expected:ce.void,received:r.parsedType}),je}return Ln(t.data)}}Jv.create=a=>new Jv({typeName:ke.ZodVoid,...Oe(a)});class Fn extends Ve{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),o=this._def;if(s.parsedType!==ce.array)return ne(s,{code:F.invalid_type,expected:ce.array,received:s.parsedType}),je;if(o.exactLength!==null){const h=s.data.length>o.exactLength.value,m=s.data.length<o.exactLength.value;(h||m)&&(ne(s,{code:h?F.too_big:F.too_small,minimum:m?o.exactLength.value:void 0,maximum:h?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&s.data.length<o.minLength.value&&(ne(s,{code:F.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&s.data.length>o.maxLength.value&&(ne(s,{code:F.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((h,m)=>o.type._parseAsync(new ts(s,h,s.path,m)))).then(h=>Gt.mergeArray(r,h));const c=[...s.data].map((h,m)=>o.type._parseSync(new ts(s,h,s.path,m)));return Gt.mergeArray(r,c)}get element(){return this._def.type}min(t,s){return new Fn({...this._def,minLength:{value:t,message:pe.toString(s)}})}max(t,s){return new Fn({...this._def,maxLength:{value:t,message:pe.toString(s)}})}length(t,s){return new Fn({...this._def,exactLength:{value:t,message:pe.toString(s)}})}nonempty(t){return this.min(1,t)}}Fn.create=(a,t)=>new Fn({type:a,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...Oe(t)});function Ui(a){if(a instanceof jt){const t={};for(const s in a.shape){const r=a.shape[s];t[s]=fa.create(Ui(r))}return new jt({...a._def,shape:()=>t})}else return a instanceof Fn?new Fn({...a._def,type:Ui(a.element)}):a instanceof fa?fa.create(Ui(a.unwrap())):a instanceof er?er.create(Ui(a.unwrap())):a instanceof Ha?Ha.create(a.items.map(t=>Ui(t))):a}class jt extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=Ge.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==ce.object){const g=this._getOrReturnCtx(t);return ne(g,{code:F.invalid_type,expected:ce.object,received:g.parsedType}),je}const{status:r,ctx:o}=this._processInputParams(t),{shape:c,keys:h}=this._getCached(),m=[];if(!(this._def.catchall instanceof pa&&this._def.unknownKeys==="strip"))for(const g in o.data)h.includes(g)||m.push(g);const p=[];for(const g of h){const v=c[g],x=o.data[g];p.push({key:{status:"valid",value:g},value:v._parse(new ts(o,x,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof pa){const g=this._def.unknownKeys;if(g==="passthrough")for(const v of m)p.push({key:{status:"valid",value:v},value:{status:"valid",value:o.data[v]}});else if(g==="strict")m.length>0&&(ne(o,{code:F.unrecognized_keys,keys:m}),r.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const v of m){const x=o.data[v];p.push({key:{status:"valid",value:v},value:g._parse(new ts(o,x,o.path,v)),alwaysSet:v in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const g=[];for(const v of p){const x=await v.key,_=await v.value;g.push({key:x,value:_,alwaysSet:v.alwaysSet})}return g}).then(g=>Gt.mergeObjectSync(r,g)):Gt.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,r)=>{const o=this._def.errorMap?.(s,r).message??r.defaultError;return s.code==="unrecognized_keys"?{message:pe.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ke.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new jt({...this._def,catchall:t})}pick(t){const s={};for(const r of Ge.objectKeys(t))t[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new jt({...this._def,shape:()=>s})}omit(t){const s={};for(const r of Ge.objectKeys(this.shape))t[r]||(s[r]=this.shape[r]);return new jt({...this._def,shape:()=>s})}deepPartial(){return Ui(this)}partial(t){const s={};for(const r of Ge.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?s[r]=o:s[r]=o.optional()}return new jt({...this._def,shape:()=>s})}required(t){const s={};for(const r of Ge.objectKeys(this.shape))if(t&&!t[r])s[r]=this.shape[r];else{let c=this.shape[r];for(;c instanceof fa;)c=c._def.innerType;s[r]=c}return new jt({...this._def,shape:()=>s})}keyof(){return y0(Ge.objectKeys(this.shape))}}jt.create=(a,t)=>new jt({shape:()=>a,unknownKeys:"strip",catchall:pa.create(),typeName:ke.ZodObject,...Oe(t)});jt.strictCreate=(a,t)=>new jt({shape:()=>a,unknownKeys:"strict",catchall:pa.create(),typeName:ke.ZodObject,...Oe(t)});jt.lazycreate=(a,t)=>new jt({shape:a,unknownKeys:"strip",catchall:pa.create(),typeName:ke.ZodObject,...Oe(t)});class Ac extends Ve{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function o(c){for(const m of c)if(m.result.status==="valid")return m.result;for(const m of c)if(m.result.status==="dirty")return s.common.issues.push(...m.ctx.common.issues),m.result;const h=c.map(m=>new Es(m.ctx.common.issues));return ne(s,{code:F.invalid_union,unionErrors:h}),je}if(s.common.async)return Promise.all(r.map(async c=>{const h={...s,common:{...s.common,issues:[]},parent:null};return{result:await c._parseAsync({data:s.data,path:s.path,parent:h}),ctx:h}})).then(o);{let c;const h=[];for(const p of r){const g={...s,common:{...s.common,issues:[]},parent:null},v=p._parseSync({data:s.data,path:s.path,parent:g});if(v.status==="valid")return v;v.status==="dirty"&&!c&&(c={result:v,ctx:g}),g.common.issues.length&&h.push(g.common.issues)}if(c)return s.common.issues.push(...c.ctx.common.issues),c.result;const m=h.map(p=>new Es(p));return ne(s,{code:F.invalid_union,unionErrors:m}),je}}get options(){return this._def.options}}Ac.create=(a,t)=>new Ac({options:a,typeName:ke.ZodUnion,...Oe(t)});function sh(a,t){const s=la(a),r=la(t);if(a===t)return{valid:!0,data:a};if(s===ce.object&&r===ce.object){const o=Ge.objectKeys(t),c=Ge.objectKeys(a).filter(m=>o.indexOf(m)!==-1),h={...a,...t};for(const m of c){const p=sh(a[m],t[m]);if(!p.valid)return{valid:!1};h[m]=p.data}return{valid:!0,data:h}}else if(s===ce.array&&r===ce.array){if(a.length!==t.length)return{valid:!1};const o=[];for(let c=0;c<a.length;c++){const h=a[c],m=t[c],p=sh(h,m);if(!p.valid)return{valid:!1};o.push(p.data)}return{valid:!0,data:o}}else return s===ce.date&&r===ce.date&&+a==+t?{valid:!0,data:a}:{valid:!1}}class Ec extends Ve{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),o=(c,h)=>{if(Hv(c)||Hv(h))return je;const m=sh(c.value,h.value);return m.valid?((Pv(c)||Pv(h))&&s.dirty(),{status:s.value,value:m.data}):(ne(r,{code:F.invalid_intersection_types}),je)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([c,h])=>o(c,h)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ec.create=(a,t,s)=>new Ec({left:a,right:t,typeName:ke.ZodIntersection,...Oe(s)});class Ha extends Ve{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.array)return ne(r,{code:F.invalid_type,expected:ce.array,received:r.parsedType}),je;if(r.data.length<this._def.items.length)return ne(r,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),je;!this._def.rest&&r.data.length>this._def.items.length&&(ne(r,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...r.data].map((h,m)=>{const p=this._def.items[m]||this._def.rest;return p?p._parse(new ts(r,h,r.path,m)):null}).filter(h=>!!h);return r.common.async?Promise.all(c).then(h=>Gt.mergeArray(s,h)):Gt.mergeArray(s,c)}get items(){return this._def.items}rest(t){return new Ha({...this._def,rest:t})}}Ha.create=(a,t)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ha({items:a,typeName:ke.ZodTuple,rest:null,...Oe(t)})};class zc extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.object)return ne(r,{code:F.invalid_type,expected:ce.object,received:r.parsedType}),je;const o=[],c=this._def.keyType,h=this._def.valueType;for(const m in r.data)o.push({key:c._parse(new ts(r,m,r.path,m)),value:h._parse(new ts(r,r.data[m],r.path,m)),alwaysSet:m in r.data});return r.common.async?Gt.mergeObjectAsync(s,o):Gt.mergeObjectSync(s,o)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof Ve?new zc({keyType:t,valueType:s,typeName:ke.ZodRecord,...Oe(r)}):new zc({keyType:Cs.create(),valueType:t,typeName:ke.ZodRecord,...Oe(s)})}}class Wv extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.map)return ne(r,{code:F.invalid_type,expected:ce.map,received:r.parsedType}),je;const o=this._def.keyType,c=this._def.valueType,h=[...r.data.entries()].map(([m,p],g)=>({key:o._parse(new ts(r,m,r.path,[g,"key"])),value:c._parse(new ts(r,p,r.path,[g,"value"]))}));if(r.common.async){const m=new Map;return Promise.resolve().then(async()=>{for(const p of h){const g=await p.key,v=await p.value;if(g.status==="aborted"||v.status==="aborted")return je;(g.status==="dirty"||v.status==="dirty")&&s.dirty(),m.set(g.value,v.value)}return{status:s.value,value:m}})}else{const m=new Map;for(const p of h){const g=p.key,v=p.value;if(g.status==="aborted"||v.status==="aborted")return je;(g.status==="dirty"||v.status==="dirty")&&s.dirty(),m.set(g.value,v.value)}return{status:s.value,value:m}}}}Wv.create=(a,t,s)=>new Wv({valueType:t,keyType:a,typeName:ke.ZodMap,...Oe(s)});class kl extends Ve{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.set)return ne(r,{code:F.invalid_type,expected:ce.set,received:r.parsedType}),je;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ne(r,{code:F.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),s.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ne(r,{code:F.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),s.dirty());const c=this._def.valueType;function h(p){const g=new Set;for(const v of p){if(v.status==="aborted")return je;v.status==="dirty"&&s.dirty(),g.add(v.value)}return{status:s.value,value:g}}const m=[...r.data.values()].map((p,g)=>c._parse(new ts(r,p,r.path,g)));return r.common.async?Promise.all(m).then(p=>h(p)):h(m)}min(t,s){return new kl({...this._def,minSize:{value:t,message:pe.toString(s)}})}max(t,s){return new kl({...this._def,maxSize:{value:t,message:pe.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}}kl.create=(a,t)=>new kl({valueType:a,minSize:null,maxSize:null,typeName:ke.ZodSet,...Oe(t)});class ex extends Ve{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}ex.create=(a,t)=>new ex({getter:a,typeName:ke.ZodLazy,...Oe(t)});class tx extends Ve{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return ne(s,{received:s.data,code:F.invalid_literal,expected:this._def.value}),je}return{status:"valid",value:t.data}}get value(){return this._def.value}}tx.create=(a,t)=>new tx({value:a,typeName:ke.ZodLiteral,...Oe(t)});function y0(a,t){return new Ji({values:a,typeName:ke.ZodEnum,...Oe(t)})}class Ji extends Ve{_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),r=this._def.values;return ne(s,{expected:Ge.joinValues(r),received:s.parsedType,code:F.invalid_type}),je}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const s=this._getOrReturnCtx(t),r=this._def.values;return ne(s,{received:s.data,code:F.invalid_enum_value,options:r}),je}return Ln(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return Ji.create(t,{...this._def,...s})}exclude(t,s=this._def){return Ji.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}}Ji.create=y0;class nx extends Ve{_parse(t){const s=Ge.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ce.string&&r.parsedType!==ce.number){const o=Ge.objectValues(s);return ne(r,{expected:Ge.joinValues(o),received:r.parsedType,code:F.invalid_type}),je}if(this._cache||(this._cache=new Set(Ge.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=Ge.objectValues(s);return ne(r,{received:r.data,code:F.invalid_enum_value,options:o}),je}return Ln(t.data)}get enum(){return this._def.values}}nx.create=(a,t)=>new nx({values:a,typeName:ke.ZodNativeEnum,...Oe(t)});class Oc extends Ve{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==ce.promise&&s.common.async===!1)return ne(s,{code:F.invalid_type,expected:ce.promise,received:s.parsedType}),je;const r=s.parsedType===ce.promise?s.data:Promise.resolve(s.data);return Ln(r.then(o=>this._def.type.parseAsync(o,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Oc.create=(a,t)=>new Oc({type:a,typeName:ke.ZodPromise,...Oe(t)});class Wi extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:r}=this._processInputParams(t),o=this._def.effect||null,c={addIssue:h=>{ne(r,h),h.fatal?s.abort():s.dirty()},get path(){return r.path}};if(c.addIssue=c.addIssue.bind(c),o.type==="preprocess"){const h=o.transform(r.data,c);if(r.common.async)return Promise.resolve(h).then(async m=>{if(s.value==="aborted")return je;const p=await this._def.schema._parseAsync({data:m,path:r.path,parent:r});return p.status==="aborted"?je:p.status==="dirty"||s.value==="dirty"?dl(p.value):p});{if(s.value==="aborted")return je;const m=this._def.schema._parseSync({data:h,path:r.path,parent:r});return m.status==="aborted"?je:m.status==="dirty"||s.value==="dirty"?dl(m.value):m}}if(o.type==="refinement"){const h=m=>{const p=o.refinement(m,c);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(r.common.async===!1){const m=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return m.status==="aborted"?je:(m.status==="dirty"&&s.dirty(),h(m.value),{status:s.value,value:m.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(m=>m.status==="aborted"?je:(m.status==="dirty"&&s.dirty(),h(m.value).then(()=>({status:s.value,value:m.value}))))}if(o.type==="transform")if(r.common.async===!1){const h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ki(h))return je;const m=o.transform(h.value,c);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:m}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>Ki(h)?Promise.resolve(o.transform(h.value,c)).then(m=>({status:s.value,value:m})):je);Ge.assertNever(o)}}Wi.create=(a,t,s)=>new Wi({schema:a,typeName:ke.ZodEffects,effect:t,...Oe(s)});Wi.createWithPreprocess=(a,t,s)=>new Wi({schema:t,effect:{type:"preprocess",transform:a},typeName:ke.ZodEffects,...Oe(s)});class fa extends Ve{_parse(t){return this._getType(t)===ce.undefined?Ln(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fa.create=(a,t)=>new fa({innerType:a,typeName:ke.ZodOptional,...Oe(t)});class er extends Ve{_parse(t){return this._getType(t)===ce.null?Ln(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}er.create=(a,t)=>new er({innerType:a,typeName:ke.ZodNullable,...Oe(t)});class ah extends Ve{_parse(t){const{ctx:s}=this._processInputParams(t);let r=s.data;return s.parsedType===ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}ah.create=(a,t)=>new ah({innerType:a,typeName:ke.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Oe(t)});class ih extends Ve{_parse(t){const{ctx:s}=this._processInputParams(t),r={...s,common:{...s.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Cc(o)?o.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Es(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Es(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ih.create=(a,t)=>new ih({innerType:a,typeName:ke.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Oe(t)});class sx extends Ve{_parse(t){if(this._getType(t)!==ce.nan){const r=this._getOrReturnCtx(t);return ne(r,{code:F.invalid_type,expected:ce.nan,received:r.parsedType}),je}return{status:"valid",value:t.data}}}sx.create=a=>new sx({typeName:ke.ZodNaN,...Oe(a)});class NN extends Ve{_parse(t){const{ctx:s}=this._processInputParams(t),r=s.data;return this._def.type._parse({data:r,path:s.path,parent:s})}unwrap(){return this._def.type}}class wh extends Ve{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?je:c.status==="dirty"?(s.dirty(),dl(c.value)):this._def.out._parseAsync({data:c.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?je:o.status==="dirty"?(s.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,s){return new wh({in:t,out:s,typeName:ke.ZodPipeline})}}class rh extends Ve{_parse(t){const s=this._def.innerType._parse(t),r=o=>(Ki(o)&&(o.value=Object.freeze(o.value)),o);return Cc(s)?s.then(o=>r(o)):r(s)}unwrap(){return this._def.innerType}}rh.create=(a,t)=>new rh({innerType:a,typeName:ke.ZodReadonly,...Oe(t)});var ke;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(ke||(ke={}));const de=Cs.create,ot=Fi.create,Ts=nh.create;pa.create;const zt=Fn.create,Dn=jt.create;Ac.create;Ec.create;Ha.create;const v0=zc.create,yn=Ji.create;Oc.create;fa.create;er.create;const CN=Dn({label:de().min(1),icon:de().min(1).max(3),color:de().regex(/^#[0-9a-fA-F]{6}$/)}),RN=Dn({id:de().min(1).regex(/^[a-z][a-z0-9_-]*$/),label:de().min(1),wave:ot().int().positive()}),AN=Dn({commitTracking:Ts().optional().default(!1),scopeCreepDetection:Ts().optional().default(!1),reviewFindings:Ts().optional().default(!1),confidenceTracking:Ts().optional().default(!1),evidenceTracker:Ts().optional().default(!1),handoffLog:Ts().optional().default(!1),checkpointLog:Ts().optional().default(!1),agentOps:Ts().optional().default(!1)}),EN=Dn({pollingInterval:ot().int().min(1e3).optional().default(5e3),theme:yn(["dark","light"]).optional().default("dark")}),zN=Dn({pollInterval:ot().int().min(5e3).optional().default(3e4),maxConcurrentRuns:ot().int().min(1).max(10).optional().default(3),maxRunsPerDay:ot().int().min(1).optional().default(100),defaultTimeoutMinutes:ot().int().min(1).optional().default(30),protectedBranches:zt(de()).optional().default(["main","master"]),agentCommands:v0(de(),de()).optional().default({})});Dn({projectName:de().min(1),projectId:de().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/).optional(),tableName:de().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/).optional().default("agentTasks"),agents:v0(de().min(1),CN).refine(a=>Object.keys(a).length>=1,{message:"At least one agent is required"}),categories:zt(de().min(1)).min(1,"At least one category is required"),phases:zt(RN).min(1,"At least one phase is required"),taskIdPattern:de().min(1),extensions:AN,dashboard:EN.optional(),agentOps:zN.optional()});const ON=Dn({taskId:de().min(1),agent:de().min(1),title:de().min(1),description:de(),status:yn(Gj).optional(),priority:yn(Yj).optional(),category:de().optional(),phaseId:de().optional(),wave:ot().int().optional(),estimatedHours:ot().positive().optional(),dependencies:zt(de()).optional(),tags:zt(de()).optional(),acceptanceCriteria:zt(de()).optional(),filesExpected:zt(de()).optional(),confidenceLevel:ot().int().min(0).max(5).optional(),sourceIds:zt(de()).optional()});zt(ON);const MN=Dn({from:yn(Nc),to:yn(Nc),promotedBy:de().min(1),reason:de().optional(),timestamp:ot()});Dn({entryId:de().min(1),projectId:de().min(1),type:yn(Xj),content:de().min(1),summary:de().optional(),tier:yn(Nc),promotionHistory:zt(MN),confidenceScore:ot().min(0).max(5).optional(),validatedBy:zt(de()).optional(),taskId:de().optional(),linksTo:zt(de()),propagateTo:zt(de()),tags:zt(de()),createdBy:de().min(1),createdAt:ot(),updatedAt:ot(),nlmSynced:Ts().optional(),nlmNotebookId:de().optional(),nlmSourceId:de().optional()});Dn({entryId:de().min(1),projectId:de().optional(),title:de().min(1),content:de().min(1),category:yn(Wj),confidenceScore:ot().min(0).max(5),sourceEntryIds:zt(de()),nlmNotebookId:de().optional(),nlmSourceId:de().optional(),tags:zt(de()),createdBy:de().min(1),createdAt:ot(),updatedAt:ot(),usageCount:ot().int().min(0)});Dn({eventId:de().min(1),projectId:de().min(1),taskId:de().optional(),agent:de().min(1),driftType:yn(Kj),description:de().min(1),severity:yn(Fj),toolCallCount:ot().int().optional(),originalEstimate:ot().optional(),actualTime:ot().optional(),status:yn(Jj),resolvedBy:de().optional(),resolvedAt:ot().optional(),resolution:de().optional(),detectedAt:ot()});Dn({agentId:de().min(1),label:de().min(1),type:yn(eN),capabilities:zt(de()),preferredCategories:zt(de()),currentStatus:yn(tN),currentTaskIds:zt(de()),totalTasksCompleted:ot().int().min(0),totalHoursLogged:ot().min(0),avgCompletionRate:ot().min(0).max(1),driftEventsTriggered:ot().int().min(0),taskIdPrefix:de().min(1).max(3),color:de().regex(/^#[0-9a-fA-F]{6}$/),icon:de().min(1).max(3)});const zf=["draft","reviewed","curated"];function x0(a){const t=zf.indexOf(a);return t===-1||t>=zf.length-1?null:zf[t+1]}function LN(a,t,s){const r=x0(a.tier);if(r===null||t!==r)return!1;const o=s==="human";return a.tier==="draft"&&t==="reviewed"?!0:a.tier==="reviewed"&&t==="curated"?o:!1}function DN(a){if(a.tier!=="draft")return!1;const t=a.validatedBy??[];return new Set(t).size>=2}const UN=Zn("/context")({component:qN}),BN={decision:"D",learning:"L",task_output:"T",insight:"I",test_result:"R",error:"E",milestone:"M",drift_event:"F",note:"N"};function qN(){jl();const a=st(Se.contextEntries.list),t=Ct(Se.contextEntries.create),s=Ct(Se.contextEntries.promote),r=Ct(Se.contextEntries.addValidation),o=Ct(Se.contextEntries.updateSummary),[c,h]=Q.useState(null),[m,p]=Q.useState(!1),[g,v]=Q.useState({type:"note",content:"",tags:""});function x(S){return new Date(S).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}if(!a)return d.jsx("div",{className:"text-zinc-400",children:"Loading..."});const _=Nc.map(S=>({tier:S,entries:a.filter(k=>k.tier===S)}));return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Context Tiers"}),d.jsx(Ke,{onClick:()=>p(!m),children:m?"Cancel":"+ Create Entry"})]}),d.jsx("p",{className:"text-zinc-500 mt-1",children:"Promote knowledge through draft → reviewed → curated pipeline"})]}),d.jsxs("div",{className:"flex gap-6 text-sm text-zinc-500",children:[d.jsxs("span",{children:[d.jsx("strong",{children:"draft→reviewed"}),": AI (confidence > 3) or human"]}),d.jsxs("span",{children:[d.jsx("strong",{children:"reviewed→curated"}),": human only"]}),d.jsxs("span",{children:[d.jsx("strong",{children:"Auto-promote"}),": 2+ unique agent validations"]})]}),m&&d.jsx(We,{className:"p-4 border-blue-300 bg-blue-50",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex gap-4",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Type"}),d.jsxs("select",{value:g.type,onChange:S=>v({...g,type:S.target.value}),className:"w-full mt-1 p-2 text-sm border rounded-lg",children:[d.jsx("option",{value:"decision",children:"decision"}),d.jsx("option",{value:"learning",children:"learning"}),d.jsx("option",{value:"task_output",children:"task_output"}),d.jsx("option",{value:"insight",children:"insight"}),d.jsx("option",{value:"test_result",children:"test_result"}),d.jsx("option",{value:"error",children:"error"}),d.jsx("option",{value:"milestone",children:"milestone"}),d.jsx("option",{value:"drift_event",children:"drift_event"}),d.jsx("option",{value:"note",children:"note"})]})]}),d.jsxs("div",{className:"flex-1",children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Tags (comma-separated)"}),d.jsx("input",{type:"text",value:g.tags,onChange:S=>v({...g,tags:S.target.value}),placeholder:"tag1, tag2, tag3",className:"w-full mt-1 p-2 text-sm border rounded-lg"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-semibold text-zinc-500 uppercase",children:"Content"}),d.jsx("textarea",{value:g.content,onChange:S=>v({...g,content:S.target.value}),placeholder:"Enter context content...",className:"w-full mt-1 p-2 text-sm border rounded-lg h-24 resize-none"})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Ke,{size:"sm",onClick:()=>{g.content.trim()&&(t({entryId:`ctx-${Date.now()}`,projectId:"uca-demo",type:g.type,content:g.content,tier:"draft",tags:g.tags.split(",").map(S=>S.trim()).filter(Boolean),createdBy:"human"}),v({type:"note",content:"",tags:""}),p(!1))},children:"Create Entry"})})]})}),d.jsx("div",{className:"grid grid-cols-3 gap-6",children:_.map(S=>{const k=yT[S.tier];return d.jsxs("div",{children:[d.jsxs("div",{className:`flex items-center gap-2 mb-4 p-3 rounded-lg ${k.bg}`,children:[d.jsx(at,{variant:S.tier==="curated"?"success":S.tier==="reviewed"?"default":"secondary",children:S.tier}),d.jsxs("span",{className:"text-sm font-medium",children:[S.entries.length," entries"]})]}),d.jsx("div",{className:"space-y-3",children:S.entries.map(w=>{const A=w,H=x0(w.tier),X=H?LN(A,H,"human"):!1,P=DN(A);return d.jsx(We,{className:`border ${k.border}`,children:d.jsxs(rt,{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:`w-6 h-6 rounded ${k.bg} ${k.text} flex items-center justify-center text-xs font-bold`,children:BN[w.type]??"?"}),d.jsx(at,{variant:"outline",className:"text-[10px]",children:w.type})]}),w.confidenceScore!=null&&d.jsxs("span",{className:"text-xs text-zinc-400",children:["confidence: ",w.confidenceScore,"/5"]})]}),d.jsx("p",{className:"text-sm",children:w.content}),d.jsx("div",{className:"flex flex-wrap gap-1",children:w.tags.map(q=>d.jsx("span",{className:"text-[10px] bg-zinc-100 text-zinc-500 px-1.5 py-0.5 rounded",children:q},q))}),w.taskId&&d.jsx("div",{className:"flex items-center gap-1 text-xs bg-blue-50 text-blue-700 rounded px-2 py-0.5 w-fit",children:d.jsxs("span",{children:["Linked: ",w.taskId]})}),w.tier==="curated"&&d.jsxs("div",{className:"mt-2 p-2 bg-zinc-900 text-zinc-100 rounded-lg",children:[d.jsx("div",{className:"text-[10px] uppercase text-zinc-400 mb-1",children:"System Prompt Preview"}),d.jsx("pre",{className:"text-[10px] font-mono whitespace-pre-wrap break-all",children:`## ${w.type}: ${w.summary||w.content.slice(0,100)}${w.content.length>100?"...":""}`})]}),w.validatedBy&&w.validatedBy.length>0&&d.jsxs("div",{className:"text-xs text-zinc-400",children:["Validated by: ",w.validatedBy.join(", ")]}),d.jsxs("div",{className:"text-xs text-zinc-400 flex items-center gap-2",children:[d.jsxs("span",{children:["Created by: ",d.jsx("strong",{children:w.createdBy})]}),d.jsx("span",{children:"•"}),d.jsx("span",{children:x(w.createdAt)})]}),w.promotionHistory.length>0&&d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>h(c===w.entryId?null:w.entryId),className:"text-xs text-zinc-400 hover:text-zinc-600 cursor-pointer",children:[c===w.entryId?"Hide":"Show"," history (",w.promotionHistory.length,")"]}),c===w.entryId&&d.jsx("div",{className:"mt-1 pl-2 border-l-2 border-zinc-200 space-y-1",children:w.promotionHistory.map((q,ie)=>d.jsxs("div",{className:"text-xs text-zinc-400",children:[q.from," → ",q.to," by ",q.promotedBy,q.reason&&` — "${q.reason}"`]},ie))})]}),d.jsxs("div",{className:"flex gap-2 pt-1",children:[!w.summary&&d.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>o({entryId:w.entryId,summary:w.content.slice(0,100)}),children:"Generate Summary"}),X&&H&&d.jsxs(Ke,{size:"sm",onClick:()=>s({entryId:w.entryId,promotedBy:"human",reason:"Manual promotion via demo UI"}),children:["Promote to ",H]}),(w.tier==="draft"||w.tier==="reviewed")&&d.jsx(Ke,{size:"sm",variant:"outline",onClick:()=>r({entryId:w.entryId,validator:"demo-reviewer"}),children:"+ Validate"}),P&&d.jsx(at,{variant:"success",className:"self-center",children:"Auto-promotable"})]})]})},w.entryId)})})]},S.tier)})})]})}const $N=Zn("/agents")({component:ZN}),VN={active:"bg-emerald-500",idle:"bg-amber-500",offline:"bg-zinc-400"},Of=["active","idle","offline"];function IN({agentTasks:a}){const t=a.length;if(t===0)return d.jsx("div",{className:"text-xs text-zinc-400",children:"No tasks assigned"});const s={done:"bg-emerald-500",in_progress:"bg-blue-500",review:"bg-amber-500",todo:"bg-zinc-300",backlog:"bg-zinc-200",blocked:"bg-red-400"},r=Object.entries(a.reduce((o,c)=>(o[c.status]=(o[c.status]??0)+1,o),{}));return d.jsxs("div",{children:[d.jsx("div",{className:"flex h-3 rounded-full overflow-hidden",children:r.map(([o,c])=>d.jsx("div",{className:s[o]??"bg-zinc-200",style:{width:`${c/t*100}%`},title:`${o}: ${c}`},o))}),d.jsx("div",{className:"flex gap-2 mt-1.5 flex-wrap",children:r.map(([o,c])=>d.jsxs("span",{className:"text-[10px] text-zinc-400",children:[o.replace("_"," "),": ",c]},o))})]})}function ZN(){const a=st(Se.agents.list),t=st(Se.tasks.list),s=Ct(Se.agents.updateStatus);return!a||!t?d.jsx("div",{className:"text-zinc-400",children:"Loading..."}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Agent Registry"}),d.jsxs("p",{className:"text-zinc-500 mt-1",children:[a.length," agents registered"]})]}),d.jsx("div",{className:"grid grid-cols-3 gap-6",children:a.map(r=>{const o=t.filter(h=>h.agent===r.agentId),c=o.filter(h=>h.status==="in_progress").length;return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center text-lg font-bold ${qi(r.agentId).bg} ${qi(r.agentId).text}`,children:r.icon}),d.jsxs("div",{children:[d.jsx(yt,{className:"text-base",children:r.label}),d.jsx("span",{className:"text-xs text-zinc-400",children:r.agentId})]})]}),d.jsxs("button",{onClick:()=>{const h=Of.indexOf(r.currentStatus),m=Of[(h+1)%Of.length];s({agentId:r.agentId,currentStatus:m})},className:"flex items-center gap-1.5 cursor-pointer hover:opacity-70 transition-opacity",title:"Click to cycle status",children:[d.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${VN[r.currentStatus]??"bg-zinc-400"}`}),d.jsx("span",{className:"text-xs text-zinc-500",children:r.currentStatus})]})]})}),d.jsxs(rt,{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-zinc-400 mb-1.5",children:"Capabilities"}),d.jsx("div",{className:"flex flex-wrap gap-1",children:r.capabilities.map(h=>d.jsx(at,{variant:"secondary",className:"text-[10px]",children:h},h))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-zinc-400 mb-1.5",children:"Workload"}),d.jsx(IN,{agentTasks:o})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{className:"bg-zinc-50 rounded-lg p-2.5",children:[d.jsx("p",{className:"text-xs text-zinc-400",children:"Completed"}),d.jsx("p",{className:"text-lg font-bold",children:r.totalTasksCompleted})]}),d.jsxs("div",{className:"bg-zinc-50 rounded-lg p-2.5",children:[d.jsx("p",{className:"text-xs text-zinc-400",children:"Rate"}),d.jsxs("p",{className:"text-lg font-bold",children:[(r.avgCompletionRate*100).toFixed(0),"%"]})]}),d.jsxs("div",{className:"bg-zinc-50 rounded-lg p-2.5",children:[d.jsx("p",{className:"text-xs text-zinc-400",children:"In Progress"}),d.jsx("p",{className:"text-lg font-bold",children:c})]}),d.jsxs("div",{className:"bg-zinc-50 rounded-lg p-2.5",children:[d.jsx("p",{className:"text-xs text-zinc-400",children:"Drift Events"}),d.jsx("p",{className:"text-lg font-bold text-red-600",children:r.driftEventsTriggered})]})]}),r.currentTaskIds.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-zinc-400 mb-1.5",children:"Active Tasks"}),d.jsx("div",{className:"space-y-1",children:o.filter(h=>h.status==="in_progress").map(h=>d.jsxs("div",{className:"text-xs bg-zinc-50 rounded px-2 py-1 flex justify-between",children:[d.jsx("span",{className:"font-mono text-zinc-400",children:h.taskId}),d.jsx("span",{className:"truncate ml-2",children:h.title})]},h.taskId))})]})]})]},r.agentId)})})]})}const HN=Zn("/agent-ops")({component:FN}),PN={green:"bg-emerald-500",yellow:"bg-amber-500",red:"bg-red-500"},QN={queued:"secondary",running:"warning",done:"success",failed:"destructive",cancelled:"secondary"};function GN({heartbeat:a}){const t=PN[a.computedStatus]??"bg-zinc-400",s=Math.round((Date.now()-a.lastSeenAt)/1e3),r=s<60?`${s}s`:s<3600?`${Math.round(s/60)}m`:`${Math.round(s/3600)}h`;return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${t}`}),d.jsx("span",{className:"text-sm font-mono",children:a.agentId}),d.jsx("span",{className:"text-xs text-zinc-400",children:r})]})}function YN({runs:a}){return a.length===0?d.jsx("p",{className:"text-sm text-zinc-400",children:"No runs found"}):d.jsx("div",{className:"space-y-2",children:a.slice(0,10).map(t=>d.jsxs("div",{className:"flex items-center justify-between bg-zinc-50 rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(at,{variant:QN[t.status]??"secondary",children:t.status}),d.jsxs("span",{className:"text-xs font-mono text-zinc-500",children:[t.runId.slice(0,12),"..."]}),d.jsxs("span",{className:"text-xs text-zinc-400",children:["by ",t.agent]}),t.taskId&&d.jsx("span",{className:"text-xs font-mono text-zinc-400",children:t.taskId})]}),d.jsx("div",{className:"text-xs text-zinc-400",children:new Date(t.queuedAt).toLocaleTimeString()})]},t.runId))})}function XN({memory:a,agentFilter:t}){const[s,r]=Q.useState({}),o=a.reduce((c,h)=>(t&&h.agentId!==t||(c[h.agentId]||(c[h.agentId]=[]),c[h.agentId].push(h)),c),{});return a.length===0?d.jsx("p",{className:"text-sm text-zinc-400",children:"No memory entries"}):d.jsx("div",{className:"space-y-4",children:Object.entries(o).map(([c,h])=>d.jsxs("div",{className:"border rounded-lg",children:[d.jsxs("button",{onClick:()=>r(m=>({...m,[c]:!m[c]})),className:"w-full flex items-center justify-between p-3 bg-zinc-50 hover:bg-zinc-100 transition-colors",children:[d.jsx("span",{className:"font-mono text-sm",children:c}),d.jsxs("span",{className:"text-xs text-zinc-400",children:[h.length," entries"]})]}),!s[c]&&d.jsx("div",{className:"p-3 space-y-2",children:h.slice(0,5).map(m=>d.jsxs("div",{className:"text-xs",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(at,{variant:"secondary",className:"text-[10px]",children:m.tier}),d.jsxs("span",{className:"text-zinc-400",children:[m.tokens," tokens"]})]}),d.jsx("p",{className:"text-zinc-600 line-clamp-2",children:m.summary??m.content})]},m.memoryId))})]},c))})}function KN({agentSkills:a}){const t=Array.from(a.keys()),s=new Set;a.forEach(o=>{o.forEach(c=>s.add(c.skill.skillId))});const r=Array.from(s);return r.length===0?d.jsx("p",{className:"text-sm text-zinc-400",children:"No skills assigned"}):d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b",children:[d.jsx("th",{className:"text-left p-2 font-medium text-zinc-500",children:"Agent"}),r.map(o=>d.jsx("th",{className:"p-2 font-medium text-zinc-500 text-xs",children:o},o))]})}),d.jsx("tbody",{children:t.map(o=>d.jsxs("tr",{className:"border-b",children:[d.jsx("td",{className:"p-2 font-mono text-xs",children:o}),r.map(c=>{const h=a.get(o)?.some(m=>m.skill.skillId===c&&m.binding.enabled);return d.jsx("td",{className:"p-2 text-center",children:h?d.jsx("span",{className:"text-emerald-500",children:"✓"}):d.jsx("span",{className:"text-zinc-300",children:"–"})},c)})]},o))})]})})}function FN(){const a=st(Se.heartbeats.listHeartbeats),t=st(Se.agentOps.listRuns,{limit:10}),s=st(Se.memory.listMemory,{}),r=st(Se.agents.list),o=st(Se.tasks.list),c=Ct(Se.agentOps.createJobFromTask),[h,m]=Q.useState(""),[p,g]=Q.useState(""),[v,x]=Q.useState(!1),_=new Map;r&&r.forEach(A=>{const H=st(Se.skills.listAgentSkills,{agentId:A.agentId});H&&_.set(A.agentId,H)});const S=o?.filter(A=>A.status!=="done"&&A.status!=="archived")??[],k=r??[],w=async()=>{if(!(!h||!p)){x(!0);try{await c({taskId:h})}catch(A){console.error(A)}x(!1)}};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Agent Ops — Mission Control"}),d.jsx("p",{className:"text-zinc-500 mt-1",children:"Job dispatch, heartbeats, runs, memory, and capabilities"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Job Dispatch"})}),d.jsxs(rt,{className:"space-y-4",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("select",{className:"flex-1 rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:h,onChange:A=>m(A.target.value),children:[d.jsx("option",{value:"",children:"Select task..."}),S.map(A=>d.jsxs("option",{value:A.taskId,children:[A.taskId,": ",A.title]},A.taskId))]}),d.jsxs("select",{className:"w-32 rounded-lg border border-zinc-200 px-3 py-2 text-sm",value:p,onChange:A=>g(A.target.value),children:[d.jsx("option",{value:"",children:"Agent..."}),k.map(A=>d.jsx("option",{value:A.agentId,children:A.agentId},A.agentId))]})]}),d.jsx(Ke,{onClick:w,disabled:!h||v,className:"w-full",children:v?"Dispatching...":"Dispatch Job"})]})]}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Heartbeat Indicators"})}),d.jsx(rt,{children:a&&a.length>0?d.jsx("div",{className:"flex flex-wrap gap-3",children:a.map(A=>d.jsx(GN,{heartbeat:A},A.agentId))}):d.jsx("p",{className:"text-sm text-zinc-400",children:"No heartbeats recorded"})})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Recent Runs"})}),d.jsx(rt,{children:d.jsx(YN,{runs:t??[]})})]}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Memory Browser"})}),d.jsx(rt,{children:d.jsx(XN,{memory:s??[],agentFilter:null})})]})]}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{className:"text-base",children:"Capability Matrix"})}),d.jsx(rt,{children:d.jsx(KN,{agentSkills:_})})]})]})}const JN=Zn("/")({component:nC}),b0=[{id:"foundation",label:"Foundation",wave:1},{id:"runtime",label:"Runtime",wave:2},{id:"dashboard",label:"Dashboard",wave:3},{id:"publish",label:"Publish",wave:3},{id:"cli-ext",label:"CLI Ext",wave:4},{id:"nlm",label:"NLM",wave:5},{id:"meta",label:"Meta",wave:6}];function tc({title:a,value:t,subtitle:s,accent:r}){return d.jsxs(We,{children:[d.jsxs(gt,{children:[d.jsx("p",{className:"text-sm text-zinc-500",children:a}),d.jsx(yt,{className:`text-3xl font-bold ${r??""}`,children:t})]}),s&&d.jsx(rt,{children:d.jsx("p",{className:"text-xs text-zinc-400",children:s})})]})}function WN({tasks:a}){return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Phase Progress"})}),d.jsx(rt,{className:"space-y-3",children:b0.map(t=>{const s=a.filter(h=>h.phaseId===t.id),r=s.filter(h=>h.status==="done").length,o=s.length,c=o>0?Math.round(r/o*100):0;return d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"text-sm w-24 text-zinc-600 truncate",children:t.label}),d.jsx("div",{className:"flex-1 h-3 bg-zinc-100 rounded-full overflow-hidden",children:d.jsx("div",{className:`h-full rounded-full transition-all ${c===100?"bg-emerald-500":c>0?"bg-blue-500":"bg-zinc-200"}`,style:{width:`${c}%`}})}),d.jsxs("span",{className:"text-xs font-mono w-16 text-right text-zinc-500",children:[r,"/",o," (",c,"%)"]})]},t.id)})})]})}function eC({tasks:a,driftEvents:t}){const s=t.filter(c=>c.status==="open"&&(c.severity==="high"||c.severity==="critical")),r=a.filter(c=>c.status==="blocked"),o=[...s.map(c=>({type:"drift",severity:"red",text:`${c.driftType}: ${c.description.slice(0,80)}${c.description.length>80?"...":""}`,id:c.eventId})),...r.map(c=>({type:"task",severity:"amber",text:`Blocked: ${c.taskId} — ${c.title}`,id:c.taskId}))];return o.length===0?d.jsx(We,{className:"border-emerald-200 bg-emerald-50",children:d.jsx(rt,{className:"p-4 text-sm text-emerald-700",children:"No alerts — all clear"})}):d.jsxs(We,{className:"border-red-200",children:[d.jsx(gt,{children:d.jsxs(yt,{className:"text-red-700",children:["Alerts (",o.length,")"]})}),d.jsx(rt,{className:"space-y-2",children:o.map(c=>d.jsx("div",{className:`text-sm rounded-lg px-3 py-2 ${c.severity==="red"?"bg-red-50 text-red-800":"bg-amber-50 text-amber-800"}`,children:c.text},c.id))})]})}function tC({tasks:a}){const[t,s]=Q.useState("mid"),r=[...a].sort((v,x)=>(v.createdAt??0)-(x.createdAt??0));Math.min(...r.map(v=>v.createdAt??Date.now())),Math.max(...r.map(v=>v.updatedAt??Date.now()));const o=v=>new Date(v).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),c=v=>new Date(v).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),h=v=>{switch(v){case"done":return"bg-emerald-500";case"in_progress":return"bg-blue-500";case"review":return"bg-amber-500";case"blocked":return"bg-red-500";case"todo":return"bg-zinc-300";case"backlog":return"bg-zinc-200";default:return"bg-zinc-400"}},m=()=>{const v={};return r.forEach(x=>{if(!x.createdAt)return;const _=o(x.createdAt);v[_]||(v[_]={phases:{}}),x.phaseId&&(v[_].phases[x.phaseId]=(v[_].phases[x.phaseId]??0)+1)}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"flex gap-1",children:Object.entries(v).map(([x,_])=>{const S=Object.values(_.phases).reduce((k,w)=>k+w,0);return d.jsxs("div",{className:"flex-1 min-w-[60px]",children:[d.jsx("div",{className:"text-[10px] text-zinc-500 text-center mb-1",children:x}),d.jsx("div",{className:"h-16 flex flex-col gap-0.5",children:b0.slice(0,4).map(k=>{const w=_.phases[k.id]??0,A=S>0?w/S*60:0;return d.jsx("div",{className:`${h("todo")} rounded-sm`,style:{height:`${Math.max(A,w>0?4:0)}px`},title:`${k.label}: ${w} tasks`},k.id)})})]},x)})}),d.jsxs("div",{className:"flex justify-between text-[10px] text-zinc-400 mt-2",children:[d.jsx("span",{children:"Months"}),d.jsxs("span",{children:[Object.keys(v).length," months of activity"]})]})]})},p=()=>{const v={};r.forEach(_=>{if(!_.createdAt)return;const S=new Date(_.createdAt),k=`${S.getFullYear()}-W${Math.ceil(S.getDate()/7)}`;v[k]||(v[k]={done:0,total:0}),v[k].total++,_.status==="done"&&v[k].done++});const x=Object.entries(v).slice(-12);return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"flex gap-1 items-end h-24",children:x.map(([_,S])=>{const k=S.total>0?S.done/S.total*100:0;return d.jsxs("div",{className:"flex-1 min-w-[30px] group relative",children:[d.jsx("div",{className:`rounded-t transition-all ${k===100?"bg-emerald-500":k>0?"bg-blue-500":"bg-zinc-300"}`,style:{height:`${Math.max(S.total/10*24,4)}px`}}),d.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 bg-zinc-800 text-white text-[10px] px-2 py-1 rounded opacity-0 group-hover:opacity-100 whitespace-nowrap z-10",children:[_,": ",S.done,"/",S.total," done"]})]},_)})}),d.jsxs("div",{className:"flex justify-between text-[10px] text-zinc-400",children:[d.jsx("span",{children:"Weekly view (last 12 weeks)"}),d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),"done"]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),"active"]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-zinc-300"}),"planned"]})]})]})]})},g=()=>{const v=[];r.forEach(_=>{_.statusHistory&&_.statusHistory.forEach(S=>{v.push({taskId:_.taskId,title:_.title,status:S.status,timestamp:S.timestamp,agent:S.agent})})});const x=v.sort((_,S)=>S.timestamp-_.timestamp).slice(0,20);return d.jsxs("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:[x.map((_,S)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"text-zinc-400 w-16",children:c(_.timestamp)}),d.jsx("span",{className:`w-2 h-2 rounded-full ${h(_.status)}`}),d.jsx("span",{className:"font-mono text-zinc-500 w-12",children:_.taskId}),d.jsx("span",{className:"truncate flex-1",children:_.title}),d.jsx(at,{variant:"secondary",className:"text-[10px]",children:_.status})]},`${_.taskId}-${_.status}-${S}`)),x.length===0&&d.jsx("p",{className:"text-xs text-zinc-400",children:"No status history available"})]})};return d.jsxs(We,{children:[d.jsx(gt,{children:d.jsxs(yt,{className:"flex items-center justify-between",children:[d.jsx("span",{children:"Temporal View"}),d.jsx("div",{className:"flex gap-1",children:["bird","mid","micro"].map(v=>d.jsx("button",{onClick:()=>s(v),className:`px-3 py-1 text-xs rounded-lg transition-colors ${t===v?"bg-zinc-800 text-white":"bg-zinc-100 text-zinc-600 hover:bg-zinc-200"}`,children:v==="bird"?"🐦 Bird's eye":v==="mid"?"🔭 Mid-level":"🔬 Microscope"},v))})]})}),d.jsxs(rt,{children:[t==="bird"&&d.jsx(m,{}),t==="mid"&&d.jsx(p,{}),t==="micro"&&d.jsx(g,{})]})]})}function nC(){const a=st(Se.tasks.stats),t=st(Se.contextEntries.stats),s=st(Se.driftEvents.stats),r=st(Se.agents.stats),o=st(Se.tasks.list),c=st(Se.driftEvents.list);if(!a||!t||!s||!r||!o||!c)return d.jsx("div",{className:"text-zinc-400",children:"Loading..."});const h=a.total>0?Math.round((a.byStatus.done??0)/a.total*100):0;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold",children:"Cockpit"}),d.jsxs("p",{className:"text-zinc-500 mt-1",children:["UCA — ",h,"% complete (",a.byStatus.done??0,"/",a.total," tasks)"]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[d.jsx(tc,{title:"Tasks",value:`${a.byStatus.done??0}/${a.total}`,subtitle:`${a.byStatus.in_progress??0} in progress`}),d.jsx(tc,{title:"Context",value:t.total,subtitle:`${t.byTier.curated??0} curated, ${t.byTier.reviewed??0} reviewed`}),d.jsx(tc,{title:"Open Drifts",value:s.open,accent:s.open>0?"text-red-600":"text-emerald-600",subtitle:`${s.bySeverity.high??0} high severity`}),d.jsx(tc,{title:"Agents",value:r.active,subtitle:`${r.total} registered`})]}),d.jsx(tC,{tasks:o}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsx(WN,{tasks:o}),d.jsx(eC,{tasks:o,driftEvents:c})]}),d.jsxs(We,{children:[d.jsx(gt,{children:d.jsx(yt,{children:"Active Work"})}),d.jsx(rt,{children:d.jsxs("div",{className:"space-y-2",children:[o.filter(m=>m.status==="in_progress"||m.status==="review").map(m=>d.jsxs("div",{className:"flex items-center justify-between text-sm bg-zinc-50 rounded-lg px-3 py-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-zinc-400",children:m.taskId}),d.jsx("span",{children:m.title})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(at,{variant:"secondary",children:m.agent}),d.jsx(at,{variant:m.status==="review"?"warning":"default",children:m.status.replace("_"," ")})]})]},m.taskId)),o.filter(m=>m.status==="in_progress"||m.status==="review").length===0&&d.jsx("p",{className:"text-sm text-zinc-400",children:"No active tasks"})]})})]})]})}const sC=vT.update({id:"/tasks",path:"/tasks",getParentRoute:()=>ns}),aC=_T.update({id:"/skills",path:"/skills",getParentRoute:()=>ns}),iC=jT.update({id:"/mnemonics",path:"/mnemonics",getParentRoute:()=>ns}),rC=Bj.update({id:"/export",path:"/export",getParentRoute:()=>ns}),lC=Hj.update({id:"/drift",path:"/drift",getParentRoute:()=>ns}),oC=UN.update({id:"/context",path:"/context",getParentRoute:()=>ns}),cC=$N.update({id:"/agents",path:"/agents",getParentRoute:()=>ns}),uC=HN.update({id:"/agent-ops",path:"/agent-ops",getParentRoute:()=>ns}),dC=JN.update({id:"/",path:"/",getParentRoute:()=>ns}),fC={IndexRoute:dC,AgentOpsRoute:uC,AgentsRoute:cC,ContextRoute:oC,DriftRoute:lC,ExportRoute:rC,MnemonicsRoute:iC,SkillsRoute:aC,TasksRoute:sC},hC=ns._addFileChildren(fC)._addFileTypes();function mC(){return U1({routeTree:hC,scrollRestoration:!0})}const pC=mC();Y_.createRoot(document.getElementById("root")).render(d.jsx(Q.StrictMode,{children:d.jsx($1,{router:pC})}));
|