@agent-team-foundation/first-tree-hub 0.9.9 → 0.9.11

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.
@@ -1,361 +0,0 @@
1
- var e0=e=>{throw TypeError(e)};var vm=(e,t,n)=>t.has(e)||e0("Cannot "+n);var I=(e,t,n)=>(vm(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?e0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,i)=>(vm(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),Be=(e,t,n)=>(vm(e,t,"access private method"),n);var Hc=(e,t,n,i)=>({set _(l){ye(e,t,l,n)},get _(){return I(e,t,i)}});function jN(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(i,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bm={exports:{}},Po={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var t0;function EN(){if(t0)return Po;t0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:i,key:u,ref:l!==void 0?l:null,props:o}}return Po.Fragment=t,Po.jsx=n,Po.jsxs=n,Po}var n0;function CN(){return n0||(n0=1,bm.exports=EN()),bm.exports}var d=CN(),xm={exports:{}},Le={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var r0;function _N(){if(r0)return Le;r0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function N(L,A,C){this.props=L,this.context=A,this.refs=E,this.updater=C||k}N.prototype.isReactComponent={},N.prototype.setState=function(L,A){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,A,"setState")},N.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=N.prototype;function D(L,A,C){this.props=L,this.context=A,this.refs=E,this.updater=C||k}var U=D.prototype=new T;U.constructor=D,j(U,N.prototype),U.isPureReactComponent=!0;var B=Array.isArray;function z(){}var F={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ee(L,A,C){var J=C.ref;return{$$typeof:e,type:L,key:A,ref:J!==void 0?J:null,props:C}}function q(L,A){return ee(L.type,A,L.props)}function ae(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function re(L){var A={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(C){return A[C]})}var pe=/\/+/g;function fe(L,A){return typeof L=="object"&&L!==null&&L.key!=null?re(""+L.key):A.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(z,z):(L.status="pending",L.then(function(A){L.status==="pending"&&(L.status="fulfilled",L.value=A)},function(A){L.status==="pending"&&(L.status="rejected",L.reason=A)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,A,C,J,Y){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var ge=!1;if(L===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(L.$$typeof){case e:case t:ge=!0;break;case y:return ge=L._init,P(ge(L._payload),A,C,J,Y)}}if(ge)return Y=Y(L),ge=J===""?"."+fe(L,0):J,B(Y)?(C="",ge!=null&&(C=ge.replace(pe,"$&/")+"/"),P(Y,A,C,"",function(_t){return _t})):Y!=null&&(ae(Y)&&(Y=q(Y,C+(Y.key==null||L&&L.key===Y.key?"":(""+Y.key).replace(pe,"$&/")+"/")+ge)),A.push(Y)),1;ge=0;var Me=J===""?".":J+":";if(B(L))for(var xe=0;xe<L.length;xe++)J=L[xe],ue=Me+fe(J,xe),ge+=P(J,A,C,ue,Y);else if(xe=x(L),typeof xe=="function")for(L=xe.call(L),xe=0;!(J=L.next()).done;)J=J.value,ue=Me+fe(J,xe++),ge+=P(J,A,C,ue,Y);else if(ue==="object"){if(typeof L.then=="function")return P(W(L),A,C,J,Y);throw A=String(L),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.")}return ge}function V(L,A,C){if(L==null)return L;var J=[],Y=0;return P(L,J,"","",function(ue){return A.call(C,ue,Y++)}),J}function ce(L){if(L._status===-1){var A=L._result;A=A(),A.then(function(C){(L._status===0||L._status===-1)&&(L._status=1,L._result=C)},function(C){(L._status===0||L._status===-1)&&(L._status=2,L._result=C)}),L._status===-1&&(L._status=0,L._result=A)}if(L._status===1)return L._result.default;throw L._result}var be=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},R={map:V,forEach:function(L,A,C){V(L,function(){A.apply(this,arguments)},C)},count:function(L){var A=0;return V(L,function(){A++}),A},toArray:function(L){return V(L,function(A){return A})||[]},only:function(L){if(!ae(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Le.Activity=g,Le.Children=R,Le.Component=N,Le.Fragment=n,Le.Profiler=l,Le.PureComponent=D,Le.StrictMode=i,Le.Suspense=m,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Le.__COMPILER_RUNTIME={__proto__:null,c:function(L){return F.H.useMemoCache(L)}},Le.cache=function(L){return function(){return L.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(L,A,C){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var J=j({},L.props),Y=L.key;if(A!=null)for(ue in A.key!==void 0&&(Y=""+A.key),A)!Z.call(A,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&A.ref===void 0||(J[ue]=A[ue]);var ue=arguments.length-2;if(ue===1)J.children=C;else if(1<ue){for(var ge=Array(ue),Me=0;Me<ue;Me++)ge[Me]=arguments[Me+2];J.children=ge}return ee(L.type,Y,J)},Le.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Le.createElement=function(L,A,C){var J,Y={},ue=null;if(A!=null)for(J in A.key!==void 0&&(ue=""+A.key),A)Z.call(A,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Y[J]=A[J]);var ge=arguments.length-2;if(ge===1)Y.children=C;else if(1<ge){for(var Me=Array(ge),xe=0;xe<ge;xe++)Me[xe]=arguments[xe+2];Y.children=Me}if(L&&L.defaultProps)for(J in ge=L.defaultProps,ge)Y[J]===void 0&&(Y[J]=ge[J]);return ee(L,ue,Y)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(L){return{$$typeof:f,render:L}},Le.isValidElement=ae,Le.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ce}},Le.memo=function(L,A){return{$$typeof:h,type:L,compare:A===void 0?null:A}},Le.startTransition=function(L){var A=F.T,C={};F.T=C;try{var J=L(),Y=F.S;Y!==null&&Y(C,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(z,be)}catch(ue){be(ue)}finally{A!==null&&C.types!==null&&(A.types=C.types),F.T=A}},Le.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Le.use=function(L){return F.H.use(L)},Le.useActionState=function(L,A,C){return F.H.useActionState(L,A,C)},Le.useCallback=function(L,A){return F.H.useCallback(L,A)},Le.useContext=function(L){return F.H.useContext(L)},Le.useDebugValue=function(){},Le.useDeferredValue=function(L,A){return F.H.useDeferredValue(L,A)},Le.useEffect=function(L,A){return F.H.useEffect(L,A)},Le.useEffectEvent=function(L){return F.H.useEffectEvent(L)},Le.useId=function(){return F.H.useId()},Le.useImperativeHandle=function(L,A,C){return F.H.useImperativeHandle(L,A,C)},Le.useInsertionEffect=function(L,A){return F.H.useInsertionEffect(L,A)},Le.useLayoutEffect=function(L,A){return F.H.useLayoutEffect(L,A)},Le.useMemo=function(L,A){return F.H.useMemo(L,A)},Le.useOptimistic=function(L,A){return F.H.useOptimistic(L,A)},Le.useReducer=function(L,A,C){return F.H.useReducer(L,A,C)},Le.useRef=function(L){return F.H.useRef(L)},Le.useState=function(L){return F.H.useState(L)},Le.useSyncExternalStore=function(L,A,C){return F.H.useSyncExternalStore(L,A,C)},Le.useTransition=function(){return F.H.useTransition()},Le.version="19.2.4",Le}var a0;function ag(){return a0||(a0=1,xm.exports=_N()),xm.exports}var S=ag();const NN=Md(S),ig=jN({__proto__:null,default:NN},[S]);var Sm={exports:{}},$o={},wm={exports:{}},km={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var i0;function AN(){return i0||(i0=1,(function(e){function t(P,V){var ce=P.length;P.push(V);e:for(;0<ce;){var be=ce-1>>>1,R=P[be];if(0<l(R,V))P[be]=V,P[ce]=R,ce=be;else break e}}function n(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var V=P[0],ce=P.pop();if(ce!==V){P[0]=ce;e:for(var be=0,R=P.length,L=R>>>1;be<L;){var A=2*(be+1)-1,C=P[A],J=A+1,Y=P[J];if(0>l(C,ce))J<R&&0>l(Y,C)?(P[be]=Y,P[J]=ce,be=J):(P[be]=C,P[A]=ce,be=A);else if(J<R&&0>l(Y,ce))P[be]=Y,P[J]=ce,be=J;else break e}}return V}function l(P,V){var ce=P.sortIndex-V.sortIndex;return ce!==0?ce:P.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,b=3,x=!1,k=!1,j=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function U(P){for(var V=n(h);V!==null;){if(V.callback===null)i(h);else if(V.startTime<=P)i(h),V.sortIndex=V.expirationTime,t(m,V);else break;V=n(h)}}function B(P){if(j=!1,U(P),!k)if(n(m)!==null)k=!0,z||(z=!0,re());else{var V=n(h);V!==null&&W(B,V.startTime-P)}}var z=!1,F=-1,Z=5,ee=-1;function q(){return E?!0:!(e.unstable_now()-ee<Z)}function ae(){if(E=!1,z){var P=e.unstable_now();ee=P;var V=!0;try{e:{k=!1,j&&(j=!1,T(F),F=-1),x=!0;var ce=b;try{t:{for(U(P),g=n(m);g!==null&&!(g.expirationTime>P&&q());){var be=g.callback;if(typeof be=="function"){g.callback=null,b=g.priorityLevel;var R=be(g.expirationTime<=P);if(P=e.unstable_now(),typeof R=="function"){g.callback=R,U(P),V=!0;break t}g===n(m)&&i(m),U(P)}else i(m);g=n(m)}if(g!==null)V=!0;else{var L=n(h);L!==null&&W(B,L.startTime-P),V=!1}}break e}finally{g=null,b=ce,x=!1}V=void 0}}finally{V?re():z=!1}}}var re;if(typeof D=="function")re=function(){D(ae)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,fe=pe.port2;pe.port1.onmessage=ae,re=function(){fe.postMessage(null)}}else re=function(){N(ae,0)};function W(P,V){F=N(function(){P(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(P){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var ce=b;b=V;try{return P()}finally{b=ce}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ce=b;b=P;try{return V()}finally{b=ce}},e.unstable_scheduleCallback=function(P,V,ce){var be=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?be+ce:be):ce=be,P){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ce+R,P={id:y++,callback:V,priorityLevel:P,startTime:ce,expirationTime:R,sortIndex:-1},ce>be?(P.sortIndex=ce,t(h,P),n(m)===null&&P===n(h)&&(j?(T(F),F=-1):j=!0,W(B,ce-be))):(P.sortIndex=R,t(m,P),k||x||(k=!0,z||(z=!0,re()))),P},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(P){var V=b;return function(){var ce=b;b=V;try{return P.apply(this,arguments)}finally{b=ce}}}})(km)),km}var l0;function TN(){return l0||(l0=1,wm.exports=AN()),wm.exports}var jm={exports:{}},fn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var s0;function RN(){if(s0)return fn;s0=1;var e=ag();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,fn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,y)},fn.flushSync=function(m){var h=u.T,y=i.p;try{if(u.T=null,i.p=2,m)return m()}finally{u.T=h,i.p=y,i.d.f()}},fn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(m,h))},fn.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},fn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:x}):y==="script"&&i.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},fn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);i.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(m)},fn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);i.d.L(m,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},fn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);i.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(m)},fn.requestFormReset=function(m){i.d.r(m)},fn.unstable_batchedUpdates=function(m,h){return m(h)},fn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},fn.useFormStatus=function(){return u.H.useHostTransitionStatus()},fn.version="19.2.4",fn}var o0;function US(){if(o0)return jm.exports;o0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jm.exports=RN(),jm.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var u0;function zN(){if(u0)return $o;u0=1;var e=TN(),t=ag(),n=US();function i(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var a=r,s=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(s=a.return),r=a.return;while(r)}return a.tag===3?s:null}function u(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function f(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(i(188))}function h(r){var a=r.alternate;if(!a){if(a=o(r),a===null)throw Error(i(188));return a!==r?null:r}for(var s=r,c=a;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===c)return m(p),a;v=v.sibling}throw Error(i(188))}if(s.return!==c.return)s=p,c=v;else{for(var w=!1,_=p.child;_;){if(_===s){w=!0,s=p,c=v;break}if(_===c){w=!0,c=p,s=v;break}_=_.sibling}if(!w){for(_=v.child;_;){if(_===s){w=!0,s=v,c=p;break}if(_===c){w=!0,c=v,s=p;break}_=_.sibling}if(!w)throw Error(i(189))}}if(s.alternate!==c)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?r:a}function y(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=y(r),a!==null)return a;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),D=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function re(r){return r===null||typeof r!="object"?null:(r=ae&&r[ae]||r["@@iterator"],typeof r=="function"?r:null)}var pe=Symbol.for("react.client.reference");function fe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===pe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case z:return"SuspenseList";case ee:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case D:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case U:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case F:return a=r.displayName||null,a!==null?a:fe(r.type)||"Memo";case Z:a=r._payload,r=r._init;try{return fe(r(a))}catch{}}return null}var W=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},be=[],R=-1;function L(r){return{current:r}}function A(r){0>R||(r.current=be[R],be[R]=null,R--)}function C(r,a){R++,be[R]=r.current,r.current=a}var J=L(null),Y=L(null),ue=L(null),ge=L(null);function Me(r,a){switch(C(ue,a),C(Y,r),C(J,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?kx(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=kx(a),r=jx(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}A(J),C(J,r)}function xe(){A(J),A(Y),A(ue)}function _t(r){r.memoizedState!==null&&C(ge,r);var a=J.current,s=jx(a,r.type);a!==s&&(C(Y,r),C(J,s))}function en(r){Y.current===r&&(A(J),A(Y)),ge.current===r&&(A(ge),Lo._currentValue=ce)}var Bn,tr;function tn(r){if(Bn===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Bn=a&&a[1]||"",tr=-1<s.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Bn+r+tr}var Na=!1;function ft(r,a){if(!r||Na)return"";Na=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(X){var K=X}Reflect.construct(r,[],se)}else{try{se.call()}catch(X){K=X}r.call(se.prototype)}}else{try{throw Error()}catch(X){K=X}(se=r())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(X){if(X&&K&&typeof X.stack=="string")return[X.stack,K.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],_=v[1];if(w&&_){var M=w.split(`
44
- `),G=_.split(`
45
- `);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===G.length)for(c=M.length-1,p=G.length-1;1<=c&&0<=p&&M[c]!==G[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==G[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==G[p]){var te=`
46
- `+M[c].replace(" at new "," at ");return r.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",r.displayName)),te}while(1<=c&&0<=p);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?tn(s):""}function Gt(r,a){switch(r.tag){case 26:case 27:case 5:return tn(r.type);case 16:return tn("Lazy");case 13:return r.child!==a&&a!==null?tn("Suspense Fallback"):tn("Suspense");case 19:return tn("SuspenseList");case 0:case 15:return ft(r.type,!1);case 11:return ft(r.type.render,!1);case 1:return ft(r.type,!0);case 31:return tn("Activity");default:return""}}function br(r){try{var a="",s=null;do a+=Gt(r,s),s=r,r=r.return;while(r);return a}catch(c){return`
47
- Error generating stack: `+c.message+`
48
- `+c.stack}}var Zr=Object.prototype.hasOwnProperty,Vr=e.unstable_scheduleCallback,Ai=e.unstable_cancelCallback,Ti=e.unstable_shouldYield,Vs=e.unstable_requestPaint,nn=e.unstable_now,Qs=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,nt=e.unstable_IdlePriority,cn=e.log,xr=e.unstable_setDisableYieldValue,rn=null,Dt=null;function dn(r){if(typeof cn=="function"&&xr(r),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(rn,r)}catch{}}var ut=Math.clz32?Math.clz32:Aa,Nr=Math.log,Pn=Math.LN2;function Aa(r){return r>>>=0,r===0?32:31-(Nr(r)/Pn|0)|0}var Ri=256,zi=262144,Oi=4194304;function Ar(r){var a=r&42;if(a!==0)return a;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Di(r,a,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var _=c&134217727;return _!==0?(c=_&~v,c!==0?p=Ar(c):(w&=_,w!==0?p=Ar(w):s||(s=_&~r,s!==0&&(p=Ar(s))))):(_=c&~v,_!==0?p=Ar(_):w!==0?p=Ar(w):s||(s=c&~r,s!==0&&(p=Ar(s)))),p===0?0:a!==0&&a!==p&&(a&v)===0&&(v=p&-p,s=a&-a,v>=s||v===32&&(s&4194048)!==0)?a:p}function Ta(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function Tu(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Gs(){var r=Oi;return Oi<<=1,(Oi&62914560)===0&&(Oi=4194304),r}function Sl(r){for(var a=[],s=0;31>s;s++)a.push(r);return a}function Ra(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Ru(r,a,s,c,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var _=r.entanglements,M=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var te=31-ut(s),se=1<<te;_[te]=0,M[te]=-1;var K=G[te];if(K!==null)for(G[te]=null,te=0;te<K.length;te++){var X=K[te];X!==null&&(X.lane&=-536870913)}s&=~se}c!==0&&Ks(r,c,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~a))}function Ks(r,a,s){r.pendingLanes|=a,r.suspendedLanes&=~a;var c=31-ut(a);r.entangledLanes|=a,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function oe(r,a){var s=r.entangledLanes|=a;for(r=r.entanglements;s;){var c=31-ut(s),p=1<<c;p&a|r[c]&a&&(r[c]|=a),s&=~p}}function Ze(r,a){var s=a&-a;return s=(s&42)!==0?1:Kt(s),(s&(r.suspendedLanes|a))!==0?0:s}function Kt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function wl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function of(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:Qx(r.type))}function uy(r,a){var s=V.p;try{return V.p=r,a()}finally{V.p=s}}var za=Math.random().toString(36).slice(2),an="__reactFiber$"+za,kn="__reactProps$"+za,kl="__reactContainer$"+za,uf="__reactEvents$"+za,hC="__reactListeners$"+za,mC="__reactHandles$"+za,cy="__reactResources$"+za,Ys="__reactMarker$"+za;function cf(r){delete r[an],delete r[kn],delete r[uf],delete r[hC],delete r[mC]}function jl(r){var a=r[an];if(a)return a;for(var s=r.parentNode;s;){if(a=s[kl]||s[an]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(r=Rx(r);r!==null;){if(s=r[an])return s;r=Rx(r)}return a}r=s,s=r.parentNode}return null}function El(r){if(r=r[an]||r[kl]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Xs(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function Cl(r){var a=r[cy];return a||(a=r[cy]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Yt(r){r[Ys]=!0}var dy=new Set,fy={};function Mi(r,a){_l(r,a),_l(r+"Capture",a)}function _l(r,a){for(fy[r]=a,r=0;r<a.length;r++)dy.add(a[r])}var pC=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]*$"),hy={},my={};function gC(r){return Zr.call(my,r)?!0:Zr.call(hy,r)?!1:pC.test(r)?my[r]=!0:(hy[r]=!0,!1)}function zu(r,a,s){if(gC(a))if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+s)}}function Ou(r,a,s){if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+s)}}function Qr(r,a,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(a,s,""+c)}}function nr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function py(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function yC(r,a,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,a,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function df(r){if(!r._valueTracker){var a=py(r)?"checked":"value";r._valueTracker=yC(r,a,""+r[a])}}function gy(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return r&&(c=py(r)?r.checked?"true":"false":r.value),r=c,r!==s?(a.setValue(r),!0):!1}function Du(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var vC=/[\n"\\]/g;function rr(r){return r.replace(vC,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ff(r,a,s,c,p,v,w,_){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),a!=null?w==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+nr(a)):r.value!==""+nr(a)&&(r.value=""+nr(a)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),a!=null?hf(r,w,nr(a)):s!=null?hf(r,w,nr(s)):c!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+nr(_):r.removeAttribute("name")}function yy(r,a,s,c,p,v,w,_){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),a!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||a!=null)){df(r);return}s=s!=null?""+nr(s):"",a=a!=null?""+nr(a):s,_||a===r.value||(r.value=a),r.defaultValue=a}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=_?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),df(r)}function hf(r,a,s){a==="number"&&Du(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Nl(r,a,s,c){if(r=r.options,a){a={};for(var p=0;p<s.length;p++)a["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=a.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&c&&(r[s].defaultSelected=!0)}else{for(s=""+nr(s),a=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}a!==null||r[p].disabled||(a=r[p])}a!==null&&(a.selected=!0)}}function vy(r,a,s){if(a!=null&&(a=""+nr(a),a!==r.value&&(r.value=a),s==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=s!=null?""+nr(s):""}function by(r,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(i(92));if(W(c)){if(1<c.length)throw Error(i(93));c=c[0]}s=c}s==null&&(s=""),a=s}s=nr(a),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),df(r)}function Al(r,a){if(a){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=a;return}}r.textContent=a}var bC=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 xy(r,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":c?r.setProperty(a,s):typeof s!="number"||s===0||bC.has(a)?a==="float"?r.cssFloat=s:r[a]=(""+s).trim():r[a]=s+"px"}function Sy(r,a,s){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in a)c=a[p],a.hasOwnProperty(p)&&s[p]!==c&&xy(r,p,c)}else for(var v in a)a.hasOwnProperty(v)&&xy(r,v,a[v])}function mf(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xC=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"]]),SC=/^[\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 Mu(r){return SC.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Gr(){}var pf=null;function gf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Tl=null,Rl=null;function wy(r){var a=El(r);if(a&&(r=a.stateNode)){var s=r[kn]||null;e:switch(r=a.stateNode,a.type){case"input":if(ff(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+rr(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==r&&c.form===r.form){var p=c[kn]||null;if(!p)throw Error(i(90));ff(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===r.form&&gy(c)}break e;case"textarea":vy(r,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Nl(r,!!s.multiple,a,!1)}}}var yf=!1;function ky(r,a,s){if(yf)return r(a,s);yf=!0;try{var c=r(a);return c}finally{if(yf=!1,(Tl!==null||Rl!==null)&&(wc(),Tl&&(a=Tl,r=Rl,Rl=Tl=null,wy(a),r)))for(a=0;a<r.length;a++)wy(r[a])}}function Js(r,a){var s=r.stateNode;if(s===null)return null;var c=s[kn]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(i(231,a,typeof s));return s}var Kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vf=!1;if(Kr)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){vf=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{vf=!1}var Oa=null,bf=null,Lu=null;function jy(){if(Lu)return Lu;var r,a=bf,s=a.length,c,p="value"in Oa?Oa.value:Oa.textContent,v=p.length;for(r=0;r<s&&a[r]===p[r];r++);var w=s-r;for(c=1;c<=w&&a[s-c]===p[v-c];c++);return Lu=p.slice(r,1<c?1-c:void 0)}function Iu(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Uu(){return!0}function Ey(){return!1}function jn(r){function a(s,c,p,v,w){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(s=r[_],this[_]=s?s(v):v[_]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Uu:Ey,this.isPropagationStopped=Ey,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Uu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Uu)},persist:function(){},isPersistent:Uu}),a}var Li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bu=jn(Li),eo=g({},Li,{view:0,detail:0}),wC=jn(eo),xf,Sf,to,Pu=g({},eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==to&&(to&&r.type==="mousemove"?(xf=r.screenX-to.screenX,Sf=r.screenY-to.screenY):Sf=xf=0,to=r),xf)},movementY:function(r){return"movementY"in r?r.movementY:Sf}}),Cy=jn(Pu),kC=g({},Pu,{dataTransfer:0}),jC=jn(kC),EC=g({},eo,{relatedTarget:0}),wf=jn(EC),CC=g({},Li,{animationName:0,elapsedTime:0,pseudoElement:0}),_C=jn(CC),NC=g({},Li,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),AC=jn(NC),TC=g({},Li,{data:0}),_y=jn(TC),RC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zC={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"},OC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DC(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=OC[r])?!!a[r]:!1}function kf(){return DC}var MC=g({},eo,{key:function(r){if(r.key){var a=RC[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Iu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?zC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kf,charCode:function(r){return r.type==="keypress"?Iu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Iu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),LC=jn(MC),IC=g({},Pu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ny=jn(IC),UC=g({},eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kf}),BC=jn(UC),PC=g({},Li,{propertyName:0,elapsedTime:0,pseudoElement:0}),$C=jn(PC),FC=g({},Pu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),qC=jn(FC),HC=g({},Li,{newState:0,oldState:0}),ZC=jn(HC),VC=[9,13,27,32],jf=Kr&&"CompositionEvent"in window,no=null;Kr&&"documentMode"in document&&(no=document.documentMode);var QC=Kr&&"TextEvent"in window&&!no,Ay=Kr&&(!jf||no&&8<no&&11>=no),Ty=" ",Ry=!1;function zy(r,a){switch(r){case"keyup":return VC.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var zl=!1;function GC(r,a){switch(r){case"compositionend":return Oy(a);case"keypress":return a.which!==32?null:(Ry=!0,Ty);case"textInput":return r=a.data,r===Ty&&Ry?null:r;default:return null}}function KC(r,a){if(zl)return r==="compositionend"||!jf&&zy(r,a)?(r=jy(),Lu=bf=Oa=null,zl=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Ay&&a.locale!=="ko"?null:a.data;default:return null}}var YC={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 Dy(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!YC[r.type]:a==="textarea"}function My(r,a,s,c){Tl?Rl?Rl.push(c):Rl=[c]:Tl=c,a=Ac(a,"onChange"),0<a.length&&(s=new Bu("onChange","change",null,s,c),r.push({event:s,listeners:a}))}var ro=null,ao=null;function XC(r){yx(r,0)}function $u(r){var a=Xs(r);if(gy(a))return r}function Ly(r,a){if(r==="change")return a}var Iy=!1;if(Kr){var Ef;if(Kr){var Cf="oninput"in document;if(!Cf){var Uy=document.createElement("div");Uy.setAttribute("oninput","return;"),Cf=typeof Uy.oninput=="function"}Ef=Cf}else Ef=!1;Iy=Ef&&(!document.documentMode||9<document.documentMode)}function By(){ro&&(ro.detachEvent("onpropertychange",Py),ao=ro=null)}function Py(r){if(r.propertyName==="value"&&$u(ao)){var a=[];My(a,ao,r,gf(r)),ky(XC,a)}}function JC(r,a,s){r==="focusin"?(By(),ro=a,ao=s,ro.attachEvent("onpropertychange",Py)):r==="focusout"&&By()}function WC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return $u(ao)}function e_(r,a){if(r==="click")return $u(a)}function t_(r,a){if(r==="input"||r==="change")return $u(a)}function n_(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var $n=typeof Object.is=="function"?Object.is:n_;function io(r,a){if($n(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var s=Object.keys(r),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Zr.call(a,p)||!$n(r[p],a[p]))return!1}return!0}function $y(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Fy(r,a){var s=$y(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=a&&c>=a)return{node:s,offset:a-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=$y(s)}}function qy(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?qy(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function Hy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Du(r.document);a instanceof r.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)r=a.contentWindow;else break;a=Du(r.document)}return a}function _f(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var r_=Kr&&"documentMode"in document&&11>=document.documentMode,Ol=null,Nf=null,lo=null,Af=!1;function Zy(r,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Af||Ol==null||Ol!==Du(c)||(c=Ol,"selectionStart"in c&&_f(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),lo&&io(lo,c)||(lo=c,c=Ac(Nf,"onSelect"),0<c.length&&(a=new Bu("onSelect","select",null,a,s),r.push({event:a,listeners:c}),a.target=Ol)))}function Ii(r,a){var s={};return s[r.toLowerCase()]=a.toLowerCase(),s["Webkit"+r]="webkit"+a,s["Moz"+r]="moz"+a,s}var Dl={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionrun:Ii("Transition","TransitionRun"),transitionstart:Ii("Transition","TransitionStart"),transitioncancel:Ii("Transition","TransitionCancel"),transitionend:Ii("Transition","TransitionEnd")},Tf={},Vy={};Kr&&(Vy=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ui(r){if(Tf[r])return Tf[r];if(!Dl[r])return r;var a=Dl[r],s;for(s in a)if(a.hasOwnProperty(s)&&s in Vy)return Tf[r]=a[s];return r}var Qy=Ui("animationend"),Gy=Ui("animationiteration"),Ky=Ui("animationstart"),a_=Ui("transitionrun"),i_=Ui("transitionstart"),l_=Ui("transitioncancel"),Yy=Ui("transitionend"),Xy=new Map,Rf="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(" ");Rf.push("scrollEnd");function Sr(r,a){Xy.set(r,a),Mi(a,[r])}var Fu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ar=[],Ml=0,zf=0;function qu(){for(var r=Ml,a=zf=Ml=0;a<r;){var s=ar[a];ar[a++]=null;var c=ar[a];ar[a++]=null;var p=ar[a];ar[a++]=null;var v=ar[a];if(ar[a++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}v!==0&&Jy(s,p,v)}}function Hu(r,a,s,c){ar[Ml++]=r,ar[Ml++]=a,ar[Ml++]=s,ar[Ml++]=c,zf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Of(r,a,s,c){return Hu(r,a,s,c),Zu(r)}function Bi(r,a){return Hu(r,null,null,a),Zu(r)}function Jy(r,a,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&a!==null&&(p=31-ut(s),r=v.hiddenUpdates,c=r[p],c===null?r[p]=[a]:c.push(a),a.lane=s|536870912),v):null}function Zu(r){if(50<Ao)throw Ao=0,Fh=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var Ll={};function s_(r,a,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(r,a,s,c){return new s_(r,a,s,c)}function Df(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Yr(r,a){var s=r.alternate;return s===null?(s=Fn(r.tag,a,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=a,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,a=r.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Wy(r,a){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,a=s.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Vu(r,a,s,c,p,v){var w=0;if(c=r,typeof r=="function")Df(r)&&(w=1);else if(typeof r=="string")w=fN(r,s,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case ee:return r=Fn(31,s,a,p),r.elementType=ee,r.lanes=v,r;case j:return Pi(s.children,p,v,a);case E:w=8,p|=24;break;case N:return r=Fn(12,s,a,p|2),r.elementType=N,r.lanes=v,r;case B:return r=Fn(13,s,a,p),r.elementType=B,r.lanes=v,r;case z:return r=Fn(19,s,a,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case D:w=10;break e;case T:w=9;break e;case U:w=11;break e;case F:w=14;break e;case Z:w=16,c=null;break e}w=29,s=Error(i(130,r===null?"null":typeof r,"")),c=null}return a=Fn(w,s,a,p),a.elementType=r,a.type=c,a.lanes=v,a}function Pi(r,a,s,c){return r=Fn(7,r,c,a),r.lanes=s,r}function Mf(r,a,s){return r=Fn(6,r,null,a),r.lanes=s,r}function ev(r){var a=Fn(18,null,null,0);return a.stateNode=r,a}function Lf(r,a,s){return a=Fn(4,r.children!==null?r.children:[],r.key,a),a.lanes=s,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var tv=new WeakMap;function ir(r,a){if(typeof r=="object"&&r!==null){var s=tv.get(r);return s!==void 0?s:(a={value:r,source:a,stack:br(a)},tv.set(r,a),a)}return{value:r,source:a,stack:br(a)}}var Il=[],Ul=0,Qu=null,so=0,lr=[],sr=0,Da=null,Tr=1,Rr="";function Xr(r,a){Il[Ul++]=so,Il[Ul++]=Qu,Qu=r,so=a}function nv(r,a,s){lr[sr++]=Tr,lr[sr++]=Rr,lr[sr++]=Da,Da=r;var c=Tr;r=Rr;var p=32-ut(c)-1;c&=~(1<<p),s+=1;var v=32-ut(a)+p;if(30<v){var w=p-p%5;v=(c&(1<<w)-1).toString(32),c>>=w,p-=w,Tr=1<<32-ut(a)+p|s<<p|c,Rr=v+r}else Tr=1<<v|s<<p|c,Rr=r}function If(r){r.return!==null&&(Xr(r,1),nv(r,1,0))}function Uf(r){for(;r===Qu;)Qu=Il[--Ul],Il[Ul]=null,so=Il[--Ul],Il[Ul]=null;for(;r===Da;)Da=lr[--sr],lr[sr]=null,Rr=lr[--sr],lr[sr]=null,Tr=lr[--sr],lr[sr]=null}function rv(r,a){lr[sr++]=Tr,lr[sr++]=Rr,lr[sr++]=Da,Tr=a.id,Rr=a.overflow,Da=r}var ln=null,wt=null,Je=!1,Ma=null,or=!1,Bf=Error(i(519));function La(r){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oo(ir(a,r)),Bf}function av(r){var a=r.stateNode,s=r.type,c=r.memoizedProps;switch(a[an]=r,a[kn]=c,s){case"dialog":Qe("cancel",a),Qe("close",a);break;case"iframe":case"object":case"embed":Qe("load",a);break;case"video":case"audio":for(s=0;s<Ro.length;s++)Qe(Ro[s],a);break;case"source":Qe("error",a);break;case"img":case"image":case"link":Qe("error",a),Qe("load",a);break;case"details":Qe("toggle",a);break;case"input":Qe("invalid",a),yy(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Qe("invalid",a);break;case"textarea":Qe("invalid",a),by(a,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||Sx(a.textContent,s)?(c.popover!=null&&(Qe("beforetoggle",a),Qe("toggle",a)),c.onScroll!=null&&Qe("scroll",a),c.onScrollEnd!=null&&Qe("scrollend",a),c.onClick!=null&&(a.onclick=Gr),a=!0):a=!1,a||La(r,!0)}function iv(r){for(ln=r.return;ln;)switch(ln.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:ln=ln.return}}function Bl(r){if(r!==ln)return!1;if(!Je)return iv(r),Je=!0,!1;var a=r.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||rm(r.type,r.memoizedProps)),s=!s),s&&wt&&La(r),iv(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));wt=Tx(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));wt=Tx(r)}else a===27?(a=wt,Ya(r.type)?(r=om,om=null,wt=r):wt=a):wt=ln?cr(r.stateNode.nextSibling):null;return!0}function $i(){wt=ln=null,Je=!1}function Pf(){var r=Ma;return r!==null&&(Nn===null?Nn=r:Nn.push.apply(Nn,r),Ma=null),r}function oo(r){Ma===null?Ma=[r]:Ma.push(r)}var $f=L(null),Fi=null,Jr=null;function Ia(r,a,s){C($f,a._currentValue),a._currentValue=s}function Wr(r){r._currentValue=$f.current,A($f)}function Ff(r,a,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),r===s)break;r=r.return}}function qf(r,a,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var _=v;v=p;for(var M=0;M<a.length;M++)if(_.context===a[M]){v.lanes|=s,_=v.alternate,_!==null&&(_.lanes|=s),Ff(v.return,s,r),c||(w=null);break e}v=_.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(i(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),Ff(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Pl(r,a,s,c){r=null;for(var p=a,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var _=p.type;$n(p.pendingProps.value,w.value)||(r!==null?r.push(_):r=[_])}}else if(p===ge.current){if(w=p.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Lo):r=[Lo])}p=p.return}r!==null&&qf(a,r,s,c),a.flags|=262144}function Gu(r){for(r=r.firstContext;r!==null;){if(!$n(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function qi(r){Fi=r,Jr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function sn(r){return lv(Fi,r)}function Ku(r,a){return Fi===null&&qi(r),lv(r,a)}function lv(r,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Jr===null){if(r===null)throw Error(i(308));Jr=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Jr=Jr.next=a;return s}var o_=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){a.aborted=!0,r.forEach(function(s){return s()})}},u_=e.unstable_scheduleCallback,c_=e.unstable_NormalPriority,It={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hf(){return{controller:new o_,data:new Map,refCount:0}}function uo(r){r.refCount--,r.refCount===0&&u_(c_,function(){r.controller.abort()})}var co=null,Zf=0,$l=0,Fl=null;function d_(r,a){if(co===null){var s=co=[];Zf=0,$l=Gh(),Fl={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Zf++,a.then(sv,sv),a}function sv(){if(--Zf===0&&co!==null){Fl!==null&&(Fl.status="fulfilled");var r=co;co=null,$l=0,Fl=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function f_(r,a){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){c.status="fulfilled",c.value=a;for(var p=0;p<s.length;p++)(0,s[p])(a)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var ov=P.S;P.S=function(r,a){Zb=nn(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&d_(r,a),ov!==null&&ov(r,a)};var Hi=L(null);function Vf(){var r=Hi.current;return r!==null?r:gt.pooledCache}function Yu(r,a){a===null?C(Hi,Hi.current):C(Hi,a.pool)}function uv(){var r=Vf();return r===null?null:{parent:It._currentValue,pool:r}}var ql=Error(i(460)),Qf=Error(i(474)),Xu=Error(i(542)),Ju={then:function(){}};function cv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function dv(r,a,s){switch(s=r[s],s===void 0?r.push(a):s!==a&&(a.then(Gr,Gr),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,hv(r),r;default:if(typeof a.status=="string")a.then(Gr,Gr);else{if(r=gt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=a,r.status="pending",r.then(function(c){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=c}},function(c){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,hv(r),r}throw Vi=a,ql}}function Zi(r){try{var a=r._init;return a(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Vi=s,ql):s}}var Vi=null;function fv(){if(Vi===null)throw Error(i(459));var r=Vi;return Vi=null,r}function hv(r){if(r===ql||r===Xu)throw Error(i(483))}var Hl=null,fo=0;function Wu(r){var a=fo;return fo+=1,Hl===null&&(Hl=[]),dv(Hl,r,a)}function ho(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function ec(r,a){throw a.$$typeof===b?Error(i(525)):(r=Object.prototype.toString.call(a),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function mv(r){function a(H,$){if(r){var Q=H.deletions;Q===null?(H.deletions=[$],H.flags|=16):Q.push($)}}function s(H,$){if(!r)return null;for(;$!==null;)a(H,$),$=$.sibling;return null}function c(H){for(var $=new Map;H!==null;)H.key!==null?$.set(H.key,H):$.set(H.index,H),H=H.sibling;return $}function p(H,$){return H=Yr(H,$),H.index=0,H.sibling=null,H}function v(H,$,Q){return H.index=Q,r?(Q=H.alternate,Q!==null?(Q=Q.index,Q<$?(H.flags|=67108866,$):Q):(H.flags|=67108866,$)):(H.flags|=1048576,$)}function w(H){return r&&H.alternate===null&&(H.flags|=67108866),H}function _(H,$,Q,le){return $===null||$.tag!==6?($=Mf(Q,H.mode,le),$.return=H,$):($=p($,Q),$.return=H,$)}function M(H,$,Q,le){var Ne=Q.type;return Ne===j?te(H,$,Q.props.children,le,Q.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Z&&Zi(Ne)===$.type)?($=p($,Q.props),ho($,Q),$.return=H,$):($=Vu(Q.type,Q.key,Q.props,null,H.mode,le),ho($,Q),$.return=H,$)}function G(H,$,Q,le){return $===null||$.tag!==4||$.stateNode.containerInfo!==Q.containerInfo||$.stateNode.implementation!==Q.implementation?($=Lf(Q,H.mode,le),$.return=H,$):($=p($,Q.children||[]),$.return=H,$)}function te(H,$,Q,le,Ne){return $===null||$.tag!==7?($=Pi(Q,H.mode,le,Ne),$.return=H,$):($=p($,Q),$.return=H,$)}function se(H,$,Q){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Mf(""+$,H.mode,Q),$.return=H,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return Q=Vu($.type,$.key,$.props,null,H.mode,Q),ho(Q,$),Q.return=H,Q;case k:return $=Lf($,H.mode,Q),$.return=H,$;case Z:return $=Zi($),se(H,$,Q)}if(W($)||re($))return $=Pi($,H.mode,Q,null),$.return=H,$;if(typeof $.then=="function")return se(H,Wu($),Q);if($.$$typeof===D)return se(H,Ku(H,$),Q);ec(H,$)}return null}function K(H,$,Q,le){var Ne=$!==null?$.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ne!==null?null:_(H,$,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return Q.key===Ne?M(H,$,Q,le):null;case k:return Q.key===Ne?G(H,$,Q,le):null;case Z:return Q=Zi(Q),K(H,$,Q,le)}if(W(Q)||re(Q))return Ne!==null?null:te(H,$,Q,le,null);if(typeof Q.then=="function")return K(H,$,Wu(Q),le);if(Q.$$typeof===D)return K(H,$,Ku(H,Q),le);ec(H,Q)}return null}function X(H,$,Q,le,Ne){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(Q)||null,_($,H,""+le,Ne);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return H=H.get(le.key===null?Q:le.key)||null,M($,H,le,Ne);case k:return H=H.get(le.key===null?Q:le.key)||null,G($,H,le,Ne);case Z:return le=Zi(le),X(H,$,Q,le,Ne)}if(W(le)||re(le))return H=H.get(Q)||null,te($,H,le,Ne,null);if(typeof le.then=="function")return X(H,$,Q,Wu(le),Ne);if(le.$$typeof===D)return X(H,$,Q,Ku($,le),Ne);ec($,le)}return null}function Se(H,$,Q,le){for(var Ne=null,rt=null,je=$,Ue=$=0,Ye=null;je!==null&&Ue<Q.length;Ue++){je.index>Ue?(Ye=je,je=null):Ye=je.sibling;var at=K(H,je,Q[Ue],le);if(at===null){je===null&&(je=Ye);break}r&&je&&at.alternate===null&&a(H,je),$=v(at,$,Ue),rt===null?Ne=at:rt.sibling=at,rt=at,je=Ye}if(Ue===Q.length)return s(H,je),Je&&Xr(H,Ue),Ne;if(je===null){for(;Ue<Q.length;Ue++)je=se(H,Q[Ue],le),je!==null&&($=v(je,$,Ue),rt===null?Ne=je:rt.sibling=je,rt=je);return Je&&Xr(H,Ue),Ne}for(je=c(je);Ue<Q.length;Ue++)Ye=X(je,H,Ue,Q[Ue],le),Ye!==null&&(r&&Ye.alternate!==null&&je.delete(Ye.key===null?Ue:Ye.key),$=v(Ye,$,Ue),rt===null?Ne=Ye:rt.sibling=Ye,rt=Ye);return r&&je.forEach(function(ti){return a(H,ti)}),Je&&Xr(H,Ue),Ne}function ze(H,$,Q,le){if(Q==null)throw Error(i(151));for(var Ne=null,rt=null,je=$,Ue=$=0,Ye=null,at=Q.next();je!==null&&!at.done;Ue++,at=Q.next()){je.index>Ue?(Ye=je,je=null):Ye=je.sibling;var ti=K(H,je,at.value,le);if(ti===null){je===null&&(je=Ye);break}r&&je&&ti.alternate===null&&a(H,je),$=v(ti,$,Ue),rt===null?Ne=ti:rt.sibling=ti,rt=ti,je=Ye}if(at.done)return s(H,je),Je&&Xr(H,Ue),Ne;if(je===null){for(;!at.done;Ue++,at=Q.next())at=se(H,at.value,le),at!==null&&($=v(at,$,Ue),rt===null?Ne=at:rt.sibling=at,rt=at);return Je&&Xr(H,Ue),Ne}for(je=c(je);!at.done;Ue++,at=Q.next())at=X(je,H,Ue,at.value,le),at!==null&&(r&&at.alternate!==null&&je.delete(at.key===null?Ue:at.key),$=v(at,$,Ue),rt===null?Ne=at:rt.sibling=at,rt=at);return r&&je.forEach(function(kN){return a(H,kN)}),Je&&Xr(H,Ue),Ne}function pt(H,$,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:e:{for(var Ne=Q.key;$!==null;){if($.key===Ne){if(Ne=Q.type,Ne===j){if($.tag===7){s(H,$.sibling),le=p($,Q.props.children),le.return=H,H=le;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Z&&Zi(Ne)===$.type){s(H,$.sibling),le=p($,Q.props),ho(le,Q),le.return=H,H=le;break e}s(H,$);break}else a(H,$);$=$.sibling}Q.type===j?(le=Pi(Q.props.children,H.mode,le,Q.key),le.return=H,H=le):(le=Vu(Q.type,Q.key,Q.props,null,H.mode,le),ho(le,Q),le.return=H,H=le)}return w(H);case k:e:{for(Ne=Q.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===Q.containerInfo&&$.stateNode.implementation===Q.implementation){s(H,$.sibling),le=p($,Q.children||[]),le.return=H,H=le;break e}else{s(H,$);break}else a(H,$);$=$.sibling}le=Lf(Q,H.mode,le),le.return=H,H=le}return w(H);case Z:return Q=Zi(Q),pt(H,$,Q,le)}if(W(Q))return Se(H,$,Q,le);if(re(Q)){if(Ne=re(Q),typeof Ne!="function")throw Error(i(150));return Q=Ne.call(Q),ze(H,$,Q,le)}if(typeof Q.then=="function")return pt(H,$,Wu(Q),le);if(Q.$$typeof===D)return pt(H,$,Ku(H,Q),le);ec(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,$!==null&&$.tag===6?(s(H,$.sibling),le=p($,Q),le.return=H,H=le):(s(H,$),le=Mf(Q,H.mode,le),le.return=H,H=le),w(H)):s(H,$)}return function(H,$,Q,le){try{fo=0;var Ne=pt(H,$,Q,le);return Hl=null,Ne}catch(je){if(je===ql||je===Xu)throw je;var rt=Fn(29,je,null,H.mode);return rt.lanes=le,rt.return=H,rt}finally{}}}var Qi=mv(!0),pv=mv(!1),Ua=!1;function Gf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ba(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pa(r,a,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(it&2)!==0){var p=c.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a,a=Zu(r),Jy(r,null,s),a}return Hu(r,c,a,s),Zu(r)}function mo(r,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,oe(r,s)}}function Yf(r,a){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=a:v=v.next=a}else p=v=a;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=a:r.next=a,s.lastBaseUpdate=a}var Xf=!1;function po(){if(Xf){var r=Fl;if(r!==null)throw r}}function go(r,a,s,c){Xf=!1;var p=r.updateQueue;Ua=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var M=_,G=M.next;M.next=null,w===null?v=G:w.next=G,w=M;var te=r.alternate;te!==null&&(te=te.updateQueue,_=te.lastBaseUpdate,_!==w&&(_===null?te.firstBaseUpdate=G:_.next=G,te.lastBaseUpdate=M))}if(v!==null){var se=p.baseState;w=0,te=G=M=null,_=v;do{var K=_.lane&-536870913,X=K!==_.lane;if(X?(Ke&K)===K:(c&K)===K){K!==0&&K===$l&&(Xf=!0),te!==null&&(te=te.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Se=r,ze=_;K=a;var pt=s;switch(ze.tag){case 1:if(Se=ze.payload,typeof Se=="function"){se=Se.call(pt,se,K);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=ze.payload,K=typeof Se=="function"?Se.call(pt,se,K):Se,K==null)break e;se=g({},se,K);break e;case 2:Ua=!0}}K=_.callback,K!==null&&(r.flags|=64,X&&(r.flags|=8192),X=p.callbacks,X===null?p.callbacks=[K]:X.push(K))}else X={lane:K,tag:_.tag,payload:_.payload,callback:_.callback,next:null},te===null?(G=te=X,M=se):te=te.next=X,w|=K;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;X=_,_=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);te===null&&(M=se),p.baseState=M,p.firstBaseUpdate=G,p.lastBaseUpdate=te,v===null&&(p.shared.lanes=0),Za|=w,r.lanes=w,r.memoizedState=se}}function gv(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function yv(r,a){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)gv(s[r],a)}var Zl=L(null),tc=L(0);function vv(r,a){r=oa,C(tc,r),C(Zl,a),oa=r|a.baseLanes}function Jf(){C(tc,oa),C(Zl,Zl.current)}function Wf(){oa=tc.current,A(Zl),A(tc)}var qn=L(null),ur=null;function $a(r){var a=r.alternate;C(Mt,Mt.current&1),C(qn,r),ur===null&&(a===null||Zl.current!==null||a.memoizedState!==null)&&(ur=r)}function eh(r){C(Mt,Mt.current),C(qn,r),ur===null&&(ur=r)}function bv(r){r.tag===22?(C(Mt,Mt.current),C(qn,r),ur===null&&(ur=r)):Fa()}function Fa(){C(Mt,Mt.current),C(qn,qn.current)}function Hn(r){A(qn),ur===r&&(ur=null),A(Mt)}var Mt=L(0);function nc(r){for(var a=r;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||lm(s)||sm(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ea=0,Ie=null,ht=null,Ut=null,rc=!1,Vl=!1,Gi=!1,ac=0,yo=0,Ql=null,h_=0;function Rt(){throw Error(i(321))}function th(r,a){if(a===null)return!1;for(var s=0;s<a.length&&s<r.length;s++)if(!$n(r[s],a[s]))return!1;return!0}function nh(r,a,s,c,p,v){return ea=v,Ie=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,P.H=r===null||r.memoizedState===null?nb:yh,Gi=!1,v=s(c,p),Gi=!1,Vl&&(v=Sv(a,s,c,p)),xv(r),v}function xv(r){P.H=xo;var a=ht!==null&&ht.next!==null;if(ea=0,Ut=ht=Ie=null,rc=!1,yo=0,Ql=null,a)throw Error(i(300));r===null||Bt||(r=r.dependencies,r!==null&&Gu(r)&&(Bt=!0))}function Sv(r,a,s,c){Ie=r;var p=0;do{if(Vl&&(Ql=null),yo=0,Vl=!1,25<=p)throw Error(i(301));if(p+=1,Ut=ht=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=rb,v=a(s,c)}while(Vl);return v}function m_(){var r=P.H,a=r.useState()[0];return a=typeof a.then=="function"?vo(a):a,r=r.useState()[0],(ht!==null?ht.memoizedState:null)!==r&&(Ie.flags|=1024),a}function rh(){var r=ac!==0;return ac=0,r}function ah(r,a,s){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~s}function ih(r){if(rc){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}rc=!1}ea=0,Ut=ht=Ie=null,Vl=!1,yo=ac=0,Ql=null}function gn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ie.memoizedState=Ut=r:Ut=Ut.next=r,Ut}function Lt(){if(ht===null){var r=Ie.alternate;r=r!==null?r.memoizedState:null}else r=ht.next;var a=Ut===null?Ie.memoizedState:Ut.next;if(a!==null)Ut=a,ht=r;else{if(r===null)throw Ie.alternate===null?Error(i(467)):Error(i(310));ht=r,r={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Ut===null?Ie.memoizedState=Ut=r:Ut=Ut.next=r}return Ut}function ic(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vo(r){var a=yo;return yo+=1,Ql===null&&(Ql=[]),r=dv(Ql,r,a),a=Ie,(Ut===null?a.memoizedState:Ut.next)===null&&(a=a.alternate,P.H=a===null||a.memoizedState===null?nb:yh),r}function lc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return vo(r);if(r.$$typeof===D)return sn(r)}throw Error(i(438,String(r)))}function lh(r){var a=null,s=Ie.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Ie.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(p){return p.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=ic(),Ie.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(r),c=0;c<r;c++)s[c]=q;return a.index++,s}function ta(r,a){return typeof a=="function"?a(r):a}function sc(r){var a=Lt();return sh(a,ht,r)}function sh(r,a,s){var c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var p=r.baseQueue,v=c.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}a.baseQueue=p=v,c.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{a=p.next;var _=w=null,M=null,G=a,te=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(Ke&se)===se:(ea&se)===se){var K=G.revertLane;if(K===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),se===$l&&(te=!0);else if((ea&K)===K){G=G.next,K===$l&&(te=!0);continue}else se={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(_=M=se,w=v):M=M.next=se,Ie.lanes|=K,Za|=K;se=G.action,Gi&&s(v,se),v=G.hasEagerState?G.eagerState:s(v,se)}else K={lane:se,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(_=M=K,w=v):M=M.next=K,Ie.lanes|=se,Za|=se;G=G.next}while(G!==null&&G!==a);if(M===null?w=v:M.next=_,!$n(v,r.memoizedState)&&(Bt=!0,te&&(s=Fl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=M,c.lastRenderedState=v}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function oh(r){var a=Lt(),s=a.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,v=a.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);$n(v,a.memoizedState)||(Bt=!0),a.memoizedState=v,a.baseQueue===null&&(a.baseState=v),s.lastRenderedState=v}return[v,c]}function wv(r,a,s){var c=Ie,p=Lt(),v=Je;if(v){if(s===void 0)throw Error(i(407));s=s()}else s=a();var w=!$n((ht||p).memoizedState,s);if(w&&(p.memoizedState=s,Bt=!0),p=p.queue,dh(Ev.bind(null,c,p,r),[r]),p.getSnapshot!==a||w||Ut!==null&&Ut.memoizedState.tag&1){if(c.flags|=2048,Gl(9,{destroy:void 0},jv.bind(null,c,p,s,a),null),gt===null)throw Error(i(349));v||(ea&127)!==0||kv(c,a,s)}return s}function kv(r,a,s){r.flags|=16384,r={getSnapshot:a,value:s},a=Ie.updateQueue,a===null?(a=ic(),Ie.updateQueue=a,a.stores=[r]):(s=a.stores,s===null?a.stores=[r]:s.push(r))}function jv(r,a,s,c){a.value=s,a.getSnapshot=c,Cv(a)&&_v(r)}function Ev(r,a,s){return s(function(){Cv(a)&&_v(r)})}function Cv(r){var a=r.getSnapshot;r=r.value;try{var s=a();return!$n(r,s)}catch{return!0}}function _v(r){var a=Bi(r,2);a!==null&&An(a,r,2)}function uh(r){var a=gn();if(typeof r=="function"){var s=r;if(r=s(),Gi){dn(!0);try{s()}finally{dn(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:r},a}function Nv(r,a,s,c){return r.baseState=s,sh(r,ht,typeof c=="function"?c:ta)}function p_(r,a,s,c,p){if(cc(r))throw Error(i(485));if(r=a.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};P.T!==null?s(!0):v.isTransition=!1,c(v),s=a.pending,s===null?(v.next=a.pending=v,Av(a,v)):(v.next=s.next,a.pending=s.next=v)}}function Av(r,a){var s=a.action,c=a.payload,p=r.state;if(a.isTransition){var v=P.T,w={};P.T=w;try{var _=s(p,c),M=P.S;M!==null&&M(w,_),Tv(r,a,_)}catch(G){ch(r,a,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),P.T=v}}else try{v=s(p,c),Tv(r,a,v)}catch(G){ch(r,a,G)}}function Tv(r,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Rv(r,a,c)},function(c){return ch(r,a,c)}):Rv(r,a,s)}function Rv(r,a,s){a.status="fulfilled",a.value=s,zv(a),r.state=s,a=r.pending,a!==null&&(s=a.next,s===a?r.pending=null:(s=s.next,a.next=s,Av(r,s)))}function ch(r,a,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,zv(a),a=a.next;while(a!==c)}r.action=null}function zv(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function Ov(r,a){return a}function Dv(r,a){if(Je){var s=gt.formState;if(s!==null){e:{var c=Ie;if(Je){if(wt){t:{for(var p=wt,v=or;p.nodeType!==8;){if(!v){p=null;break t}if(p=cr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){wt=cr(p.nextSibling),c=p.data==="F!";break e}}La(c)}c=!1}c&&(a=s[0])}}return s=gn(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ov,lastRenderedState:a},s.queue=c,s=Wv.bind(null,Ie,c),c.dispatch=s,c=uh(!1),v=gh.bind(null,Ie,!1,c.queue),c=gn(),p={state:a,dispatch:null,action:r,pending:null},c.queue=p,s=p_.bind(null,Ie,p,v,s),p.dispatch=s,c.memoizedState=r,[a,s,!1]}function Mv(r){var a=Lt();return Lv(a,ht,r)}function Lv(r,a,s){if(a=sh(r,a,Ov)[0],r=sc(ta)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=vo(a)}catch(w){throw w===ql?Xu:w}else c=a;a=Lt();var p=a.queue,v=p.dispatch;return s!==a.memoizedState&&(Ie.flags|=2048,Gl(9,{destroy:void 0},g_.bind(null,p,s),null)),[c,v,r]}function g_(r,a){r.action=a}function Iv(r){var a=Lt(),s=ht;if(s!==null)return Lv(a,s,r);Lt(),a=a.memoizedState,s=Lt();var c=s.queue.dispatch;return s.memoizedState=r,[a,c,!1]}function Gl(r,a,s,c){return r={tag:r,create:s,deps:c,inst:a,next:null},a=Ie.updateQueue,a===null&&(a=ic(),Ie.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,a.lastEffect=r),r}function Uv(){return Lt().memoizedState}function oc(r,a,s,c){var p=gn();Ie.flags|=r,p.memoizedState=Gl(1|a,{destroy:void 0},s,c===void 0?null:c)}function uc(r,a,s,c){var p=Lt();c=c===void 0?null:c;var v=p.memoizedState.inst;ht!==null&&c!==null&&th(c,ht.memoizedState.deps)?p.memoizedState=Gl(a,v,s,c):(Ie.flags|=r,p.memoizedState=Gl(1|a,v,s,c))}function Bv(r,a){oc(8390656,8,r,a)}function dh(r,a){uc(2048,8,r,a)}function y_(r){Ie.flags|=4;var a=Ie.updateQueue;if(a===null)a=ic(),Ie.updateQueue=a,a.events=[r];else{var s=a.events;s===null?a.events=[r]:s.push(r)}}function Pv(r){var a=Lt().memoizedState;return y_({ref:a,nextImpl:r}),function(){if((it&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function $v(r,a){return uc(4,2,r,a)}function Fv(r,a){return uc(4,4,r,a)}function qv(r,a){if(typeof a=="function"){r=r();var s=a(r);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function Hv(r,a,s){s=s!=null?s.concat([r]):null,uc(4,4,qv.bind(null,a,r),s)}function fh(){}function Zv(r,a){var s=Lt();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&th(a,c[1])?c[0]:(s.memoizedState=[r,a],r)}function Vv(r,a){var s=Lt();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&th(a,c[1]))return c[0];if(c=r(),Gi){dn(!0);try{r()}finally{dn(!1)}}return s.memoizedState=[c,a],c}function hh(r,a,s){return s===void 0||(ea&1073741824)!==0&&(Ke&261930)===0?r.memoizedState=a:(r.memoizedState=s,r=Qb(),Ie.lanes|=r,Za|=r,s)}function Qv(r,a,s,c){return $n(s,a)?s:Zl.current!==null?(r=hh(r,s,c),$n(r,a)||(Bt=!0),r):(ea&42)===0||(ea&1073741824)!==0&&(Ke&261930)===0?(Bt=!0,r.memoizedState=s):(r=Qb(),Ie.lanes|=r,Za|=r,a)}function Gv(r,a,s,c,p){var v=V.p;V.p=v!==0&&8>v?v:8;var w=P.T,_={};P.T=_,gh(r,!1,a,s);try{var M=p(),G=P.S;if(G!==null&&G(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var te=f_(M,c);bo(r,a,te,Qn(r))}else bo(r,a,c,Qn(r))}catch(se){bo(r,a,{then:function(){},status:"rejected",reason:se},Qn())}finally{V.p=v,w!==null&&_.types!==null&&(w.types=_.types),P.T=w}}function v_(){}function mh(r,a,s,c){if(r.tag!==5)throw Error(i(476));var p=Kv(r).queue;Gv(r,p,a,ce,s===null?v_:function(){return Yv(r),s(c)})}function Kv(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:ce},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:s},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function Yv(r){var a=Kv(r);a.next===null&&(a=r.alternate.memoizedState),bo(r,a.next.queue,{},Qn())}function ph(){return sn(Lo)}function Xv(){return Lt().memoizedState}function Jv(){return Lt().memoizedState}function b_(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var s=Qn();r=Ba(s);var c=Pa(a,r,s);c!==null&&(An(c,a,s),mo(c,a,s)),a={cache:Hf()},r.payload=a;return}a=a.return}}function x_(r,a,s){var c=Qn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cc(r)?eb(a,s):(s=Of(r,a,s,c),s!==null&&(An(s,r,c),tb(s,a,c)))}function Wv(r,a,s){var c=Qn();bo(r,a,s,c)}function bo(r,a,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(cc(r))eb(a,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=a.lastRenderedReducer,v!==null))try{var w=a.lastRenderedState,_=v(w,s);if(p.hasEagerState=!0,p.eagerState=_,$n(_,w))return Hu(r,a,p,0),gt===null&&qu(),!1}catch{}finally{}if(s=Of(r,a,p,c),s!==null)return An(s,r,c),tb(s,a,c),!0}return!1}function gh(r,a,s,c){if(c={lane:2,revertLane:Gh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},cc(r)){if(a)throw Error(i(479))}else a=Of(r,s,c,2),a!==null&&An(a,r,2)}function cc(r){var a=r.alternate;return r===Ie||a!==null&&a===Ie}function eb(r,a){Vl=rc=!0;var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}function tb(r,a,s){if((s&4194048)!==0){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,oe(r,s)}}var xo={readContext:sn,use:lc,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};xo.useEffectEvent=Rt;var nb={readContext:sn,use:lc,useCallback:function(r,a){return gn().memoizedState=[r,a===void 0?null:a],r},useContext:sn,useEffect:Bv,useImperativeHandle:function(r,a,s){s=s!=null?s.concat([r]):null,oc(4194308,4,qv.bind(null,a,r),s)},useLayoutEffect:function(r,a){return oc(4194308,4,r,a)},useInsertionEffect:function(r,a){oc(4,2,r,a)},useMemo:function(r,a){var s=gn();a=a===void 0?null:a;var c=r();if(Gi){dn(!0);try{r()}finally{dn(!1)}}return s.memoizedState=[c,a],c},useReducer:function(r,a,s){var c=gn();if(s!==void 0){var p=s(a);if(Gi){dn(!0);try{s(a)}finally{dn(!1)}}}else p=a;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=x_.bind(null,Ie,r),[c.memoizedState,r]},useRef:function(r){var a=gn();return r={current:r},a.memoizedState=r},useState:function(r){r=uh(r);var a=r.queue,s=Wv.bind(null,Ie,a);return a.dispatch=s,[r.memoizedState,s]},useDebugValue:fh,useDeferredValue:function(r,a){var s=gn();return hh(s,r,a)},useTransition:function(){var r=uh(!1);return r=Gv.bind(null,Ie,r.queue,!0,!1),gn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,s){var c=Ie,p=gn();if(Je){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),gt===null)throw Error(i(349));(Ke&127)!==0||kv(c,a,s)}p.memoizedState=s;var v={value:s,getSnapshot:a};return p.queue=v,Bv(Ev.bind(null,c,v,r),[r]),c.flags|=2048,Gl(9,{destroy:void 0},jv.bind(null,c,v,s,a),null),s},useId:function(){var r=gn(),a=gt.identifierPrefix;if(Je){var s=Rr,c=Tr;s=(c&~(1<<32-ut(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=ac++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=h_++,a="_"+a+"r_"+s.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:ph,useFormState:Dv,useActionState:Dv,useOptimistic:function(r){var a=gn();a.memoizedState=a.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=gh.bind(null,Ie,!0,s),s.dispatch=a,[r,a]},useMemoCache:lh,useCacheRefresh:function(){return gn().memoizedState=b_.bind(null,Ie)},useEffectEvent:function(r){var a=gn(),s={impl:r};return a.memoizedState=s,function(){if((it&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},yh={readContext:sn,use:lc,useCallback:Zv,useContext:sn,useEffect:dh,useImperativeHandle:Hv,useInsertionEffect:$v,useLayoutEffect:Fv,useMemo:Vv,useReducer:sc,useRef:Uv,useState:function(){return sc(ta)},useDebugValue:fh,useDeferredValue:function(r,a){var s=Lt();return Qv(s,ht.memoizedState,r,a)},useTransition:function(){var r=sc(ta)[0],a=Lt().memoizedState;return[typeof r=="boolean"?r:vo(r),a]},useSyncExternalStore:wv,useId:Xv,useHostTransitionStatus:ph,useFormState:Mv,useActionState:Mv,useOptimistic:function(r,a){var s=Lt();return Nv(s,ht,r,a)},useMemoCache:lh,useCacheRefresh:Jv};yh.useEffectEvent=Pv;var rb={readContext:sn,use:lc,useCallback:Zv,useContext:sn,useEffect:dh,useImperativeHandle:Hv,useInsertionEffect:$v,useLayoutEffect:Fv,useMemo:Vv,useReducer:oh,useRef:Uv,useState:function(){return oh(ta)},useDebugValue:fh,useDeferredValue:function(r,a){var s=Lt();return ht===null?hh(s,r,a):Qv(s,ht.memoizedState,r,a)},useTransition:function(){var r=oh(ta)[0],a=Lt().memoizedState;return[typeof r=="boolean"?r:vo(r),a]},useSyncExternalStore:wv,useId:Xv,useHostTransitionStatus:ph,useFormState:Iv,useActionState:Iv,useOptimistic:function(r,a){var s=Lt();return ht!==null?Nv(s,ht,r,a):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:lh,useCacheRefresh:Jv};rb.useEffectEvent=Pv;function vh(r,a,s,c){a=r.memoizedState,s=s(c,a),s=s==null?a:g({},a,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var bh={enqueueSetState:function(r,a,s){r=r._reactInternals;var c=Qn(),p=Ba(c);p.payload=a,s!=null&&(p.callback=s),a=Pa(r,p,c),a!==null&&(An(a,r,c),mo(a,r,c))},enqueueReplaceState:function(r,a,s){r=r._reactInternals;var c=Qn(),p=Ba(c);p.tag=1,p.payload=a,s!=null&&(p.callback=s),a=Pa(r,p,c),a!==null&&(An(a,r,c),mo(a,r,c))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var s=Qn(),c=Ba(s);c.tag=2,a!=null&&(c.callback=a),a=Pa(r,c,s),a!==null&&(An(a,r,s),mo(a,r,s))}};function ab(r,a,s,c,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,v,w):a.prototype&&a.prototype.isPureReactComponent?!io(s,c)||!io(p,v):!0}function ib(r,a,s,c){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==r&&bh.enqueueReplaceState(a,a.state,null)}function Ki(r,a){var s=a;if("ref"in a){s={};for(var c in a)c!=="ref"&&(s[c]=a[c])}if(r=r.defaultProps){s===a&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function lb(r){Fu(r)}function sb(r){console.error(r)}function ob(r){Fu(r)}function dc(r,a){try{var s=r.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function ub(r,a,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function xh(r,a,s){return s=Ba(s),s.tag=3,s.payload={element:null},s.callback=function(){dc(r,a)},s}function cb(r){return r=Ba(r),r.tag=3,r}function db(r,a,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;r.payload=function(){return p(v)},r.callback=function(){ub(a,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){ub(a,s,c),typeof p!="function"&&(Va===null?Va=new Set([this]):Va.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function S_(r,a,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Pl(a,s,p,!0),s=qn.current,s!==null){switch(s.tag){case 31:case 13:return ur===null?kc():s.alternate===null&&zt===0&&(zt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===Ju?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),Zh(r,c,p)),!1;case 22:return s.flags|=65536,c===Ju?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),Zh(r,c,p)),!1}throw Error(i(435,s.tag))}return Zh(r,c,p),kc(),!1}if(Je)return a=qn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=p,c!==Bf&&(r=Error(i(422),{cause:c}),oo(ir(r,s)))):(c!==Bf&&(a=Error(i(423),{cause:c}),oo(ir(a,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=ir(c,s),p=xh(r.stateNode,c,p),Yf(r,p),zt!==4&&(zt=2)),!1;var v=Error(i(520),{cause:c});if(v=ir(v,s),No===null?No=[v]:No.push(v),zt!==4&&(zt=2),a===null)return!0;c=ir(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=xh(s.stateNode,c,r),Yf(s,r),!1;case 1:if(a=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Va===null||!Va.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=cb(p),db(p,r,s,c),Yf(s,p),!1}s=s.return}while(s!==null);return!1}var Sh=Error(i(461)),Bt=!1;function on(r,a,s,c){a.child=r===null?pv(a,null,s,c):Qi(a,r.child,s,c)}function fb(r,a,s,c,p){s=s.render;var v=a.ref;if("ref"in c){var w={};for(var _ in c)_!=="ref"&&(w[_]=c[_])}else w=c;return qi(a),c=nh(r,a,s,w,v,p),_=rh(),r!==null&&!Bt?(ah(r,a,p),na(r,a,p)):(Je&&_&&If(a),a.flags|=1,on(r,a,c,p),a.child)}function hb(r,a,s,c,p){if(r===null){var v=s.type;return typeof v=="function"&&!Df(v)&&v.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=v,mb(r,a,v,c,p)):(r=Vu(s.type,null,c,a,a.mode,p),r.ref=a.ref,r.return=a,a.child=r)}if(v=r.child,!Ah(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:io,s(w,c)&&r.ref===a.ref)return na(r,a,p)}return a.flags|=1,r=Yr(v,c),r.ref=a.ref,r.return=a,a.child=r}function mb(r,a,s,c,p){if(r!==null){var v=r.memoizedProps;if(io(v,c)&&r.ref===a.ref)if(Bt=!1,a.pendingProps=c=v,Ah(r,p))(r.flags&131072)!==0&&(Bt=!0);else return a.lanes=r.lanes,na(r,a,p)}return wh(r,a,s,c,p)}function pb(r,a,s,c){var p=c.children,v=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(c=a.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,a.child=null;return gb(r,a,v,s,c)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Yu(a,v!==null?v.cachePool:null),v!==null?vv(a,v):Jf(),bv(a);else return c=a.lanes=536870912,gb(r,a,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(Yu(a,v.cachePool),vv(a,v),Fa(),a.memoizedState=null):(r!==null&&Yu(a,null),Jf(),Fa());return on(r,a,p,s),a.child}function So(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function gb(r,a,s,c,p){var v=Vf();return v=v===null?null:{parent:It._currentValue,pool:v},a.memoizedState={baseLanes:s,cachePool:v},r!==null&&Yu(a,null),Jf(),bv(a),r!==null&&Pl(r,a,c,!0),a.childLanes=p,null}function fc(r,a){return a=mc({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function yb(r,a,s){return Qi(a,r.child,null,s),r=fc(a,a.pendingProps),r.flags|=2,Hn(a),a.memoizedState=null,r}function w_(r,a,s){var c=a.pendingProps,p=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(Je){if(c.mode==="hidden")return r=fc(a,c),a.lanes=536870912,So(null,r);if(eh(a),(r=wt)?(r=Ax(r,or),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Da!==null?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},s=ev(r),s.return=a,a.child=s,ln=a,wt=null)):r=null,r===null)throw La(a);return a.lanes=536870912,null}return fc(a,c)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(eh(a),p)if(a.flags&256)a.flags&=-257,a=yb(r,a,s);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(i(558));else if(Bt||Pl(r,a,s,!1),p=(s&r.childLanes)!==0,Bt||p){if(c=gt,c!==null&&(w=Ze(c,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Bi(r,w),An(c,r,w),Sh;kc(),a=yb(r,a,s)}else r=v.treeContext,wt=cr(w.nextSibling),ln=a,Je=!0,Ma=null,or=!1,r!==null&&rv(a,r),a=fc(a,c),a.flags|=4096;return a}return r=Yr(r.child,{mode:c.mode,children:c.children}),r.ref=a.ref,a.child=r,r.return=a,r}function hc(r,a){var s=a.ref;if(s===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(r===null||r.ref!==s)&&(a.flags|=4194816)}}function wh(r,a,s,c,p){return qi(a),s=nh(r,a,s,c,void 0,p),c=rh(),r!==null&&!Bt?(ah(r,a,p),na(r,a,p)):(Je&&c&&If(a),a.flags|=1,on(r,a,s,p),a.child)}function vb(r,a,s,c,p,v){return qi(a),a.updateQueue=null,s=Sv(a,c,s,p),xv(r),c=rh(),r!==null&&!Bt?(ah(r,a,v),na(r,a,v)):(Je&&c&&If(a),a.flags|=1,on(r,a,s,v),a.child)}function bb(r,a,s,c,p){if(qi(a),a.stateNode===null){var v=Ll,w=s.contextType;typeof w=="object"&&w!==null&&(v=sn(w)),v=new s(c,v),a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=bh,a.stateNode=v,v._reactInternals=a,v=a.stateNode,v.props=c,v.state=a.memoizedState,v.refs={},Gf(a),w=s.contextType,v.context=typeof w=="object"&&w!==null?sn(w):Ll,v.state=a.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(vh(a,s,w,c),v.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&bh.enqueueReplaceState(v,v.state,null),go(a,c,v,p),po(),v.state=a.memoizedState),typeof v.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(r===null){v=a.stateNode;var _=a.memoizedProps,M=Ki(s,_);v.props=M;var G=v.context,te=s.contextType;w=Ll,typeof te=="object"&&te!==null&&(w=sn(te));var se=s.getDerivedStateFromProps;te=typeof se=="function"||typeof v.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_||G!==w)&&ib(a,v,c,w),Ua=!1;var K=a.memoizedState;v.state=K,go(a,c,v,p),po(),G=a.memoizedState,_||K!==G||Ua?(typeof se=="function"&&(vh(a,s,se,c),G=a.memoizedState),(M=Ua||ab(a,s,M,c,K,G,w))?(te||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(a.flags|=4194308)):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=G),v.props=c,v.state=G,v.context=w,c=M):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{v=a.stateNode,Kf(r,a),w=a.memoizedProps,te=Ki(s,w),v.props=te,se=a.pendingProps,K=v.context,G=s.contextType,M=Ll,typeof G=="object"&&G!==null&&(M=sn(G)),_=s.getDerivedStateFromProps,(G=typeof _=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==se||K!==M)&&ib(a,v,c,M),Ua=!1,K=a.memoizedState,v.state=K,go(a,c,v,p),po();var X=a.memoizedState;w!==se||K!==X||Ua||r!==null&&r.dependencies!==null&&Gu(r.dependencies)?(typeof _=="function"&&(vh(a,s,_,c),X=a.memoizedState),(te=Ua||ab(a,s,te,c,K,X,M)||r!==null&&r.dependencies!==null&&Gu(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,X,M),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,X,M)),typeof v.componentDidUpdate=="function"&&(a.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=X),v.props=c,v.state=X,v.context=M,c=te):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=1024),c=!1)}return v=c,hc(r,a),c=(a.flags&128)!==0,v||c?(v=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),a.flags|=1,r!==null&&c?(a.child=Qi(a,r.child,null,p),a.child=Qi(a,null,s,p)):on(r,a,s,p),a.memoizedState=v.state,r=a.child):r=na(r,a,p),r}function xb(r,a,s,c){return $i(),a.flags|=256,on(r,a,s,c),a.child}var kh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jh(r){return{baseLanes:r,cachePool:uv()}}function Eh(r,a,s){return r=r!==null?r.childLanes&~s:0,a&&(r|=Vn),r}function Sb(r,a,s){var c=a.pendingProps,p=!1,v=(a.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Mt.current&2)!==0),w&&(p=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,r===null){if(Je){if(p?$a(a):Fa(),(r=wt)?(r=Ax(r,or),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Da!==null?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},s=ev(r),s.return=a,a.child=s,ln=a,wt=null)):r=null,r===null)throw La(a);return sm(r)?a.lanes=32:a.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(Fa(),p=a.mode,_=mc({mode:"hidden",children:_},p),c=Pi(c,p,s,null),_.return=a,c.return=a,_.sibling=c,a.child=_,c=a.child,c.memoizedState=jh(s),c.childLanes=Eh(r,w,s),a.memoizedState=kh,So(null,c)):($a(a),Ch(a,_))}var M=r.memoizedState;if(M!==null&&(_=M.dehydrated,_!==null)){if(v)a.flags&256?($a(a),a.flags&=-257,a=_h(r,a,s)):a.memoizedState!==null?(Fa(),a.child=r.child,a.flags|=128,a=null):(Fa(),_=c.fallback,p=a.mode,c=mc({mode:"visible",children:c.children},p),_=Pi(_,p,s,null),_.flags|=2,c.return=a,_.return=a,c.sibling=_,a.child=c,Qi(a,r.child,null,s),c=a.child,c.memoizedState=jh(s),c.childLanes=Eh(r,w,s),a.memoizedState=kh,a=So(null,c));else if($a(a),sm(_)){if(w=_.nextSibling&&_.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(i(419)),c.stack="",c.digest=w,oo({value:c,source:null,stack:null}),a=_h(r,a,s)}else if(Bt||Pl(r,a,s,!1),w=(s&r.childLanes)!==0,Bt||w){if(w=gt,w!==null&&(c=Ze(w,s),c!==0&&c!==M.retryLane))throw M.retryLane=c,Bi(r,c),An(w,r,c),Sh;lm(_)||kc(),a=_h(r,a,s)}else lm(_)?(a.flags|=192,a.child=r.child,a=null):(r=M.treeContext,wt=cr(_.nextSibling),ln=a,Je=!0,Ma=null,or=!1,r!==null&&rv(a,r),a=Ch(a,c.children),a.flags|=4096);return a}return p?(Fa(),_=c.fallback,p=a.mode,M=r.child,G=M.sibling,c=Yr(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,G!==null?_=Yr(G,_):(_=Pi(_,p,s,null),_.flags|=2),_.return=a,c.return=a,c.sibling=_,a.child=c,So(null,c),c=a.child,_=r.child.memoizedState,_===null?_=jh(s):(p=_.cachePool,p!==null?(M=It._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=uv(),_={baseLanes:_.baseLanes|s,cachePool:p}),c.memoizedState=_,c.childLanes=Eh(r,w,s),a.memoizedState=kh,So(r.child,c)):($a(a),s=r.child,r=s.sibling,s=Yr(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,r!==null&&(w=a.deletions,w===null?(a.deletions=[r],a.flags|=16):w.push(r)),a.child=s,a.memoizedState=null,s)}function Ch(r,a){return a=mc({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function mc(r,a){return r=Fn(22,r,null,a),r.lanes=0,r}function _h(r,a,s){return Qi(a,r.child,null,s),r=Ch(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function wb(r,a,s){r.lanes|=a;var c=r.alternate;c!==null&&(c.lanes|=a),Ff(r.return,a,s)}function Nh(r,a,s,c,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function kb(r,a,s){var c=a.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var w=Mt.current,_=(w&2)!==0;if(_?(w=w&1|2,a.flags|=128):w&=1,C(Mt,w),on(r,a,c,s),c=Je?so:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&wb(r,s,a);else if(r.tag===19)wb(r,s,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=a.child,p=null;s!==null;)r=s.alternate,r!==null&&nc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=a.child,a.child=null):(p=s.sibling,s.sibling=null),Nh(a,!1,p,s,v,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=a.child,a.child=null;p!==null;){if(r=p.alternate,r!==null&&nc(r)===null){a.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Nh(a,!0,s,null,v,c);break;case"together":Nh(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function na(r,a,s){if(r!==null&&(a.dependencies=r.dependencies),Za|=a.lanes,(s&a.childLanes)===0)if(r!==null){if(Pl(r,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(i(153));if(a.child!==null){for(r=a.child,s=Yr(r,r.pendingProps),a.child=s,s.return=a;r.sibling!==null;)r=r.sibling,s=s.sibling=Yr(r,r.pendingProps),s.return=a;s.sibling=null}return a.child}function Ah(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Gu(r)))}function k_(r,a,s){switch(a.tag){case 3:Me(a,a.stateNode.containerInfo),Ia(a,It,r.memoizedState.cache),$i();break;case 27:case 5:_t(a);break;case 4:Me(a,a.stateNode.containerInfo);break;case 10:Ia(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,eh(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?($a(a),a.flags|=128,null):(s&a.child.childLanes)!==0?Sb(r,a,s):($a(a),r=na(r,a,s),r!==null?r.sibling:null);$a(a);break;case 19:var p=(r.flags&128)!==0;if(c=(s&a.childLanes)!==0,c||(Pl(r,a,s,!1),c=(s&a.childLanes)!==0),p){if(c)return kb(r,a,s);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),C(Mt,Mt.current),c)break;return null;case 22:return a.lanes=0,pb(r,a,s,a.pendingProps);case 24:Ia(a,It,r.memoizedState.cache)}return na(r,a,s)}function jb(r,a,s){if(r!==null)if(r.memoizedProps!==a.pendingProps)Bt=!0;else{if(!Ah(r,s)&&(a.flags&128)===0)return Bt=!1,k_(r,a,s);Bt=(r.flags&131072)!==0}else Bt=!1,Je&&(a.flags&1048576)!==0&&nv(a,so,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(r=Zi(a.elementType),a.type=r,typeof r=="function")Df(r)?(c=Ki(r,c),a.tag=1,a=bb(null,a,r,c,s)):(a.tag=0,a=wh(null,a,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===U){a.tag=11,a=fb(null,a,r,c,s);break e}else if(p===F){a.tag=14,a=hb(null,a,r,c,s);break e}}throw a=fe(r)||r,Error(i(306,a,""))}}return a;case 0:return wh(r,a,a.type,a.pendingProps,s);case 1:return c=a.type,p=Ki(c,a.pendingProps),bb(r,a,c,p,s);case 3:e:{if(Me(a,a.stateNode.containerInfo),r===null)throw Error(i(387));c=a.pendingProps;var v=a.memoizedState;p=v.element,Kf(r,a),go(a,c,null,s);var w=a.memoizedState;if(c=w.cache,Ia(a,It,c),c!==v.cache&&qf(a,[It],s,!0),po(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=v,a.memoizedState=v,a.flags&256){a=xb(r,a,c,s);break e}else if(c!==p){p=ir(Error(i(424)),a),oo(p),a=xb(r,a,c,s);break e}else{switch(r=a.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(wt=cr(r.firstChild),ln=a,Je=!0,Ma=null,or=!0,s=pv(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if($i(),c===p){a=na(r,a,s);break e}on(r,a,c,s)}a=a.child}return a;case 26:return hc(r,a),r===null?(s=Mx(a.type,null,a.pendingProps,null))?a.memoizedState=s:Je||(s=a.type,r=a.pendingProps,c=Tc(ue.current).createElement(s),c[an]=a,c[kn]=r,un(c,s,r),Yt(c),a.stateNode=c):a.memoizedState=Mx(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return _t(a),r===null&&Je&&(c=a.stateNode=zx(a.type,a.pendingProps,ue.current),ln=a,or=!0,p=wt,Ya(a.type)?(om=p,wt=cr(c.firstChild)):wt=p),on(r,a,a.pendingProps.children,s),hc(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Je&&((p=c=wt)&&(c=W_(c,a.type,a.pendingProps,or),c!==null?(a.stateNode=c,ln=a,wt=cr(c.firstChild),or=!1,p=!0):p=!1),p||La(a)),_t(a),p=a.type,v=a.pendingProps,w=r!==null?r.memoizedProps:null,c=v.children,rm(p,v)?c=null:w!==null&&rm(p,w)&&(a.flags|=32),a.memoizedState!==null&&(p=nh(r,a,m_,null,null,s),Lo._currentValue=p),hc(r,a),on(r,a,c,s),a.child;case 6:return r===null&&Je&&((r=s=wt)&&(s=eN(s,a.pendingProps,or),s!==null?(a.stateNode=s,ln=a,wt=null,r=!0):r=!1),r||La(a)),null;case 13:return Sb(r,a,s);case 4:return Me(a,a.stateNode.containerInfo),c=a.pendingProps,r===null?a.child=Qi(a,null,c,s):on(r,a,c,s),a.child;case 11:return fb(r,a,a.type,a.pendingProps,s);case 7:return on(r,a,a.pendingProps,s),a.child;case 8:return on(r,a,a.pendingProps.children,s),a.child;case 12:return on(r,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Ia(a,a.type,c.value),on(r,a,c.children,s),a.child;case 9:return p=a.type._context,c=a.pendingProps.children,qi(a),p=sn(p),c=c(p),a.flags|=1,on(r,a,c,s),a.child;case 14:return hb(r,a,a.type,a.pendingProps,s);case 15:return mb(r,a,a.type,a.pendingProps,s);case 19:return kb(r,a,s);case 31:return w_(r,a,s);case 22:return pb(r,a,s,a.pendingProps);case 24:return qi(a),c=sn(It),r===null?(p=Vf(),p===null&&(p=gt,v=Hf(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),a.memoizedState={parent:c,cache:p},Gf(a),Ia(a,It,p)):((r.lanes&s)!==0&&(Kf(r,a),go(a,null,null,s),po()),p=r.memoizedState,v=a.memoizedState,p.parent!==c?(p={parent:c,cache:c},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),Ia(a,It,c)):(c=v.cache,Ia(a,It,c),c!==p.cache&&qf(a,[It],s,!0))),on(r,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function ra(r){r.flags|=4}function Th(r,a,s,c,p){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Xb())r.flags|=8192;else throw Vi=Ju,Qf}else r.flags&=-16777217}function Eb(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Px(a))if(Xb())r.flags|=8192;else throw Vi=Ju,Qf}function pc(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?Gs():536870912,r.lanes|=a,Jl|=a)}function wo(r,a){if(!Je)switch(r.tailMode){case"hidden":a=r.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function kt(r){var a=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(a)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,a}function j_(r,a,s){var c=a.pendingProps;switch(Uf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(a),null;case 1:return kt(a),null;case 3:return s=a.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Wr(It),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Bl(a)?ra(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Pf())),kt(a),null;case 26:var p=a.type,v=a.memoizedState;return r===null?(ra(a),v!==null?(kt(a),Eb(a,v)):(kt(a),Th(a,p,null,c,s))):v?v!==r.memoizedState?(ra(a),kt(a),Eb(a,v)):(kt(a),a.flags&=-16777217):(r=r.memoizedProps,r!==c&&ra(a),kt(a),Th(a,p,r,c,s)),null;case 27:if(en(a),s=ue.current,p=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&ra(a);else{if(!c){if(a.stateNode===null)throw Error(i(166));return kt(a),null}r=J.current,Bl(a)?av(a):(r=zx(p,c,s),a.stateNode=r,ra(a))}return kt(a),null;case 5:if(en(a),p=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&ra(a);else{if(!c){if(a.stateNode===null)throw Error(i(166));return kt(a),null}if(v=J.current,Bl(a))av(a);else{var w=Tc(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}v[an]=a,v[kn]=c;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=v;e:switch(un(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ra(a)}}return kt(a),Th(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,s),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==c&&ra(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(r=ue.current,Bl(a)){if(r=a.stateNode,s=a.memoizedProps,c=null,p=ln,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[an]=a,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Sx(r.nodeValue,s)),r||La(a,!0)}else r=Tc(r).createTextNode(c),r[an]=a,a.stateNode=r}return kt(a),null;case 31:if(s=a.memoizedState,r===null||r.memoizedState!==null){if(c=Bl(a),s!==null){if(r===null){if(!c)throw Error(i(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[an]=a}else $i(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;kt(a),r=!1}else s=Pf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return a.flags&256?(Hn(a),a):(Hn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return kt(a),null;case 13:if(c=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Bl(a),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[an]=a}else $i(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;kt(a),p=!1}else p=Pf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?(Hn(a),a):(Hn(a),null)}return Hn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=a.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),s!==r&&s&&(a.child.flags|=8192),pc(a,a.updateQueue),kt(a),null);case 4:return xe(),r===null&&Jh(a.stateNode.containerInfo),kt(a),null;case 10:return Wr(a.type),kt(a),null;case 19:if(A(Mt),c=a.memoizedState,c===null)return kt(a),null;if(p=(a.flags&128)!==0,v=c.rendering,v===null)if(p)wo(c,!1);else{if(zt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(v=nc(r),v!==null){for(a.flags|=128,wo(c,!1),r=v.updateQueue,a.updateQueue=r,pc(a,r),a.subtreeFlags=0,r=s,s=a.child;s!==null;)Wy(s,r),s=s.sibling;return C(Mt,Mt.current&1|2),Je&&Xr(a,c.treeForkCount),a.child}r=r.sibling}c.tail!==null&&nn()>xc&&(a.flags|=128,p=!0,wo(c,!1),a.lanes=4194304)}else{if(!p)if(r=nc(v),r!==null){if(a.flags|=128,p=!0,r=r.updateQueue,a.updateQueue=r,pc(a,r),wo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Je)return kt(a),null}else 2*nn()-c.renderingStartTime>xc&&s!==536870912&&(a.flags|=128,p=!0,wo(c,!1),a.lanes=4194304);c.isBackwards?(v.sibling=a.child,a.child=v):(r=c.last,r!==null?r.sibling=v:a.child=v,c.last=v)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=nn(),r.sibling=null,s=Mt.current,C(Mt,p?s&1|2:s&1),Je&&Xr(a,c.treeForkCount),r):(kt(a),null);case 22:case 23:return Hn(a),Wf(),c=a.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(kt(a),a.subtreeFlags&6&&(a.flags|=8192)):kt(a),s=a.updateQueue,s!==null&&pc(a,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),r!==null&&A(Hi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Wr(It),kt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function E_(r,a){switch(Uf(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Wr(It),xe(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return en(a),null;case 31:if(a.memoizedState!==null){if(Hn(a),a.alternate===null)throw Error(i(340));$i()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(Hn(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));$i()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return A(Mt),null;case 4:return xe(),null;case 10:return Wr(a.type),null;case 22:case 23:return Hn(a),Wf(),r!==null&&A(Hi),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Wr(It),null;case 25:return null;default:return null}}function Cb(r,a){switch(Uf(a),a.tag){case 3:Wr(It),xe();break;case 26:case 27:case 5:en(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&Hn(a);break;case 13:Hn(a);break;case 19:A(Mt);break;case 10:Wr(a.type);break;case 22:case 23:Hn(a),Wf(),r!==null&&A(Hi);break;case 24:Wr(It)}}function ko(r,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&r)===r){c=void 0;var v=s.create,w=s.inst;c=v(),w.destroy=c}s=s.next}while(s!==p)}}catch(_){dt(a,a.return,_)}}function qa(r,a,s){try{var c=a.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&r)===r){var w=c.inst,_=w.destroy;if(_!==void 0){w.destroy=void 0,p=a;var M=s,G=_;try{G()}catch(te){dt(p,M,te)}}}c=c.next}while(c!==v)}}catch(te){dt(a,a.return,te)}}function _b(r){var a=r.updateQueue;if(a!==null){var s=r.stateNode;try{yv(a,s)}catch(c){dt(r,r.return,c)}}}function Nb(r,a,s){s.props=Ki(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){dt(r,a,c)}}function jo(r,a){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){dt(r,a,p)}}function zr(r,a){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){dt(r,a,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){dt(r,a,p)}else s.current=null}function Ab(r){var a=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){dt(r,r.return,p)}}function Rh(r,a,s){try{var c=r.stateNode;Q_(c,r.type,s,a),c[kn]=a}catch(p){dt(r,r.return,p)}}function Tb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ya(r.type)||r.tag===4}function zh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Tb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ya(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Oh(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(r),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Gr));else if(c!==4&&(c===27&&Ya(r.type)&&(s=r.stateNode,a=null),r=r.child,r!==null))for(Oh(r,a,s),r=r.sibling;r!==null;)Oh(r,a,s),r=r.sibling}function gc(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?s.insertBefore(r,a):s.appendChild(r);else if(c!==4&&(c===27&&Ya(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(gc(r,a,s),r=r.sibling;r!==null;)gc(r,a,s),r=r.sibling}function Rb(r){var a=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);un(a,c,s),a[an]=r,a[kn]=s}catch(v){dt(r,r.return,v)}}var aa=!1,Pt=!1,Dh=!1,zb=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function C_(r,a){if(r=r.containerInfo,tm=Ic,r=Hy(r),_f(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,_=-1,M=-1,G=0,te=0,se=r,K=null;t:for(;;){for(var X;se!==s||p!==0&&se.nodeType!==3||(_=w+p),se!==v||c!==0&&se.nodeType!==3||(M=w+c),se.nodeType===3&&(w+=se.nodeValue.length),(X=se.firstChild)!==null;)K=se,se=X;for(;;){if(se===r)break t;if(K===s&&++G===p&&(_=w),K===v&&++te===c&&(M=w),(X=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=X}s=_===-1||M===-1?null:{start:_,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(nm={focusedElem:r,selectionRange:s},Ic=!1,Xt=a;Xt!==null;)if(a=Xt,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,Xt=r;else for(;Xt!==null;){switch(a=Xt,v=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=a,p=v.memoizedProps,v=v.memoizedState,c=s.stateNode;try{var Se=Ki(s.type,p);r=c.getSnapshotBeforeUpdate(Se,v),c.__reactInternalSnapshotBeforeUpdate=r}catch(ze){dt(s,s.return,ze)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,s=r.nodeType,s===9)im(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":im(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=a.sibling,r!==null){r.return=a.return,Xt=r;break}Xt=a.return}}function Ob(r,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:la(r,s),c&4&&ko(5,s);break;case 1:if(la(r,s),c&4)if(r=s.stateNode,a===null)try{r.componentDidMount()}catch(w){dt(s,s.return,w)}else{var p=Ki(s.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(p,a,r.__reactInternalSnapshotBeforeUpdate)}catch(w){dt(s,s.return,w)}}c&64&&_b(s),c&512&&jo(s,s.return);break;case 3:if(la(r,s),c&64&&(r=s.updateQueue,r!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{yv(r,a)}catch(w){dt(s,s.return,w)}}break;case 27:a===null&&c&4&&Rb(s);case 26:case 5:la(r,s),a===null&&c&4&&Ab(s),c&512&&jo(s,s.return);break;case 12:la(r,s);break;case 31:la(r,s),c&4&&Lb(r,s);break;case 13:la(r,s),c&4&&Ib(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=M_.bind(null,s),tN(r,s))));break;case 22:if(c=s.memoizedState!==null||aa,!c){a=a!==null&&a.memoizedState!==null||Pt,p=aa;var v=Pt;aa=c,(Pt=a)&&!v?sa(r,s,(s.subtreeFlags&8772)!==0):la(r,s),aa=p,Pt=v}break;case 30:break;default:la(r,s)}}function Db(r){var a=r.alternate;a!==null&&(r.alternate=null,Db(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&cf(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var jt=null,En=!1;function ia(r,a,s){for(s=s.child;s!==null;)Mb(r,a,s),s=s.sibling}function Mb(r,a,s){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(rn,s)}catch{}switch(s.tag){case 26:Pt||zr(s,a),ia(r,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Pt||zr(s,a);var c=jt,p=En;Ya(s.type)&&(jt=s.stateNode,En=!1),ia(r,a,s),Oo(s.stateNode),jt=c,En=p;break;case 5:Pt||zr(s,a);case 6:if(c=jt,p=En,jt=null,ia(r,a,s),jt=c,En=p,jt!==null)if(En)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(s.stateNode)}catch(v){dt(s,a,v)}else try{jt.removeChild(s.stateNode)}catch(v){dt(s,a,v)}break;case 18:jt!==null&&(En?(r=jt,_x(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),ls(r)):_x(jt,s.stateNode));break;case 4:c=jt,p=En,jt=s.stateNode.containerInfo,En=!0,ia(r,a,s),jt=c,En=p;break;case 0:case 11:case 14:case 15:qa(2,s,a),Pt||qa(4,s,a),ia(r,a,s);break;case 1:Pt||(zr(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Nb(s,a,c)),ia(r,a,s);break;case 21:ia(r,a,s);break;case 22:Pt=(c=Pt)||s.memoizedState!==null,ia(r,a,s),Pt=c;break;default:ia(r,a,s)}}function Lb(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ls(r)}catch(s){dt(a,a.return,s)}}}function Ib(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ls(r)}catch(s){dt(a,a.return,s)}}function __(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new zb),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new zb),a;default:throw Error(i(435,r.tag))}}function yc(r,a){var s=__(r);a.forEach(function(c){if(!s.has(c)){s.add(c);var p=L_.bind(null,r,c);c.then(p,p)}})}function Cn(r,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],v=r,w=a,_=w;e:for(;_!==null;){switch(_.tag){case 27:if(Ya(_.type)){jt=_.stateNode,En=!1;break e}break;case 5:jt=_.stateNode,En=!1;break e;case 3:case 4:jt=_.stateNode.containerInfo,En=!0;break e}_=_.return}if(jt===null)throw Error(i(160));Mb(v,w,p),jt=null,En=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Ub(a,r),a=a.sibling}var wr=null;function Ub(r,a){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Cn(a,r),_n(r),c&4&&(qa(3,r,r.return),ko(3,r),qa(5,r,r.return));break;case 1:Cn(a,r),_n(r),c&512&&(Pt||s===null||zr(s,s.return)),c&64&&aa&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=wr;if(Cn(a,r),_n(r),c&512&&(Pt||s===null||zr(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Ys]||v[an]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),un(v,c,s),v[an]=r,Yt(v),c=v;break e;case"link":var w=Ux("link","href",p).get(c+(s.href||""));if(w){for(var _=0;_<w.length;_++)if(v=w[_],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(_,1);break t}}v=p.createElement(c),un(v,c,s),p.head.appendChild(v);break;case"meta":if(w=Ux("meta","content",p).get(c+(s.content||""))){for(_=0;_<w.length;_++)if(v=w[_],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(_,1);break t}}v=p.createElement(c),un(v,c,s),p.head.appendChild(v);break;default:throw Error(i(468,c))}v[an]=r,Yt(v),c=v}r.stateNode=c}else Bx(p,r.type,r.stateNode);else r.stateNode=Ix(p,c,r.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Bx(p,r.type,r.stateNode):Ix(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Rh(r,r.memoizedProps,s.memoizedProps)}break;case 27:Cn(a,r),_n(r),c&512&&(Pt||s===null||zr(s,s.return)),s!==null&&c&4&&Rh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Cn(a,r),_n(r),c&512&&(Pt||s===null||zr(s,s.return)),r.flags&32){p=r.stateNode;try{Al(p,"")}catch(Se){dt(r,r.return,Se)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Rh(r,p,s!==null?s.memoizedProps:p)),c&1024&&(Dh=!0);break;case 6:if(Cn(a,r),_n(r),c&4){if(r.stateNode===null)throw Error(i(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(Se){dt(r,r.return,Se)}}break;case 3:if(Oc=null,p=wr,wr=Rc(a.containerInfo),Cn(a,r),wr=p,_n(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ls(a.containerInfo)}catch(Se){dt(r,r.return,Se)}Dh&&(Dh=!1,Bb(r));break;case 4:c=wr,wr=Rc(r.stateNode.containerInfo),Cn(a,r),_n(r),wr=c;break;case 12:Cn(a,r),_n(r);break;case 31:Cn(a,r),_n(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,yc(r,c)));break;case 13:Cn(a,r),_n(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(bc=nn()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,yc(r,c)));break;case 22:p=r.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,G=aa,te=Pt;if(aa=G||p,Pt=te||M,Cn(a,r),Pt=te,aa=G,_n(r),c&8192)e:for(a=r.stateNode,a._visibility=p?a._visibility&-2:a._visibility|1,p&&(s===null||M||aa||Pt||Yi(r)),s=null,a=r;;){if(a.tag===5||a.tag===26){if(s===null){M=s=a;try{if(v=M.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{_=M.stateNode;var se=M.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;_.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(Se){dt(M,M.return,Se)}}}else if(a.tag===6){if(s===null){M=a;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(Se){dt(M,M.return,Se)}}}else if(a.tag===18){if(s===null){M=a;try{var X=M.stateNode;p?Nx(X,!0):Nx(M.stateNode,!1)}catch(Se){dt(M,M.return,Se)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,yc(r,s))));break;case 19:Cn(a,r),_n(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,yc(r,c)));break;case 30:break;case 21:break;default:Cn(a,r),_n(r)}}function _n(r){var a=r.flags;if(a&2){try{for(var s,c=r.return;c!==null;){if(Tb(c)){s=c;break}c=c.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var p=s.stateNode,v=zh(r);gc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Al(w,""),s.flags&=-33);var _=zh(r);gc(r,_,w);break;case 3:case 4:var M=s.stateNode.containerInfo,G=zh(r);Oh(r,G,M);break;default:throw Error(i(161))}}catch(te){dt(r,r.return,te)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function Bb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;Bb(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function la(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Ob(r,a.alternate,a),a=a.sibling}function Yi(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:qa(4,a,a.return),Yi(a);break;case 1:zr(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Nb(a,a.return,s),Yi(a);break;case 27:Oo(a.stateNode);case 26:case 5:zr(a,a.return),Yi(a);break;case 22:a.memoizedState===null&&Yi(a);break;case 30:Yi(a);break;default:Yi(a)}r=r.sibling}}function sa(r,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,p=r,v=a,w=v.flags;switch(v.tag){case 0:case 11:case 15:sa(p,v,s),ko(4,v);break;case 1:if(sa(p,v,s),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){dt(c,c.return,G)}if(c=v,p=c.updateQueue,p!==null){var _=c.stateNode;try{var M=p.shared.hiddenCallbacks;if(M!==null)for(p.shared.hiddenCallbacks=null,p=0;p<M.length;p++)gv(M[p],_)}catch(G){dt(c,c.return,G)}}s&&w&64&&_b(v),jo(v,v.return);break;case 27:Rb(v);case 26:case 5:sa(p,v,s),s&&c===null&&w&4&&Ab(v),jo(v,v.return);break;case 12:sa(p,v,s);break;case 31:sa(p,v,s),s&&w&4&&Lb(p,v);break;case 13:sa(p,v,s),s&&w&4&&Ib(p,v);break;case 22:v.memoizedState===null&&sa(p,v,s),jo(v,v.return);break;case 30:break;default:sa(p,v,s)}a=a.sibling}}function Mh(r,a){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&uo(s))}function Lh(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&uo(r))}function kr(r,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Pb(r,a,s,c),a=a.sibling}function Pb(r,a,s,c){var p=a.flags;switch(a.tag){case 0:case 11:case 15:kr(r,a,s,c),p&2048&&ko(9,a);break;case 1:kr(r,a,s,c);break;case 3:kr(r,a,s,c),p&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&uo(r)));break;case 12:if(p&2048){kr(r,a,s,c),r=a.stateNode;try{var v=a.memoizedProps,w=v.id,_=v.onPostCommit;typeof _=="function"&&_(w,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(M){dt(a,a.return,M)}}else kr(r,a,s,c);break;case 31:kr(r,a,s,c);break;case 13:kr(r,a,s,c);break;case 23:break;case 22:v=a.stateNode,w=a.alternate,a.memoizedState!==null?v._visibility&2?kr(r,a,s,c):Eo(r,a):v._visibility&2?kr(r,a,s,c):(v._visibility|=2,Kl(r,a,s,c,(a.subtreeFlags&10256)!==0||!1)),p&2048&&Mh(w,a);break;case 24:kr(r,a,s,c),p&2048&&Lh(a.alternate,a);break;default:kr(r,a,s,c)}}function Kl(r,a,s,c,p){for(p=p&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var v=r,w=a,_=s,M=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:Kl(v,w,_,M,p),ko(8,w);break;case 23:break;case 22:var te=w.stateNode;w.memoizedState!==null?te._visibility&2?Kl(v,w,_,M,p):Eo(v,w):(te._visibility|=2,Kl(v,w,_,M,p)),p&&G&2048&&Mh(w.alternate,w);break;case 24:Kl(v,w,_,M,p),p&&G&2048&&Lh(w.alternate,w);break;default:Kl(v,w,_,M,p)}a=a.sibling}}function Eo(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=r,c=a,p=c.flags;switch(c.tag){case 22:Eo(s,c),p&2048&&Mh(c.alternate,c);break;case 24:Eo(s,c),p&2048&&Lh(c.alternate,c);break;default:Eo(s,c)}a=a.sibling}}var Co=8192;function Yl(r,a,s){if(r.subtreeFlags&Co)for(r=r.child;r!==null;)$b(r,a,s),r=r.sibling}function $b(r,a,s){switch(r.tag){case 26:Yl(r,a,s),r.flags&Co&&r.memoizedState!==null&&hN(s,wr,r.memoizedState,r.memoizedProps);break;case 5:Yl(r,a,s);break;case 3:case 4:var c=wr;wr=Rc(r.stateNode.containerInfo),Yl(r,a,s),wr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Co,Co=16777216,Yl(r,a,s),Co=c):Yl(r,a,s));break;default:Yl(r,a,s)}}function Fb(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function _o(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Xt=c,Hb(c,r)}Fb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)qb(r),r=r.sibling}function qb(r){switch(r.tag){case 0:case 11:case 15:_o(r),r.flags&2048&&qa(9,r,r.return);break;case 3:_o(r);break;case 12:_o(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,vc(r)):_o(r);break;default:_o(r)}}function vc(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Xt=c,Hb(c,r)}Fb(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:qa(8,a,a.return),vc(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,vc(a));break;default:vc(a)}r=r.sibling}}function Hb(r,a){for(;Xt!==null;){var s=Xt;switch(s.tag){case 0:case 11:case 15:qa(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:uo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Xt=c;else e:for(s=r;Xt!==null;){c=Xt;var p=c.sibling,v=c.return;if(Db(c),c===s){Xt=null;break e}if(p!==null){p.return=v,Xt=p;break e}Xt=v}}}var N_={getCacheForType:function(r){var a=sn(It),s=a.data.get(r);return s===void 0&&(s=r(),a.data.set(r,s)),s},cacheSignal:function(){return sn(It).controller.signal}},A_=typeof WeakMap=="function"?WeakMap:Map,it=0,gt=null,Ve=null,Ke=0,ct=0,Zn=null,Ha=!1,Xl=!1,Ih=!1,oa=0,zt=0,Za=0,Xi=0,Uh=0,Vn=0,Jl=0,No=null,Nn=null,Bh=!1,bc=0,Zb=0,xc=1/0,Sc=null,Va=null,Ht=0,Qa=null,Wl=null,ua=0,Ph=0,$h=null,Vb=null,Ao=0,Fh=null;function Qn(){return(it&2)!==0&&Ke!==0?Ke&-Ke:P.T!==null?Gh():of()}function Qb(){if(Vn===0)if((Ke&536870912)===0||Je){var r=zi;zi<<=1,(zi&3932160)===0&&(zi=262144),Vn=r}else Vn=536870912;return r=qn.current,r!==null&&(r.flags|=32),Vn}function An(r,a,s){(r===gt&&(ct===2||ct===9)||r.cancelPendingCommit!==null)&&(es(r,0),Ga(r,Ke,Vn,!1)),Ra(r,s),((it&2)===0||r!==gt)&&(r===gt&&((it&2)===0&&(Xi|=s),zt===4&&Ga(r,Ke,Vn,!1)),Or(r))}function Gb(r,a,s){if((it&6)!==0)throw Error(i(327));var c=!s&&(a&127)===0&&(a&r.expiredLanes)===0||Ta(r,a),p=c?z_(r,a):Hh(r,a,!0),v=c;do{if(p===0){Xl&&!c&&Ga(r,a,0,!1);break}else{if(s=r.current.alternate,v&&!T_(s)){p=Hh(r,a,!1),v=!1;continue}if(p===2){if(v=a,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var _=r;p=No;var M=_.current.memoizedState.isDehydrated;if(M&&(es(_,w).flags|=256),w=Hh(_,w,!1),w!==2){if(Ih&&!M){_.errorRecoveryDisabledLanes|=v,Xi|=v,p=4;break e}v=Nn,Nn=p,v!==null&&(Nn===null?Nn=v:Nn.push.apply(Nn,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){es(r,0),Ga(r,a,0,!0);break}e:{switch(c=r,v=p,v){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Ga(c,a,Vn,!Ha);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(p=bc+300-nn(),10<p)){if(Ga(c,a,Vn,!Ha),Di(c,0,!0)!==0)break e;ua=a,c.timeoutHandle=Ex(Kb.bind(null,c,s,Nn,Sc,Bh,a,Vn,Xi,Jl,Ha,v,"Throttled",-0,0),p);break e}Kb(c,s,Nn,Sc,Bh,a,Vn,Xi,Jl,Ha,v,null,-0,0)}}break}while(!0);Or(r)}function Kb(r,a,s,c,p,v,w,_,M,G,te,se,K,X){if(r.timeoutHandle=-1,se=a.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gr},$b(a,v,se);var Se=(v&62914560)===v?bc-nn():(v&4194048)===v?Zb-nn():0;if(Se=mN(se,Se),Se!==null){ua=v,r.cancelPendingCommit=Se(rx.bind(null,r,a,v,s,c,p,w,_,M,te,se,null,K,X)),Ga(r,v,w,!G);return}}rx(r,a,v,s,c,p,w,_,M)}function T_(r){for(var a=r;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],v=p.getSnapshot;p=p.value;try{if(!$n(v(),p))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ga(r,a,s,c){a&=~Uh,a&=~Xi,r.suspendedLanes|=a,r.pingedLanes&=~a,c&&(r.warmLanes|=a),c=r.expirationTimes;for(var p=a;0<p;){var v=31-ut(p),w=1<<v;c[v]=-1,p&=~w}s!==0&&Ks(r,s,a)}function wc(){return(it&6)===0?(To(0),!1):!0}function qh(){if(Ve!==null){if(ct===0)var r=Ve.return;else r=Ve,Jr=Fi=null,ih(r),Hl=null,fo=0,r=Ve;for(;r!==null;)Cb(r.alternate,r),r=r.return;Ve=null}}function es(r,a){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,Y_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ua=0,qh(),gt=r,Ve=s=Yr(r.current,null),Ke=a,ct=0,Zn=null,Ha=!1,Xl=Ta(r,a),Ih=!1,Jl=Vn=Uh=Xi=Za=zt=0,Nn=No=null,Bh=!1,(a&8)!==0&&(a|=a&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=a;0<c;){var p=31-ut(c),v=1<<p;a|=r[p],c&=~v}return oa=a,qu(),s}function Yb(r,a){Ie=null,P.H=xo,a===ql||a===Xu?(a=fv(),ct=3):a===Qf?(a=fv(),ct=4):ct=a===Sh?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Zn=a,Ve===null&&(zt=1,dc(r,ir(a,r.current)))}function Xb(){var r=qn.current;return r===null?!0:(Ke&4194048)===Ke?ur===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?r===ur:!1}function Jb(){var r=P.H;return P.H=xo,r===null?xo:r}function Wb(){var r=P.A;return P.A=N_,r}function kc(){zt=4,Ha||(Ke&4194048)!==Ke&&qn.current!==null||(Xl=!0),(Za&134217727)===0&&(Xi&134217727)===0||gt===null||Ga(gt,Ke,Vn,!1)}function Hh(r,a,s){var c=it;it|=2;var p=Jb(),v=Wb();(gt!==r||Ke!==a)&&(Sc=null,es(r,a)),a=!1;var w=zt;e:do try{if(ct!==0&&Ve!==null){var _=Ve,M=Zn;switch(ct){case 8:qh(),w=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(a=!0);var G=ct;if(ct=0,Zn=null,ts(r,_,M,G),s&&Xl){w=0;break e}break;default:G=ct,ct=0,Zn=null,ts(r,_,M,G)}}R_(),w=zt;break}catch(te){Yb(r,te)}while(!0);return a&&r.shellSuspendCounter++,Jr=Fi=null,it=c,P.H=p,P.A=v,Ve===null&&(gt=null,Ke=0,qu()),w}function R_(){for(;Ve!==null;)ex(Ve)}function z_(r,a){var s=it;it|=2;var c=Jb(),p=Wb();gt!==r||Ke!==a?(Sc=null,xc=nn()+500,es(r,a)):Xl=Ta(r,a);e:do try{if(ct!==0&&Ve!==null){a=Ve;var v=Zn;t:switch(ct){case 1:ct=0,Zn=null,ts(r,a,v,1);break;case 2:case 9:if(cv(v)){ct=0,Zn=null,tx(a);break}a=function(){ct!==2&&ct!==9||gt!==r||(ct=7),Or(r)},v.then(a,a);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:cv(v)?(ct=0,Zn=null,tx(a)):(ct=0,Zn=null,ts(r,a,v,7));break;case 5:var w=null;switch(Ve.tag){case 26:w=Ve.memoizedState;case 5:case 27:var _=Ve;if(w?Px(w):_.stateNode.complete){ct=0,Zn=null;var M=_.sibling;if(M!==null)Ve=M;else{var G=_.return;G!==null?(Ve=G,jc(G)):Ve=null}break t}}ct=0,Zn=null,ts(r,a,v,5);break;case 6:ct=0,Zn=null,ts(r,a,v,6);break;case 8:qh(),zt=6;break e;default:throw Error(i(462))}}O_();break}catch(te){Yb(r,te)}while(!0);return Jr=Fi=null,P.H=c,P.A=p,it=s,Ve!==null?0:(gt=null,Ke=0,qu(),zt)}function O_(){for(;Ve!==null&&!Ti();)ex(Ve)}function ex(r){var a=jb(r.alternate,r,oa);r.memoizedProps=r.pendingProps,a===null?jc(r):Ve=a}function tx(r){var a=r,s=a.alternate;switch(a.tag){case 15:case 0:a=vb(s,a,a.pendingProps,a.type,void 0,Ke);break;case 11:a=vb(s,a,a.pendingProps,a.type.render,a.ref,Ke);break;case 5:ih(a);default:Cb(s,a),a=Ve=Wy(a,oa),a=jb(s,a,oa)}r.memoizedProps=r.pendingProps,a===null?jc(r):Ve=a}function ts(r,a,s,c){Jr=Fi=null,ih(a),Hl=null,fo=0;var p=a.return;try{if(S_(r,p,a,s,Ke)){zt=1,dc(r,ir(s,r.current)),Ve=null;return}}catch(v){if(p!==null)throw Ve=p,v;zt=1,dc(r,ir(s,r.current)),Ve=null;return}a.flags&32768?(Je||c===1?r=!0:Xl||(Ke&536870912)!==0?r=!1:(Ha=r=!0,(c===2||c===9||c===3||c===6)&&(c=qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),nx(a,r)):jc(a)}function jc(r){var a=r;do{if((a.flags&32768)!==0){nx(a,Ha);return}r=a.return;var s=j_(a.alternate,a,oa);if(s!==null){Ve=s;return}if(a=a.sibling,a!==null){Ve=a;return}Ve=a=r}while(a!==null);zt===0&&(zt=5)}function nx(r,a){do{var s=E_(r.alternate,r);if(s!==null){s.flags&=32767,Ve=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(r=r.sibling,r!==null)){Ve=r;return}Ve=r=s}while(r!==null);zt=6,Ve=null}function rx(r,a,s,c,p,v,w,_,M){r.cancelPendingCommit=null;do Ec();while(Ht!==0);if((it&6)!==0)throw Error(i(327));if(a!==null){if(a===r.current)throw Error(i(177));if(v=a.lanes|a.childLanes,v|=zf,Ru(r,s,v,w,_,M),r===gt&&(Ve=gt=null,Ke=0),Wl=a,Qa=r,ua=s,Ph=v,$h=p,Vb=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,I_(Oe,function(){return ox(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=V.p,V.p=2,w=it,it|=4;try{C_(r,a,s)}finally{it=w,V.p=p,P.T=c}}Ht=1,ax(),ix(),lx()}}function ax(){if(Ht===1){Ht=0;var r=Qa,a=Wl,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var c=V.p;V.p=2;var p=it;it|=4;try{Ub(a,r);var v=nm,w=Hy(r.containerInfo),_=v.focusedElem,M=v.selectionRange;if(w!==_&&_&&_.ownerDocument&&qy(_.ownerDocument.documentElement,_)){if(M!==null&&_f(_)){var G=M.start,te=M.end;if(te===void 0&&(te=G),"selectionStart"in _)_.selectionStart=G,_.selectionEnd=Math.min(te,_.value.length);else{var se=_.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var X=K.getSelection(),Se=_.textContent.length,ze=Math.min(M.start,Se),pt=M.end===void 0?ze:Math.min(M.end,Se);!X.extend&&ze>pt&&(w=pt,pt=ze,ze=w);var H=Fy(_,ze),$=Fy(_,pt);if(H&&$&&(X.rangeCount!==1||X.anchorNode!==H.node||X.anchorOffset!==H.offset||X.focusNode!==$.node||X.focusOffset!==$.offset)){var Q=se.createRange();Q.setStart(H.node,H.offset),X.removeAllRanges(),ze>pt?(X.addRange(Q),X.extend($.node,$.offset)):(Q.setEnd($.node,$.offset),X.addRange(Q))}}}}for(se=[],X=_;X=X.parentNode;)X.nodeType===1&&se.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<se.length;_++){var le=se[_];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Ic=!!tm,nm=tm=null}finally{it=p,V.p=c,P.T=s}}r.current=a,Ht=2}}function ix(){if(Ht===2){Ht=0;var r=Qa,a=Wl,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var c=V.p;V.p=2;var p=it;it|=4;try{Ob(r,a.alternate,a)}finally{it=p,V.p=c,P.T=s}}Ht=3}}function lx(){if(Ht===4||Ht===3){Ht=0,Vs();var r=Qa,a=Wl,s=ua,c=Vb;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Ht=5:(Ht=0,Wl=Qa=null,sx(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Va=null),wl(s),a=a.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(rn,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=P.T,p=V.p,V.p=2,P.T=null;try{for(var v=r.onRecoverableError,w=0;w<c.length;w++){var _=c[w];v(_.value,{componentStack:_.stack})}}finally{P.T=a,V.p=p}}(ua&3)!==0&&Ec(),Or(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Fh?Ao++:(Ao=0,Fh=r):Ao=0,To(0)}}function sx(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,uo(a)))}function Ec(){return ax(),ix(),lx(),ox()}function ox(){if(Ht!==5)return!1;var r=Qa,a=Ph;Ph=0;var s=wl(ua),c=P.T,p=V.p;try{V.p=32>s?32:s,P.T=null,s=$h,$h=null;var v=Qa,w=ua;if(Ht=0,Wl=Qa=null,ua=0,(it&6)!==0)throw Error(i(331));var _=it;if(it|=4,qb(v.current),Pb(v,v.current,w,s),it=_,To(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(rn,v)}catch{}return!0}finally{V.p=p,P.T=c,sx(r,a)}}function ux(r,a,s){a=ir(s,a),a=xh(r.stateNode,a,2),r=Pa(r,a,2),r!==null&&(Ra(r,2),Or(r))}function dt(r,a,s){if(r.tag===3)ux(r,r,s);else for(;a!==null;){if(a.tag===3){ux(a,r,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Va===null||!Va.has(c))){r=ir(s,r),s=cb(2),c=Pa(a,s,2),c!==null&&(db(s,c,a,r),Ra(c,2),Or(c));break}}a=a.return}}function Zh(r,a,s){var c=r.pingCache;if(c===null){c=r.pingCache=new A_;var p=new Set;c.set(a,p)}else p=c.get(a),p===void 0&&(p=new Set,c.set(a,p));p.has(s)||(Ih=!0,p.add(s),r=D_.bind(null,r,a,s),a.then(r,r))}function D_(r,a,s){var c=r.pingCache;c!==null&&c.delete(a),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,gt===r&&(Ke&s)===s&&(zt===4||zt===3&&(Ke&62914560)===Ke&&300>nn()-bc?(it&2)===0&&es(r,0):Uh|=s,Jl===Ke&&(Jl=0)),Or(r)}function cx(r,a){a===0&&(a=Gs()),r=Bi(r,a),r!==null&&(Ra(r,a),Or(r))}function M_(r){var a=r.memoizedState,s=0;a!==null&&(s=a.retryLane),cx(r,s)}function L_(r,a){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),cx(r,s)}function I_(r,a){return Vr(r,a)}var Cc=null,ns=null,Vh=!1,_c=!1,Qh=!1,Ka=0;function Or(r){r!==ns&&r.next===null&&(ns===null?Cc=ns=r:ns=ns.next=r),_c=!0,Vh||(Vh=!0,B_())}function To(r,a){if(!Qh&&_c){Qh=!0;do for(var s=!1,c=Cc;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var w=c.suspendedLanes,_=c.pingedLanes;v=(1<<31-ut(42|r)+1)-1,v&=p&~(w&~_),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,mx(c,v))}else v=Ke,v=Di(c,c===gt?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ta(c,v)||(s=!0,mx(c,v));c=c.next}while(s);Qh=!1}}function U_(){dx()}function dx(){_c=Vh=!1;var r=0;Ka!==0&&K_()&&(r=Ka);for(var a=nn(),s=null,c=Cc;c!==null;){var p=c.next,v=fx(c,a);v===0?(c.next=null,s===null?Cc=p:s.next=p,p===null&&(ns=s)):(s=c,(r!==0||(v&3)!==0)&&(_c=!0)),c=p}Ht!==0&&Ht!==5||To(r),Ka!==0&&(Ka=0)}function fx(r,a){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-ut(v),_=1<<w,M=p[w];M===-1?((_&s)===0||(_&c)!==0)&&(p[w]=Tu(_,a)):M<=a&&(r.expiredLanes|=_),v&=~_}if(a=gt,s=Ke,s=Di(r,r===a?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===a&&(ct===2||ct===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Ai(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ta(r,s)){if(a=s&-s,a===r.callbackPriority)return a;switch(c!==null&&Ai(c),wl(s)){case 2:case 8:s=me;break;case 32:s=Oe;break;case 268435456:s=nt;break;default:s=Oe}return c=hx.bind(null,r),s=Vr(s,c),r.callbackPriority=a,r.callbackNode=s,a}return c!==null&&c!==null&&Ai(c),r.callbackPriority=2,r.callbackNode=null,2}function hx(r,a){if(Ht!==0&&Ht!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Ec()&&r.callbackNode!==s)return null;var c=Ke;return c=Di(r,r===gt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Gb(r,c,a),fx(r,nn()),r.callbackNode!=null&&r.callbackNode===s?hx.bind(null,r):null)}function mx(r,a){if(Ec())return null;Gb(r,a,!0)}function B_(){X_(function(){(it&6)!==0?Vr(ne,U_):dx()})}function Gh(){if(Ka===0){var r=$l;r===0&&(r=Ri,Ri<<=1,(Ri&261888)===0&&(Ri=256)),Ka=r}return Ka}function px(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Mu(""+r)}function gx(r,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,r.id&&s.setAttribute("form",r.id),a.parentNode.insertBefore(s,a),r=new FormData(r),s.parentNode.removeChild(s),r}function P_(r,a,s,c,p){if(a==="submit"&&s&&s.stateNode===p){var v=px((p[kn]||null).action),w=c.submitter;w&&(a=(a=w[kn]||null)?px(a.formAction):w.getAttribute("formAction"),a!==null&&(v=a,w=null));var _=new Bu("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ka!==0){var M=w?gx(p,w):new FormData(p);mh(s,{pending:!0,data:M,method:p.method,action:v},null,M)}}else typeof v=="function"&&(_.preventDefault(),M=w?gx(p,w):new FormData(p),mh(s,{pending:!0,data:M,method:p.method,action:v},v,M))},currentTarget:p}]})}}for(var Kh=0;Kh<Rf.length;Kh++){var Yh=Rf[Kh],$_=Yh.toLowerCase(),F_=Yh[0].toUpperCase()+Yh.slice(1);Sr($_,"on"+F_)}Sr(Qy,"onAnimationEnd"),Sr(Gy,"onAnimationIteration"),Sr(Ky,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(a_,"onTransitionRun"),Sr(i_,"onTransitionStart"),Sr(l_,"onTransitionCancel"),Sr(Yy,"onTransitionEnd"),_l("onMouseEnter",["mouseout","mouseover"]),_l("onMouseLeave",["mouseout","mouseover"]),_l("onPointerEnter",["pointerout","pointerover"]),_l("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ro));function yx(r,a){a=(a&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var v=void 0;if(a)for(var w=c.length-1;0<=w;w--){var _=c[w],M=_.instance,G=_.currentTarget;if(_=_.listener,M!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(te){Fu(te)}p.currentTarget=null,v=M}else for(w=0;w<c.length;w++){if(_=c[w],M=_.instance,G=_.currentTarget,_=_.listener,M!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(te){Fu(te)}p.currentTarget=null,v=M}}}}function Qe(r,a){var s=a[uf];s===void 0&&(s=a[uf]=new Set);var c=r+"__bubble";s.has(c)||(vx(a,r,2,!1),s.add(c))}function Xh(r,a,s){var c=0;a&&(c|=4),vx(s,r,c,a)}var Nc="_reactListening"+Math.random().toString(36).slice(2);function Jh(r){if(!r[Nc]){r[Nc]=!0,dy.forEach(function(s){s!=="selectionchange"&&(q_.has(s)||Xh(s,!1,r),Xh(s,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Nc]||(a[Nc]=!0,Xh("selectionchange",!1,a))}}function vx(r,a,s,c){switch(Qx(a)){case 2:var p=yN;break;case 8:p=vN;break;default:p=hm}s=p.bind(null,a,s,r),p=void 0,!vf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(a,s,{capture:!0,passive:p}):r.addEventListener(a,s,!0):p!==void 0?r.addEventListener(a,s,{passive:p}):r.addEventListener(a,s,!1)}function Wh(r,a,s,c,p){var v=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var _=c.stateNode.containerInfo;if(_===p)break;if(w===4)for(w=c.return;w!==null;){var M=w.tag;if((M===3||M===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;_!==null;){if(w=jl(_),w===null)return;if(M=w.tag,M===5||M===6||M===26||M===27){c=v=w;continue e}_=_.parentNode}}c=c.return}ky(function(){var G=v,te=gf(s),se=[];e:{var K=Xy.get(r);if(K!==void 0){var X=Bu,Se=r;switch(r){case"keypress":if(Iu(s)===0)break e;case"keydown":case"keyup":X=LC;break;case"focusin":Se="focus",X=wf;break;case"focusout":Se="blur",X=wf;break;case"beforeblur":case"afterblur":X=wf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=Cy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=jC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=BC;break;case Qy:case Gy:case Ky:X=_C;break;case Yy:X=$C;break;case"scroll":case"scrollend":X=wC;break;case"wheel":X=qC;break;case"copy":case"cut":case"paste":X=AC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Ny;break;case"toggle":case"beforetoggle":X=ZC}var ze=(a&4)!==0,pt=!ze&&(r==="scroll"||r==="scrollend"),H=ze?K!==null?K+"Capture":null:K;ze=[];for(var $=G,Q;$!==null;){var le=$;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||H===null||(le=Js($,H),le!=null&&ze.push(zo($,le,Q))),pt)break;$=$.return}0<ze.length&&(K=new X(K,Se,null,s,te),se.push({event:K,listeners:ze}))}}if((a&7)===0){e:{if(K=r==="mouseover"||r==="pointerover",X=r==="mouseout"||r==="pointerout",K&&s!==pf&&(Se=s.relatedTarget||s.fromElement)&&(jl(Se)||Se[kl]))break e;if((X||K)&&(K=te.window===te?te:(K=te.ownerDocument)?K.defaultView||K.parentWindow:window,X?(Se=s.relatedTarget||s.toElement,X=G,Se=Se?jl(Se):null,Se!==null&&(pt=o(Se),ze=Se.tag,Se!==pt||ze!==5&&ze!==27&&ze!==6)&&(Se=null)):(X=null,Se=G),X!==Se)){if(ze=Cy,le="onMouseLeave",H="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(ze=Ny,le="onPointerLeave",H="onPointerEnter",$="pointer"),pt=X==null?K:Xs(X),Q=Se==null?K:Xs(Se),K=new ze(le,$+"leave",X,s,te),K.target=pt,K.relatedTarget=Q,le=null,jl(te)===G&&(ze=new ze(H,$+"enter",Se,s,te),ze.target=Q,ze.relatedTarget=pt,le=ze),pt=le,X&&Se)t:{for(ze=H_,H=X,$=Se,Q=0,le=H;le;le=ze(le))Q++;le=0;for(var Ne=$;Ne;Ne=ze(Ne))le++;for(;0<Q-le;)H=ze(H),Q--;for(;0<le-Q;)$=ze($),le--;for(;Q--;){if(H===$||$!==null&&H===$.alternate){ze=H;break t}H=ze(H),$=ze($)}ze=null}else ze=null;X!==null&&bx(se,K,X,ze,!1),Se!==null&&pt!==null&&bx(se,pt,Se,ze,!0)}}e:{if(K=G?Xs(G):window,X=K.nodeName&&K.nodeName.toLowerCase(),X==="select"||X==="input"&&K.type==="file")var rt=Ly;else if(Dy(K))if(Iy)rt=t_;else{rt=WC;var je=JC}else X=K.nodeName,!X||X.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?G&&mf(G.elementType)&&(rt=Ly):rt=e_;if(rt&&(rt=rt(r,G))){My(se,rt,s,te);break e}je&&je(r,K,G),r==="focusout"&&G&&K.type==="number"&&G.memoizedProps.value!=null&&hf(K,"number",K.value)}switch(je=G?Xs(G):window,r){case"focusin":(Dy(je)||je.contentEditable==="true")&&(Ol=je,Nf=G,lo=null);break;case"focusout":lo=Nf=Ol=null;break;case"mousedown":Af=!0;break;case"contextmenu":case"mouseup":case"dragend":Af=!1,Zy(se,s,te);break;case"selectionchange":if(r_)break;case"keydown":case"keyup":Zy(se,s,te)}var Ue;if(jf)e:{switch(r){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else zl?zy(r,s)&&(Ye="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(Ye="onCompositionStart");Ye&&(Ay&&s.locale!=="ko"&&(zl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&zl&&(Ue=jy()):(Oa=te,bf="value"in Oa?Oa.value:Oa.textContent,zl=!0)),je=Ac(G,Ye),0<je.length&&(Ye=new _y(Ye,r,null,s,te),se.push({event:Ye,listeners:je}),Ue?Ye.data=Ue:(Ue=Oy(s),Ue!==null&&(Ye.data=Ue)))),(Ue=QC?GC(r,s):KC(r,s))&&(Ye=Ac(G,"onBeforeInput"),0<Ye.length&&(je=new _y("onBeforeInput","beforeinput",null,s,te),se.push({event:je,listeners:Ye}),je.data=Ue)),P_(se,r,G,s,te)}yx(se,a)})}function zo(r,a,s){return{instance:r,listener:a,currentTarget:s}}function Ac(r,a){for(var s=a+"Capture",c=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Js(r,s),p!=null&&c.unshift(zo(r,p,v)),p=Js(r,a),p!=null&&c.push(zo(r,p,v))),r.tag===3)return c;r=r.return}return[]}function H_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function bx(r,a,s,c,p){for(var v=a._reactName,w=[];s!==null&&s!==c;){var _=s,M=_.alternate,G=_.stateNode;if(_=_.tag,M!==null&&M===c)break;_!==5&&_!==26&&_!==27||G===null||(M=G,p?(G=Js(s,v),G!=null&&w.unshift(zo(s,G,M))):p||(G=Js(s,v),G!=null&&w.push(zo(s,G,M)))),s=s.return}w.length!==0&&r.push({event:a,listeners:w})}var Z_=/\r\n?/g,V_=/\u0000|\uFFFD/g;function xx(r){return(typeof r=="string"?r:""+r).replace(Z_,`
49
- `).replace(V_,"")}function Sx(r,a){return a=xx(a),xx(r)===a}function mt(r,a,s,c,p,v){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Al(r,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Al(r,""+c);break;case"className":Ou(r,"class",c);break;case"tabIndex":Ou(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Ou(r,s,c);break;case"style":Sy(r,c,v);break;case"data":if(a!=="object"){Ou(r,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Mu(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"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 v=="function"&&(s==="formAction"?(a!=="input"&&mt(r,a,"name",p.name,p,null),mt(r,a,"formEncType",p.formEncType,p,null),mt(r,a,"formMethod",p.formMethod,p,null),mt(r,a,"formTarget",p.formTarget,p,null)):(mt(r,a,"encType",p.encType,p,null),mt(r,a,"method",p.method,p,null),mt(r,a,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Mu(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Gr);break;case"onScroll":c!=null&&Qe("scroll",r);break;case"onScrollEnd":c!=null&&Qe("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Mu(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Qe("beforetoggle",r),Qe("toggle",r),zu(r,"popover",c);break;case"xlinkActuate":Qr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Qr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Qr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Qr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Qr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Qr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":zu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=xC.get(s)||s,zu(r,s,c))}}function em(r,a,s,c,p,v){switch(s){case"style":Sy(r,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Al(r,c):(typeof c=="number"||typeof c=="bigint")&&Al(r,""+c);break;case"onScroll":c!=null&&Qe("scroll",r);break;case"onScrollEnd":c!=null&&Qe("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Gr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fy.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),a=s.slice(2,p?s.length-7:void 0),v=r[kn]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(a,v,p),typeof c=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(a,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):zu(r,s,c)}}}function un(r,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",r),Qe("load",r);var c=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:mt(r,a,v,w,s,null)}}p&&mt(r,a,"srcSet",s.srcSet,s,null),c&&mt(r,a,"src",s.src,s,null);return;case"input":Qe("invalid",r);var _=v=w=p=null,M=null,G=null;for(c in s)if(s.hasOwnProperty(c)){var te=s[c];if(te!=null)switch(c){case"name":p=te;break;case"type":w=te;break;case"checked":M=te;break;case"defaultChecked":G=te;break;case"value":v=te;break;case"defaultValue":_=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,a));break;default:mt(r,a,c,te,s,null)}}yy(r,v,_,M,G,w,p,!1);return;case"select":Qe("invalid",r),c=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":v=_;break;case"defaultValue":w=_;break;case"multiple":c=_;default:mt(r,a,p,_,s,null)}a=v,s=w,r.multiple=!!c,a!=null?Nl(r,!!c,a,!1):s!=null&&Nl(r,!!c,s,!0);return;case"textarea":Qe("invalid",r),v=p=c=null;for(w in s)if(s.hasOwnProperty(w)&&(_=s[w],_!=null))switch(w){case"value":c=_;break;case"defaultValue":p=_;break;case"children":v=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:mt(r,a,w,_,s,null)}by(r,c,p,v);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(c=s[M],c!=null))switch(M){case"selected":r.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:mt(r,a,M,c,s,null)}return;case"dialog":Qe("beforetoggle",r),Qe("toggle",r),Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":Qe("load",r);break;case"video":case"audio":for(c=0;c<Ro.length;c++)Qe(Ro[c],r);break;case"image":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"embed":case"source":case"link":Qe("error",r),Qe("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in s)if(s.hasOwnProperty(G)&&(c=s[G],c!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:mt(r,a,G,c,s,null)}return;default:if(mf(a)){for(te in s)s.hasOwnProperty(te)&&(c=s[te],c!==void 0&&em(r,a,te,c,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(c=s[_],c!=null&&mt(r,a,_,c,s,null))}function Q_(r,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,_=null,M=null,G=null,te=null;for(X in s){var se=s[X];if(s.hasOwnProperty(X)&&se!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":M=se;default:c.hasOwnProperty(X)||mt(r,a,X,null,c,se)}}for(var K in c){var X=c[K];if(se=s[K],c.hasOwnProperty(K)&&(X!=null||se!=null))switch(K){case"type":v=X;break;case"name":p=X;break;case"checked":G=X;break;case"defaultChecked":te=X;break;case"value":w=X;break;case"defaultValue":_=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,a));break;default:X!==se&&mt(r,a,K,X,c,se)}}ff(r,w,_,M,G,te,v,p);return;case"select":X=w=_=K=null;for(v in s)if(M=s[v],s.hasOwnProperty(v)&&M!=null)switch(v){case"value":break;case"multiple":X=M;default:c.hasOwnProperty(v)||mt(r,a,v,null,c,M)}for(p in c)if(v=c[p],M=s[p],c.hasOwnProperty(p)&&(v!=null||M!=null))switch(p){case"value":K=v;break;case"defaultValue":_=v;break;case"multiple":w=v;default:v!==M&&mt(r,a,p,v,c,M)}a=_,s=w,c=X,K!=null?Nl(r,!!s,K,!1):!!c!=!!s&&(a!=null?Nl(r,!!s,a,!0):Nl(r,!!s,s?[]:"",!1));return;case"textarea":X=K=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:mt(r,a,_,null,c,p)}for(w in c)if(p=c[w],v=s[w],c.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":K=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==v&&mt(r,a,w,p,c,v)}vy(r,K,X);return;case"option":for(var Se in s)if(K=s[Se],s.hasOwnProperty(Se)&&K!=null&&!c.hasOwnProperty(Se))switch(Se){case"selected":r.selected=!1;break;default:mt(r,a,Se,null,c,K)}for(M in c)if(K=c[M],X=s[M],c.hasOwnProperty(M)&&K!==X&&(K!=null||X!=null))switch(M){case"selected":r.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:mt(r,a,M,K,c,X)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in s)K=s[ze],s.hasOwnProperty(ze)&&K!=null&&!c.hasOwnProperty(ze)&&mt(r,a,ze,null,c,K);for(G in c)if(K=c[G],X=s[G],c.hasOwnProperty(G)&&K!==X&&(K!=null||X!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,a));break;default:mt(r,a,G,K,c,X)}return;default:if(mf(a)){for(var pt in s)K=s[pt],s.hasOwnProperty(pt)&&K!==void 0&&!c.hasOwnProperty(pt)&&em(r,a,pt,void 0,c,K);for(te in c)K=c[te],X=s[te],!c.hasOwnProperty(te)||K===X||K===void 0&&X===void 0||em(r,a,te,K,c,X);return}}for(var H in s)K=s[H],s.hasOwnProperty(H)&&K!=null&&!c.hasOwnProperty(H)&&mt(r,a,H,null,c,K);for(se in c)K=c[se],X=s[se],!c.hasOwnProperty(se)||K===X||K==null&&X==null||mt(r,a,se,K,c,X)}function wx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function G_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],v=p.transferSize,w=p.initiatorType,_=p.duration;if(v&&_&&wx(w)){for(w=0,_=p.responseEnd,c+=1;c<s.length;c++){var M=s[c],G=M.startTime;if(G>_)break;var te=M.transferSize,se=M.initiatorType;te&&wx(se)&&(M=M.responseEnd,w+=te*(M<_?1:(_-G)/(M-G)))}if(--c,a+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var tm=null,nm=null;function Tc(r){return r.nodeType===9?r:r.ownerDocument}function kx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jx(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function rm(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var am=null;function K_(){var r=window.event;return r&&r.type==="popstate"?r===am?!1:(am=r,!0):(am=null,!1)}var Ex=typeof setTimeout=="function"?setTimeout:void 0,Y_=typeof clearTimeout=="function"?clearTimeout:void 0,Cx=typeof Promise=="function"?Promise:void 0,X_=typeof queueMicrotask=="function"?queueMicrotask:typeof Cx<"u"?function(r){return Cx.resolve(null).then(r).catch(J_)}:Ex;function J_(r){setTimeout(function(){throw r})}function Ya(r){return r==="head"}function _x(r,a){var s=a,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),ls(a);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Oo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Oo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,_=v.nodeName;v[Ys]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Oo(r.ownerDocument.body);s=p}while(s);ls(a)}function Nx(r,a){var s=r;r=0;do{var c=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function im(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":im(s),cf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function W_(r,a,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Ys])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=cr(r.nextSibling),r===null)break}return null}function eN(r,a,s){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=cr(r.nextSibling),r===null))return null;return r}function Ax(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=cr(r.nextSibling),r===null))return null;return r}function lm(r){return r.data==="$?"||r.data==="$~"}function sm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function tN(r,a){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||s.readyState!=="loading")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function cr(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var om=null;function Tx(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(a===0)return cr(r.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}r=r.nextSibling}return null}function Rx(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return r;a--}else s!=="/$"&&s!=="/&"||a++}r=r.previousSibling}return null}function zx(r,a,s){switch(a=Tc(s),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Oo(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);cf(r)}var dr=new Map,Ox=new Set;function Rc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ca=V.d;V.d={f:nN,r:rN,D:aN,C:iN,L:lN,m:sN,X:uN,S:oN,M:cN};function nN(){var r=ca.f(),a=wc();return r||a}function rN(r){var a=El(r);a!==null&&a.tag===5&&a.type==="form"?Yv(a):ca.r(r)}var rs=typeof document>"u"?null:document;function Dx(r,a,s){var c=rs;if(c&&typeof a=="string"&&a){var p=rr(a);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Ox.has(p)||(Ox.add(p),r={rel:r,crossOrigin:s,href:a},c.querySelector(p)===null&&(a=c.createElement("link"),un(a,"link",r),Yt(a),c.head.appendChild(a)))}}function aN(r){ca.D(r),Dx("dns-prefetch",r,null)}function iN(r,a){ca.C(r,a),Dx("preconnect",r,a)}function lN(r,a,s){ca.L(r,a,s);var c=rs;if(c&&r&&a){var p='link[rel="preload"][as="'+rr(a)+'"]';a==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+rr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+rr(s.imageSizes)+'"]')):p+='[href="'+rr(r)+'"]';var v=p;switch(a){case"style":v=as(r);break;case"script":v=is(r)}dr.has(v)||(r=g({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:r,as:a},s),dr.set(v,r),c.querySelector(p)!==null||a==="style"&&c.querySelector(Do(v))||a==="script"&&c.querySelector(Mo(v))||(a=c.createElement("link"),un(a,"link",r),Yt(a),c.head.appendChild(a)))}}function sN(r,a){ca.m(r,a);var s=rs;if(s&&r){var c=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+rr(c)+'"][href="'+rr(r)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=is(r)}if(!dr.has(v)&&(r=g({rel:"modulepreload",href:r},a),dr.set(v,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Mo(v)))return}c=s.createElement("link"),un(c,"link",r),Yt(c),s.head.appendChild(c)}}}function oN(r,a,s){ca.S(r,a,s);var c=rs;if(c&&r){var p=Cl(c).hoistableStyles,v=as(r);a=a||"default";var w=p.get(v);if(!w){var _={loading:0,preload:null};if(w=c.querySelector(Do(v)))_.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":a},s),(s=dr.get(v))&&um(r,s);var M=w=c.createElement("link");Yt(M),un(M,"link",r),M._p=new Promise(function(G,te){M.onload=G,M.onerror=te}),M.addEventListener("load",function(){_.loading|=1}),M.addEventListener("error",function(){_.loading|=2}),_.loading|=4,zc(w,a,c)}w={type:"stylesheet",instance:w,count:1,state:_},p.set(v,w)}}}function uN(r,a){ca.X(r,a);var s=rs;if(s&&r){var c=Cl(s).hoistableScripts,p=is(r),v=c.get(p);v||(v=s.querySelector(Mo(p)),v||(r=g({src:r,async:!0},a),(a=dr.get(p))&&cm(r,a),v=s.createElement("script"),Yt(v),un(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function cN(r,a){ca.M(r,a);var s=rs;if(s&&r){var c=Cl(s).hoistableScripts,p=is(r),v=c.get(p);v||(v=s.querySelector(Mo(p)),v||(r=g({src:r,async:!0,type:"module"},a),(a=dr.get(p))&&cm(r,a),v=s.createElement("script"),Yt(v),un(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function Mx(r,a,s,c){var p=(p=ue.current)?Rc(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=as(s.href),s=Cl(p).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=as(s.href);var v=Cl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Do(r)))&&!v._p&&(w.instance=v,w.state.loading=5),dr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},dr.set(r,s),v||dN(p,r,s,w.state))),a&&c===null)throw Error(i(528,""));return w}if(a&&c!==null)throw Error(i(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=is(s),s=Cl(p).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function as(r){return'href="'+rr(r)+'"'}function Do(r){return'link[rel="stylesheet"]['+r+"]"}function Lx(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function dN(r,a,s,c){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=r.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),un(a,"link",s),Yt(a),r.head.appendChild(a))}function is(r){return'[src="'+rr(r)+'"]'}function Mo(r){return"script[async]"+r}function Ix(r,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=r.querySelector('style[data-href~="'+rr(s.href)+'"]');if(c)return a.instance=c,Yt(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Yt(c),un(c,"style",p),zc(c,s.precedence,r),a.instance=c;case"stylesheet":p=as(s.href);var v=r.querySelector(Do(p));if(v)return a.state.loading|=4,a.instance=v,Yt(v),v;c=Lx(s),(p=dr.get(p))&&um(c,p),v=(r.ownerDocument||r).createElement("link"),Yt(v);var w=v;return w._p=new Promise(function(_,M){w.onload=_,w.onerror=M}),un(v,"link",c),a.state.loading|=4,zc(v,s.precedence,r),a.instance=v;case"script":return v=is(s.src),(p=r.querySelector(Mo(v)))?(a.instance=p,Yt(p),p):(c=s,(p=dr.get(v))&&(c=g({},s),cm(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Yt(p),un(p,"link",c),r.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,zc(c,s.precedence,r));return a.instance}function zc(r,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,w=0;w<c.length;w++){var _=c[w];if(_.dataset.precedence===a)v=_;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(r,a.firstChild))}function um(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function cm(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var Oc=null;function Ux(r,a,s){if(Oc===null){var c=new Map,p=Oc=new Map;p.set(s,c)}else p=Oc,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[Ys]||v[an]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(a)||"";w=r+w;var _=c.get(w);_?_.push(v):c.set(w,[v])}}return c}function Bx(r,a,s){r=r.ownerDocument||r,r.head.insertBefore(s,a==="title"?r.querySelector("head > title"):null)}function fN(r,a,s){if(s===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return r=a.disabled,typeof a.precedence=="string"&&r==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Px(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function hN(r,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=as(c.href),v=a.querySelector(Do(p));if(v){a=v._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=Dc.bind(r),a.then(r,r)),s.state.loading|=4,s.instance=v,Yt(v);return}v=a.ownerDocument||a,c=Lx(c),(p=dr.get(p))&&um(c,p),v=v.createElement("link"),Yt(v);var w=v;w._p=new Promise(function(_,M){w.onload=_,w.onerror=M}),un(v,"link",c),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=Dc.bind(r),a.addEventListener("load",s),a.addEventListener("error",s))}}var dm=0;function mN(r,a){return r.stylesheets&&r.count===0&&Lc(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Lc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+a);0<r.imgBytes&&dm===0&&(dm=62500*G_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Lc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>dm?50:800)+a);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Dc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Mc=null;function Lc(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Mc=new Map,a.forEach(pN,r),Mc=null,Dc.call(r))}function pN(r,a){if(!(a.state.loading&4)){var s=Mc.get(r);if(s)var c=s.get(null);else{s=new Map,Mc.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}p=a.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||c,v===c&&s.set(null,p),s.set(w,p),this.count++,c=Dc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),a.state.loading|=4}}var Lo={$$typeof:D,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function gN(r,a,s,c,p,v,w,_,M){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sl(0),this.hiddenUpdates=Sl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function $x(r,a,s,c,p,v,w,_,M,G,te,se){return r=new gN(r,a,s,w,M,G,te,se,_),a=1,v===!0&&(a|=24),v=Fn(3,null,null,a),r.current=v,v.stateNode=r,a=Hf(),a.refCount++,r.pooledCache=a,a.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:a},Gf(v),r}function Fx(r){return r?(r=Ll,r):Ll}function qx(r,a,s,c,p,v){p=Fx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ba(a),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Pa(r,c,a),s!==null&&(An(s,r,a),mo(s,r,a))}function Hx(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<a?s:a}}function fm(r,a){Hx(r,a),(r=r.alternate)&&Hx(r,a)}function Zx(r){if(r.tag===13||r.tag===31){var a=Bi(r,67108864);a!==null&&An(a,r,67108864),fm(r,67108864)}}function Vx(r){if(r.tag===13||r.tag===31){var a=Qn();a=Kt(a);var s=Bi(r,a);s!==null&&An(s,r,a),fm(r,a)}}var Ic=!0;function yN(r,a,s,c){var p=P.T;P.T=null;var v=V.p;try{V.p=2,hm(r,a,s,c)}finally{V.p=v,P.T=p}}function vN(r,a,s,c){var p=P.T;P.T=null;var v=V.p;try{V.p=8,hm(r,a,s,c)}finally{V.p=v,P.T=p}}function hm(r,a,s,c){if(Ic){var p=mm(c);if(p===null)Wh(r,a,c,Uc,s),Gx(r,c);else if(xN(p,r,a,s,c))c.stopPropagation();else if(Gx(r,c),a&4&&-1<bN.indexOf(r)){for(;p!==null;){var v=El(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ar(v.pendingLanes);if(w!==0){var _=v;for(_.pendingLanes|=2,_.entangledLanes|=2;w;){var M=1<<31-ut(w);_.entanglements[1]|=M,w&=~M}Or(v),(it&6)===0&&(xc=nn()+500,To(0))}}break;case 31:case 13:_=Bi(v,2),_!==null&&An(_,v,2),wc(),fm(v,2)}if(v=mm(c),v===null&&Wh(r,a,c,Uc,s),v===p)break;p=v}p!==null&&c.stopPropagation()}else Wh(r,a,c,null,s)}}function mm(r){return r=gf(r),pm(r)}var Uc=null;function pm(r){if(Uc=null,r=jl(r),r!==null){var a=o(r);if(a===null)r=null;else{var s=a.tag;if(s===13){if(r=u(a),r!==null)return r;r=null}else if(s===31){if(r=f(a),r!==null)return r;r=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return Uc=r,null}function Qx(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qs()){case ne:return 2;case me:return 8;case Oe:case $e:return 32;case nt:return 268435456;default:return 32}default:return 32}}var gm=!1,Xa=null,Ja=null,Wa=null,Io=new Map,Uo=new Map,ei=[],bN="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 Gx(r,a){switch(r){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":Io.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(a.pointerId)}}function Bo(r,a,s,c,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},a!==null&&(a=El(a),a!==null&&Zx(a)),r):(r.eventSystemFlags|=c,a=r.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),r)}function xN(r,a,s,c,p){switch(a){case"focusin":return Xa=Bo(Xa,r,a,s,c,p),!0;case"dragenter":return Ja=Bo(Ja,r,a,s,c,p),!0;case"mouseover":return Wa=Bo(Wa,r,a,s,c,p),!0;case"pointerover":var v=p.pointerId;return Io.set(v,Bo(Io.get(v)||null,r,a,s,c,p)),!0;case"gotpointercapture":return v=p.pointerId,Uo.set(v,Bo(Uo.get(v)||null,r,a,s,c,p)),!0}return!1}function Kx(r){var a=jl(r.target);if(a!==null){var s=o(a);if(s!==null){if(a=s.tag,a===13){if(a=u(s),a!==null){r.blockedOn=a,uy(r.priority,function(){Vx(s)});return}}else if(a===31){if(a=f(s),a!==null){r.blockedOn=a,uy(r.priority,function(){Vx(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Bc(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var s=mm(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);pf=c,s.target.dispatchEvent(c),pf=null}else return a=El(s),a!==null&&Zx(a),r.blockedOn=s,!1;a.shift()}return!0}function Yx(r,a,s){Bc(r)&&s.delete(a)}function SN(){gm=!1,Xa!==null&&Bc(Xa)&&(Xa=null),Ja!==null&&Bc(Ja)&&(Ja=null),Wa!==null&&Bc(Wa)&&(Wa=null),Io.forEach(Yx),Uo.forEach(Yx)}function Pc(r,a){r.blockedOn===a&&(r.blockedOn=null,gm||(gm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,SN)))}var $c=null;function Xx(r){$c!==r&&($c=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$c===r&&($c=null);for(var a=0;a<r.length;a+=3){var s=r[a],c=r[a+1],p=r[a+2];if(typeof c!="function"){if(pm(c||s)===null)continue;break}var v=El(s);v!==null&&(r.splice(a,3),a-=3,mh(v,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function ls(r){function a(M){return Pc(M,r)}Xa!==null&&Pc(Xa,r),Ja!==null&&Pc(Ja,r),Wa!==null&&Pc(Wa,r),Io.forEach(a),Uo.forEach(a);for(var s=0;s<ei.length;s++){var c=ei[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<ei.length&&(s=ei[0],s.blockedOn===null);)Kx(s),s.blockedOn===null&&ei.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],v=s[c+1],w=p[kn]||null;if(typeof v=="function")w||Xx(s);else if(w){var _=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[kn]||null)_=w.formAction;else if(pm(p)!==null)continue}else _=w.action;typeof _=="function"?s[c+1]=_:(s.splice(c,3),c-=3),Xx(s)}}}function Jx(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function a(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),p!==null&&(p(),p=null)}}}function ym(r){this._internalRoot=r}Fc.prototype.render=ym.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var s=a.current,c=Qn();qx(s,c,r,a,null,null)},Fc.prototype.unmount=ym.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;qx(r.current,2,null,r,null,null),wc(),a[kl]=null}};function Fc(r){this._internalRoot=r}Fc.prototype.unstable_scheduleHydration=function(r){if(r){var a=of();r={blockedOn:null,target:r,priority:a};for(var s=0;s<ei.length&&a!==0&&a<ei[s].priority;s++);ei.splice(s,0,r),s===0&&Kx(r)}};var Wx=t.version;if(Wx!=="19.2.4")throw Error(i(527,Wx,"19.2.4"));V.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(a),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var wN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{rn=qc.inject(wN),Dt=qc}catch{}}return $o.createRoot=function(r,a){if(!l(r))throw Error(i(299));var s=!1,c="",p=lb,v=sb,w=ob;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=$x(r,1,!1,null,null,s,c,null,p,v,w,Jx),r[kl]=a.current,Jh(r),new ym(a)},$o.hydrateRoot=function(r,a,s){if(!l(r))throw Error(i(299));var c=!1,p="",v=lb,w=sb,_=ob,M=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),a=$x(r,1,!0,a,s??null,c,p,M,v,w,_,Jx),a.context=Fx(null),s=a.current,c=Qn(),c=Kt(c),p=Ba(c),p.callback=null,Pa(s,p,c),s=c,a.current.lanes=s,Ra(a,s),Or(a),r[kl]=a.current,Jh(r),new Fc(a)},$o.version="19.2.4",$o}var c0;function ON(){if(c0)return Sm.exports;c0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sm.exports=zN(),Sm.exports}var DN=ON(),Us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tl,oi,Ss,_S,MN=(_S=class extends Us{constructor(){super();_e(this,tl);_e(this,oi);_e(this,Ss);ye(this,Ss,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){I(this,oi)||this.setEventListener(I(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,oi))==null||t.call(this),ye(this,oi,void 0))}setEventListener(t){var n;ye(this,Ss,t),(n=I(this,oi))==null||n.call(this),ye(this,oi,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){I(this,tl)!==t&&(ye(this,tl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof I(this,tl)=="boolean"?I(this,tl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tl=new WeakMap,oi=new WeakMap,Ss=new WeakMap,_S),lg=new MN,LN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ui,rg,NS,IN=(NS=class{constructor(){_e(this,ui,LN);_e(this,rg,!1)}setTimeoutProvider(e){ye(this,ui,e)}setTimeout(e,t){return I(this,ui).setTimeout(e,t)}clearTimeout(e){I(this,ui).clearTimeout(e)}setInterval(e,t){return I(this,ui).setInterval(e,t)}clearInterval(e){I(this,ui).clearInterval(e)}},ui=new WeakMap,rg=new WeakMap,NS),el=new IN;function UN(e){setTimeout(e,0)}var BN=typeof window>"u"||"Deno"in globalThis;function bn(){}function PN(e,t){return typeof e=="function"?e(t):e}function fp(e){return typeof e=="number"&&e>=0&&e!==1/0}function BS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vi(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function d0(e,t){const{type:n="all",exact:i,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(i){if(t.queryHash!==sg(u,t.options))return!1}else if(!au(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function f0(e,t){const{exact:n,status:i,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(cl(t.options.mutationKey)!==cl(o))return!1}else if(!au(t.options.mutationKey,o))return!1}return!(i&&t.state.status!==i||l&&!l(t))}function sg(e,t){return((t==null?void 0:t.queryKeyHashFn)||cl)(e)}function cl(e){return JSON.stringify(e,(t,n)=>hp(n)?Object.keys(n).sort().reduce((i,l)=>(i[l]=n[l],i),{}):n)}function au(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>au(e[n],t[n])):!1}var $N=Object.prototype.hasOwnProperty;function PS(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=h0(e)&&h0(t);if(!i&&!(hp(e)&&hp(t)))return t;const o=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),f=u.length,m=i?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=i?y:u[y],b=e[g],x=t[g];if(b===x){m[g]=b,(i?y<o:$N.call(e,g))&&h++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){m[g]=x;continue}const k=PS(b,x,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function xd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function h0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hp(e){if(!m0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!m0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function m0(e){return Object.prototype.toString.call(e)==="[object Object]"}function FN(e){return new Promise(t=>{el.setTimeout(t,e)})}function mp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?PS(e,t):t}function qN(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function HN(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var og=Symbol();function $S(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===og?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ug(e,t){return typeof e=="function"?e(...t):!!e}function ZN(e,t,n){let i=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),i||(i=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var iu=(()=>{let e=()=>BN;return{isServer(){return e()},setIsServer(t){e=t}}})();function pp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function i(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{i({status:"fulfilled",value:l}),e(l)},n.reject=l=>{i({status:"rejected",reason:l}),t(l)},n}var VN=UN;function QN(){let e=[],t=0,n=f=>{f()},i=f=>{f()},l=VN;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{i(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{l=f}}}var Vt=QN(),ws,ci,ks,AS,GN=(AS=class extends Us{constructor(){super();_e(this,ws,!0);_e(this,ci);_e(this,ks);ye(this,ks,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){I(this,ci)||this.setEventListener(I(this,ks))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,ci))==null||t.call(this),ye(this,ci,void 0))}setEventListener(t){var n;ye(this,ks,t),(n=I(this,ci))==null||n.call(this),ye(this,ci,t(this.setOnline.bind(this)))}setOnline(t){I(this,ws)!==t&&(ye(this,ws,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return I(this,ws)}},ws=new WeakMap,ci=new WeakMap,ks=new WeakMap,AS),Sd=new GN;function KN(e){return Math.min(1e3*2**e,3e4)}function FS(e){return(e??"online")==="online"?Sd.isOnline():!0}var gp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function qS(e){let t=!1,n=0,i;const l=pp(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const N=new gp(j);b(N),(E=e.onCancel)==null||E.call(e,N)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>lg.isFocused()&&(e.networkMode==="always"||Sd.isOnline())&&e.canRun(),y=()=>FS(e.networkMode)&&e.canRun(),g=j=>{o()||(i==null||i(),l.resolve(j))},b=j=>{o()||(i==null||i(),l.reject(j))},x=()=>new Promise(j=>{var E;i=N=>{(o()||h())&&j(N)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;i=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(N){j=Promise.reject(N)}Promise.resolve(j).then(g).catch(N=>{var z;if(o())return;const T=e.retry??(iu.isServer()?0:3),D=e.retryDelay??KN,U=typeof D=="function"?D(n,N):D,B=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,N);if(t||!B){b(N);return}n++,(z=e.onFail)==null||z.call(e,n,N),FN(U).then(()=>h()?void 0:x()).then(()=>{t?b(N):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(i==null||i(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():x().then(k),l)}}var nl,TS,HS=(TS=class{constructor(){_e(this,nl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fp(this.gcTime)&&ye(this,nl,el.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(iu.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,nl)&&(el.clearTimeout(I(this,nl)),ye(this,nl,void 0))}},nl=new WeakMap,TS),rl,js,fr,al,Jt,pu,il,Kn,ZS,fa,RS,YN=(RS=class extends HS{constructor(t){super();_e(this,Kn);_e(this,rl);_e(this,js);_e(this,fr);_e(this,al);_e(this,Jt);_e(this,pu);_e(this,il);ye(this,il,!1),ye(this,pu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,al,t.client),ye(this,fr,I(this,al).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,rl,g0(this.options)),this.state=t.state??I(this,rl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=I(this,Jt))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,pu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=g0(this.options);n.data!==void 0&&(this.setState(p0(n.data,n.dataUpdatedAt)),ye(this,rl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,fr).remove(this)}setData(t,n){const i=mp(this.state.data,t,this.options);return Be(this,Kn,fa).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){Be(this,Kn,fa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,l;const n=(i=I(this,Jt))==null?void 0:i.promise;return(l=I(this,Jt))==null||l.cancel(t),n?n.then(bn).catch(bn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,rl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>hr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===og||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!BS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,Jt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,Jt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(I(this,Jt)&&(I(this,il)||Be(this,Kn,ZS).call(this)?I(this,Jt).cancel({revert:!0}):I(this,Jt).cancelRetry()),this.scheduleGc()),I(this,fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,Kn,fa).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,x,k,j,E,N,T,D;if(this.state.fetchStatus!=="idle"&&((m=I(this,Jt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(I(this,Jt))return I(this,Jt).continueRetry(),I(this,Jt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const U=this.observers.find(B=>B.options.queryFn);U&&this.setOptions(U.options)}const i=new AbortController,l=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(ye(this,il,!0),i.signal)})},o=()=>{const U=$S(this.options,n),z=(()=>{const F={client:I(this,al),queryKey:this.queryKey,meta:this.meta};return l(F),F})();return ye(this,il,!1),this.options.persister?this.options.persister(U,z,this):U(z)},f=(()=>{const U={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:I(this,al),state:this.state,fetchFn:o};return l(U),U})();(h=this.options.behavior)==null||h.onFetch(f,this),ye(this,js,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Be(this,Kn,fa).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ye(this,Jt,qS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:U=>{U instanceof gp&&U.revert&&this.setState({...I(this,js),fetchStatus:"idle"}),i.abort()},onFail:(U,B)=>{Be(this,Kn,fa).call(this,{type:"failed",failureCount:U,error:B})},onPause:()=>{Be(this,Kn,fa).call(this,{type:"pause"})},onContinue:()=>{Be(this,Kn,fa).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const U=await I(this,Jt).start();if(U===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(U),(x=(b=I(this,fr).config).onSuccess)==null||x.call(b,U,this),(j=(k=I(this,fr).config).onSettled)==null||j.call(k,U,this.state.error,this),U}catch(U){if(U instanceof gp){if(U.silent)return I(this,Jt).promise;if(U.revert){if(this.state.data===void 0)throw U;return this.state.data}}throw Be(this,Kn,fa).call(this,{type:"error",error:U}),(N=(E=I(this,fr).config).onError)==null||N.call(E,U,this),(D=(T=I(this,fr).config).onSettled)==null||D.call(T,this.state.data,U,this),U}finally{this.scheduleGc()}}},rl=new WeakMap,js=new WeakMap,fr=new WeakMap,al=new WeakMap,Jt=new WeakMap,pu=new WeakMap,il=new WeakMap,Kn=new WeakSet,ZS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},fa=function(t){const n=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...VS(i.data,this.options),fetchMeta:t.meta??null};case"success":const l={...i,...p0(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,js,t.manual?l:void 0),l;case"error":const o=t.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),Vt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),I(this,fr).notify({query:this,type:"updated",action:t})})},RS);function VS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:FS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function p0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function g0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rn,We,gu,vn,ll,Es,ha,di,yu,Cs,_s,sl,ol,fi,Ns,st,Yo,yp,vp,bp,xp,Sp,wp,kp,QS,zS,XN=(zS=class extends Us{constructor(t,n){super();_e(this,st);_e(this,Rn);_e(this,We);_e(this,gu);_e(this,vn);_e(this,ll);_e(this,Es);_e(this,ha);_e(this,di);_e(this,yu);_e(this,Cs);_e(this,_s);_e(this,sl);_e(this,ol);_e(this,fi);_e(this,Ns,new Set);this.options=n,ye(this,Rn,t),ye(this,di,null),ye(this,ha,pp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,We).addObserver(this),y0(I(this,We),this.options)?Be(this,st,Yo).call(this):this.updateResult(),Be(this,st,xp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jp(I(this,We),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jp(I(this,We),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,st,Sp).call(this),Be(this,st,wp).call(this),I(this,We).removeObserver(this)}setOptions(t){const n=this.options,i=I(this,We);if(this.options=I(this,Rn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,I(this,We))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,st,kp).call(this),I(this,We).setOptions(this.options),n._defaulted&&!xd(this.options,n)&&I(this,Rn).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,We),observer:this});const l=this.hasListeners();l&&v0(I(this,We),i,this.options,n)&&Be(this,st,Yo).call(this),this.updateResult(),l&&(I(this,We)!==i||hr(this.options.enabled,I(this,We))!==hr(n.enabled,I(this,We))||vi(this.options.staleTime,I(this,We))!==vi(n.staleTime,I(this,We)))&&Be(this,st,yp).call(this);const o=Be(this,st,vp).call(this);l&&(I(this,We)!==i||hr(this.options.enabled,I(this,We))!==hr(n.enabled,I(this,We))||o!==I(this,fi))&&Be(this,st,bp).call(this,o)}getOptimisticResult(t){const n=I(this,Rn).getQueryCache().build(I(this,Rn),t),i=this.createResult(n,t);return WN(this,i)&&(ye(this,vn,i),ye(this,Es,this.options),ye(this,ll,I(this,We).state)),i}getCurrentResult(){return I(this,vn)}trackResult(t,n){return new Proxy(t,{get:(i,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&I(this,ha).status==="pending"&&I(this,ha).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(t){I(this,Ns).add(t)}getCurrentQuery(){return I(this,We)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=I(this,Rn).defaultQueryOptions(t),i=I(this,Rn).getQueryCache().build(I(this,Rn),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return Be(this,st,Yo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,vn)))}createResult(t,n){var ee;const i=I(this,We),l=this.options,o=I(this,vn),u=I(this,ll),f=I(this,Es),h=t!==i?t.state:I(this,gu),{state:y}=t;let g={...y},b=!1,x;if(n._optimisticResults){const q=this.hasListeners(),ae=!q&&y0(t,n),re=q&&v0(t,i,n,l);(ae||re)&&(g={...g,...VS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;x=g.data;let N=!1;if(n.placeholderData!==void 0&&x===void 0&&E==="pending"){let q;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(q=o.data,N=!0):q=typeof n.placeholderData=="function"?n.placeholderData((ee=I(this,_s))==null?void 0:ee.state.data,I(this,_s)):n.placeholderData,q!==void 0&&(E="success",x=mp(o==null?void 0:o.data,q,n),b=!0)}if(n.select&&x!==void 0&&!N)if(o&&x===(u==null?void 0:u.data)&&n.select===I(this,yu))x=I(this,Cs);else try{ye(this,yu,n.select),x=n.select(x),x=mp(o==null?void 0:o.data,x,n),ye(this,Cs,x),ye(this,di,null)}catch(q){ye(this,di,q)}I(this,di)&&(k=I(this,di),x=I(this,Cs),j=Date.now(),E="error");const T=g.fetchStatus==="fetching",D=E==="pending",U=E==="error",B=D&&T,z=x!==void 0,Z={status:E,fetchStatus:g.fetchStatus,isPending:D,isSuccess:E==="success",isError:U,isInitialLoading:B,isLoading:B,data:x,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:T,isRefetching:T&&!D,isLoadingError:U&&!z,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:U&&z,isStale:cg(t,n),refetch:this.refetch,promise:I(this,ha),isEnabled:hr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=Z.data!==void 0,ae=Z.status==="error"&&!q,re=W=>{ae?W.reject(Z.error):q&&W.resolve(Z.data)},pe=()=>{const W=ye(this,ha,Z.promise=pp());re(W)},fe=I(this,ha);switch(fe.status){case"pending":t.queryHash===i.queryHash&&re(fe);break;case"fulfilled":(ae||Z.data!==fe.value)&&pe();break;case"rejected":(!ae||Z.error!==fe.reason)&&pe();break}}return Z}updateResult(){const t=I(this,vn),n=this.createResult(I(this,We),this.options);if(ye(this,ll,I(this,We).state),ye(this,Es,this.options),I(this,ll).data!==void 0&&ye(this,_s,I(this,We)),xd(n,t))return;ye(this,vn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!I(this,Ns).size)return!0;const u=new Set(o??I(this,Ns));return this.options.throwOnError&&u.add("error"),Object.keys(I(this,vn)).some(f=>{const m=f;return I(this,vn)[m]!==t[m]&&u.has(m)})};Be(this,st,QS).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,st,xp).call(this)}},Rn=new WeakMap,We=new WeakMap,gu=new WeakMap,vn=new WeakMap,ll=new WeakMap,Es=new WeakMap,ha=new WeakMap,di=new WeakMap,yu=new WeakMap,Cs=new WeakMap,_s=new WeakMap,sl=new WeakMap,ol=new WeakMap,fi=new WeakMap,Ns=new WeakMap,st=new WeakSet,Yo=function(t){Be(this,st,kp).call(this);let n=I(this,We).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(bn)),n},yp=function(){Be(this,st,Sp).call(this);const t=vi(this.options.staleTime,I(this,We));if(iu.isServer()||I(this,vn).isStale||!fp(t))return;const i=BS(I(this,vn).dataUpdatedAt,t)+1;ye(this,sl,el.setTimeout(()=>{I(this,vn).isStale||this.updateResult()},i))},vp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,We)):this.options.refetchInterval)??!1},bp=function(t){Be(this,st,wp).call(this),ye(this,fi,t),!(iu.isServer()||hr(this.options.enabled,I(this,We))===!1||!fp(I(this,fi))||I(this,fi)===0)&&ye(this,ol,el.setInterval(()=>{(this.options.refetchIntervalInBackground||lg.isFocused())&&Be(this,st,Yo).call(this)},I(this,fi)))},xp=function(){Be(this,st,yp).call(this),Be(this,st,bp).call(this,Be(this,st,vp).call(this))},Sp=function(){I(this,sl)&&(el.clearTimeout(I(this,sl)),ye(this,sl,void 0))},wp=function(){I(this,ol)&&(el.clearInterval(I(this,ol)),ye(this,ol,void 0))},kp=function(){const t=I(this,Rn).getQueryCache().build(I(this,Rn),this.options);if(t===I(this,We))return;const n=I(this,We);ye(this,We,t),ye(this,gu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},QS=function(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(I(this,vn))}),I(this,Rn).getQueryCache().notify({query:I(this,We),type:"observerResultsUpdated"})})},zS);function JN(e,t){return hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function y0(e,t){return JN(e,t)||e.state.data!==void 0&&jp(e,t,t.refetchOnMount)}function jp(e,t,n){if(hr(t.enabled,e)!==!1&&vi(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&cg(e,t)}return!1}function v0(e,t,n,i){return(e!==t||hr(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&cg(e,n)}function cg(e,t){return hr(t.enabled,e)!==!1&&e.isStaleByTime(vi(t.staleTime,e))}function WN(e,t){return!xd(e.getCurrentResult(),t)}function b0(e){return{onFetch:(t,n)=>{var y,g,b,x,k;const i=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=D=>{ZN(D,()=>t.signal,()=>j=!0)},N=$S(t.options,t.fetchOptions),T=async(D,U,B)=>{if(j)return Promise.reject();if(U==null&&D.pages.length)return Promise.resolve(D);const F=(()=>{const ae={client:t.client,queryKey:t.queryKey,pageParam:U,direction:B?"backward":"forward",meta:t.options.meta};return E(ae),ae})(),Z=await N(F),{maxPages:ee}=t.options,q=B?HN:qN;return{pages:q(D.pages,Z,ee),pageParams:q(D.pageParams,U,ee)}};if(l&&o.length){const D=l==="backward",U=D?e2:x0,B={pages:o,pageParams:u},z=U(i,B);f=await T(B,z,D)}else{const D=e??o.length;do{const U=m===0?u[0]??i.initialPageParam:x0(i,f);if(m>0&&U==null)break;f=await T(f,U),m++}while(m<D)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function x0(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function e2(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var vu,Lr,hn,ul,Ir,ii,OS,t2=(OS=class extends HS{constructor(t){super();_e(this,Ir);_e(this,vu);_e(this,Lr);_e(this,hn);_e(this,ul);ye(this,vu,t.client),this.mutationId=t.mutationId,ye(this,hn,t.mutationCache),ye(this,Lr,[]),this.state=t.state||GS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,Lr).includes(t)||(I(this,Lr).push(t),this.clearGcTimeout(),I(this,hn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Lr,I(this,Lr).filter(n=>n!==t)),this.scheduleGc(),I(this,hn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,Lr).length||(this.state.status==="pending"?this.scheduleGc():I(this,hn).remove(this))}continue(){var t;return((t=I(this,ul))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,b,x,k,j,E,N,T,D,U,B,z,F;const n=()=>{Be(this,Ir,ii).call(this,{type:"continue"})},i={client:I(this,vu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,ul,qS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(Z,ee)=>{Be(this,Ir,ii).call(this,{type:"failed",failureCount:Z,error:ee})},onPause:()=>{Be(this,Ir,ii).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,hn).canRun(this)}));const l=this.state.status==="pending",o=!I(this,ul).canStart();try{if(l)n();else{Be(this,Ir,ii).call(this,{type:"pending",variables:t,isPaused:o}),I(this,hn).config.onMutate&&await I(this,hn).config.onMutate(t,this,i);const ee=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,i));ee!==this.state.context&&Be(this,Ir,ii).call(this,{type:"pending",context:ee,variables:t,isPaused:o})}const Z=await I(this,ul).start();return await((h=(m=I(this,hn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,i)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,Z,t,this.state.context,i)),await((x=(b=I(this,hn).config).onSettled)==null?void 0:x.call(b,Z,null,this.state.variables,this.state.context,this,i)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,i)),Be(this,Ir,ii).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((N=(E=I(this,hn).config).onError)==null?void 0:N.call(E,Z,t,this.state.context,this,i))}catch(ee){Promise.reject(ee)}try{await((D=(T=this.options).onError)==null?void 0:D.call(T,Z,t,this.state.context,i))}catch(ee){Promise.reject(ee)}try{await((B=(U=I(this,hn).config).onSettled)==null?void 0:B.call(U,void 0,Z,this.state.variables,this.state.context,this,i))}catch(ee){Promise.reject(ee)}try{await((F=(z=this.options).onSettled)==null?void 0:F.call(z,void 0,Z,t,this.state.context,i))}catch(ee){Promise.reject(ee)}throw Be(this,Ir,ii).call(this,{type:"error",error:Z}),Z}finally{I(this,hn).runNext(this)}}},vu=new WeakMap,Lr=new WeakMap,hn=new WeakMap,ul=new WeakMap,Ir=new WeakSet,ii=function(t){const n=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vt.batch(()=>{I(this,Lr).forEach(i=>{i.onMutationUpdate(t)}),I(this,hn).notify({mutation:this,type:"updated",action:t})})},OS);function GS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ma,jr,bu,DS,n2=(DS=class extends Us{constructor(t={}){super();_e(this,ma);_e(this,jr);_e(this,bu);this.config=t,ye(this,ma,new Set),ye(this,jr,new Map),ye(this,bu,0)}build(t,n,i){const l=new t2({client:t,mutationCache:this,mutationId:++Hc(this,bu)._,options:t.defaultMutationOptions(n),state:i});return this.add(l),l}add(t){I(this,ma).add(t);const n=Zc(t);if(typeof n=="string"){const i=I(this,jr).get(n);i?i.push(t):I(this,jr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,ma).delete(t)){const n=Zc(t);if(typeof n=="string"){const i=I(this,jr).get(n);if(i)if(i.length>1){const l=i.indexOf(t);l!==-1&&i.splice(l,1)}else i[0]===t&&I(this,jr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Zc(t);if(typeof n=="string"){const i=I(this,jr).get(n),l=i==null?void 0:i.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var i;const n=Zc(t);if(typeof n=="string"){const l=(i=I(this,jr).get(n))==null?void 0:i.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vt.batch(()=>{I(this,ma).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,ma).clear(),I(this,jr).clear()})}getAll(){return Array.from(I(this,ma))}find(t){const n={exact:!0,...t};return this.getAll().find(i=>f0(n,i))}findAll(t={}){return this.getAll().filter(n=>f0(t,n))}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vt.batch(()=>Promise.all(t.map(n=>n.continue().catch(bn))))}},ma=new WeakMap,jr=new WeakMap,bu=new WeakMap,DS);function Zc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var pa,hi,zn,ga,va,dd,Ep,MS,r2=(MS=class extends Us{constructor(n,i){super();_e(this,va);_e(this,pa);_e(this,hi);_e(this,zn);_e(this,ga);ye(this,pa,n),this.setOptions(i),this.bindMethods(),Be(this,va,dd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const i=this.options;this.options=I(this,pa).defaultMutationOptions(n),xd(this.options,i)||I(this,pa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,zn),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&cl(i.mutationKey)!==cl(this.options.mutationKey)?this.reset():((l=I(this,zn))==null?void 0:l.state.status)==="pending"&&I(this,zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=I(this,zn))==null||n.removeObserver(this)}onMutationUpdate(n){Be(this,va,dd).call(this),Be(this,va,Ep).call(this,n)}getCurrentResult(){return I(this,hi)}reset(){var n;(n=I(this,zn))==null||n.removeObserver(this),ye(this,zn,void 0),Be(this,va,dd).call(this),Be(this,va,Ep).call(this)}mutate(n,i){var l;return ye(this,ga,i),(l=I(this,zn))==null||l.removeObserver(this),ye(this,zn,I(this,pa).getMutationCache().build(I(this,pa),this.options)),I(this,zn).addObserver(this),I(this,zn).execute(n)}},pa=new WeakMap,hi=new WeakMap,zn=new WeakMap,ga=new WeakMap,va=new WeakSet,dd=function(){var i;const n=((i=I(this,zn))==null?void 0:i.state)??GS();ye(this,hi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ep=function(n){Vt.batch(()=>{var i,l,o,u,f,m,h,y;if(I(this,ga)&&this.hasListeners()){const g=I(this,hi).variables,b=I(this,hi).context,x={client:I(this,pa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(i=I(this,ga)).onSuccess)==null||l.call(i,n.data,g,b,x)}catch(k){Promise.reject(k)}try{(u=(o=I(this,ga)).onSettled)==null||u.call(o,n.data,null,g,b,x)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=I(this,ga)).onError)==null||m.call(f,n.error,g,b,x)}catch(k){Promise.reject(k)}try{(y=(h=I(this,ga)).onSettled)==null||y.call(h,void 0,n.error,g,b,x)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(I(this,hi))})})},MS),Ur,LS,a2=(LS=class extends Us{constructor(t={}){super();_e(this,Ur);this.config=t,ye(this,Ur,new Map)}build(t,n,i){const l=n.queryKey,o=n.queryHash??sg(l,n);let u=this.get(o);return u||(u=new YN({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){I(this,Ur).has(t.queryHash)||(I(this,Ur).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=I(this,Ur).get(t.queryHash);n&&(t.destroy(),n===t&&I(this,Ur).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,Ur).get(t)}getAll(){return[...I(this,Ur).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>d0(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>d0(t,i)):n}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ur=new WeakMap,LS),Ot,mi,pi,As,Ts,gi,Rs,zs,IS,i2=(IS=class{constructor(e={}){_e(this,Ot);_e(this,mi);_e(this,pi);_e(this,As);_e(this,Ts);_e(this,gi);_e(this,Rs);_e(this,zs);ye(this,Ot,e.queryCache||new a2),ye(this,mi,e.mutationCache||new n2),ye(this,pi,e.defaultOptions||{}),ye(this,As,new Map),ye(this,Ts,new Map),ye(this,gi,0)}mount(){Hc(this,gi)._++,I(this,gi)===1&&(ye(this,Rs,lg.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Ot).onFocus())})),ye(this,zs,Sd.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Ot).onOnline())})))}unmount(){var e,t;Hc(this,gi)._--,I(this,gi)===0&&((e=I(this,Rs))==null||e.call(this),ye(this,Rs,void 0),(t=I(this,zs))==null||t.call(this),ye(this,zs,void 0))}isFetching(e){return I(this,Ot).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,mi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Ot).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=I(this,Ot).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return I(this,Ot).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),l=I(this,Ot).get(i.queryHash),o=l==null?void 0:l.state.data,u=PN(t,o);if(u!==void 0)return I(this,Ot).build(this,i).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Vt.batch(()=>I(this,Ot).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Ot).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=I(this,Ot);Vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=I(this,Ot);return Vt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=Vt.batch(()=>I(this,Ot).findAll(e).map(l=>l.cancel(n)));return Promise.all(i).then(bn).catch(bn)}invalidateQueries(e,t={}){return Vt.batch(()=>(I(this,Ot).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=Vt.batch(()=>I(this,Ot).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(bn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(bn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=I(this,Ot).build(this,t);return n.isStaleByTime(vi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bn).catch(bn)}fetchInfiniteQuery(e){return e.behavior=b0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bn).catch(bn)}ensureInfiniteQueryData(e){return e.behavior=b0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Sd.isOnline()?I(this,mi).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,Ot)}getMutationCache(){return I(this,mi)}getDefaultOptions(){return I(this,pi)}setDefaultOptions(e){ye(this,pi,e)}setQueryDefaults(e,t){I(this,As).set(cl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,As).values()],n={};return t.forEach(i=>{au(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){I(this,Ts).set(cl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,Ts).values()],n={};return t.forEach(i=>{au(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,pi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===og&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,pi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,Ot).clear(),I(this,mi).clear()}},Ot=new WeakMap,mi=new WeakMap,pi=new WeakMap,As=new WeakMap,Ts=new WeakMap,gi=new WeakMap,Rs=new WeakMap,zs=new WeakMap,IS),KS=S.createContext(void 0),Wn=e=>{const t=S.useContext(KS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},l2=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(KS.Provider,{value:e,children:t})),YS=S.createContext(!1),s2=()=>S.useContext(YS);YS.Provider;function o2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var u2=S.createContext(o2()),c2=()=>S.useContext(u2),d2=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ug(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},f2=e=>{S.useEffect(()=>{e.clearReset()},[e])},h2=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(l&&e.data===void 0||ug(n,[e.error,i])),m2=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...l)=>n(i(...l)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},p2=(e,t)=>e.isLoading&&e.isFetching&&!t,g2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,S0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function y2(e,t,n){var b,x,k,j;const i=s2(),l=c2(),o=Wn(),u=o.defaultQueryOptions(e);(x=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||x.call(b,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=i?"isRestoring":"optimistic",m2(u),d2(u,l,f),f2(l);const m=!o.getQueryCache().get(u.queryHash),[h]=S.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!i&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(E=>{const N=g?h.subscribe(Vt.batchCalls(E)):bn;return h.updateResult(),N},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),S.useEffect(()=>{h.setOptions(u)},[u,h]),g2(u,y))throw S0(u,h,l);if(h2({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,y),u.experimental_prefetchInRender&&!iu.isServer()&&p2(y,i)){const E=m?S0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(bn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function qe(e,t){return y2(e,XN)}function yt(e,t){const n=Wn(),[i]=S.useState(()=>new r2(n,e));S.useEffect(()=>{i.setOptions(e)},[i,e]);const l=S.useSyncExternalStore(S.useCallback(u=>i.subscribe(Vt.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=S.useCallback((u,f)=>{i.mutate(u,f).catch(bn)},[i]);if(l.error&&ug(i.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:o,mutateAsync:l.mutate}}/**
50
- * react-router v7.13.1
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var w0="popstate";function k0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function v2(e={}){function t(i,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||i.location;return Cp("",{pathname:u,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,l){return typeof l=="string"?l:lu(l)}return x2(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function b2(){return Math.random().toString(36).substring(2,10)}function j0(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Cp(e,t,n=null,i,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Bs(t):t,state:n,key:t&&t.key||i||b2(),unstable_mask:l}}function lu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Bs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function x2(e,t,n,i={}){let{window:l=document.defaultView,v5Compat:o=!1}=i,u=l.history,f="POP",m=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let E=y(),N=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:N})}function b(E,N){f="PUSH";let T=k0(E)?E:Cp(j.location,E,N);h=y()+1;let D=j0(T,h),U=j.createHref(T.unstable_mask||T);try{u.pushState(D,"",U)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(U)}o&&m&&m({action:f,location:j.location,delta:1})}function x(E,N){f="REPLACE";let T=k0(E)?E:Cp(j.location,E,N);h=y();let D=j0(T,h),U=j.createHref(T.unstable_mask||T);u.replaceState(D,"",U),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return S2(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(w0,g),m=E,()=>{l.removeEventListener(w0,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let N=k(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:x,go(E){return u.go(E)}};return j}function S2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Et(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:lu(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function XS(e,t,n="/"){return w2(e,t,n,!1)}function w2(e,t,n,i){let l=typeof t=="string"?Bs(t):t,o=ba(l.pathname||"/",n);if(o==null)return null;let u=JS(e);k2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=D2(o);f=z2(u[m],h,i)}return f}function JS(e,t=[],n=[],i="",l=!1){let o=(u,f,m=l,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&m)return;Et(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let g=$r([i,y.relativePath]),b=n.concat(y);u.children&&u.children.length>0&&(Et(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),JS(u.children,t,b,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:T2(g,u.index),routesMeta:b})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of WS(u.path))o(u,f,!0,h)}),t}function WS(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return l?[o,""]:[o];let u=WS(i.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function k2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:R2(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var j2=/^:[\w-]+$/,E2=3,C2=2,_2=1,N2=10,A2=-2,E0=e=>e==="*";function T2(e,t){let n=e.split("/"),i=n.length;return n.some(E0)&&(i+=A2),t&&(i+=C2),n.filter(l=>!E0(l)).reduce((l,o)=>l+(j2.test(o)?E2:o===""?_2:N2),i)}function R2(e,t){return e.length===t.length&&e.slice(0,-1).every((i,l)=>i===t[l])?e[e.length-1]-t[t.length-1]:0}function z2(e,t,n=!1){let{routesMeta:i}=e,l={},o="/",u=[];for(let f=0;f<i.length;++f){let m=i[f],h=f===i.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=wd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!i[i.length-1].route.index&&(g=wd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:$r([o,g.pathname]),pathnameBase:U2($r([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=$r([o,g.pathnameBase]))}return u}function wd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=O2(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const x=f[b];return g&&!x?h[y]=void 0:h[y]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function O2(e,t=!1,n=!0){pr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,y)=>{if(i.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),i]}function D2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ba(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}var M2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function L2(e,t="/"){let{pathname:n,search:i="",hash:l=""}=typeof e=="string"?Bs(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=C0(n.substring(1),"/"):o=C0(n,t)):o=t,{pathname:o,search:B2(i),hash:P2(l)}}function C0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Em(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function I2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dg(e){let t=I2(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function Ld(e,t,n,i=!1){let l;typeof e=="string"?l=Bs(e):(l={...e},Et(!l.pathname||!l.pathname.includes("?"),Em("?","pathname","search",l)),Et(!l.pathname||!l.pathname.includes("#"),Em("#","pathname","hash",l)),Et(!l.search||!l.search.includes("#"),Em("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let g=t.length-1;if(!i&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=L2(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var $r=e=>e.join("/").replace(/\/\/+/g,"/"),U2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,P2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$2=class{constructor(e,t,n,i=!1){this.status=e,this.statusText=t||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function F2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function q2(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ew=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tw(e,t){let n=e;if(typeof n!="string"||!M2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,l=!1;if(ew)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ba(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{pr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var nw=["POST","PUT","PATCH","DELETE"];new Set(nw);var H2=["GET",...nw];new Set(H2);var Ps=S.createContext(null);Ps.displayName="DataRouter";var Id=S.createContext(null);Id.displayName="DataRouterState";var Z2=S.createContext(!1),rw=S.createContext({isTransitioning:!1});rw.displayName="ViewTransition";var V2=S.createContext(new Map);V2.displayName="Fetchers";var Q2=S.createContext(null);Q2.displayName="Await";var er=S.createContext(null);er.displayName="Navigation";var xu=S.createContext(null);xu.displayName="Location";var gr=S.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var fg=S.createContext(null);fg.displayName="RouteError";var aw="REACT_ROUTER_ERROR",G2="REDIRECT",K2="ROUTE_ERROR_RESPONSE";function Y2(e){if(e.startsWith(`${aw}:${G2}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function X2(e){if(e.startsWith(`${aw}:${K2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new $2(t.status,t.statusText,t.data)}catch{}}function J2(e,{relative:t}={}){Et($s(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=S.useContext(er),{hash:l,pathname:o,search:u}=Su(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:$r([n,o])),i.createHref({pathname:f,search:u,hash:l})}function $s(){return S.useContext(xu)!=null}function yr(){return Et($s(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(xu).location}var iw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lw(e){S.useContext(er).static||S.useLayoutEffect(e)}function qr(){let{isDataRoute:e}=S.useContext(gr);return e?mA():W2()}function W2(){Et($s(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Ps),{basename:t,navigator:n}=S.useContext(er),{matches:i}=S.useContext(gr),{pathname:l}=yr(),o=JSON.stringify(dg(i)),u=S.useRef(!1);return lw(()=>{u.current=!0}),S.useCallback((m,h={})=>{if(pr(u.current,iw),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=Ld(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:$r([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var eA=S.createContext(null);function tA(e){let t=S.useContext(gr).outlet;return S.useMemo(()=>t&&S.createElement(eA.Provider,{value:e},t),[t,e])}function nA(){let{matches:e}=S.useContext(gr),t=e[e.length-1];return t?t.params:{}}function Su(e,{relative:t}={}){let{matches:n}=S.useContext(gr),{pathname:i}=yr(),l=JSON.stringify(dg(n));return S.useMemo(()=>Ld(e,JSON.parse(l),i,t==="path"),[e,l,i,t])}function rA(e,t){return sw(e,t)}function sw(e,t,n){var E;Et($s(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(er),{matches:l}=S.useContext(gr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let N=h&&h.path||"";uw(f,!h||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let y=yr(),g;if(t){let N=typeof t=="string"?Bs(t):t;Et(m==="/"||((E=N.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${N.pathname}" was given in the \`location\` prop.`),g=N}else g=y;let b=g.pathname||"/",x=b;if(m!=="/"){let N=m.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(N.length).join("/")}let k=XS(e,{pathname:x});pr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),pr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=oA(k&&k.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:$r([m,i.encodeLocation?i.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:$r([m,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,n);return t&&j?S.createElement(xu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function aA(){let e=hA(),t=F2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:l},n):null,u)}var iA=S.createElement(aA,null),ow=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=X2(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement(gr.Provider,{value:this.props.routeContext},S.createElement(fg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(lA,{error:e},t):t}};ow.contextType=Z2;var Cm=new WeakMap;function lA({children:e,error:t}){let{basename:n}=S.useContext(er);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=Y2(t.digest);if(i){let l=Cm.get(t);if(l)throw l;let o=tw(i.location,n);if(ew&&!Cm.get(t))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw Cm.set(t,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function sA({routeContext:e,match:t,children:n}){let i=S.useContext(Ps);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(gr.Provider,{value:e},n)}function oA(e,t=[],n){let i=n==null?void 0:n.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let l=e,o=i==null?void 0:i.errors;if(o!=null){let y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Et(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let u=!1,f=-1;if(n&&i){u=i.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:x}=i,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=i&&m?(y,g)=>{var b,x;m(y,{location:i.location,params:((x=(b=i.matches)==null?void 0:b[0])==null?void 0:x.params)??{},unstable_pattern:q2(i.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let x,k=!1,j=null,E=null;i&&(x=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||iA,u&&(f<0&&b===0?(uw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=g.route.hydrateFallbackElement||null)));let N=t.concat(l.slice(0,b+1)),T=()=>{let D;return x?D=j:k?D=E:g.route.Component?D=S.createElement(g.route.Component,null):g.route.element?D=g.route.element:D=y,S.createElement(sA,{match:g,routeContext:{outlet:y,matches:N,isDataRoute:i!=null},children:D})};return i&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?S.createElement(ow,{location:i.location,revalidation:i.revalidation,component:j,error:x,children:T(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:h}):T()},null)}function hg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uA(e){let t=S.useContext(Ps);return Et(t,hg(e)),t}function cA(e){let t=S.useContext(Id);return Et(t,hg(e)),t}function dA(e){let t=S.useContext(gr);return Et(t,hg(e)),t}function mg(e){let t=dA(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function fA(){return mg("useRouteId")}function hA(){var i;let e=S.useContext(fg),t=cA("useRouteError"),n=mg("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function mA(){let{router:e}=uA("useNavigate"),t=mg("useNavigate"),n=S.useRef(!1);return lw(()=>{n.current=!0}),S.useCallback(async(l,o={})=>{pr(n.current,iw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var _0={};function uw(e,t,n){!t&&!_0[e]&&(_0[e]=!0,pr(!1,n))}S.memo(pA);function pA({routes:e,future:t,state:n,isStatic:i,onError:l}){return sw(e,void 0,{state:n,isStatic:i,onError:l})}function pg({to:e,replace:t,state:n,relative:i}){Et($s(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=S.useContext(er);pr(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=S.useContext(gr),{pathname:u}=yr(),f=qr(),m=Ld(e,dg(o),u,i==="path"),h=JSON.stringify(m);return S.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:i})},[f,h,i,t,n]),null}function _p(e){return tA(e.context)}function Dr(e){Et(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function gA({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Et(!$s(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=S.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Bs(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:x="default",unstable_mask:k}=n,j=S.useMemo(()=>{let E=ba(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:x,unstable_mask:k},navigationType:i}},[f,h,y,g,b,x,i,k]);return pr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(er.Provider,{value:m},S.createElement(xu.Provider,{children:t,value:j}))}function yA({children:e,location:t}){return rA(Np(e),t)}function Np(e,t=[]){let n=[];return S.Children.forEach(e,(i,l)=>{if(!S.isValidElement(i))return;let o=[...t,l];if(i.type===S.Fragment){n.push.apply(n,Np(i.props.children,o));return}Et(i.type===Dr,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Et(!i.props.index||!i.props.children,"An index route cannot have child routes.");let u={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(u.children=Np(i.props.children,o)),n.push(u)}),n}var fd="get",hd="application/x-www-form-urlencoded";function Ud(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vA(e){return Ud(e)&&e.tagName.toLowerCase()==="button"}function bA(e){return Ud(e)&&e.tagName.toLowerCase()==="form"}function xA(e){return Ud(e)&&e.tagName.toLowerCase()==="input"}function SA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wA(e,t){return e.button===0&&(!t||t==="_self")&&!SA(e)}function Ap(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(l=>[n,l]):[[n,i]])},[]))}function kA(e,t){let n=Ap(e);return t&&t.forEach((i,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Vc=null;function jA(){if(Vc===null)try{new FormData(document.createElement("form"),0),Vc=!1}catch{Vc=!0}return Vc}var EA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _m(e){return e!=null&&!EA.has(e)?(pr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hd}"`),null):e}function CA(e,t){let n,i,l,o,u;if(bA(e)){let f=e.getAttribute("action");i=f?ba(f,t):null,n=e.getAttribute("method")||fd,l=_m(e.getAttribute("enctype"))||hd,o=new FormData(e)}else if(vA(e)||xA(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(i=m?ba(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||fd,l=_m(e.getAttribute("formenctype"))||_m(f.getAttribute("enctype"))||hd,o=new FormData(f,e),!jA()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(Ud(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=fd,i=null,l=hd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:i,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _A(e,t,n,i){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${i}`:l.pathname=`${l.pathname}.${i}`:l.pathname==="/"?l.pathname=`_root.${i}`:t&&ba(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${i}`,l}async function NA(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function AA(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function TA(e,t,n){let i=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await NA(o,n);return u.links?u.links():[]}return[]}));return DA(i.flat(1).filter(AA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function N0(e,t,n,i,l,o){let u=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=i.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function RA(e,t,{includeHydrateFallback:n}={}){return zA(e.map(i=>{let l=t.routes[i.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function zA(e){return[...new Set(e)]}function OA(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function DA(e,t){let n=new Set;return new Set(t),e.reduce((i,l)=>{let o=JSON.stringify(OA(l));return n.has(o)||(n.add(o),i.push({key:o,link:l})),i},[])}function cw(){let e=S.useContext(Ps);return gg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function MA(){let e=S.useContext(Id);return gg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var yg=S.createContext(void 0);yg.displayName="FrameworkContext";function dw(){let e=S.useContext(yg);return gg(e,"You must render this element inside a <HydratedRouter> element"),e}function LA(e,t){let n=S.useContext(yg),[i,l]=S.useState(!1),[o,u]=S.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=N=>{N.forEach(T=>{u(T.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),S.useEffect(()=>{if(i){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[i]);let x=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:Fo(f,x),onBlur:Fo(m,k),onMouseEnter:Fo(h,x),onMouseLeave:Fo(y,k),onTouchStart:Fo(g,x)}]:[!1,b,{}]}function Fo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function IA({page:e,...t}){let{router:n}=cw(),i=S.useMemo(()=>XS(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?S.createElement(BA,{page:e,matches:i,...t}):null}function UA(e){let{manifest:t,routeModules:n}=dw(),[i,l]=S.useState([]);return S.useEffect(()=>{let o=!1;return TA(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),i}function BA({page:e,matches:t,...n}){let i=yr(),{future:l,manifest:o,routeModules:u}=dw(),{basename:f}=cw(),{loaderData:m,matches:h}=MA(),y=S.useMemo(()=>N0(e,t,h,o,i,"data"),[e,t,h,o,i]),g=S.useMemo(()=>N0(e,t,h,o,i,"assets"),[e,t,h,o,i]),b=S.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let j=new Set,E=!1;if(t.forEach(T=>{var U;let D=o.routes[T.route.id];!D||!D.hasLoader||(!y.some(B=>B.route.id===T.route.id)&&T.route.id in m&&((U=u[T.route.id])!=null&&U.shouldRevalidate)||D.hasClientLoader?E=!0:j.add(T.route.id))}),j.size===0)return[];let N=_A(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&N.searchParams.set("_routes",t.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[N.pathname+N.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,i,o,y,t,e,u]),x=S.useMemo(()=>RA(g,o),[g,o]),k=UA(g);return S.createElement(S.Fragment,null,b.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>S.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function PA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $A=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$A&&(window.__reactRouterVersion="7.13.1")}catch{}function FA({basename:e,children:t,unstable_useTransitions:n,window:i}){let l=S.useRef();l.current==null&&(l.current=v2({window:i,v5Compat:!0}));let o=l.current,[u,f]=S.useState({action:o.action,location:o.location}),m=S.useCallback(h=>{n===!1?f(h):S.startTransition(()=>f(h))},[n]);return S.useLayoutEffect(()=>o.listen(m),[o,m]),S.createElement(gA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var fw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hw=S.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x,...k},j){let{basename:E,navigator:N,unstable_useTransitions:T}=S.useContext(er),D=typeof y=="string"&&fw.test(y),U=tw(y,E);y=U.to;let B=J2(y,{relative:l}),z=yr(),F=null;if(f){let W=Ld(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);E!=="/"&&(W.pathname=W.pathname==="/"?E:$r([E,W.pathname])),F=N.createHref(W)}let[Z,ee,q]=LA(i,k),ae=ZA(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:x,unstable_useTransitions:T});function re(W){t&&t(W),W.defaultPrevented||ae(W)}let pe=!(U.isExternal||o),fe=S.createElement("a",{...k,...q,href:(pe?F:void 0)||U.absoluteURL||B,onClick:pe?re:t,ref:PA(j,ee),target:h,"data-discover":!D&&n==="render"?"true":void 0});return Z&&!D?S.createElement(S.Fragment,null,fe,S.createElement(IA,{page:B})):fe});hw.displayName="Link";var mw=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},y){let g=Su(u,{relative:h.relative}),b=yr(),x=S.useContext(Id),{navigator:k,basename:j}=S.useContext(er),E=x!=null&&YA(g)&&f===!0,N=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,T=b.pathname,D=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(T=T.toLowerCase(),D=D?D.toLowerCase():null,N=N.toLowerCase()),D&&j&&(D=ba(D,j)||D);const U=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let B=T===N||!l&&T.startsWith(N)&&T.charAt(U)==="/",z=D!=null&&(D===N||!l&&D.startsWith(N)&&D.charAt(N.length)==="/"),F={isActive:B,isPending:z,isTransitioning:E},Z=B?t:void 0,ee;typeof i=="function"?ee=i(F):ee=[i,B?"active":null,z?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o(F):o;return S.createElement(hw,{...h,"aria-current":Z,className:ee,ref:y,style:q,to:u,viewTransition:f},typeof m=="function"?m(F):m)});mw.displayName="NavLink";var qA=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:l,state:o,method:u=fd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...x},k)=>{let{unstable_useTransitions:j}=S.useContext(er),E=GA(),N=KA(f,{relative:h}),T=u.toLowerCase()==="get"?"get":"post",D=typeof f=="string"&&fw.test(f),U=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let z=B.nativeEvent.submitter,F=(z==null?void 0:z.getAttribute("formmethod"))||u,Z=()=>E(z||B.currentTarget,{fetcherKey:t,method:F,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?S.startTransition(()=>Z()):Z()};return S.createElement("form",{ref:k,method:T,action:N,onSubmit:i?m:U,...x,"data-discover":!D&&e==="render"?"true":void 0})});qA.displayName="Form";function HA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pw(e){let t=S.useContext(Ps);return Et(t,HA(e)),t}function ZA(e,{target:t,replace:n,unstable_mask:i,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=qr(),g=yr(),b=Su(e,{relative:u});return S.useCallback(x=>{if(wA(x,t)){x.preventDefault();let k=n!==void 0?n:lu(g)===lu(b),j=()=>y(e,{replace:k,unstable_mask:i,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?S.startTransition(()=>j()):j()}},[g,y,b,n,i,l,t,e,o,u,f,m,h])}function vg(e){pr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(Ap(e)),n=S.useRef(!1),i=yr(),l=S.useMemo(()=>kA(i.search,n.current?null:t.current),[i.search]),o=qr(),u=S.useCallback((f,m)=>{const h=Ap(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var VA=0,QA=()=>`__${String(++VA)}__`;function GA(){let{router:e}=pw("useSubmit"),{basename:t}=S.useContext(er),n=fA(),i=e.fetch,l=e.navigate;return S.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=CA(o,t);if(u.navigate===!1){let b=u.fetcherKey||QA();await i(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,l,t,n])}function KA(e,{relative:t}={}){let{basename:n}=S.useContext(er),i=S.useContext(gr);Et(i,"useFormAction must be used inside a RouteContext");let[l]=i.matches.slice(-1),o={...Su(e||".",{relative:t})},u=yr();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:$r([n,o.pathname])),lu(o)}function YA(e,{relative:t}={}){let n=S.useContext(rw);Et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=pw("useViewTransitionState"),l=Su(e,{relative:t});if(!n.isTransitioning)return!1;let o=ba(n.currentLocation.pathname,i)||n.currentLocation.pathname,u=ba(n.nextLocation.pathname,i)||n.nextLocation.pathname;return wd(l.pathname,u)!=null||wd(l.pathname,o)!=null}const XA="/api/v1";async function JA(e,t){const n=await fetch(`${XA}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const i=await n.text();let l;try{l=JSON.parse(i).error??i}catch{l=i}throw new Error(l)}return await n.json()}const gw="/api/v1",bg="first-tree-hub:tokens";function xg(){const e=localStorage.getItem(bg);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function yw(e){localStorage.setItem(bg,JSON.stringify(e))}function vw(){localStorage.removeItem(bg)}class Bd extends Error{constructor(t,n,i){super(n),this.status=t,this.issues=i,this.name="ApiError"}}let qo=null;async function WA(e){return qo||(qo=(async()=>{try{const t=await fetch(`${gw}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),i={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return yw(i),i}catch{return null}finally{qo=null}})(),qo)}async function Qc(e,t){const{method:n="GET",body:i}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),i!==void 0&&(m["Content-Type"]="application/json"),fetch(`${gw}${e}`,{method:n,headers:m,body:i!==void 0?JSON.stringify(i):void 0})},o=xg();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await WA(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(vw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new Bd(u.status,m,h)}if(u.status!==204)return await u.json()}const De={get:e=>Qc(e),post:(e,t)=>Qc(e,{method:"POST",body:t}),patch:(e,t)=>Qc(e,{method:"PATCH",body:t}),delete:e=>Qc(e,{method:"DELETE"})},bw=S.createContext(null);function eT({children:e}){const[t,n]=S.useState(()=>!!xg()),[i,l]=S.useState(null),[o,u]=S.useState(null),[f,m]=S.useState(null),h=S.useCallback(()=>{vw(),n(!1),l(null),u(null),m(null)},[]),y=S.useCallback(async()=>{try{const b=await De.get("/me");l(b.member.role),u(b.member.id),m(b.member.agentId)}catch{}},[]),g=S.useCallback(async(b,x)=>{const k=await JA(b,x);yw({accessToken:k.accessToken,refreshToken:k.refreshToken}),n(!0),await De.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return S.useEffect(()=>{t&&!i&&y()},[t,i,y]),S.useEffect(()=>{const b=()=>h();return window.addEventListener("auth:logout",b),()=>window.removeEventListener("auth:logout",b)},[h]),d.jsx(bw.Provider,{value:{isAuthenticated:t,role:i,memberId:o,agentId:f,login:g,logout:h},children:e})}function ja(){const e=S.useContext(bw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function tT(){const{isAuthenticated:e}=ja();return e?d.jsx(_p,{}):d.jsx(pg,{to:"/login",replace:!0})}/**
61
- * @license lucide-react v0.577.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const xw=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
66
- * @license lucide-react v0.577.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const nT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
- * @license lucide-react v0.577.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const rT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());/**
76
- * @license lucide-react v0.577.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const A0=e=>{const t=rT(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
81
- * @license lucide-react v0.577.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */var aT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
86
- * @license lucide-react v0.577.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const iT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
91
- * @license lucide-react v0.577.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const lT=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:l="",children:o,iconNode:u,...f},m)=>S.createElement("svg",{ref:m,...aT,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:xw("lucide",l),...!o&&!iT(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,y])=>S.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
96
- * @license lucide-react v0.577.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const ot=(e,t)=>{const n=S.forwardRef(({className:i,...l},o)=>S.createElement(lT,{ref:o,iconNode:t,className:xw(`lucide-${nT(A0(e))}`,`lucide-${e}`,i),...l}));return n.displayName=A0(e),n};/**
101
- * @license lucide-react v0.577.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const sT=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],oT=ot("bell",sT);/**
106
- * @license lucide-react v0.577.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const uT=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],cT=ot("bot",uT);/**
111
- * @license lucide-react v0.577.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const dT=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],fT=ot("cable",dT);/**
116
- * @license lucide-react v0.577.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const hT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pd=ot("check",hT);/**
121
- * @license lucide-react v0.577.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const mT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],pT=ot("chevron-down",mT);/**
126
- * @license lucide-react v0.577.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const gT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yT=ot("chevron-right",gT);/**
131
- * @license lucide-react v0.577.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const vT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Sg=ot("copy",vT);/**
136
- * @license lucide-react v0.577.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const bT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],xT=ot("ellipsis",bT);/**
141
- * @license lucide-react v0.577.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const ST=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],wT=ot("funnel",ST);/**
146
- * @license lucide-react v0.577.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const kT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],jT=ot("layout-dashboard",kT);/**
151
- * @license lucide-react v0.577.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const ET=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Tp=ot("link-2",ET);/**
156
- * @license lucide-react v0.577.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const CT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],_T=ot("lock",CT);/**
161
- * @license lucide-react v0.577.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const NT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],AT=ot("log-out",NT);/**
166
- * @license lucide-react v0.577.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const TT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Sw=ot("message-square",TT);/**
171
- * @license lucide-react v0.577.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const RT=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],zT=ot("moon",RT);/**
176
- * @license lucide-react v0.577.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const OT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],DT=ot("paperclip",OT);/**
181
- * @license lucide-react v0.577.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const MT=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],LT=ot("pause",MT);/**
186
- * @license lucide-react v0.577.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const IT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$d=ot("pencil",IT);/**
191
- * @license lucide-react v0.577.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const UT=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],BT=ot("play",UT);/**
196
- * @license lucide-react v0.577.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const PT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gl=ot("plus",PT);/**
201
- * @license lucide-react v0.577.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const $T=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Fd=ot("search",$T);/**
206
- * @license lucide-react v0.577.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const FT=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],qT=ot("send",FT);/**
211
- * @license lucide-react v0.577.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const HT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ZT=ot("square",HT);/**
216
- * @license lucide-react v0.577.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const VT=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],QT=ot("sun",VT);/**
221
- * @license lucide-react v0.577.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const GT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],KT=ot("terminal",GT);/**
226
- * @license lucide-react v0.577.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const YT=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],su=ot("trash-2",YT);/**
231
- * @license lucide-react v0.577.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const XT=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],JT=ot("triangle-alert",XT);/**
236
- * @license lucide-react v0.577.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const WT=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],eR=ot("undo-2",WT);/**
241
- * @license lucide-react v0.577.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const tR=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],nR=ot("unplug",tR);/**
246
- * @license lucide-react v0.577.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const rR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Rp=ot("x",rR);function ww(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=ww(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function kw(){for(var e,t,n=0,i="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=ww(e))&&(i&&(i+=" "),i+=t);return i}const aR=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},iR=(e,t)=>({classGroupId:e,validator:t}),jw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kd="-",T0=[],lR="arbitrary..",sR=e=>{const t=uR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return oR(u);const f=u.split(kd),m=f[0]===""&&f.length>1?1:0;return Ew(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=i[u],h=n[u];return m?h?aR(h,m):m:h||T0}return n[u]||T0}}},Ew=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Ew(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(kd):e.slice(t).join(kd),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},oR=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?lR+i:void 0})(),uR=e=>{const{theme:t,classGroups:n}=e;return cR(n,t)},cR=(e,t)=>{const n=jw();for(const i in e){const l=e[i];wg(l,n,i,t)}return n},wg=(e,t,n,i)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];dR(u,t,n,i)}},dR=(e,t,n,i)=>{if(typeof e=="string"){fR(e,t,n);return}if(typeof e=="function"){hR(e,t,n,i);return}mR(e,t,n,i)},fR=(e,t,n)=>{const i=e===""?t:Cw(t,e);i.classGroupId=n},hR=(e,t,n,i)=>{if(pR(e)){wg(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(iR(n,e))},mR=(e,t,n,i)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];wg(m,Cw(t,f),n,i)}},Cw=(e,t)=>{let n=e;const i=t.split(kd),l=i.length;for(let o=0;o<l;o++){const u=i[o];let f=n.nextPart.get(u);f||(f=jw(),n.nextPart.set(u,f)),n=f}return n},pR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=i[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},zp="!",R0=":",yR=[],z0=(e,t,n,i,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:l}),vR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=l=>{const o=[];let u=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(u===0&&f===0){if(E===R0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,x=!1;g.endsWith(zp)?(b=g.slice(0,-1),x=!0):g.startsWith(zp)&&(b=g.slice(1),x=!0);const k=h&&h>m?h-m:void 0;return z0(o,x,b,k)};if(t){const l=t+R0,o=i;i=u=>u.startsWith(l)?o(u.slice(l.length)):z0(yR,!1,u,void 0,!0)}if(n){const l=i;i=o=>n({className:o,parseClassName:l})}return i},bR=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let l=[];for(let o=0;o<n.length;o++){const u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),i.push(...l),l=[]),i.push(u)):l.push(u)}return l.length>0&&(l.sort(),i.push(...l)),i}},xR=e=>({cache:gR(e.cacheSize),parseClassName:vR(e),sortModifiers:bR(e),...sR(e)}),SR=/\s+/,wR=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(SR);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,N=i(E?k.substring(0,j):k);if(!N){if(!E){m=y+(m.length>0?" "+m:m);continue}if(N=i(k),!N){m=y+(m.length>0?" "+m:m);continue}E=!1}const T=b.length===0?"":b.length===1?b[0]:o(b).join(":"),D=x?T+zp:T,U=D+N;if(u.indexOf(U)>-1)continue;u.push(U);const B=l(N,E);for(let z=0;z<B.length;++z){const F=B[z];u.push(D+F)}m=y+(m.length>0?" "+m:m)}return m},kR=(...e)=>{let t=0,n,i,l="";for(;t<e.length;)(n=e[t++])&&(i=_w(n))&&(l&&(l+=" "),l+=i);return l},_w=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=_w(e[i]))&&(n&&(n+=" "),n+=t);return n},jR=(e,...t)=>{let n,i,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=xR(h),i=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=i(m);if(h)return h;const y=wR(m,n);return l(m,y),y};return o=u,(...m)=>o(kR(...m))},ER=[],Zt=e=>{const t=n=>n[e]||ER;return t.isThemeGetter=!0,t},Nw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Aw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_R=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NR=/\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$/,AR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,TR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ni=e=>CR.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ri=e=>!!e&&Number.isInteger(Number(e)),Nm=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),da=e=>_R.test(e),Tw=()=>!0,zR=e=>NR.test(e)&&!AR.test(e),kg=()=>!1,OR=e=>TR.test(e),DR=e=>RR.test(e),MR=e=>!we(e)&&!ke(e),LR=e=>ji(e,Ow,kg),we=e=>Nw.test(e),Ji=e=>ji(e,Dw,zR),O0=e=>ji(e,HR,Fe),IR=e=>ji(e,Lw,Tw),UR=e=>ji(e,Mw,kg),D0=e=>ji(e,Rw,kg),BR=e=>ji(e,zw,DR),Gc=e=>ji(e,Iw,OR),ke=e=>Aw.test(e),Ho=e=>yl(e,Dw),PR=e=>yl(e,Mw),M0=e=>yl(e,Rw),$R=e=>yl(e,Ow),FR=e=>yl(e,zw),Kc=e=>yl(e,Iw,!0),qR=e=>yl(e,Lw,!0),ji=(e,t,n)=>{const i=Nw.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},yl=(e,t,n=!1)=>{const i=Aw.exec(e);return i?i[1]?t(i[1]):n:!1},Rw=e=>e==="position"||e==="percentage",zw=e=>e==="image"||e==="url",Ow=e=>e==="length"||e==="size"||e==="bg-size",Dw=e=>e==="length",HR=e=>e==="number",Mw=e=>e==="family-name",Lw=e=>e==="number"||e==="weight",Iw=e=>e==="shadow",ZR=()=>{const e=Zt("color"),t=Zt("font"),n=Zt("text"),i=Zt("font-weight"),l=Zt("tracking"),o=Zt("leading"),u=Zt("breakpoint"),f=Zt("container"),m=Zt("spacing"),h=Zt("radius"),y=Zt("shadow"),g=Zt("inset-shadow"),b=Zt("text-shadow"),x=Zt("drop-shadow"),k=Zt("blur"),j=Zt("perspective"),E=Zt("aspect"),N=Zt("ease"),T=Zt("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...U(),ke,we],z=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],Z=()=>[ke,we,m],ee=()=>[ni,"full","auto",...Z()],q=()=>[ri,"none","subgrid",ke,we],ae=()=>["auto",{span:["full",ri,ke,we]},ri,ke,we],re=()=>[ri,"auto",ke,we],pe=()=>["auto","min","max","fr",ke,we],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...Z()],V=()=>[ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],ce=()=>[ni,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],be=()=>[ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],R=()=>[e,ke,we],L=()=>[...U(),M0,D0,{position:[ke,we]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",$R,LR,{size:[ke,we]}],J=()=>[Nm,Ho,Ji],Y=()=>["","none","full",h,ke,we],ue=()=>["",Fe,Ho,Ji],ge=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Fe,Nm,M0,D0],_t=()=>["","none",k,ke,we],en=()=>["none",Fe,ke,we],Bn=()=>["none",Fe,ke,we],tr=()=>[Fe,ke,we],tn=()=>[ni,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[da],breakpoint:[da],color:[Tw],container:[da],"drop-shadow":[da],ease:["in","out","in-out"],font:[MR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[da],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[da],shadow:[da],spacing:["px",Fe],text:[da],"text-shadow":[da],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ni,we,ke,E]}],container:["container"],columns:[{columns:[Fe,we,ke,f]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:B()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[ri,"auto",ke,we]}],basis:[{basis:[ni,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,ni,"auto","initial","none",we]}],grow:[{grow:["",Fe,ke,we]}],shrink:[{shrink:["",Fe,ke,we]}],order:[{order:[ri,"first","last","none",ke,we]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...be()]}],"min-block-size":[{"min-block":["auto",...be()]}],"max-block-size":[{"max-block":["none",...be()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Ho,Ji]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,qR,IR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nm,we]}],"font-family":[{font:[PR,UR,t]}],"font-features":[{"font-features":[we]}],"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:[l,ke,we]}],"line-clamp":[{"line-clamp":[Fe,"none",ke,O0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",ke,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ke,Ji]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Fe,"auto",ke,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ri,ke,we],radial:["",ke,we],conic:[ri,ke,we]},FR,BR]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],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:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ke,we]}],"outline-w":[{outline:["",Fe,Ho,Ji]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",y,Kc,Gc]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",g,Kc,Gc]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Fe,Ji]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",b,Kc,Gc]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Fe,ke,we]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ke,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":U()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,we]}],filter:[{filter:["","none",ke,we]}],blur:[{blur:_t()}],brightness:[{brightness:[Fe,ke,we]}],contrast:[{contrast:[Fe,ke,we]}],"drop-shadow":[{"drop-shadow":["","none",x,Kc,Gc]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Fe,ke,we]}],"hue-rotate":[{"hue-rotate":[Fe,ke,we]}],invert:[{invert:["",Fe,ke,we]}],saturate:[{saturate:[Fe,ke,we]}],sepia:[{sepia:["",Fe,ke,we]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,we]}],"backdrop-blur":[{"backdrop-blur":_t()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ke,we]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ke,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ke,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ke,we]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ke,we]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ke,we]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ke,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ke,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ke,we]}],ease:[{ease:["linear","initial",N,ke,we]}],delay:[{delay:[Fe,ke,we]}],animate:[{animate:["none",T,ke,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,ke,we]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:en()}],"rotate-x":[{"rotate-x":en()}],"rotate-y":[{"rotate-y":en()}],"rotate-z":[{"rotate-z":en()}],scale:[{scale:Bn()}],"scale-x":[{"scale-x":Bn()}],"scale-y":[{"scale-y":Bn()}],"scale-z":[{"scale-z":Bn()}],"scale-3d":["scale-3d"],skew:[{skew:tr()}],"skew-x":[{"skew-x":tr()}],"skew-y":[{"skew-y":tr()}],transform:[{transform:[ke,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tn()}],"translate-x":[{"translate-x":tn()}],"translate-y":[{"translate-y":tn()}],"translate-z":[{"translate-z":tn()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,we]}],"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":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,we]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Fe,Ho,Ji,O0]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},VR=jR(ZR);function Te(...e){return VR(kw(e))}function xa(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"—"}function QR(e){return De.delete(`/clients/${encodeURIComponent(e)}`)}function wu(){return De.get("/admin/agents/activity")}function qd(){return De.get("/clients")}function GR(e){return De.post(`/clients/${e}/disconnect`)}function Uw(){return De.post("/connect-tokens")}const Bw=(e,t)=>["session",e,t],Op=e=>["agent-sessions",e];function KR(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function YR(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="sdk"&&t.source!=="runtime"&&t.source!=="tool"||typeof t.message!="string"?null:{source:t.source,message:t.message}}function XR(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Fs(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const i=n.toString();return De.get(`/admin/sessions/agents/${e}${i?`?${i}`:""}`)}function JR(e,t,n){const i=new URLSearchParams;i.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&i.set("cursor",String(n.cursor)),n!=null&&n.direction&&i.set("direction",n.direction);const l=i.toString();return De.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function WR(e,t){return De.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function ez(e,t){return De.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var L0=1,tz=.9,nz=.8,rz=.17,Am=.1,Tm=.999,az=.9999,iz=.99,lz=/[\\\/_+.#"@\[\(\{&]/,sz=/[\\\/_+.#"@\[\(\{&]/g,oz=/[\s-]/,Pw=/[\s-]/g;function Dp(e,t,n,i,l,o,u){if(o===t.length)return l===e.length?L0:iz;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=i.charAt(o),h=n.indexOf(m,l),y=0,g,b,x,k;h>=0;)g=Dp(e,t,n,i,h+1,o+1,u),g>y&&(h===l?g*=L0:lz.test(e.charAt(h-1))?(g*=nz,x=e.slice(l,h-1).match(sz),x&&l>0&&(g*=Math.pow(Tm,x.length))):oz.test(e.charAt(h-1))?(g*=tz,k=e.slice(l,h-1).match(Pw),k&&l>0&&(g*=Math.pow(Tm,k.length))):(g*=rz,l>0&&(g*=Math.pow(Tm,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=az)),(g<Am&&n.charAt(h-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&n.charAt(h-1)!==i.charAt(o))&&(b=Dp(e,t,n,i,h+1,o+2,u),b*Am>g&&(g=b*Am)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function I0(e){return e.toLowerCase().replace(Pw," ")}function uz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Dp(e,t,I0(e),I0(t),0,0,{})}function bi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function U0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xi(...e){return t=>{let n=!1;const i=e.map(l=>{const o=U0(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<i.length;l++){const o=i[l];typeof o=="function"?o():U0(e[l],null)}}}}function vl(...e){return S.useCallback(xi(...e),e)}function cz(e,t){const n=S.createContext(t),i=o=>{const{children:u,...f}=o,m=S.useMemo(()=>f,Object.values(f));return d.jsx(n.Provider,{value:m,children:u})};i.displayName=e+"Provider";function l(o){const u=S.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[i,l]}function dz(e,t=[]){let n=[];function i(o,u){const f=S.createContext(u),m=n.length;n=[...n,u];const h=g=>{var N;const{scope:b,children:x,...k}=g,j=((N=b==null?void 0:b[e])==null?void 0:N[m])||f,E=S.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:E,children:x})};h.displayName=o+"Provider";function y(g,b){var j;const x=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=S.useContext(x);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>S.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[i,fz(l,...t)]}function fz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const u=i.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var ou=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},hz=ig[" useId ".trim().toString()]||(()=>{}),mz=0;function ya(e){const[t,n]=S.useState(hz());return ou(()=>{n(i=>i??String(mz++))},[e]),t?`radix-${t}`:""}var pz=ig[" useInsertionEffect ".trim().toString()]||ou;function gz({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[l,o,u]=yz({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${i} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,i])}const h=S.useCallback(y=>{var g;if(f){const b=vz(y)?y(e):y;b!==e&&((g=u.current)==null||g.call(u,b))}else o(y)},[f,e,o,u]);return[m,h]}function yz({defaultProp:e,onChange:t}){const[n,i]=S.useState(e),l=S.useRef(n),o=S.useRef(t);return pz(()=>{o.current=t},[t]),S.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,i,o]}function vz(e){return typeof e=="function"}var $w=US();const bz=Md($w);function Fw(e){const t=xz(e),n=S.forwardRef((i,l)=>{const{children:o,...u}=i,f=S.Children.toArray(o),m=f.find(wz);if(m){const h=m.props.children,y=f.map(g=>g===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:g);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function xz(e){const t=S.forwardRef((n,i)=>{const{children:l,...o}=n;if(S.isValidElement(l)){const u=jz(l),f=kz(o,l.props);return l.type!==S.Fragment&&(f.ref=i?xi(i,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sz=Symbol("radix.slottable");function wz(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sz}function kz(e,t){const n={...t};for(const i in t){const l=e[i],o=t[i];/^on[A-Z]/.test(i)?l&&o?n[i]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[i]=l):i==="style"?n[i]={...l,...o}:i==="className"&&(n[i]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function jz(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ez=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ea=Ez.reduce((e,t)=>{const n=Fw(`Primitive.${t}`),i=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Cz(e,t){e&&$w.flushSync(()=>e.dispatchEvent(t))}function uu(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}function _z(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e);S.useEffect(()=>{const i=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var Nz="DismissableLayer",Mp="dismissableLayer.update",Az="dismissableLayer.pointerDownOutside",Tz="dismissableLayer.focusOutside",B0,qw=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hw=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=S.useContext(qw),[y,g]=S.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=S.useState({}),k=vl(t,F=>g(F)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=j.indexOf(E),T=y?j.indexOf(y):-1,D=h.layersWithOutsidePointerEventsDisabled.size>0,U=T>=N,B=Oz(F=>{const Z=F.target,ee=[...h.branches].some(q=>q.contains(Z));!U||ee||(l==null||l(F),u==null||u(F),F.defaultPrevented||f==null||f())},b),z=Dz(F=>{const Z=F.target;[...h.branches].some(q=>q.contains(Z))||(o==null||o(F),u==null||u(F),F.defaultPrevented||f==null||f())},b);return _z(F=>{T===h.layers.size-1&&(i==null||i(F),!F.defaultPrevented&&f&&(F.preventDefault(),f()))},b),S.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(B0=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),P0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=B0)}},[y,b,n,h]),S.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),P0())},[y,h]),S.useEffect(()=>{const F=()=>x({});return document.addEventListener(Mp,F),()=>document.removeEventListener(Mp,F)},[]),d.jsx(Ea.div,{...m,ref:k,style:{pointerEvents:D?U?"auto":"none":void 0,...e.style},onFocusCapture:bi(e.onFocusCapture,z.onFocusCapture),onBlurCapture:bi(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:bi(e.onPointerDownCapture,B.onPointerDownCapture)})});Hw.displayName=Nz;var Rz="DismissableLayerBranch",zz=S.forwardRef((e,t)=>{const n=S.useContext(qw),i=S.useRef(null),l=vl(t,i);return S.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(Ea.div,{...e,ref:l})});zz.displayName=Rz;function Oz(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e),i=S.useRef(!1),l=S.useRef(()=>{});return S.useEffect(()=>{const o=f=>{if(f.target&&!i.current){let m=function(){Zw(Az,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);i.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Dz(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e),i=S.useRef(!1);return S.useEffect(()=>{const l=o=>{o.target&&!i.current&&Zw(Tz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function P0(){const e=new CustomEvent(Mp);document.dispatchEvent(e)}function Zw(e,t,n,{discrete:i}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),i?Cz(l,o):l.dispatchEvent(o)}var Rm="focusScope.autoFocusOnMount",zm="focusScope.autoFocusOnUnmount",$0={bubbles:!1,cancelable:!0},Mz="FocusScope",Vw=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=S.useState(null),h=uu(l),y=uu(o),g=S.useRef(null),b=vl(t,j=>m(j)),x=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(i){let j=function(D){if(x.paused||!f)return;const U=D.target;f.contains(U)?g.current=U:li(g.current,{select:!0})},E=function(D){if(x.paused||!f)return;const U=D.relatedTarget;U!==null&&(f.contains(U)||li(g.current,{select:!0}))},N=function(D){if(document.activeElement===document.body)for(const B of D)B.removedNodes.length>0&&li(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const T=new MutationObserver(N);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),T.disconnect()}}},[i,f,x.paused]),S.useEffect(()=>{if(f){q0.add(x);const j=document.activeElement;if(!f.contains(j)){const N=new CustomEvent(Rm,$0);f.addEventListener(Rm,h),f.dispatchEvent(N),N.defaultPrevented||(Lz($z(Qw(f)),{select:!0}),document.activeElement===j&&li(f))}return()=>{f.removeEventListener(Rm,h),setTimeout(()=>{const N=new CustomEvent(zm,$0);f.addEventListener(zm,y),f.dispatchEvent(N),N.defaultPrevented||li(j??document.body,{select:!0}),f.removeEventListener(zm,y),q0.remove(x)},0)}}},[f,h,y,x]);const k=S.useCallback(j=>{if(!n&&!i||x.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,N=document.activeElement;if(E&&N){const T=j.currentTarget,[D,U]=Iz(T);D&&U?!j.shiftKey&&N===U?(j.preventDefault(),n&&li(D,{select:!0})):j.shiftKey&&N===D&&(j.preventDefault(),n&&li(U,{select:!0})):N===T&&j.preventDefault()}},[n,i,x.paused]);return d.jsx(Ea.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});Vw.displayName=Mz;function Lz(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(li(i,{select:t}),document.activeElement!==n)return}function Iz(e){const t=Qw(e),n=F0(t,e),i=F0(t.reverse(),e);return[n,i]}function Qw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function F0(e,t){for(const n of e)if(!Uz(n,{upTo:t}))return n}function Uz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bz(e){return e instanceof HTMLInputElement&&"select"in e}function li(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Bz(e)&&t&&e.select()}}var q0=Pz();function Pz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=H0(e,t),e.unshift(t)},remove(t){var n;e=H0(e,t),(n=e[0])==null||n.resume()}}}function H0(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function $z(e){return e.filter(t=>t.tagName!=="A")}var Fz="Portal",Gw=S.forwardRef((e,t)=>{var f;const{container:n,...i}=e,[l,o]=S.useState(!1);ou(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?bz.createPortal(d.jsx(Ea.div,{...i,ref:t}),u):null});Gw.displayName=Fz;function qz(e,t){return S.useReducer((n,i)=>t[n][i]??n,e)}var Hd=e=>{const{present:t,children:n}=e,i=Hz(t),l=typeof n=="function"?n({present:i.isPresent}):S.Children.only(n),o=vl(i.ref,Zz(l));return typeof n=="function"||i.isPresent?S.cloneElement(l,{ref:o}):null};Hd.displayName="Presence";function Hz(e){const[t,n]=S.useState(),i=S.useRef(null),l=S.useRef(e),o=S.useRef("none"),u=e?"mounted":"unmounted",[f,m]=qz(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const h=Yc(i.current);o.current=f==="mounted"?h:"none"},[f]),ou(()=>{const h=i.current,y=l.current;if(y!==e){const b=o.current,x=Yc(h);e?m("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==x?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),ou(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=x=>{const j=Yc(i.current).includes(CSS.escape(x.animationName));if(x.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=x=>{x.target===t&&(o.current=Yc(i.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(h=>{i.current=h?getComputedStyle(h):null,n(h)},[])}}function Yc(e){return(e==null?void 0:e.animationName)||"none"}function Zz(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Om=0;function Vz(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Z0()),document.body.insertAdjacentElement("beforeend",e[1]??Z0()),Om++,()=>{Om===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Om--}},[])}function Z0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Br=function(){return Br=Object.assign||function(t){for(var n,i=1,l=arguments.length;i<l;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)};function Kw(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]]);return n}function Qz(e,t,n){if(n||arguments.length===2)for(var i=0,l=t.length,o;i<l;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var md="right-scroll-bar-position",pd="width-before-scroll-bar",Gz="with-scroll-bars-hidden",Kz="--removed-body-scroll-bar-size";function Dm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yz(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var l=n.value;l!==i&&(n.value=i,n.callback(i,l))}}}})[0];return n.callback=t,n.facade}var Xz=typeof window<"u"?S.useLayoutEffect:S.useEffect,V0=new WeakMap;function Jz(e,t){var n=Yz(null,function(i){return e.forEach(function(l){return Dm(l,i)})});return Xz(function(){var i=V0.get(n);if(i){var l=new Set(i),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||Dm(f,null)}),o.forEach(function(f){l.has(f)||Dm(f,u)})}V0.set(n,e)},[e]),n}function Wz(e){return e}function eO(e,t){t===void 0&&(t=Wz);var n=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var u=t(o,i);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(i=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){i=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var y=u;u=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){u.push(y),h()},filter:function(y){return u=u.filter(y),n}}}};return l}function tO(e){e===void 0&&(e={});var t=eO(null);return t.options=Br({async:!0,ssr:!1},e),t}var Yw=function(e){var t=e.sideCar,n=Kw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return S.createElement(i,Br({},n))};Yw.isSideCarExport=!0;function nO(e,t){return e.useMedium(t),Yw}var Xw=tO(),Mm=function(){},Zd=S.forwardRef(function(e,t){var n=S.useRef(null),i=S.useState({onScrollCapture:Mm,onWheelCapture:Mm,onTouchMoveCapture:Mm}),l=i[0],o=i[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,x=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,N=e.as,T=N===void 0?"div":N,D=e.gapMode,U=Kw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=b,z=Jz([n,t]),F=Br(Br({},U),l);return S.createElement(S.Fragment,null,y&&S.createElement(B,{sideCar:Xw,removeScrollBar:h,shards:g,noRelative:x,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:D}),u?S.cloneElement(S.Children.only(f),Br(Br({},F),{ref:z})):S.createElement(T,Br({},F,{className:m,ref:z}),f))});Zd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zd.classNames={fullWidth:pd,zeroRight:md};var rO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rO();return t&&e.setAttribute("nonce",t),e}function iO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=aO())&&(iO(t,n),lO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oO=function(){var e=sO();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Jw=function(){var e=oO(),t=function(n){var i=n.styles,l=n.dynamic;return e(i,l),null};return t},uO={left:0,top:0,right:0,gap:0},Lm=function(e){return parseInt(e||"",10)||0},cO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Lm(n),Lm(i),Lm(l)]},dO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uO;var t=cO(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},fO=Jw(),vs="data-scroll-locked",hO=function(e,t,n,i){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
251
- .`.concat(Gz,` {
252
- overflow: hidden `).concat(i,`;
253
- padding-right: `).concat(f,"px ").concat(i,`;
254
- }
255
- body[`).concat(vs,`] {
256
- overflow: hidden `).concat(i,`;
257
- overscroll-behavior: contain;
258
- `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
259
- padding-left: `.concat(l,`px;
260
- padding-top: `).concat(o,`px;
261
- padding-right: `).concat(u,`px;
262
- margin-left:0;
263
- margin-top:0;
264
- margin-right: `).concat(f,"px ").concat(i,`;
265
- `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
266
- }
267
-
268
- .`).concat(md,` {
269
- right: `).concat(f,"px ").concat(i,`;
270
- }
271
-
272
- .`).concat(pd,` {
273
- margin-right: `).concat(f,"px ").concat(i,`;
274
- }
275
-
276
- .`).concat(md," .").concat(md,` {
277
- right: 0 `).concat(i,`;
278
- }
279
-
280
- .`).concat(pd," .").concat(pd,` {
281
- margin-right: 0 `).concat(i,`;
282
- }
283
-
284
- body[`).concat(vs,`] {
285
- `).concat(Kz,": ").concat(f,`px;
286
- }
287
- `)},Q0=function(){var e=parseInt(document.body.getAttribute(vs)||"0",10);return isFinite(e)?e:0},mO=function(){S.useEffect(function(){return document.body.setAttribute(vs,(Q0()+1).toString()),function(){var e=Q0()-1;e<=0?document.body.removeAttribute(vs):document.body.setAttribute(vs,e.toString())}},[])},pO=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;mO();var o=S.useMemo(function(){return dO(l)},[l]);return S.createElement(fO,{styles:hO(o,!t,l,n?"":"!important")})},Lp=!1;if(typeof window<"u")try{var Xc=Object.defineProperty({},"passive",{get:function(){return Lp=!0,!0}});window.addEventListener("test",Xc,Xc),window.removeEventListener("test",Xc,Xc)}catch{Lp=!1}var ss=Lp?{passive:!1}:!1,gO=function(e){return e.tagName==="TEXTAREA"},Ww=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gO(e)&&n[t]==="visible")},yO=function(e){return Ww(e,"overflowY")},vO=function(e){return Ww(e,"overflowX")},G0=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=ek(e,i);if(l){var o=tk(e,i),u=o[1],f=o[2];if(u>f)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},bO=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},xO=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},ek=function(e,t){return e==="v"?yO(t):vO(t)},tk=function(e,t){return e==="v"?bO(t):xO(t)},SO=function(e,t){return e==="h"&&t==="rtl"?-1:1},wO=function(e,t,n,i,l){var o=SO(e,window.getComputedStyle(t).direction),u=o*i,f=n.target,m=t.contains(f),h=!1,y=u>0,g=0,b=0;do{if(!f)break;var x=tk(e,f),k=x[0],j=x[1],E=x[2],N=j-E-o*k;(k||N)&&ek(e,f)&&(g+=N,b+=k);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(h=!0),h},Jc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K0=function(e){return[e.deltaX,e.deltaY]},Y0=function(e){return e&&"current"in e?e.current:e},kO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jO=function(e){return`
288
- .block-interactivity-`.concat(e,` {pointer-events: none;}
289
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
290
- `)},EO=0,os=[];function CO(e){var t=S.useRef([]),n=S.useRef([0,0]),i=S.useRef(),l=S.useState(EO++)[0],o=S.useState(Jw)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=Qz([e.lockRef.current],(e.shards||[]).map(Y0),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var N=Jc(j),T=n.current,D="deltaX"in j?j.deltaX:T[0]-N[0],U="deltaY"in j?j.deltaY:T[1]-N[1],B,z=j.target,F=Math.abs(D)>Math.abs(U)?"h":"v";if("touches"in j&&F==="h"&&z.type==="range")return!1;var Z=window.getSelection(),ee=Z&&Z.anchorNode,q=ee?ee===z||ee.contains(z):!1;if(q)return!1;var ae=G0(F,z);if(!ae)return!0;if(ae?B=F:(B=F==="v"?"h":"v",ae=G0(F,z)),!ae)return!1;if(!i.current&&"changedTouches"in j&&(D||U)&&(i.current=B),!B)return!0;var re=i.current||B;return wO(re,E,j,re==="h"?D:U)},[]),m=S.useCallback(function(j){var E=j;if(!(!os.length||os[os.length-1]!==o)){var N="deltaY"in E?K0(E):Jc(E),T=t.current.filter(function(B){return B.name===E.type&&(B.target===E.target||E.target===B.shadowParent)&&kO(B.delta,N)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var D=(u.current.shards||[]).map(Y0).filter(Boolean).filter(function(B){return B.contains(E.target)}),U=D.length>0?f(E,D[0]):!u.current.noIsolation;U&&E.cancelable&&E.preventDefault()}}},[]),h=S.useCallback(function(j,E,N,T){var D={name:j,delta:E,target:N,should:T,shadowParent:_O(N)};t.current.push(D),setTimeout(function(){t.current=t.current.filter(function(U){return U!==D})},1)},[]),y=S.useCallback(function(j){n.current=Jc(j),i.current=void 0},[]),g=S.useCallback(function(j){h(j.type,K0(j),j.target,f(j,e.lockRef.current))},[]),b=S.useCallback(function(j){h(j.type,Jc(j),j.target,f(j,e.lockRef.current))},[]);S.useEffect(function(){return os.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ss),document.addEventListener("touchmove",m,ss),document.addEventListener("touchstart",y,ss),function(){os=os.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ss),document.removeEventListener("touchmove",m,ss),document.removeEventListener("touchstart",y,ss)}},[]);var x=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(o,{styles:jO(l)}):null,x?S.createElement(pO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _O(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const NO=nO(Xw,CO);var nk=S.forwardRef(function(e,t){return S.createElement(Zd,Br({},e,{ref:t,sideCar:NO}))});nk.classNames=Zd.classNames;var AO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},us=new WeakMap,Wc=new WeakMap,ed={},Im=0,rk=function(e){return e&&(e.host||rk(e.parentNode))},TO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=rk(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},RO=function(e,t,n,i){var l=TO(t,Array.isArray(e)?e:[e]);ed[n]||(ed[n]=new WeakMap);var o=ed[n],u=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var x=b.getAttribute(i),k=x!==null&&x!=="false",j=(us.get(b)||0)+1,E=(o.get(b)||0)+1;us.set(b,j),o.set(b,E),u.push(b),j===1&&k&&Wc.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",b,N)}})};return y(t),f.clear(),Im++,function(){u.forEach(function(g){var b=us.get(g)-1,x=o.get(g)-1;us.set(g,b),o.set(g,x),b||(Wc.has(g)||g.removeAttribute(i),Wc.delete(g)),x||g.removeAttribute(n)}),Im--,Im||(us=new WeakMap,us=new WeakMap,Wc=new WeakMap,ed={})}},zO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=AO(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),RO(i,l,n,"aria-hidden")):function(){return null}},Vd="Dialog",[ak]=dz(Vd),[OO,_r]=ak(Vd),ik=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=S.useRef(null),m=S.useRef(null),[h,y]=gz({prop:i,defaultProp:l??!1,onChange:o,caller:Vd});return d.jsx(OO,{scope:t,triggerRef:f,contentRef:m,contentId:ya(),titleId:ya(),descriptionId:ya(),open:h,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};ik.displayName=Vd;var lk="DialogTrigger",sk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(lk,n),o=vl(t,l.triggerRef);return d.jsx(Ea.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Cg(l.open),...i,ref:o,onClick:bi(e.onClick,l.onOpenToggle)})});sk.displayName=lk;var jg="DialogPortal",[DO,ok]=ak(jg,{forceMount:void 0}),uk=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:l}=e,o=_r(jg,t);return d.jsx(DO,{scope:t,forceMount:n,children:S.Children.map(i,u=>d.jsx(Hd,{present:n||o.open,children:d.jsx(Gw,{asChild:!0,container:l,children:u})}))})};uk.displayName=jg;var jd="DialogOverlay",ck=S.forwardRef((e,t)=>{const n=ok(jd,e.__scopeDialog),{forceMount:i=n.forceMount,...l}=e,o=_r(jd,e.__scopeDialog);return o.modal?d.jsx(Hd,{present:i||o.open,children:d.jsx(LO,{...l,ref:t})}):null});ck.displayName=jd;var MO=Fw("DialogOverlay.RemoveScroll"),LO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(jd,n);return d.jsx(nk,{as:MO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Ea.div,{"data-state":Cg(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),dl="DialogContent",dk=S.forwardRef((e,t)=>{const n=ok(dl,e.__scopeDialog),{forceMount:i=n.forceMount,...l}=e,o=_r(dl,e.__scopeDialog);return d.jsx(Hd,{present:i||o.open,children:o.modal?d.jsx(IO,{...l,ref:t}):d.jsx(UO,{...l,ref:t})})});dk.displayName=dl;var IO=S.forwardRef((e,t)=>{const n=_r(dl,e.__scopeDialog),i=S.useRef(null),l=vl(t,n.contentRef,i);return S.useEffect(()=>{const o=i.current;if(o)return zO(o)},[]),d.jsx(fk,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bi(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:bi(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:bi(e.onFocusOutside,o=>o.preventDefault())})}),UO=S.forwardRef((e,t)=>{const n=_r(dl,e.__scopeDialog),i=S.useRef(!1),l=S.useRef(!1);return d.jsx(fk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(i.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),fk=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=_r(dl,n),m=S.useRef(null),h=vl(t,m);return Vz(),d.jsxs(d.Fragment,{children:[d.jsx(Vw,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx(Hw,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Cg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(BO,{titleId:f.titleId}),d.jsx($O,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Eg="DialogTitle",hk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(Eg,n);return d.jsx(Ea.h2,{id:l.titleId,...i,ref:t})});hk.displayName=Eg;var mk="DialogDescription",pk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(mk,n);return d.jsx(Ea.p,{id:l.descriptionId,...i,ref:t})});pk.displayName=mk;var gk="DialogClose",yk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(gk,n);return d.jsx(Ea.button,{type:"button",...i,ref:t,onClick:bi(e.onClick,()=>l.onOpenChange(!1))})});yk.displayName=gk;function Cg(e){return e?"open":"closed"}var vk="DialogTitleWarning",[XF,bk]=cz(vk,{contentName:dl,titleName:Eg,docsSlug:"dialog"}),BO=({titleId:e})=>{const t=bk(vk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
291
-
292
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
293
-
294
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},PO="DialogDescriptionWarning",$O=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bk(PO).contentName}}.`;return S.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},xk=ik,FO=sk,Sk=uk,wk=ck,kk=dk,qO=hk,HO=pk,ZO=yk,VO=Symbol.for("react.lazy"),Ed=ig[" use ".trim().toString()];function QO(e){return typeof e=="object"&&e!==null&&"then"in e}function jk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===VO&&"_payload"in e&&QO(e._payload)}function Ek(e){const t=KO(e),n=S.forwardRef((i,l)=>{let{children:o,...u}=i;jk(o)&&typeof Ed=="function"&&(o=Ed(o._payload));const f=S.Children.toArray(o),m=f.find(XO);if(m){const h=m.props.children,y=f.map(g=>g===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:g);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var GO=Ek("Slot");function KO(e){const t=S.forwardRef((n,i)=>{let{children:l,...o}=n;if(jk(l)&&typeof Ed=="function"&&(l=Ed(l._payload)),S.isValidElement(l)){const u=WO(l),f=JO(o,l.props);return l.type!==S.Fragment&&(f.ref=i?xi(i,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YO=Symbol("radix.slottable");function XO(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YO}function JO(e,t){const n={...t};for(const i in t){const l=e[i],o=t[i];/^on[A-Z]/.test(i)?l&&o?n[i]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[i]=l):i==="style"?n[i]={...l,...o}:i==="className"&&(n[i]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function WO(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ca=eD.reduce((e,t)=>{const n=Ek(`Primitive.${t}`),i=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),Zo='[cmdk-group=""]',Um='[cmdk-group-items=""]',tD='[cmdk-group-heading=""]',Ck='[cmdk-item=""]',X0=`${Ck}:not([aria-disabled="true"])`,Ip="cmdk-item-select",fs="data-value",nD=(e,t,n)=>uz(e,t,n),_k=S.createContext(void 0),ku=()=>S.useContext(_k),Nk=S.createContext(void 0),_g=()=>S.useContext(Nk),Ak=S.createContext(void 0),Tk=S.forwardRef((e,t)=>{let n=hs(()=>{var A,C;return{search:"",value:(C=(A=e.value)!=null?A:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=hs(()=>new Set),l=hs(()=>new Map),o=hs(()=>new Map),u=hs(()=>new Set),f=Rk(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:x,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...N}=e,T=ya(),D=ya(),U=ya(),B=S.useRef(null),z=hD();fl(()=>{if(y!==void 0){let A=y.trim();n.current.value=A,F.emit()}},[y]),fl(()=>{z(6,pe)},[]);let F=S.useMemo(()=>({subscribe:A=>(u.current.add(A),()=>u.current.delete(A)),snapshot:()=>n.current,setState:(A,C,J)=>{var Y,ue,ge,Me;if(!Object.is(n.current[A],C)){if(n.current[A]=C,A==="search")re(),q(),z(1,ae);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let xe=document.getElementById(U);xe?xe.focus():(Y=document.getElementById(T))==null||Y.focus()}if(z(7,()=>{var xe;n.current.selectedItemId=(xe=fe())==null?void 0:xe.id,F.emit()}),J||z(5,pe),((ue=f.current)==null?void 0:ue.value)!==void 0){let xe=C??"";(Me=(ge=f.current).onValueChange)==null||Me.call(ge,xe);return}}F.emit()}},emit:()=>{u.current.forEach(A=>A())}}),[]),Z=S.useMemo(()=>({value:(A,C,J)=>{var Y;C!==((Y=o.current.get(A))==null?void 0:Y.value)&&(o.current.set(A,{value:C,keywords:J}),n.current.filtered.items.set(A,ee(C,J)),z(2,()=>{q(),F.emit()}))},item:(A,C)=>(i.current.add(A),C&&(l.current.has(C)?l.current.get(C).add(A):l.current.set(C,new Set([A]))),z(3,()=>{re(),q(),n.current.value||ae(),F.emit()}),()=>{o.current.delete(A),i.current.delete(A),n.current.filtered.items.delete(A);let J=fe();z(4,()=>{re(),(J==null?void 0:J.getAttribute("id"))===A&&ae(),F.emit()})}),group:A=>(l.current.has(A)||l.current.set(A,new Set),()=>{o.current.delete(A),l.current.delete(A)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:T,inputId:U,labelId:D,listInnerRef:B}),[]);function ee(A,C){var J,Y;let ue=(Y=(J=f.current)==null?void 0:J.filter)!=null?Y:nD;return A?ue(A,n.current.search,C):0}function q(){if(!n.current.search||f.current.shouldFilter===!1)return;let A=n.current.filtered.items,C=[];n.current.filtered.groups.forEach(Y=>{let ue=l.current.get(Y),ge=0;ue.forEach(Me=>{let xe=A.get(Me);ge=Math.max(xe,ge)}),C.push([Y,ge])});let J=B.current;W().sort((Y,ue)=>{var ge,Me;let xe=Y.getAttribute("id"),_t=ue.getAttribute("id");return((ge=A.get(_t))!=null?ge:0)-((Me=A.get(xe))!=null?Me:0)}).forEach(Y=>{let ue=Y.closest(Um);ue?ue.appendChild(Y.parentElement===ue?Y:Y.closest(`${Um} > *`)):J.appendChild(Y.parentElement===J?Y:Y.closest(`${Um} > *`))}),C.sort((Y,ue)=>ue[1]-Y[1]).forEach(Y=>{var ue;let ge=(ue=B.current)==null?void 0:ue.querySelector(`${Zo}[${fs}="${encodeURIComponent(Y[0])}"]`);ge==null||ge.parentElement.appendChild(ge)})}function ae(){let A=W().find(J=>J.getAttribute("aria-disabled")!=="true"),C=A==null?void 0:A.getAttribute(fs);F.setState("value",C||void 0)}function re(){var A,C,J,Y;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ge of i.current){let Me=(C=(A=o.current.get(ge))==null?void 0:A.value)!=null?C:"",xe=(Y=(J=o.current.get(ge))==null?void 0:J.keywords)!=null?Y:[],_t=ee(Me,xe);n.current.filtered.items.set(ge,_t),_t>0&&ue++}for(let[ge,Me]of l.current)for(let xe of Me)if(n.current.filtered.items.get(xe)>0){n.current.filtered.groups.add(ge);break}n.current.filtered.count=ue}function pe(){var A,C,J;let Y=fe();Y&&(((A=Y.parentElement)==null?void 0:A.firstChild)===Y&&((J=(C=Y.closest(Zo))==null?void 0:C.querySelector(tD))==null||J.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function fe(){var A;return(A=B.current)==null?void 0:A.querySelector(`${Ck}[aria-selected="true"]`)}function W(){var A;return Array.from(((A=B.current)==null?void 0:A.querySelectorAll(X0))||[])}function P(A){let C=W()[A];C&&F.setState("value",C.getAttribute(fs))}function V(A){var C;let J=fe(),Y=W(),ue=Y.findIndex(Me=>Me===J),ge=Y[ue+A];(C=f.current)!=null&&C.loop&&(ge=ue+A<0?Y[Y.length-1]:ue+A===Y.length?Y[0]:Y[ue+A]),ge&&F.setState("value",ge.getAttribute(fs))}function ce(A){let C=fe(),J=C==null?void 0:C.closest(Zo),Y;for(;J&&!Y;)J=A>0?dD(J,Zo):fD(J,Zo),Y=J==null?void 0:J.querySelector(X0);Y?F.setState("value",Y.getAttribute(fs)):V(A)}let be=()=>P(W().length-1),R=A=>{A.preventDefault(),A.metaKey?be():A.altKey?ce(1):V(1)},L=A=>{A.preventDefault(),A.metaKey?P(0):A.altKey?ce(-1):V(-1)};return S.createElement(Ca.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:A=>{var C;(C=N.onKeyDown)==null||C.call(N,A);let J=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||J))switch(A.key){case"n":case"j":{E&&A.ctrlKey&&R(A);break}case"ArrowDown":{R(A);break}case"p":case"k":{E&&A.ctrlKey&&L(A);break}case"ArrowUp":{L(A);break}case"Home":{A.preventDefault(),P(0);break}case"End":{A.preventDefault(),be();break}case"Enter":{A.preventDefault();let Y=fe();if(Y){let ue=new Event(Ip);Y.dispatchEvent(ue)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:pD},m),Qd(e,A=>S.createElement(Nk.Provider,{value:F},S.createElement(_k.Provider,{value:Z},A))))}),rD=S.forwardRef((e,t)=>{var n,i;let l=ya(),o=S.useRef(null),u=S.useContext(Ak),f=ku(),m=Rk(e),h=(i=(n=m.current)==null?void 0:n.forceMount)!=null?i:u==null?void 0:u.forceMount;fl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=zk(l,o,[e.value,e.children,o],e.keywords),g=_g(),b=Si(z=>z.value&&z.value===y.current),x=Si(z=>h||f.filter()===!1?!0:z.search?z.filtered.items.get(l)>0:!0);S.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Ip,k),()=>z.removeEventListener(Ip,k)},[x,e.onSelect,e.disabled]);function k(){var z,F;j(),(F=(z=m.current).onSelect)==null||F.call(z,y.current)}function j(){g.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:N,onSelect:T,forceMount:D,keywords:U,...B}=e;return S.createElement(Ca.div,{ref:xi(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),aD=S.forwardRef((e,t)=>{let{heading:n,children:i,forceMount:l,...o}=e,u=ya(),f=S.useRef(null),m=S.useRef(null),h=ya(),y=ku(),g=Si(x=>l||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);fl(()=>y.group(u),[]),zk(u,f,[e.value,e.heading,m]);let b=S.useMemo(()=>({id:u,forceMount:l}),[l]);return S.createElement(Ca.div,{ref:xi(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&S.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Qd(e,x=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(Ak.Provider,{value:b},x))))}),iD=S.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,l=S.useRef(null),o=Si(u=>!u.search);return!n&&!o?null:S.createElement(Ca.div,{ref:xi(l,t),...i,"cmdk-separator":"",role:"separator"})}),lD=S.forwardRef((e,t)=>{let{onValueChange:n,...i}=e,l=e.value!=null,o=_g(),u=Si(h=>h.search),f=Si(h=>h.selectedItemId),m=ku();return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ca.input,{ref:t,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),sD=S.forwardRef((e,t)=>{let{children:n,label:i="Suggestions",...l}=e,o=S.useRef(null),u=S.useRef(null),f=Si(h=>h.selectedItemId),m=ku();return S.useEffect(()=>{if(u.current&&o.current){let h=u.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let x=h.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),S.createElement(Ca.div,{ref:xi(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":i,id:m.listId},Qd(e,h=>S.createElement("div",{ref:xi(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),oD=S.forwardRef((e,t)=>{let{open:n,onOpenChange:i,overlayClassName:l,contentClassName:o,container:u,...f}=e;return S.createElement(xk,{open:n,onOpenChange:i},S.createElement(Sk,{container:u},S.createElement(wk,{"cmdk-overlay":"",className:l}),S.createElement(kk,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(Tk,{ref:t,...f}))))}),uD=S.forwardRef((e,t)=>Si(n=>n.filtered.count===0)?S.createElement(Ca.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),cD=S.forwardRef((e,t)=>{let{progress:n,children:i,label:l="Loading...",...o}=e;return S.createElement(Ca.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Qd(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),Ln=Object.assign(Tk,{List:sD,Item:rD,Input:lD,Group:aD,Separator:iD,Dialog:oD,Empty:uD,Loading:cD});function dD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Rk(e){let t=S.useRef(e);return fl(()=>{t.current=e}),t}var fl=typeof window>"u"?S.useEffect:S.useLayoutEffect;function hs(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Si(e){let t=_g(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function zk(e,t,n,i=[]){let l=S.useRef(),o=ku();return fl(()=>{var u;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=i.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(fs,f),l.current=f}),l}var hD=()=>{let[e,t]=S.useState(),n=hs(()=>new Map);return fl(()=>{n.current.forEach(i=>i()),n.current=new Map},[e]),(i,l)=>{n.current.set(i,l),t({})}};function mD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Qd({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(mD(t),{ref:t.ref},n(t.props.children)):n(t)}var pD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const On=xk,gD=FO,yD=Sk,Ok=S.forwardRef(({className:e,...t},n)=>d.jsx(wk,{ref:n,className:Te("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ok.displayName="DialogOverlay";const wn=S.forwardRef(({className:e,children:t,...n},i)=>d.jsxs(yD,{children:[d.jsx(Ok,{}),d.jsxs(kk,{ref:i,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,d.jsxs(ZO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(Rp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wn.displayName="DialogContent";function Jn({className:e,...t}){return d.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Dn({className:e,...t}){return d.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Mn=S.forwardRef(({className:e,...t},n)=>d.jsx(qO,{ref:n,className:Te("text-subtitle leading-none tracking-tight",e),...t}));Mn.displayName="DialogTitle";const vD=S.forwardRef(({className:e,...t},n)=>d.jsx(HO,{ref:n,className:Te("text-body text-muted-foreground",e),...t}));vD.displayName="DialogDescription";const Dk=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Dk.displayName=Ln.displayName;function bD({open:e,onOpenChange:t,children:n}){return d.jsx(On,{open:e,onOpenChange:t,children:d.jsx(wn,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Dk,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})})}const Mk=S.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(Fd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(Ln.Input,{ref:n,className:Te("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Mk.displayName=Ln.Input.displayName;const Lk=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.List,{ref:n,className:Te("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Lk.displayName=Ln.List.displayName;const Ik=S.forwardRef((e,t)=>d.jsx(Ln.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Ik.displayName=Ln.Empty.displayName;const gd=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Group,{ref:n,className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));gd.displayName=Ln.Group.displayName;const Up=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));Up.displayName=Ln.Separator.displayName;const yd=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Item,{ref:n,className:Te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));yd.displayName=Ln.Item.displayName;function Ng(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return De.get(`/admin/agents${n?`?${n}`:""}`)}function xD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return De.get(`/admin/agents/all${n?`?${n}`:""}`)}function Uk(e){return De.get(`/admin/agents/${encodeURIComponent(e)}`)}function SD(e){return De.post("/admin/agents",e)}function J0(e,t){return De.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function wD(e){return De.delete(`/admin/agents/${encodeURIComponent(e)}`)}function kD(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function jD(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function ED(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Ei(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Ng({limit:100}),staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName??n.name??n.uuid);return n=>n?t.get(n)??n:"—"},[e])}const CD=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function _D({open:e,onOpenChange:t}){const n=qr(),i=Ei(),{data:l}=qe({queryKey:["activity"],queryFn:wu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=qe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await Fs(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return d.jsxs(bD,{open:e,onOpenChange:t,children:[d.jsx(Mk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(Lk,{children:[d.jsx(Ik,{children:"No results"}),o.length>0&&d.jsx(gd,{heading:"Agents",children:o.map(h=>{const y=i(h.agentId);return d.jsxs(yd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(cT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:y}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Up,{}),d.jsx(gd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=i(h);return d.jsxs(yd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[d.jsx(Sw,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:g}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),d.jsx(Up,{}),d.jsx(gd,{heading:"Pages",children:CD.map(h=>d.jsxs(yd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(jT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function ju(e){return d.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[d.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),d.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),d.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),d.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),d.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),d.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function Bp(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return De.get(`/admin/notifications${n?`?${n}`:""}`)}function Bk(e){return De.post(`/admin/notifications/${e}/read`)}function ND(){return De.post("/admin/notifications/read-all")}const AD={agent_error:"Error",session_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale",agent_disconnected:"Disconnected",agent_connected:"Connected",agent_needs_decision:"Decision",session_completed:"Completed"};function TD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Pk({notification:e,onClick:t,clickable:n}){const i=(AD[e.type]??e.type).toString(),l=TD(e.severity),o=n??!0;return d.jsxs("button",{type:"button",onClick:t,className:Te("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[d.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[d.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:i.replace("_"," ")}),d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:xa(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function RD(){var x;const[e,t]=S.useState(!1),[n,i]=S.useState(null),l=S.useRef(null),o=qr(),u=Wn(),{data:f}=qe({queryKey:["notifications","bell"],queryFn:()=>Bp({limit:8}),refetchInterval:1e4}),{data:m}=qe({queryKey:["notifications","unread-count"],queryFn:()=>Bp({read:!1,limit:100}),refetchInterval:1e4}),h=((x=m==null?void 0:m.items)==null?void 0:x.length)??0,y=h>0,g=S.useCallback(async k=>{k.read||(Bk(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),b=S.useCallback(async()=>{i(null);try{await ND(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){i(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[d.jsx(oT,{className:"h-4 w-4"}),y&&d.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),d.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&d.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&d.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),d.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?d.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>d.jsx(Pk,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function zD(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function OD(){const[e,t]=S.useState(zD);return S.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),d.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?d.jsx(QT,{className:"h-4 w-4"}):d.jsx(zT,{className:"h-4 w-4"})})}const W0=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],DD={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function MD(){const{role:e,logout:t}=ja(),n=e==="admin",[i,l]=S.useState(!1),o=n?[...W0,DD]:W0,u=yr(),f=u.pathname==="/"||u.search.includes("a=");return S.useEffect(()=>{const m=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),l(y=>!y))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),d.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[d.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(ju,{width:16,height:18,style:{color:"var(--fg)"}}),d.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",d.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(mw,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>Te("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:h?"var(--fg)":"var(--fg-3)",background:h?"var(--bg-hover)":"transparent"},children:[m.label,h&&d.jsx("span",{className:"kbd",children:m.kbd})]})},m.to))}),d.jsxs("div",{className:"flex items-center",style:{gap:6},children:[d.jsxs("button",{type:"button",onClick:()=>l(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(Fd,{className:"h-4 w-4"}),d.jsx("span",{children:"Jump to…"}),d.jsx("span",{className:"kbd",children:"⌘K"})]}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx(RD,{}),d.jsx(OD,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)] text-body",style:{padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",borderRadius:"var(--radius-input)",gap:6},"aria-label":"Log out",children:d.jsx(AT,{className:"h-4 w-4"})})]})]}),d.jsx(_D,{open:i,onOpenChange:l}),f?d.jsx(_p,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:d.jsx(_p,{})})})]})}function ie(e,t,n){function i(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=n!=null&&n.Parent?new o:this;i(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(u,"init",{value:i}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class bs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $k extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Fk={};function wi(e){return Fk}function qk(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,l])=>t.indexOf(+i)===-1).map(([i,l])=>l)}function Pp(e,t){return typeof t=="bigint"?t.toString():t}function Gd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ag(e){return e==null}function Tg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function LD(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let l=(i.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(i)){const m=i.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const e1=Symbol("evaluating");function lt(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==e1)return i===void 0&&(i=e1,i=n()),i},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function bl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ci(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function t1(e){return JSON.stringify(e)}function ID(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Hk="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const UD=Gd(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Os(e){if(cu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(cu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Zk(e){return Os(e)?{...e}:Array.isArray(e)?[...e]:e}const BD=new Set(["string","number","symbol"]);function Ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _i(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(i._zod.parent=e),i}function Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function PD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const $D={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function FD(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return bl(this,"shape",u),u},checks:[]});return _i(e,o)}function qD(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return bl(this,"shape",u),u},checks:[]});return _i(e,o)}function HD(e,t){if(!Os(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ci(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return bl(this,"shape",o),o}});return _i(e,l)}function ZD(e,t){if(!Os(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ci(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return bl(this,"shape",i),i}});return _i(e,n)}function VD(e,t){const n=Ci(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return bl(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return _i(e,n)}function QD(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ci(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return bl(this,"shape",m),m},checks:[]});return _i(t,u)}function GD(e,t,n){const i=Ci(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return bl(this,"shape",o),o}});return _i(t,i)}function ps(e,t=0){var n;if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(((n=e.issues[i])==null?void 0:n.continue)!==!0)return!0;return!1}function gs(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function td(e){return typeof e=="string"?e:e==null?void 0:e.message}function ki(e,t,n){var l,o,u,f,m,h;const i={...e,path:e.path??[]};if(!e.message){const y=td((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??td((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??td((m=n.customError)==null?void 0:m.call(n,e))??td((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";i.message=y}return delete i.inst,delete i.continue,t!=null&&t.reportInput||delete i.input,i}function Rg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function du(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const Vk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Qk=ie("$ZodError",Vk),Gk=ie("$ZodError",Vk,{Parent:Error});function KD(e,t=n=>n.message){const n={},i=[];for(const l of e.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):i.push(t(l));return{formErrors:i,fieldErrors:n}}function YD(e,t=n=>n.message){const n={_errors:[]},i=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(u=>i({issues:u}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return i(e),n}const zg=e=>(t,n,i,l)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new bs;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ki(m,o,wi())));throw Hk(f,l==null?void 0:l.callee),f}return u.value},Og=e=>async(t,n,i,l)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ki(m,o,wi())));throw Hk(f,l==null?void 0:l.callee),f}return u.value},Kd=e=>(t,n,i)=>{const l=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new bs;return o.issues.length?{success:!1,error:new(e??Qk)(o.issues.map(u=>ki(u,l,wi())))}:{success:!0,data:o.value}},XD=Kd(Gk),Yd=e=>async(t,n,i)=>{const l=i?Object.assign(i,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(u=>ki(u,l,wi())))}:{success:!0,data:o.value}},JD=Yd(Gk),WD=e=>(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return zg(e)(t,n,l)},e3=e=>(t,n,i)=>zg(e)(t,n,i),t3=e=>async(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Og(e)(t,n,l)},n3=e=>async(t,n,i)=>Og(e)(t,n,i),r3=e=>(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Kd(e)(t,n,l)},a3=e=>(t,n,i)=>Kd(e)(t,n,i),i3=e=>async(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Yd(e)(t,n,l)},l3=e=>async(t,n,i)=>Yd(e)(t,n,i),s3=/^[cC][^\s-]{8,}$/,o3=/^[0-9a-z]+$/,u3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,c3=/^[0-9a-vA-V]{20}$/,d3=/^[A-Za-z0-9]{27}$/,f3=/^[a-zA-Z0-9_-]{21}$/,h3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,m3=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,n1=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,p3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,g3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function y3(){return new RegExp(g3,"u")}const v3=/^(?:(?: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])$/,b3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,x3=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,S3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kk=/^[A-Za-z0-9_-]*$/,k3=/^\+[1-9]\d{6,14}$/,Yk="(?:(?:\\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])))",j3=new RegExp(`^${Yk}$`);function Xk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function E3(e){return new RegExp(`^${Xk(e)}$`)}function C3(e){const t=Xk({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Yk}T(?:${i})$`)}const _3=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},N3=/^-?\d+$/,Jk=/^-?\d+(?:\.\d+)?$/,A3=/^(?:true|false)$/i,T3=/^[^A-Z]*$/,R3=/^[^a-z]*$/,In=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wk={number:"number",bigint:"bigint",object:"date"},ej=ie("$ZodCheckLessThan",(e,t)=>{In.init(e,t);const n=Wk[typeof t.value];e._zod.onattach.push(i=>{const l=i._zod.bag,o=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tj=ie("$ZodCheckGreaterThan",(e,t)=>{In.init(e,t);const n=Wk[typeof t.value];e._zod.onattach.push(i=>{const l=i._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),z3=ie("$ZodCheckMultipleOf",(e,t)=>{In.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):LD(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),O3=ie("$ZodCheckNumberFormat",(e,t)=>{var u;In.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),i=n?"int":"number",[l,o]=$D[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,n&&(m.pattern=N3)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}m<l&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),D3=ie("$ZodCheckMaxLength",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=i=>{const l=i.value;return!Ag(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const l=i.value;if(l.length<=t.maximum)return;const u=Rg(l);i.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),M3=ie("$ZodCheckMinLength",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=i=>{const l=i.value;return!Ag(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const l=i.value;if(l.length>=t.minimum)return;const u=Rg(l);i.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),L3=ie("$ZodCheckLengthEquals",(e,t)=>{var n;In.init(e,t),(n=e._zod.def).when??(n.when=i=>{const l=i.value;return!Ag(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=i=>{const l=i.value,o=l.length;if(o===t.length)return;const u=Rg(l),f=o>t.length;i.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Xd=ie("$ZodCheckStringFormat",(e,t)=>{var n,i;In.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),I3=ie("$ZodCheckRegex",(e,t)=>{Xd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),U3=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=T3),Xd.init(e,t)}),B3=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=R3),Xd.init(e,t)}),P3=ie("$ZodCheckIncludes",(e,t)=>{In.init(e,t);const n=Ds(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),$3=ie("$ZodCheckStartsWith",(e,t)=>{In.init(e,t);const n=new RegExp(`^${Ds(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),F3=ie("$ZodCheckEndsWith",(e,t)=>{In.init(e,t);const n=new RegExp(`.*${Ds(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),q3=ie("$ZodCheckOverwrite",(e,t)=>{In.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class H3{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
295
- `).filter(u=>u),l=Math.min(...i.map(u=>u.length-u.trimStart().length)),o=i.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
296
- `))}}const Z3={major:4,minor:3,patch:6},Nt=ie("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Z3;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const u of o._zod.onattach)u(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=ps(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const x=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new bs;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==x&&(y||(y=ps(f,x)))});else{if(f.issues.length===x)continue;y||(y=ps(f,x))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(ps(f))return f.aborted=!0,f;const y=o(m,i,h);if(y instanceof Promise){if(h.async===!1)throw new bs;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>u(g,f,m)):u(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new bs;return h.then(y=>o(y,i,m))}return o(h,i,m)}}lt(e,"~standard",()=>({validate:o=>{var u;try{const f=XD(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return JD(e,o).then(m=>{var h;return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),Dg=ie("$ZodString",(e,t)=>{var n;Nt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??_3(e._zod.bag),e._zod.parse=(i,l)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),Ct=ie("$ZodStringFormat",(e,t)=>{Xd.init(e,t),Dg.init(e,t)}),V3=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=m3),Ct.init(e,t)}),Q3=ie("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=n1(i))}else t.pattern??(t.pattern=n1());Ct.init(e,t)}),G3=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=p3),Ct.init(e,t)}),K3=ie("$ZodURL",(e,t)=>{Ct.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),l=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Y3=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=y3()),Ct.init(e,t)}),X3=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=f3),Ct.init(e,t)}),J3=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=s3),Ct.init(e,t)}),W3=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=o3),Ct.init(e,t)}),eM=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=u3),Ct.init(e,t)}),tM=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=c3),Ct.init(e,t)}),nM=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=d3),Ct.init(e,t)}),rM=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=C3(t)),Ct.init(e,t)}),aM=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=j3),Ct.init(e,t)}),iM=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=E3(t)),Ct.init(e,t)}),lM=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=h3),Ct.init(e,t)}),sM=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=v3),Ct.init(e,t),e._zod.bag.format="ipv4"}),oM=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=b3),Ct.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),uM=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=x3),Ct.init(e,t)}),cM=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=S3),Ct.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[l,o]=i;if(!o)throw new Error;const u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function nj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const dM=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=w3),Ct.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{nj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function fM(e){if(!Kk.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return nj(n)}const hM=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Kk),Ct.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{fM(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),mM=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=k3),Ct.init(e,t)});function pM(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const l=JSON.parse(atob(i));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const gM=ie("$ZodJWT",(e,t)=>{Ct.init(e,t),e._zod.check=n=>{pM(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rj=ie("$ZodNumber",(e,t)=>{Nt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Jk,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),yM=ie("$ZodNumberFormat",(e,t)=>{O3.init(e,t),rj.init(e,t)}),vM=ie("$ZodBoolean",(e,t)=>{Nt.init(e,t),e._zod.pattern=A3,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),bM=ie("$ZodUnknown",(e,t)=>{Nt.init(e,t),e._zod.parse=n=>n}),xM=ie("$ZodNever",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function r1(e,t,n){e.issues.length&&t.issues.push(...gs(n,e.issues)),t.value[n]=e.value}const SM=ie("$ZodArray",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},i);m instanceof Promise?o.push(m.then(h=>r1(h,n,u))):r1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function Cd(e,t,n,i,l){if(e.issues.length){if(l&&!(n in i))return;t.issues.push(...gs(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function aj(e){var i,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(i=e.shape)==null?void 0:i[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=PD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ij(e,t,n,i,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){u.push(g);continue}const b=m.run({value:t[g],issues:[]},i);b instanceof Promise?e.push(b.then(x=>Cd(x,n,g,t,y))):Cd(b,n,g,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const wM=ie("$ZodObject",(e,t)=>{Nt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const i=Gd(()=>aj(t));lt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=cu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=i.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const y=[],g=u.shape;for(const b of u.keys){const x=g[b],k=x._zod.optout==="optional",j=x._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>Cd(E,f,b,h,k))):Cd(j,f,b,h,k)}return o?ij(y,h,f,m,i.value,e):y.length?Promise.all(y).then(()=>f):f}}),kM=ie("$ZodObjectJIT",(e,t)=>{wM.init(e,t);const n=e._zod.parse,i=Gd(()=>aj(t)),l=b=>{var D;const x=new H3(["shape","payload","ctx"]),k=i.value,j=U=>{const B=t1(U);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const U of k.keys)E[U]=`key_${N++}`;x.write("const newResult = {};");for(const U of k.keys){const B=E[U],z=t1(U),F=b[U],Z=((D=F==null?void 0:F._zod)==null?void 0:D.optout)==="optional";x.write(`const ${B} = ${j(U)};`),Z?x.write(`
297
- if (${B}.issues.length) {
298
- if (${z} in input) {
299
- payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
300
- ...iss,
301
- path: iss.path ? [${z}, ...iss.path] : [${z}]
302
- })));
303
- }
304
- }
305
-
306
- if (${B}.value === undefined) {
307
- if (${z} in input) {
308
- newResult[${z}] = undefined;
309
- }
310
- } else {
311
- newResult[${z}] = ${B}.value;
312
- }
313
-
314
- `):x.write(`
315
- if (${B}.issues.length) {
316
- payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
317
- ...iss,
318
- path: iss.path ? [${z}, ...iss.path] : [${z}]
319
- })));
320
- }
321
-
322
- if (${B}.value === undefined) {
323
- if (${z} in input) {
324
- newResult[${z}] = undefined;
325
- }
326
- } else {
327
- newResult[${z}] = ${B}.value;
328
- }
329
-
330
- `)}x.write("payload.value = newResult;"),x.write("return payload;");const T=x.compile();return(U,B)=>T(b,U,B)};let o;const u=cu,f=!Fk.jitless,h=f&&UD.value,y=t.catchall;let g;e._zod.parse=(b,x)=>{g??(g=i.value);const k=b.value;return u(k)?f&&h&&(x==null?void 0:x.async)===!1&&x.jitless!==!0?(o||(o=l(t.shape)),b=o(b,x),y?ij([],k,b,x,g,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function a1(e,t,n,i){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ps(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>ki(u,i,wi())))}),t)}const lj=ie("$ZodUnion",(e,t)=>{Nt.init(e,t),lt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),lt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),lt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),lt(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>Tg(o.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return i(l,o);let u=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>a1(m,l,e,o)):a1(f,l,e,o)}}),jM=ie("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lj.init(e,t);const n=e._zod.parse;lt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const i=Gd(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const u=l.value;if(!cu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=i.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),EM=ie("$ZodIntersection",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},i),u=t.right._zod.run({value:l,issues:[]},i);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>i1(n,m,h)):i1(n,o,u)}});function $p(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Os(e)&&Os(t)){const n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of i){const u=$p(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const l=e[i],o=t[i],u=$p(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[i,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function i1(e,t,n){const i=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)i.has(m)||i.set(m,{}),i.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)i.has(m)||i.set(m,{}),i.get(m).r=!0;else e.issues.push(f);const o=[...i].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ps(e))return e;const u=$p(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const CM=ie("$ZodRecord",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{const l=n.value;if(!Os(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},i);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...gs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...gs(h,y.issues)),n.value[h]=y.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Jk.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},i);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>ki(g,i,wi())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},i);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...gs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...gs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),_M=ie("$ZodEnum",(e,t)=>{Nt.init(e,t);const n=qk(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(l=>BD.has(typeof l)).map(l=>typeof l=="string"?Ds(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return i.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),NM=ie("$ZodLiteral",(e,t)=>{if(Nt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Ds(i):i?Ds(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,l)=>{const o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),AM=ie("$ZodTransform",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new $k(e.constructor.name);const l=t.transform(n.value,n);if(i.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new bs;return n.value=l,n}});function l1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const sj=ie("$ZodOptional",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Tg(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>l1(o,n.value)):l1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),TM=ie("$ZodExactOptional",(e,t)=>{sj.init(e,t),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),RM=ie("$ZodNullable",(e,t)=>{Nt.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Tg(n.source)}|null)$`):void 0}),lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),zM=ie("$ZodDefault",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>s1(o,t)):s1(l,t)}});function s1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const OM=ie("$ZodPrefault",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),DM=ie("$ZodNonOptional",(e,t)=>{Nt.init(e,t),lt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>o1(o,e)):o1(l,e)}});function o1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const MM=ie("$ZodCatch",(e,t)=>{Nt.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>ki(u,i,wi()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>ki(o,i,wi()))},input:n.value}),n.issues=[]),n)}}),LM=ie("$ZodPipe",(e,t)=>{Nt.init(e,t),lt(e._zod,"values",()=>t.in._zod.values),lt(e._zod,"optin",()=>t.in._zod.optin),lt(e._zod,"optout",()=>t.out._zod.optout),lt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const o=t.out._zod.run(n,i);return o instanceof Promise?o.then(u=>nd(u,t.in,i)):nd(o,t.in,i)}const l=t.in._zod.run(n,i);return l instanceof Promise?l.then(o=>nd(o,t.out,i)):nd(l,t.out,i)}});function nd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const IM=ie("$ZodReadonly",(e,t)=>{Nt.init(e,t),lt(e._zod,"propValues",()=>t.innerType._zod.propValues),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"optin",()=>{var n,i;return(i=(n=t.innerType)==null?void 0:n._zod)==null?void 0:i.optin}),lt(e._zod,"optout",()=>{var n,i;return(i=(n=t.innerType)==null?void 0:n._zod)==null?void 0:i.optout}),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(u1):u1(l)}});function u1(e){return e.value=Object.freeze(e.value),e}const UM=ie("$ZodCustom",(e,t)=>{In.init(e,t),Nt.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,l=t.fn(i);if(l instanceof Promise)return l.then(o=>c1(o,n,i,e));c1(l,n,i,e)}});function c1(e,t,n,i){if(!e){const l={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(l.params=i._zod.def.params),t.issues.push(du(l))}}var d1;class BM{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const l={...i,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function PM(){return new BM}(d1=globalThis).__zod_globalRegistry??(d1.__zod_globalRegistry=PM());const Xo=globalThis.__zod_globalRegistry;function $M(e,t){return new e({type:"string",...Ce(t)})}function FM(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function f1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function qM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function HM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function ZM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function VM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function QM(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function GM(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function KM(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function YM(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function XM(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function JM(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function WM(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function e4(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function t4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function n4(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function r4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function a4(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function i4(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function l4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function s4(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function o4(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function u4(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function c4(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function d4(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function f4(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function h4(e,t){return new e({type:"number",checks:[],...Ce(t)})}function m4(e,t){return new e({type:"number",coerce:!0,checks:[],...Ce(t)})}function p4(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function g4(e,t){return new e({type:"boolean",...Ce(t)})}function y4(e){return new e({type:"unknown"})}function v4(e,t){return new e({type:"never",...Ce(t)})}function h1(e,t){return new ej({check:"less_than",...Ce(t),value:e,inclusive:!1})}function Bm(e,t){return new ej({check:"less_than",...Ce(t),value:e,inclusive:!0})}function m1(e,t){return new tj({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function Pm(e,t){return new tj({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function p1(e,t){return new z3({check:"multiple_of",...Ce(t),value:e})}function oj(e,t){return new D3({check:"max_length",...Ce(t),maximum:e})}function _d(e,t){return new M3({check:"min_length",...Ce(t),minimum:e})}function uj(e,t){return new L3({check:"length_equals",...Ce(t),length:e})}function b4(e,t){return new I3({check:"string_format",format:"regex",...Ce(t),pattern:e})}function x4(e){return new U3({check:"string_format",format:"lowercase",...Ce(e)})}function S4(e){return new B3({check:"string_format",format:"uppercase",...Ce(e)})}function w4(e,t){return new P3({check:"string_format",format:"includes",...Ce(t),includes:e})}function k4(e,t){return new $3({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function j4(e,t){return new F3({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function qs(e){return new q3({check:"overwrite",tx:e})}function E4(e){return qs(t=>t.normalize(e))}function C4(){return qs(e=>e.trim())}function _4(){return qs(e=>e.toLowerCase())}function N4(){return qs(e=>e.toUpperCase())}function A4(){return qs(e=>ID(e))}function T4(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function R4(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function z4(e){const t=O4(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(du(i,n.value,t._zod.def));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(du(l))}},e(n.value,n)));return t}function O4(e,t){const n=new In({check:"custom",...Ce(t)});return n._zod.check=e,n}function cj(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Xo,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Ft(e,t,n={path:[],schemaPath:[]}){var y,g;var i;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)u.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,b);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const x=e._zod.parent;x&&(u.ref||(u.ref=x),Ft(x,t,b),t.seen.get(x).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&yn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((i=u.schema).default??(i.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function dj(e,t){var u,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const y of e.seen.entries()){const g=(u=e.metadataRegistry.get(y[0]))==null?void 0:u.id;if(g){const b=i.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,N=e.external.uri??(D=>D);if(E)return{ref:N(E)};const T=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=T,{defId:T,ref:`${N("__shared")}#/${g}/${T}`}}if(y[1]===n)return{ref:"#"};const x=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:x+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:x}=l(y);g.def={...g.schema},x&&(g.defId=x);const k=g.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
331
-
332
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const x=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&x){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function fj(e,t){var u,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},x=y.ref;if(y.ref=null,x){i(x);const j=e.seen.get(x),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,b),h._zod.parent===x)for(const T in g)T==="$ref"||T==="allOf"||T in b||delete g[T];if(E.$ref&&j.def)for(const T in g)T==="$ref"||T==="allOf"||T in j.def&&JSON.stringify(g[T])===JSON.stringify(j.def[T])&&delete g[T]}const k=h._zod.parent;if(k&&k!==x){i(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}e.override({zodSchema:h,jsonSchema:g,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())i(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(u=e.external)!=null&&u.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Nd(t,"input",e.processors),output:Nd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return yn(i.element,n);if(i.type==="set")return yn(i.valueType,n);if(i.type==="lazy")return yn(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return yn(i.innerType,n);if(i.type==="intersection")return yn(i.left,n)||yn(i.right,n);if(i.type==="record"||i.type==="map")return yn(i.keyType,n)||yn(i.valueType,n);if(i.type==="pipe")return yn(i.in,n)||yn(i.out,n);if(i.type==="object"){for(const l in i.shape)if(yn(i.shape[l],n))return!0;return!1}if(i.type==="union"){for(const l of i.options)if(yn(l,n))return!0;return!1}if(i.type==="tuple"){for(const l of i.items)if(yn(l,n))return!0;return!!(i.rest&&yn(i.rest,n))}return!1}const D4=(e,t={})=>n=>{const i=cj({...n,processors:t});return Ft(e,i),dj(i,e),fj(i,e)},Nd=(e,t,n={})=>i=>{const{libraryOptions:l,target:o}=i??{},u=cj({...l??{},target:o,io:t,processors:n});return Ft(e,u),dj(u,e),fj(u,e)},M4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},L4=(e,t,n,i)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=M4[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},I4=(e,t,n,i)=>{const l=n,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},U4=(e,t,n,i)=>{n.type="boolean"},B4=(e,t,n,i)=>{n.not={}},P4=(e,t,n,i)=>{},$4=(e,t,n,i)=>{const l=e._zod.def,o=qk(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},F4=(e,t,n,i)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},q4=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},H4=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Z4=(e,t,n,i)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Ft(o.element,t,{...i,path:[...i.path,"items"]})},V4=(e,t,n,i)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const y in u)l.properties[y]=Ft(u[y],t,{...i,path:[...i.path,"properties",y]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Ft(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},Q4=(e,t,n,i)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Ft(f,t,{...i,path:[...i.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},G4=(e,t,n,i)=>{const l=e._zod.def,o=Ft(l.left,t,{...i,path:[...i.path,"allOf",0]}),u=Ft(l.right,t,{...i,path:[...i.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(u)?u.allOf:[u]];n.allOf=m},K4=(e,t,n,i)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Ft(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});l.patternProperties={};for(const g of m)l.patternProperties[g.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Ft(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),l.additionalProperties=Ft(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const h=u._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},Y4=(e,t,n,i)=>{const l=e._zod.def,o=Ft(l.innerType,t,i),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},X4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType},J4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},W4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},e5=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},t5=(e,t,n,i)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Ft(o,t,i);const u=t.seen.get(e);u.ref=o},n5=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},hj=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType},r5=ie("ZodISODateTime",(e,t)=>{rM.init(e,t),Tt.init(e,t)});function a5(e){return u4(r5,e)}const i5=ie("ZodISODate",(e,t)=>{aM.init(e,t),Tt.init(e,t)});function l5(e){return c4(i5,e)}const s5=ie("ZodISOTime",(e,t)=>{iM.init(e,t),Tt.init(e,t)});function o5(e){return d4(s5,e)}const u5=ie("ZodISODuration",(e,t)=>{lM.init(e,t),Tt.init(e,t)});function c5(e){return f4(u5,e)}const d5=(e,t)=>{Qk.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>YD(e,n)},flatten:{value:n=>KD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Pp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Pp,2)}},isEmpty:{get(){return e.issues.length===0}}})},vr=ie("ZodError",d5,{Parent:Error}),f5=zg(vr),h5=Og(vr),m5=Kd(vr),p5=Yd(vr),g5=WD(vr),y5=e3(vr),v5=t3(vr),b5=n3(vr),x5=r3(vr),S5=a3(vr),w5=i3(vr),k5=l3(vr),At=ie("ZodType",(e,t)=>(Nt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nd(e,"input"),output:Nd(e,"output")}}),e.toJSONSchema=D4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ci(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>_i(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>f5(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>m5(e,n,i),e.parseAsync=async(n,i)=>h5(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>p5(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>g5(e,n,i),e.decode=(n,i)=>y5(e,n,i),e.encodeAsync=async(n,i)=>v5(e,n,i),e.decodeAsync=async(n,i)=>b5(e,n,i),e.safeEncode=(n,i)=>x5(e,n,i),e.safeDecode=(n,i)=>S5(e,n,i),e.safeEncodeAsync=async(n,i)=>w5(e,n,i),e.safeDecodeAsync=async(n,i)=>k5(e,n,i),e.refine=(n,i)=>e.check(g6(n,i)),e.superRefine=n=>e.check(y6(n)),e.overwrite=n=>e.check(qs(n)),e.optional=()=>v1(e),e.exactOptional=()=>r6(e),e.nullable=()=>b1(e),e.nullish=()=>v1(b1(e)),e.nonoptional=n=>u6(e,n),e.array=()=>Yn(e),e.or=n=>gj([e,n]),e.and=n=>X5(e,n),e.transform=n=>x1(e,t6(n)),e.default=n=>l6(e,n),e.prefault=n=>o6(e,n),e.catch=n=>d6(e,n),e.pipe=n=>x1(e,n),e.readonly=()=>m6(e),e.describe=n=>{const i=e.clone();return Xo.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){var n;return(n=Xo.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Xo.get(e);const i=e.clone();return Xo.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),mj=ie("_ZodString",(e,t)=>{Dg.init(e,t),At.init(e,t),e._zod.processJSONSchema=(i,l,o)=>L4(e,i,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(b4(...i)),e.includes=(...i)=>e.check(w4(...i)),e.startsWith=(...i)=>e.check(k4(...i)),e.endsWith=(...i)=>e.check(j4(...i)),e.min=(...i)=>e.check(_d(...i)),e.max=(...i)=>e.check(oj(...i)),e.length=(...i)=>e.check(uj(...i)),e.nonempty=(...i)=>e.check(_d(1,...i)),e.lowercase=i=>e.check(x4(i)),e.uppercase=i=>e.check(S4(i)),e.trim=()=>e.check(C4()),e.normalize=(...i)=>e.check(E4(...i)),e.toLowerCase=()=>e.check(_4()),e.toUpperCase=()=>e.check(N4()),e.slugify=()=>e.check(A4())}),j5=ie("ZodString",(e,t)=>{Dg.init(e,t),mj.init(e,t),e.email=n=>e.check(FM(E5,n)),e.url=n=>e.check(QM(C5,n)),e.jwt=n=>e.check(o4($5,n)),e.emoji=n=>e.check(GM(_5,n)),e.guid=n=>e.check(f1(g1,n)),e.uuid=n=>e.check(qM(rd,n)),e.uuidv4=n=>e.check(HM(rd,n)),e.uuidv6=n=>e.check(ZM(rd,n)),e.uuidv7=n=>e.check(VM(rd,n)),e.nanoid=n=>e.check(KM(N5,n)),e.guid=n=>e.check(f1(g1,n)),e.cuid=n=>e.check(YM(A5,n)),e.cuid2=n=>e.check(XM(T5,n)),e.ulid=n=>e.check(JM(R5,n)),e.base64=n=>e.check(i4(U5,n)),e.base64url=n=>e.check(l4(B5,n)),e.xid=n=>e.check(WM(z5,n)),e.ksuid=n=>e.check(e4(O5,n)),e.ipv4=n=>e.check(t4(D5,n)),e.ipv6=n=>e.check(n4(M5,n)),e.cidrv4=n=>e.check(r4(L5,n)),e.cidrv6=n=>e.check(a4(I5,n)),e.e164=n=>e.check(s4(P5,n)),e.datetime=n=>e.check(a5(n)),e.date=n=>e.check(l5(n)),e.time=n=>e.check(o5(n)),e.duration=n=>e.check(c5(n))});function O(e){return $M(j5,e)}const Tt=ie("ZodStringFormat",(e,t)=>{Ct.init(e,t),mj.init(e,t)}),E5=ie("ZodEmail",(e,t)=>{G3.init(e,t),Tt.init(e,t)}),g1=ie("ZodGUID",(e,t)=>{V3.init(e,t),Tt.init(e,t)}),rd=ie("ZodUUID",(e,t)=>{Q3.init(e,t),Tt.init(e,t)}),C5=ie("ZodURL",(e,t)=>{K3.init(e,t),Tt.init(e,t)}),_5=ie("ZodEmoji",(e,t)=>{Y3.init(e,t),Tt.init(e,t)}),N5=ie("ZodNanoID",(e,t)=>{X3.init(e,t),Tt.init(e,t)}),A5=ie("ZodCUID",(e,t)=>{J3.init(e,t),Tt.init(e,t)}),T5=ie("ZodCUID2",(e,t)=>{W3.init(e,t),Tt.init(e,t)}),R5=ie("ZodULID",(e,t)=>{eM.init(e,t),Tt.init(e,t)}),z5=ie("ZodXID",(e,t)=>{tM.init(e,t),Tt.init(e,t)}),O5=ie("ZodKSUID",(e,t)=>{nM.init(e,t),Tt.init(e,t)}),D5=ie("ZodIPv4",(e,t)=>{sM.init(e,t),Tt.init(e,t)}),M5=ie("ZodIPv6",(e,t)=>{oM.init(e,t),Tt.init(e,t)}),L5=ie("ZodCIDRv4",(e,t)=>{uM.init(e,t),Tt.init(e,t)}),I5=ie("ZodCIDRv6",(e,t)=>{cM.init(e,t),Tt.init(e,t)}),U5=ie("ZodBase64",(e,t)=>{dM.init(e,t),Tt.init(e,t)}),B5=ie("ZodBase64URL",(e,t)=>{hM.init(e,t),Tt.init(e,t)}),P5=ie("ZodE164",(e,t)=>{mM.init(e,t),Tt.init(e,t)}),$5=ie("ZodJWT",(e,t)=>{gM.init(e,t),Tt.init(e,t)}),Mg=ie("ZodNumber",(e,t)=>{rj.init(e,t),At.init(e,t),e._zod.processJSONSchema=(i,l,o)=>I4(e,i,l),e.gt=(i,l)=>e.check(m1(i,l)),e.gte=(i,l)=>e.check(Pm(i,l)),e.min=(i,l)=>e.check(Pm(i,l)),e.lt=(i,l)=>e.check(h1(i,l)),e.lte=(i,l)=>e.check(Bm(i,l)),e.max=(i,l)=>e.check(Bm(i,l)),e.int=i=>e.check(y1(i)),e.safe=i=>e.check(y1(i)),e.positive=i=>e.check(m1(0,i)),e.nonnegative=i=>e.check(Pm(0,i)),e.negative=i=>e.check(h1(0,i)),e.nonpositive=i=>e.check(Bm(0,i)),e.multipleOf=(i,l)=>e.check(p1(i,l)),e.step=(i,l)=>e.check(p1(i,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function He(e){return h4(Mg,e)}const F5=ie("ZodNumberFormat",(e,t)=>{yM.init(e,t),Mg.init(e,t)});function y1(e){return p4(F5,e)}const q5=ie("ZodBoolean",(e,t)=>{vM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>U4(e,n,i)});function Eu(e){return g4(q5,e)}const H5=ie("ZodUnknown",(e,t)=>{bM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>P4()});function St(){return y4(H5)}const Z5=ie("ZodNever",(e,t)=>{xM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>B4(e,n,i)});function V5(e){return v4(Z5,e)}const Q5=ie("ZodArray",(e,t)=>{SM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>Z4(e,n,i,l),e.element=t.element,e.min=(n,i)=>e.check(_d(n,i)),e.nonempty=n=>e.check(_d(1,n)),e.max=(n,i)=>e.check(oj(n,i)),e.length=(n,i)=>e.check(uj(n,i)),e.unwrap=()=>e.element});function Yn(e,t){return T4(Q5,e,t)}const G5=ie("ZodObject",(e,t)=>{kM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>V4(e,n,i,l),lt(e,"shape",()=>t.shape),e.keyof=()=>Xe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:V5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>HD(e,n),e.safeExtend=n=>ZD(e,n),e.merge=n=>VD(e,n),e.pick=n=>FD(e,n),e.omit=n=>qD(e,n),e.partial=(...n)=>QD(vj,e,n[0]),e.required=(...n)=>GD(bj,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new G5(n)}const pj=ie("ZodUnion",(e,t)=>{lj.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>Q4(e,n,i,l),e.options=t.options});function gj(e,t){return new pj({type:"union",options:e,...Ce(t)})}const K5=ie("ZodDiscriminatedUnion",(e,t)=>{pj.init(e,t),jM.init(e,t)});function yj(e,t,n){return new K5({type:"union",options:t,discriminator:e,...Ce(n)})}const Y5=ie("ZodIntersection",(e,t)=>{EM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>G4(e,n,i,l)});function X5(e,t){return new Y5({type:"intersection",left:e,right:t})}const J5=ie("ZodRecord",(e,t)=>{CM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>K4(e,n,i,l),e.keyType=t.keyType,e.valueType=t.valueType});function qt(e,t,n){return new J5({type:"record",keyType:e,valueType:t,...Ce(n)})}const Fp=ie("ZodEnum",(e,t)=>{_M.init(e,t),At.init(e,t),e._zod.processJSONSchema=(i,l,o)=>$4(e,i,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,l)=>{const o={};for(const u of i)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Fp({...t,checks:[],...Ce(l),entries:o})},e.exclude=(i,l)=>{const o={...t.entries};for(const u of i)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new Fp({...t,checks:[],...Ce(l),entries:o})}});function Xe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Fp({type:"enum",entries:n,...Ce(t)})}const W5=ie("ZodLiteral",(e,t)=>{NM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>F4(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function xn(e,t){return new W5({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const e6=ie("ZodTransform",(e,t)=>{AM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>H4(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new $k(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(du(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(du(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function t6(e){return new e6({type:"transform",transform:e})}const vj=ie("ZodOptional",(e,t)=>{sj.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>hj(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function v1(e){return new vj({type:"optional",innerType:e})}const n6=ie("ZodExactOptional",(e,t)=>{TM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>hj(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function r6(e){return new n6({type:"optional",innerType:e})}const a6=ie("ZodNullable",(e,t)=>{RM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>Y4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function b1(e){return new a6({type:"nullable",innerType:e})}const i6=ie("ZodDefault",(e,t)=>{zM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>J4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function l6(e,t){return new i6({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Zk(t)}})}const s6=ie("ZodPrefault",(e,t)=>{OM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>W4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function o6(e,t){return new s6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Zk(t)}})}const bj=ie("ZodNonOptional",(e,t)=>{DM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>X4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function u6(e,t){return new bj({type:"nonoptional",innerType:e,...Ce(t)})}const c6=ie("ZodCatch",(e,t)=>{MM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>e5(e,n,i,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function d6(e,t){return new c6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const f6=ie("ZodPipe",(e,t)=>{LM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>t5(e,n,i,l),e.in=t.in,e.out=t.out});function x1(e,t){return new f6({type:"pipe",in:e,out:t})}const h6=ie("ZodReadonly",(e,t)=>{IM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>n5(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function m6(e){return new h6({type:"readonly",innerType:e})}const p6=ie("ZodCustom",(e,t)=>{UM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>q4(e,n)});function g6(e,t={}){return R4(p6,e,t)}function y6(e){return z4(e)}const $m={custom:"custom"};function Jd(e){return m4(Mg,e)}const v6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},xj=Xe(["feishu","slack","kael"]),Sj=Xe(["active","inactive"]);de({platform:xj,agentId:O().min(1),credentials:qt(O(),St()),status:Sj.default("active")});de({agentId:O().min(1).optional(),credentials:qt(O(),St()).optional(),status:Sj.optional()});de({id:He(),platform:O(),agentId:O(),hasCredentials:Eu(),status:O(),createdAt:O(),updatedAt:O()});const b6=Xe(["code","reverse_token","oauth","manual"]);de({appId:O().min(1),appSecret:O().min(1)});de({platform:xj,externalUserId:O().min(1),agentId:O().min(1),boundVia:b6.default("manual"),displayName:O().max(200).optional()});de({id:He(),platform:O(),externalUserId:O(),agentId:O(),boundVia:O().nullable(),displayName:O().nullable(),createdAt:O()});de({feishuUserId:O().min(1),displayName:O().max(200).optional()});de({configId:He(),platform:O(),agentId:O(),appId:O(),connected:Eu(),lastActiveAt:O().nullable()});const wj=Xe(["online","offline"]),kj=Xe(["idle","working","blocked","error"]);Xe(["active","suspended","evicted"]);const x6=Xe(["active","suspended"]);de({chatId:O().min(1),state:x6});de({runtimeState:kj});de({agentId:O().min(1),runtimeType:O().max(50),runtimeVersion:O().max(50).optional()});Xe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);de({agentId:O(),status:wj,connectedAt:O().nullable(),lastSeenAt:O(),clientId:O().nullable().optional(),runtimeType:O().nullable().optional(),runtimeVersion:O().nullable().optional(),runtimeState:kj.nullable().optional(),activeSessions:He().int().nullable().optional(),totalSessions:He().int().nullable().optional(),runtimeUpdatedAt:O().nullable().optional()});de({total:He().int(),running:He().int(),byState:de({idle:He().int(),working:He().int(),blocked:He().int(),error:He().int()}),clients:He().int()});const S6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Wd=Xe(["human","personal_assistant","autonomous_agent"]),S1={PRIVATE:"private",ORGANIZATION:"organization"},Lg=Xe(["private","organization"]),w6=Xe(["admin-api","portal"]);Xe(["active","suspended"]);de({name:O().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Wd,displayName:O().max(200).optional(),delegateMention:O().max(100).optional(),organizationId:O().max(100).optional(),source:w6.optional(),visibility:Lg.optional(),metadata:qt(O(),St()).optional(),managerId:O().optional(),clientId:O().min(1).max(100).optional()});de({type:Wd.optional(),displayName:O().max(200).nullable().optional(),delegateMention:O().max(100).nullable().optional(),visibility:Lg.optional(),metadata:qt(O(),St()).optional(),managerId:O().nullable().optional(),clientId:O().min(1).max(100).nullable().optional()});de({uuid:O(),name:O().nullable(),organizationId:O(),type:Wd,displayName:O().nullable(),delegateMention:O().nullable(),inboxId:O(),status:O(),source:O().nullable().optional(),visibility:Lg,metadata:qt(O(),St()),managerId:O().nullable(),clientId:O().nullable(),presenceStatus:wj.optional(),createdAt:O(),updatedAt:O()});de({repo:O().nullable(),branch:O().nullable()});de({type:xn("agent:pinned"),agentId:O(),name:O().nullable(),displayName:O().nullable(),agentType:Wd});const k6=32e3,Ig=/^[a-z0-9][a-z0-9_-]{0,63}$/i,j6=/^[A-Z][A-Z0-9_]*$/,E6=de({append:O().max(k6).default("")}),C6=de({name:O().regex(Ig,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:xn("stdio"),command:O().min(1),args:Yn(O()).optional()}),_6=de({name:O().regex(Ig,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:xn("http"),url:O().url(),headers:qt(O(),O()).optional()}),N6=de({name:O().regex(Ig,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:xn("sse"),url:O().url(),headers:qt(O(),O()).optional()}),A6=yj("transport",[C6,_6,N6]),T6=de({key:O().regex(j6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:O(),sensitive:Eu().default(!1)}),R6=de({url:O().min(1),ref:O().min(1).optional(),localPath:O().min(1).optional()}),Ug=de({prompt:E6.default({append:""}),model:O().default(""),mcpServers:Yn(A6).default([]),env:Yn(T6).default([]),gitRepos:Yn(R6).default([])}),z6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:$m.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const i=new Set;e.env.forEach((o,u)=>{i.has(o.key)&&t.addIssue({code:$m.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),i.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??Ad(o.url);f&&(l.has(f)&&t.addIssue({code:$m.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},jj=Ug.superRefine(z6),O6=de({agentId:O(),version:He().int().positive(),payload:jj,updatedAt:O(),updatedBy:O()});de({expectedVersion:He().int().positive(),payload:Ug.partial()});de({payload:Ug.partial()});de({current:O6,next:jj,diff:Yn(de({path:O(),op:Xe(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const qp="***";function Ad(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:O().min(1),password:O().min(1)});de({accessToken:O(),refreshToken:O()});de({refreshToken:O().min(1)});de({token:O().min(1)});de({token:O(),expiresIn:He(),command:O()});const D6=Xe(["direct","group","thread"]);de({type:D6,topic:O().max(500).optional(),participantIds:Yn(O()).min(1),metadata:qt(O(),St()).optional()});const Ej=de({agentId:O(),role:O(),mode:O(),joinedAt:O()});Ej.extend({name:O().nullable(),displayName:O().nullable(),type:O()});const M6=de({id:O(),organizationId:O(),type:O(),topic:O().nullable(),lifecyclePolicy:O().nullable().optional(),metadata:qt(O(),St()),createdAt:O(),updatedAt:O()});M6.extend({participants:Yn(Ej)});de({topic:O().trim().max(500).nullable()});de({agentId:O().min(1),mode:Xe(["full","mention_only"]).default("full")});de({agentId:O().min(1)});const L6=Xe(["connected","disconnected"]);de({id:O(),userId:O().nullable(),status:L6,sdkVersion:O().max(50).nullable(),hostname:O().max(100).nullable(),os:O().max(50).nullable(),agentCount:He().int().min(0),connectedAt:O().nullable(),lastSeenAt:O(),metadata:qt(O(),St()).nullable()});de({clientId:O().min(1).max(100),hostname:O().max(100).optional(),os:O().max(50).optional(),sdkVersion:O().max(50).optional()});de({limit:Jd().int().min(1).max(100).default(20),cursor:O().optional()});const I6=["image/png","image/jpeg","image/gif","image/webp"],Bg=Xe(I6);de({data:O().min(1),mimeType:Bg,filename:O().min(1),size:He().int().nonnegative().optional(),imageId:O().uuid().optional()});de({imageId:O().uuid(),mimeType:Bg,filename:O().min(1),size:He().int().nonnegative().optional()});de({type:xn("image_payload"),imageId:O().uuid(),chatId:O(),base64:O().min(1),mimeType:Bg,filename:O().min(1),size:He().int().nonnegative().optional()});const Pg=Xe(["hub_ui","cli","feishu","github","api"]),Cj=Xe(["text","markdown","card","reference","file","task"]);de({format:Cj.default("text"),content:St(),metadata:qt(O(),St()).optional(),inReplyTo:O().optional(),replyToInbox:O().optional(),replyToChat:O().optional(),source:Pg.optional()});de({format:Cj.default("text"),content:St(),metadata:qt(O(),St()).optional(),replyToInbox:O().optional(),replyToChat:O().optional(),source:Pg.optional()});const U6=de({id:O(),chatId:O(),senderId:O(),format:O(),content:St(),metadata:qt(O(),St()),replyToInbox:O().nullable(),replyToChat:O().nullable(),inReplyTo:O().nullable(),source:Pg.nullable(),createdAt:O()}),B6=de({senderId:O(),chatId:O(),replyToChat:O().nullable()}).nullable(),P6=Xe(["full","mention_only"]),$6=U6.extend({configVersion:He().int().positive(),recipientMode:P6.default("full"),inReplyToSnapshot:B6.default(null)});Xe(["pending","delivered","acked","failed"]);const F6=de({id:He(),inboxId:O(),messageId:O(),chatId:O().nullable(),status:O(),retryCount:He(),createdAt:O(),deliveredAt:O().nullable(),ackedAt:O().nullable()});F6.extend({message:$6});de({limit:Jd().int().min(1).max(50).default(10)});const q6={ADMIN:"admin",MEMBER:"member"},$g=Xe(["admin","member"]),H6=de({id:O(),userId:O(),organizationId:O(),agentId:O(),role:$g,createdAt:O()});de({username:O().min(1).max(100),displayName:O().min(1).max(200),role:$g.default("member")});de({role:$g.optional(),displayName:O().min(1).max(200).optional()});H6.extend({username:O(),displayName:O(),password:O()});const Z6=Xe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),_j=Xe(["high","medium","low"]);de({id:O(),organizationId:O(),type:Z6,severity:_j,agentId:O().nullable(),chatId:O().nullable(),message:O(),read:Eu(),createdAt:O()});de({limit:Jd().int().min(1).max(100).default(20),cursor:O().optional(),severity:_j.optional(),read:Xe(["true","false"]).transform(e=>e==="true").optional(),agentId:O().optional()});const Nj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({name:O().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!Nj.test(e),"Name must not be a UUID format"),displayName:O().min(1).max(200),maxAgents:He().int().min(0).default(0),maxMessagesPerMinute:He().int().min(0).default(0),features:qt(O(),St()).default({})});de({name:O().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!Nj.test(e),"Name must not be a UUID format").optional(),displayName:O().min(1).max(200).optional(),maxAgents:He().int().min(0).optional(),maxMessagesPerMinute:He().int().min(0).optional(),features:qt(O(),St()).optional()});de({id:O(),name:O(),displayName:O(),maxAgents:He(),maxMessagesPerMinute:He(),features:qt(O(),St()),createdAt:O(),updatedAt:O()});const V6=de({workingCount:He().int().nonnegative(),errorMask:Eu()}),Q6=de({type:xn("pulse:tick"),organizationId:O(),agents:qt(O(),Yn(V6).length(32))}),G6=Xe(["tool_call","error","assistant_text","thinking","turn_end"]),Aj=de({toolUseId:O(),name:O(),args:St(),status:Xe(["pending","ok","error"]),durationMs:He().int().nonnegative().optional(),resultPreview:O().max(400).optional()}),Tj=de({source:Xe(["sdk","runtime","tool"]),message:O().max(2e3)}),Rj=de({text:O().max(8e3)}),zj=de({}),Oj=de({status:Xe(["success","error"])}),K6=yj("kind",[de({kind:xn("tool_call"),payload:Aj}),de({kind:xn("error"),payload:Tj}),de({kind:xn("assistant_text"),payload:Rj}),de({kind:xn("thinking"),payload:zj}),de({kind:xn("turn_end"),payload:Oj})]);de({id:O(),agentId:O(),chatId:O(),seq:He().int().positive(),kind:G6,payload:gj([Aj,Tj,Rj,zj,Oj]),createdAt:O()});de({agentId:O(),chatId:O(),event:K6});de({agentId:O(),chatId:O()});de({type:xn("session:reconcile"),agentId:O().min(1),chatIds:Yn(O().min(1)).max(500)});de({type:xn("session:reconcile:result"),agentId:O().min(1),staleChatIds:Yn(O().min(1))});const Y6=de({organizationId:O(),agentCount:He(),chatCount:He(),messageCount:He()});de({totalAgents:He(),totalChats:He(),totalMessages:He(),byOrganization:Yn(Y6)});de({key:O(),value:St(),updatedAt:O()});qt(O(),St());const yi={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},vd={[yi.INBOX_TIMEOUT_SECONDS]:300,[yi.MAX_RETRY_COUNT]:3,[yi.POLLING_INTERVAL_SECONDS]:5,[yi.PRESENCE_CLEANUP_SECONDS]:60},fu=Xe(["pending","assigned","working","completed","failed","cancelled"]),w1=Xe(["agent","admin"]),X6=Xe(["assigned","status_changed","cancelled"]);de({taskId:O(),event:X6,title:O(),body:O().default(""),status:fu,fromStatus:fu.optional(),originRef:O().nullable().optional()});const J6=de({title:O().min(1).max(500),body:O().optional(),assigneeAgentId:O().optional(),originRef:O().max(500).optional(),metadata:qt(O(),St()).optional()});J6.extend({organizationId:O().optional()});de({status:Xe(["working","completed","failed"]),result:O().optional()});de({assigneeAgentId:O().nullable().optional(),status:fu.optional(),result:O().optional()});de({chatId:O().min(1)});const W6=de({id:O(),organizationId:O(),title:O(),body:O(),status:fu,assigneeAgentId:O().nullable(),createdByType:w1,createdById:O(),originRef:O().nullable(),result:O().nullable(),metadata:qt(O(),St()),createdAt:O(),updatedAt:O(),cancelledAt:O().nullable(),cancelledByType:w1.nullable(),cancelledById:O().nullable()}),eL=de({taskId:O(),chatId:O(),linkedByAgentId:O().nullable(),linkedAt:O()});W6.extend({chats:Yn(eL)});de({status:fu.optional(),assigneeAgentId:O().optional(),originRef:O().optional(),limit:Jd().int().min(1).max(100).default(20),cursor:O().optional()});const tL=Xe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:O(),signal:tL,reason:O()});const nL=Xe(["active","suspended"]);de({id:O(),username:O(),displayName:O(),avatarUrl:O().nullable(),status:nL,createdAt:O(),updatedAt:O()});de({username:O().min(1).max(100),displayName:O().min(1).max(200),password:O().min(8).max(200)});de({displayName:O().min(1).max(200).optional(),password:O().min(8).max(200).optional()});de({type:xn("auth"),token:O().min(1)});de({type:xn("server:welcome"),serverCommandVersion:O().min(1),serverTimeMs:He().int().nonnegative()}).passthrough();const Dj=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function rL(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let i=0;i<32&&i<n.length;i++){const l=n[i],o=t[i];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const aL=2e3,iL=3e4;let si=null,Td=!1,Fm=0,eu=null;const Hp=new Set;let Jo=null,ys=0;function lL(e){for(const t of Hp)try{t(e)}catch{}Jo&&(e.type==="notification"?Jo.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(Jo.invalidateQueries({queryKey:["activity"]}),Jo.invalidateQueries({queryKey:["sessions"]})))}function Mj(){const e=xg();if(!(e!=null&&e.accessToken))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,i=new WebSocket(n);si=i,i.onmessage=l=>{if(i===si)try{const o=JSON.parse(l.data);lL(o)}catch{}},i.onopen=()=>{i===si&&(Fm=0)},i.onclose=()=>{if(i!==si||(si=null,Td||ys===0))return;Fm++;const l=Math.min(aL*2**(Fm-1),iL);eu=setTimeout(()=>{eu=null,!Td&&ys>0&&Mj()},l)}}function sL(){Td=!0,eu&&(clearTimeout(eu),eu=null),si&&(si.close(1e3,"unmount"),si=null)}function Lj(e){const{onMessage:t,enabled:n=!0}=e??{},i=Wn(),l=S.useRef(t);l.current=t,S.useEffect(()=>{Jo=i},[i]),S.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Hp.add(o),ys++,ys===1&&(Td=!1,Mj()),()=>{Hp.delete(o),ys--,ys===0&&sL()}},[n])}const Ij=S.createContext({aggregated:Dj,agents:{},receivedAtMs:null,stale:!0});function oL({children:e}){const[t,n]=S.useState({aggregated:Dj,agents:{},receivedAtMs:null}),[i,l]=S.useState(()=>Date.now());Lj({onMessage:u=>{const f=Q6.safeParse(u);f.success&&n({aggregated:rL(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),S.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=S.useMemo(()=>({...t,stale:t.receivedAtMs===null||i-t.receivedAtMs>3e4}),[t,i]);return d.jsx(Ij.Provider,{value:o,children:e})}function uL(){return S.useContext(Ij)}function ef({title:e,subtitle:t,right:n,className:i,style:l,...o}){return d.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",i),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[d.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),d.jsx("div",{style:{flex:1}}),n]})}function Uj({className:e,style:t,...n}){return d.jsx("div",{className:Te("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function Bj({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:i=>{e||(i.currentTarget.style.color="var(--fg)")},onMouseLeave:i=>{e||(i.currentTarget.style.color="var(--fg-3)")},children:n})}const cL={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function Wt({tone:e="neutral",className:t,style:n,...i}){const l=cL[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return d.jsx("span",{className:Te("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...i})}const Sa=S.forwardRef(({className:e,...t},n)=>d.jsx("table",{ref:n,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));Sa.displayName="DenseTable";const wa=S.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:e,...t}));wa.displayName="DenseTableHeader";const ka=S.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:e,...t}));ka.displayName="DenseTableBody";const Qt=S.forwardRef(({className:e,interactive:t,selected:n,style:i,...l},o)=>d.jsx("tr",{ref:o,className:Te("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...i},...l}));Qt.displayName="DenseTableRow";const Ae=S.forwardRef(({className:e,style:t,...n},i)=>d.jsx("th",{ref:i,className:Te("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));Ae.displayName="DenseTableHead";const Ee=S.forwardRef(({className:e,style:t,...n},i)=>d.jsx("td",{ref:i,className:Te("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ee.displayName="DenseTableCell";const Fr=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},...t}));Fr.displayName="Panel";const Pj=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},...t}));Pj.displayName="PanelHeader";const $j=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)"},...t}));$j.displayName="PanelTitle";const dL=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te(e),style:{padding:"var(--sp-3) var(--sp-3_5)"},...t}));dL.displayName="PanelBody";function Ms({children:e,right:t,className:n,style:i,...l}){return d.jsxs("div",{className:Te("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...i},...l,children:[d.jsx("span",{children:e}),t]})}function Cu({className:e,style:t,...n}){return d.jsx("span",{className:Te("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Fg(){return De.get("/members")}function fL(e){return De.post("/members",e)}function hL(e,t){return De.patch(`/members/${encodeURIComponent(e)}`,t)}function mL(e){return De.delete(`/members/${encodeURIComponent(e)}`)}function qg(){const{data:e}=qe({queryKey:["members","name-map"],queryFn:Fg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function pL(){const e=qr(),t=qg(),{data:n,isLoading:i,error:l}=qe({queryKey:["admin-all-agents"],queryFn:()=>xD({limit:100})});return d.jsxs("div",{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),d.jsxs(Fr,{children:[d.jsxs(Ms,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),i?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Name"}),d.jsx(Ae,{children:"Display"}),d.jsx(Ae,{children:"Type"}),d.jsx(Ae,{children:"Visibility"}),d.jsx(Ae,{children:"Owner"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Created"})]})}),d.jsx(ka,{children:n.items.map(o=>d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",children:o.name??o.uuid.slice(0,8)})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:o.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),d.jsx(Ee,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(o.createdAt)})]},o.uuid))})]})]})]})}const k1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,j1=kw,gL=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return j1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=k1(y)||k1(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,y)=>{let{class:g,className:b,...x}=y;return Object.entries(x).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return j1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},yL=gL("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ve=S.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,...l},o)=>{const u=i?GO:"button";return d.jsx(u,{className:Te(yL({variant:t,size:n,className:e})),ref:o,...l})});ve.displayName="Button";const vt=S.forwardRef(({className:e,type:t,...n},i)=>d.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:i,...n}));vt.displayName="Input";var vL="Label",Fj=S.forwardRef((e,t)=>d.jsx(Ca.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Fj.displayName=vL;var bL=Fj;const et=S.forwardRef(({className:e,...t},n)=>d.jsx(bL,{ref:n,className:Te("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));et.displayName="Label";const qj=Object.values(q6);function xL(e,t){const n=(e==null?void 0:e.trim())||t,i=n.split(/[\s._-]+/).filter(Boolean);if(i.length>=2){const l=i[0]??"",o=i[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function SL(){const e=Wn(),{memberId:t}=ja(),[n,i]=S.useState(!1),[l,o]=S.useState({username:"",displayName:"",role:"member"}),[u,f]=S.useState(null),[m,h]=S.useState(null),{data:y,isLoading:g,error:b}=qe({queryKey:["members"],queryFn:Fg}),x=yt({mutationFn:()=>fL({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:T=>{e.invalidateQueries({queryKey:["members"]}),f(T.password)}}),k=yt({mutationFn:mL,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){i(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(T){T.preventDefault(),x.mutate()}function N(T){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(T)}return d.jsxs(d.Fragment,{children:[d.jsxs(Fr,{children:[d.jsxs(Ms,{right:d.jsxs(On,{open:n,onOpenChange:T=>T?i(!0):j(),children:[d.jsx(gD,{asChild:!0,children:d.jsxs(ve,{size:"xs",className:"normal-case tracking-normal",children:[d.jsx(gl,{className:"h-3 w-3"}),"Add member"]})}),d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:u?"Member Created":"Create Member"})}),u?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("code",{className:"flex-1 text-body mono",children:u}),d.jsx(ve,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:d.jsx(Sg,{className:"h-4 w-4"})})]}),d.jsx(Dn,{children:d.jsx(ve,{onClick:j,children:"Done"})})]}):d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"member-username",children:"Username"}),d.jsx(vt,{id:"member-username",type:"text",value:l.username,onChange:T=>o({...l,username:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"member-name",children:"Display Name"}),d.jsx(vt,{id:"member-name",value:l.displayName,onChange:T=>o({...l,displayName:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:l.role,onChange:T=>o({...l,role:T.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:qj.map(T=>d.jsx("option",{value:T,children:T},T))})]}),x.error instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:x.error.message}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:x.isPending,children:x.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(y==null?void 0:y.length)===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{style:{width:30}}),d.jsx(Ae,{children:"Username"}),d.jsx(Ae,{children:"Name"}),d.jsx(Ae,{children:"Role"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{style:{width:1}})]})}),d.jsx(ka,{children:y==null?void 0:y.map(T=>{const D=t===T.id;return d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:D?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:D?"var(--accent-dim)":"var(--fg-2)"},children:xL(T.displayName,T.username)})}),d.jsxs(Ee,{children:[d.jsx("span",{className:"mono font-medium",children:T.username}),D&&d.jsx(Cu,{style:{marginLeft:6},children:"you"})]}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:T.displayName}),d.jsx(Ee,{children:d.jsx(Wt,{tone:T.role==="admin"?"accent":"neutral",children:T.role})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(T.createdAt)}),d.jsx(Ee,{style:{whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-0.5 justify-end",children:[d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:T.id,username:T.username,displayName:T.displayName,role:T.role}),title:"Edit",children:d.jsx($d,{className:"h-3.5 w-3.5"})}),d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>N(T.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:d.jsx(su,{className:"h-3.5 w-3.5"})})]})})]},T.id)})})]})]}),d.jsx(wL,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function wL({target:e,onClose:t,onSaved:n}){const[i,l]=S.useState(""),[o,u]=S.useState("member"),[f,m]=S.useState(null);S.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=yt({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return i.trim()&&i!==e.displayName&&(b.displayName=i.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:hL(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return d.jsx(On,{open:g,onOpenChange:b=>b?void 0:t(),children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{children:"Username"}),d.jsx(vt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(vt,{id:"edit-member-display",value:i,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:b=>u(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:qj.map(b=>d.jsx("option",{value:b,children:b},b))}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(ve,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function kL(){return De.get("/admin/system/config")}function jL(e){return De.patch("/admin/system/config",e)}const Hj=[{key:yi.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:yi.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:yi.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:yi.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],E1=Hj.map(e=>e.key);function EL(){const e=Wn(),{data:t,isLoading:n}=qe({queryKey:["system-config"],queryFn:kL}),[i,l]=S.useState({}),[o,u]=S.useState(!1);S.useEffect(()=>{if(!t)return;const y={};for(const g of E1){const b=t[g]??vd[g]??"";y[g]=String(b)}l(y)},[t]);const f=yt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(i)){const x=b.trim();if(x==="")y[g]=vd[g]??0;else{const k=Number(x);y[g]=Number.isNaN(k)?x:k}}return jL(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const y={};for(const g of E1)y[g]=String(vd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return d.jsx("form",{onSubmit:h,children:d.jsxs(Fr,{children:[d.jsxs(Pj,{children:[d.jsx($j,{children:"System configuration"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),d.jsx(ve,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),d.jsxs(ve,{type:"submit",size:"xs",disabled:f.isPending,children:[d.jsx(Pd,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),d.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?d.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):Hj.map(y=>d.jsx(CL,{field:y,value:i[y.key]??"",onChange:g=>l({...i,[y.key]:g})},y.key)),f.error instanceof Error&&d.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})}function CL({field:e,value:t,onChange:n}){const i=String(vd[e.key]??"—");return d.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),d.jsxs(Cu,{style:{marginTop:4,display:"block"},children:["default"," ",d.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:i})]})]}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&d.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const C1=[{key:"members",label:"Members"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function _L(){const{role:e}=ja(),t=yr(),n=qr();if(e===null)return d.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return d.jsx(pg,{to:"/settings",replace:!0});const i=t.hash.replace("#",""),l=C1.some(u=>u.key===i)?i:"members",o=u=>{n({hash:u},{replace:!0})};return d.jsxs("div",{className:"-m-6",children:[d.jsx(ef,{title:"Admin",subtitle:"Organization-wide controls"}),d.jsx(Uj,{children:C1.map(u=>d.jsx(Bj,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),d.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&d.jsx(SL,{}),l==="all-agents"&&d.jsx(pL,{}),l==="settings"&&d.jsx(EL,{})]})]})}function Zj(){return De.get("/admin/adapter-mappings")}function NL(e){return De.post("/admin/adapter-mappings",e)}function AL(e){return De.delete(`/admin/adapter-mappings/${e}`)}function Vj(){return De.get("/admin/adapters/status")}function Qj(){return De.get("/admin/adapters")}function TL(e){return De.post("/admin/adapters",e)}function RL(e,t){return De.patch(`/admin/adapters/${e}`,t)}function zL(e){return De.delete(`/admin/adapters/${e}`)}function OL(e){return De.get(`/admin/agents/${e}/config`)}function DL(e,t){return De.patch(`/admin/agents/${e}/config`,t)}function ML(e,t){return De.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function LL(e){return De.get(`/admin/agents/${e}/client-status`)}function IL({className:e,style:t,...n}){return d.jsx("div",{className:Te("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function UL({onClick:e,children:t}){return d.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function BL(){return d.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function PL({children:e,mono:t}){return d.jsx("span",{className:Te("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function hl({state:e,size:t=8,className:n}){const i={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:Te("shrink-0",n),style:i,role:"img","aria-label":"working",children:[d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),d.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?d.jsx("span",{className:Te("shrink-0",n),style:{...i,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:d.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?d.jsx("span",{className:Te("shrink-0",n),style:{...i,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?d.jsx("span",{className:Te("shrink-0",n),style:{...i,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.jsx("span",{className:Te("shrink-0",n),style:{...i,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function $L(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function ml({state:e,className:t}){const n=e!==null&&$L(e)?e:"offline",i=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return d.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:i},children:[d.jsx(hl,{state:n,size:7}),n]})}function ad({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:1},children:t})]})}function FL(e){const{agent:t}=e,[n,i]=S.useState(!1),l=t.displayName||t.name||t.uuid;return d.jsxs("section",{style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[d.jsx(JT,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),d.jsxs("div",{children:[t.status==="active"?d.jsx(qm,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(ve,{variant:"outline",size:"xs",onClick:e.onSuspend,disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx(qm,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(ve,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx(qm,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(ve,{variant:"destructive",size:"xs",onClick:()=>i(!0),disabled:e.deletePending,children:[d.jsx(su,{className:"h-3 w-3"}),"Delete"]})})]}),d.jsx(qL,{open:n,onOpenChange:i,expected:l,onDelete:()=>{i(!1),e.onDelete()},deleting:e.deletePending})]})}function qm(e){return d.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),d.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),d.jsx("div",{children:e.action})]})}function qL({open:e,onOpenChange:t,expected:n,onDelete:i,deleting:l}){const[o,u]=S.useState("");function f(m){m.preventDefault(),o===n&&i()}return d.jsx(On,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsxs(Mn,{children:['Delete "',n,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),d.jsx(vt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(ve,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const HL={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-success-soft text-success"},modified:{label:"changed",tone:"bg-warn-soft text-warn"},deleted:{label:"will be removed on save",tone:"bg-error-soft text-error"}};function Hg({status:e,onEdit:t,onDelete:n,onUndo:i,children:l,disabled:o}){const u=HL[e],f=e==="deleted";return d.jsxs("div",{className:Te("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:Te("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(ve,{size:"sm",variant:"ghost",onClick:i,children:[d.jsx(eR,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsx(ZL,{onEdit:t,onDelete:n}))]})}function ZL({onEdit:e,onDelete:t}){return d.jsxs("div",{className:"flex gap-1",children:[d.jsx(ve,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),d.jsxs(ve,{size:"sm",variant:"ghost",onClick:t,title:"Delete",children:[d.jsx(xT,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function VL(e){const[t,n]=S.useState(null),i=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Environment Variables (",i,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(l=>d.jsxs(Hg,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono font-medium",children:l.value.key}),d.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:l.value.sensitive?"••••••":l.value.value||d.jsx("em",{children:"(empty)"})}),l.value.sensitive&&d.jsx(_T,{className:"h-3 w-3 text-muted-foreground"})]},l.key))}),t&&d.jsx(QL,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function QL({open:e,onOpenChange:t,initial:n,forbiddenKeys:i,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.key)??""),[f,m]=S.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=S.useState((n==null?void 0:n.sensitive)??!1),[g,b]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function x(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(i.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=qp),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:x,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"env-key",children:"Key"}),d.jsx(vt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&d.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"env-value",children:"Value"}),d.jsx(vt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-body",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function GL(e){const[t,n]=S.useState(null),i=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Git Repositories (",i,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??Ad(l.value.url);return d.jsxs(Hg,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(KL,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function KL({open:e,onOpenChange:t,initial:n,forbiddenPaths:i,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.url)??""),[f,m]=S.useState((n==null?void 0:n.ref)??""),[h,y]=S.useState((n==null?void 0:n.localPath)??""),[g,b]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function x(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||Ad(j);if(E&&i.has(E)){b(`Another repo already occupies local path "${E}".`);return}const N={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(N)}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:x,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"git-url",children:"URL"}),d.jsx(vt,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(vt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(vt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:Ad(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function YL({agent:e,onSave:t}){const[n,i]=S.useState(!1),l=Ei(),o=qg(),u=e.metadata,f=u==null?void 0:u.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("h2",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:"Profile"}),e.status==="active"&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>i(!0),children:[d.jsx($d,{className:"h-3 w-3"})," Edit"]})]}),d.jsxs("div",{className:"px-4 py-3 text-body space-y-1",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono",children:e.name??e.uuid}),d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsx("span",{children:e.displayName??d.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),g&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsxs("span",{className:"text-muted-foreground",children:["delegate ",d.jsx("span",{className:"font-mono",children:g})]})]})]}),d.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsxs("span",{children:["owner ",d.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-foreground",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(Wt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(Wt,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&d.jsxs("span",{children:["domains"," ",d.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>d.jsx(Wt,{tone:"outline",children:b},b))})]})]})]}),d.jsx(XL,{agent:e,open:n,onOpenChange:i,onSave:t})]})}function XL({agent:e,open:t,onOpenChange:n,onSave:i}){var U;const{memberId:l,role:o}=ja(),[u,f]=S.useState(e.displayName??""),[m,h]=S.useState(e.delegateMention??""),[y,g]=S.useState(e.visibility),[b,x]=S.useState(!1),[k,j]=S.useState(null);S.useEffect(()=>{t&&(f(e.displayName??""),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",N=o==="admin"||e.managerId===l,T=qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await Ng({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&E});async function D(B){B.preventDefault(),j(null),x(!0);try{const z={displayName:u||null,delegateMention:m||null};y!==e.visibility&&(z.visibility=y),await i(z),n(!1)}catch(z){j(z instanceof Error?z.message:String(z))}finally{x(!1)}}return d.jsx(On,{open:t,onOpenChange:n,children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:D,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{children:"Name (mention)"}),d.jsx(vt,{value:e.name??"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Name is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"id-display",children:"Display Name"}),d.jsx(vt,{id:"id-display",value:u,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.target.value),disabled:!N,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:S1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:S1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:N?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:B=>h(B.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"None"}),(U=T.data)==null?void 0:U.map(B=>d.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (${B.name??B.uuid})`:B.name??B.uuid},B.uuid))]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-body text-destructive",children:k}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),d.jsx(ve,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function JL(e){const[t,n]=S.useState(null),i=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["MCP Servers (",i,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>d.jsxs(Hg,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),d.jsx("span",{className:"font-medium font-mono",children:l.value.name}),d.jsx("span",{className:"text-caption text-muted-foreground truncate",children:WL(l.value)})]},l.key))}),t&&d.jsx(eI,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function WL(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${n}`}return e.url}function eI({open:e,onOpenChange:t,initial:n,forbiddenNames:i,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=S.useState((n==null?void 0:n.name)??""),[h,y]=S.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=S.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[x,k]=S.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function N(T){if(T.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(i.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let D;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const U=g.trim().split(/\s+/).filter(B=>B.length>0);D={name:f,transport:"stdio",command:h.trim(),...U.length?{args:U}:{}}}else{const U=x.trim();try{new URL(U)}catch{E("URL is not valid.");return}D={name:f,transport:o,url:U}}l(D)}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:N,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:T=>u(T.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),d.jsx("option",{value:"http",children:"http"}),d.jsx("option",{value:"sse",children:"sse"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"mcp-name",children:"Name"}),d.jsx(vt,{id:"mcp-name",value:f,onChange:T=>m(T.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"mcp-command",children:"Command"}),d.jsx(vt,{id:"mcp-command",value:h,onChange:T=>y(T.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(vt,{id:"mcp-args",value:g,onChange:T=>b(T.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"mcp-url",children:"URL"}),d.jsx(vt,{id:"mcp-url",value:x,onChange:T=>k(T.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-body text-destructive",children:j}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const _1=[{value:"claude-opus-4-6",label:"claude-opus-4-6",hint:"most capable"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6",hint:"default"},{value:"claude-haiku-4-5",label:"claude-haiku-4-5",hint:"fastest"}];function tI({value:e,baseline:t,onChange:n,onRevert:i,disabled:l}){const o=e!==t,u=!_1.some(f=>f.value===e)&&e!=="";return d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${o?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Model",o&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),o&&d.jsx(ve,{size:"xs",variant:"ghost",onClick:i,disabled:l,children:"Revert"})]}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[d.jsx("option",{value:"",children:"(agent default)"}),_1.map(f=>d.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&d.jsxs("option",{value:e,children:[e," — custom"]})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Choose which Claude model powers this agent. Applies to new sessions immediately; active sessions switch on their next message."})]})]})}function nI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const rI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iI={};function N1(e,t){return(iI.jsx?aI:rI).test(e)}const lI=/[ \t\n\f\r]/g;function sI(e){return typeof e=="object"?e.type==="text"?A1(e.value):!1:A1(e)}function A1(e){return e.replace(lI,"")===""}class _u{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}_u.prototype.normal={};_u.prototype.property={};_u.prototype.space=void 0;function Gj(e,t){const n={},i={};for(const l of e)Object.assign(n,l.property),Object.assign(i,l.normal);return new _u(n,i,t)}function Zp(e){return e.toLowerCase()}class Un{constructor(t,n){this.attribute=n,this.property=t}}Un.prototype.attribute="";Un.prototype.booleanish=!1;Un.prototype.boolean=!1;Un.prototype.commaOrSpaceSeparated=!1;Un.prototype.commaSeparated=!1;Un.prototype.defined=!1;Un.prototype.mustUseProperty=!1;Un.prototype.number=!1;Un.prototype.overloadedBoolean=!1;Un.prototype.property="";Un.prototype.spaceSeparated=!1;Un.prototype.space=void 0;let oI=0;const Pe=xl(),$t=xl(),Vp=xl(),he=xl(),xt=xl(),xs=xl(),Gn=xl();function xl(){return 2**++oI}const Qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:$t,commaOrSpaceSeparated:Gn,commaSeparated:xs,number:he,overloadedBoolean:Vp,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Hm=Object.keys(Qp);class Zg extends Un{constructor(t,n,i,l){let o=-1;if(super(t,n),T1(this,"space",l),typeof i=="number")for(;++o<Hm.length;){const u=Hm[o];T1(this,Hm[o],(i&Qp[u])===Qp[u])}}}Zg.prototype.defined=!0;function T1(e,t,n){n&&(e[t]=n)}function Hs(e){const t={},n={};for(const[i,l]of Object.entries(e.properties)){const o=new Zg(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[Zp(i)]=i,n[Zp(o.attribute)]=i}return new _u(t,n,e.space)}const Kj=Hs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:xt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:he,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:xt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:$t,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yj(e,t){return t in e?e[t]:t}function Xj(e,t){return Yj(e,t.toLowerCase())}const uI=Hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xs,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:xt,autoFocus:Pe,autoPlay:Pe,blocking:xt,capture:null,charSet:null,checked:Pe,cite:null,className:xt,cols:he,colSpan:null,content:null,contentEditable:$t,controls:Pe,controlsList:xt,coords:he|xs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:Vp,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:xt,height:he,hidden:Vp,high:he,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:xt,itemRef:xt,itemScope:Pe,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pe,optimum:he,pattern:null,ping:xt,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:xt,required:Pe,reversed:Pe,rows:he,rowSpan:he,sandbox:xt,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:$t,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:Xj}),cI=Hs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xs,g2:xs,glyphName:xs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yj}),Jj=Hs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wj=Hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xj}),eE=Hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},fI=/[A-Z]/g,R1=/-[a-z]/g,hI=/^data[-\w.:]+$/i;function mI(e,t){const n=Zp(t);let i=t,l=Un;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hI.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(R1,gI);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!R1.test(o)){let u=o.replace(fI,pI);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Zg}return new l(i,t)}function pI(e){return"-"+e.toLowerCase()}function gI(e){return e.charAt(1).toUpperCase()}const yI=Gj([Kj,uI,Jj,Wj,eE],"html"),Vg=Gj([Kj,cI,Jj,Wj,eE],"svg");function vI(e){return e.join(" ").trim()}var cs={},Zm,z1;function bI(){if(z1)return Zm;z1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
333
- `,h="/",y="*",g="",b="comment",x="declaration";function k(E,N){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];N=N||{};var T=1,D=1;function U(fe){var W=fe.match(t);W&&(T+=W.length);var P=fe.lastIndexOf(m);D=~P?fe.length-P:D+fe.length}function B(){var fe={line:T,column:D};return function(W){return W.position=new z(fe),ee(),W}}function z(fe){this.start=fe,this.end={line:T,column:D},this.source=N.source}z.prototype.content=E;function F(fe){var W=new Error(N.source+":"+T+":"+D+": "+fe);if(W.reason=fe,W.filename=N.source,W.line=T,W.column=D,W.source=E,!N.silent)throw W}function Z(fe){var W=fe.exec(E);if(W){var P=W[0];return U(P),E=E.slice(P.length),W}}function ee(){Z(n)}function q(fe){var W;for(fe=fe||[];W=ae();)W!==!1&&fe.push(W);return fe}function ae(){var fe=B();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var W=2;g!=E.charAt(W)&&(y!=E.charAt(W)||h!=E.charAt(W+1));)++W;if(W+=2,g===E.charAt(W-1))return F("End of comment missing");var P=E.slice(2,W-2);return D+=2,U(P),E=E.slice(W),D+=2,fe({type:b,comment:P})}}function re(){var fe=B(),W=Z(i);if(W){if(ae(),!Z(l))return F("property missing ':'");var P=Z(o),V=fe({type:x,property:j(W[0].replace(e,g)),value:P?j(P[0].replace(e,g)):g});return Z(u),V}}function pe(){var fe=[];q(fe);for(var W;W=re();)W!==!1&&(fe.push(W),q(fe));return fe}return ee(),pe()}function j(E){return E?E.replace(f,g):g}return Zm=k,Zm}var O1;function xI(){if(O1)return cs;O1=1;var e=cs&&cs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(cs,"__esModule",{value:!0}),cs.default=n;const t=e(bI());function n(i,l){let o=null;if(!i||typeof i!="string")return o;const u=(0,t.default)(i),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return cs}var Vo={},D1;function SI(){if(D1)return Vo;D1=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},u=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(i,f),h.replace(t,u))};return Vo.camelCase=m,Vo}var Qo,M1;function wI(){if(M1)return Qo;M1=1;var e=Qo&&Qo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(xI()),n=SI();function i(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return i.default=i,Qo=i,Qo}var kI=wI();const jI=Md(kI),tE=nE("end"),Qg=nE("start");function nE(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function EI(e){const t=Qg(e),n=tE(e);if(t&&n)return{start:t,end:n}}function tu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?L1(e.position):"start"in e||"end"in e?L1(e):"line"in e||"column"in e?Gp(e):""}function Gp(e){return I1(e&&e.line)+":"+I1(e&&e.column)}function L1(e){return Gp(e&&e.start)+"-"+Gp(e&&e.end)}function I1(e){return e&&typeof e=="number"?e:1}class pn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const m=i.indexOf(":");m===-1?o.ruleId=i:(o.source=i.slice(0,m),o.ruleId=i.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=tu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const Gg={}.hasOwnProperty,CI=new Map,_I=/[A-Z]/g,NI=new Set(["table","tbody","thead","tfoot","tr"]),AI=new Set(["td","th"]),rE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TI(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=UI(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=II(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vg:yI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=aE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function aE(e,t,n){if(t.type==="element")return RI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zI(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return DI(e,t,n);if(t.type==="mdxjsEsm")return OI(e,t);if(t.type==="root")return MI(e,t,n);if(t.type==="text")return LI(e,t)}function RI(e,t,n){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=Vg,e.schema=l),e.ancestors.push(t);const o=lE(e,t.tagName,!1),u=BI(e,t);let f=Yg(e,t);return NI.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!sI(m):!0})),iE(e,u,o,t),Kg(u,f),e.ancestors.pop(),e.schema=i,e.create(t,o,u,n)}function zI(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}hu(e,t.position)}function OI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hu(e,t.position)}function DI(e,t,n){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=Vg,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:lE(e,t.name,!0),u=PI(e,t),f=Yg(e,t);return iE(e,u,o,t),Kg(u,f),e.ancestors.pop(),e.schema=i,e.create(t,o,u,n)}function MI(e,t,n){const i={};return Kg(i,Yg(e,t)),e.create(t,e.Fragment,i,n)}function LI(e,t){return t.value}function iE(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Kg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function II(e,t,n){return i;function i(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function UI(e,t){return n;function n(i,l,o,u){const f=Array.isArray(o.children),m=Qg(i);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function BI(e,t){const n={};let i,l;for(l in t.properties)if(l!=="children"&&Gg.call(t.properties,l)){const o=$I(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&AI.has(t.tagName)?i=f:n[u]=f}}if(i){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function PI(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else hu(e,t.position);else{const l=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else hu(e,t.position);else o=i.value===null?!0:i.value;n[l]=o}return n}function Yg(e,t){const n=[];let i=-1;const l=e.passKeys?new Map:CI;for(;++i<t.children.length;){const o=t.children[i];let u;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;u=m+"-"+h,l.set(m,h+1)}}const f=aE(e,o,u);f!==void 0&&n.push(f)}return n}function $I(e,t,n){const i=mI(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?nI(n):vI(n)),i.property==="style"){let l=typeof n=="object"?n:FI(e,String(n));return e.stylePropertyNameCase==="css"&&(l=qI(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?dI[i.property]||i.property:i.attribute,n]}}function FI(e,t){try{return jI(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,l=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=rE+"#cannot-parse-style-attribute",l}}function lE(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=N1(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}i=u}else i=N1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return Gg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);hu(e)}function hu(e,t){const n=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=rE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function qI(e){const t={};let n;for(n in e)Gg.call(e,n)&&(t[HI(n)]=e[n]);return t}function HI(e){let t=e.replace(_I,ZI);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ZI(e){return"-"+e.toLowerCase()}const Vm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},VI={};function Xg(e,t){const n=VI,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sE(e,i,l)}function sE(e,t,n){if(QI(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return U1(e.children,t,n)}return Array.isArray(e)?U1(e,t,n):""}function U1(e,t,n){const i=[];let l=-1;for(;++l<e.length;)i[l]=sE(e[l],t,n);return i.join("")}function QI(e){return!!(e&&typeof e=="object")}const B1=document.createElement("i");function Jg(e){const t="&"+e+";";B1.innerHTML=t;const n=B1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xn(e,t,n,i){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,i.length<1e4)u=Array.from(i),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<i.length;)u=i.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function mr(e,t){return e.length>0?(Xn(e,e.length,0,t),e):t}const P1={}.hasOwnProperty;function oE(e){const t={};let n=-1;for(;++n<e.length;)GI(t,e[n]);return t}function GI(e,t){let n;for(n in t){const l=(P1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){P1.call(l,u)||(l[u]=[]);const f=o[u];KI(l[u],Array.isArray(f)?f:f?[f]:[])}}}function KI(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Xn(e,0,0,i)}function uE(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Ni(/[A-Za-z]/),mn=Ni(/[\dA-Za-z]/),YI=Ni(/[#-'*+\--9=?A-Z^-~]/);function Rd(e){return e!==null&&(e<32||e===127)}const Kp=Ni(/\d/),XI=Ni(/[\dA-Fa-f]/),JI=Ni(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const tf=Ni(new RegExp("\\p{P}|\\p{S}","u")),pl=Ni(/\s/);function Ni(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Zs(e){const t=[];let n=-1,i=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&mn(e.charCodeAt(n+1))&&mn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(i,n),encodeURIComponent(u)),i=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(i)}function tt(e,t,n,i){const l=i?i-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Ge(m)?(e.enter(n),f(m)):t(m)}function f(m){return Ge(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const WI={tokenize:eU};function eU(e){const t=e.attempt(this.parser.constructs.contentInitial,i,l);let n;return t;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),tt(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Re(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const tU={tokenize:nU},$1={tokenize:rU};function nU(e){const t=this,n=[];let i=0,l,o,u;return f;function f(D){if(i<n.length){const U=n[i];return t.containerState=U[1],e.attempt(U[0].continuation,m,h)(D)}return h(D)}function m(D){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&T();const U=t.events.length;let B=U,z;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){z=t.events[B][1].end;break}N(i);let F=U;for(;F<t.events.length;)t.events[F][1].end={...z},F++;return Xn(t.events,B+1,0,t.events.slice(U)),t.events.length=F,h(D)}return f(D)}function h(D){if(i===n.length){if(!l)return b(D);if(l.currentConstruct&&l.currentConstruct.concrete)return k(D);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($1,y,g)(D)}function y(D){return l&&T(),N(i),b(D)}function g(D){return t.parser.lazy[t.now().line]=i!==n.length,u=t.now().offset,k(D)}function b(D){return t.containerState={},e.attempt($1,x,k)(D)}function x(D){return i++,n.push([t.currentConstruct,t.containerState]),b(D)}function k(D){if(D===null){l&&T(),N(0),e.consume(D);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(D)}function j(D){if(D===null){E(e.exit("chunkFlow"),!0),N(0),e.consume(D);return}return Re(D)?(e.consume(D),E(e.exit("chunkFlow")),i=0,t.interrupt=void 0,f):(e.consume(D),j)}function E(D,U){const B=t.sliceStream(D);if(U&&B.push(null),D.previous=o,o&&(o.next=D),o=D,l.defineSkip(D.start),l.write(B),t.parser.lazy[D.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<u&&(!l.events[z][1].end||l.events[z][1].end.offset>u))return;const F=t.events.length;let Z=F,ee,q;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(ee){q=t.events[Z][1].end;break}ee=!0}for(N(i),z=F;z<t.events.length;)t.events[z][1].end={...q},z++;Xn(t.events,Z+1,0,t.events.slice(F)),t.events.length=z}}function N(D){let U=n.length;for(;U-- >D;){const B=n[U];t.containerState=B[1],B[0].exit.call(t,e)}n.length=D}function T(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function rU(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ls(e){if(e===null||bt(e)||pl(e))return 1;if(tf(e))return 2}function nf(e,t,n){const i=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}const Yp={name:"attention",resolveAll:aU,tokenize:iU};function aU(e,t){let n=-1,i,l,o,u,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[i][1].end},b={...e[n][1].start};F1(g,-m),F1(b,m),u={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[i][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[i][1].end={...u.start},e[n][1].start={...f.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=mr(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=mr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=mr(h,nf(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=mr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=mr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,Xn(e,i-1,n-i+3,h),n=i+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function iU(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,l=Ls(i);let o;return u;function u(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=Ls(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(i);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function F1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lU={name:"autolink",tokenize:sU};function sU(e,t,n){let i=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return Sn(x)?(e.consume(x),u):x===64?n(x):h(x)}function u(x){return x===43||x===45||x===46||mn(x)?(i=1,f(x)):h(x)}function f(x){return x===58?(e.consume(x),i=0,m):(x===43||x===45||x===46||mn(x))&&i++<32?(e.consume(x),f):(i=0,h(x))}function m(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Rd(x)?n(x):(e.consume(x),m)}function h(x){return x===64?(e.consume(x),y):YI(x)?(e.consume(x),h):n(x)}function y(x){return mn(x)?g(x):n(x)}function g(x){return x===46?(e.consume(x),i=0,y):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||mn(x))&&i++<63){const k=x===45?b:g;return e.consume(x),k}return n(x)}}const Nu={partial:!0,tokenize:oU};function oU(e,t,n){return i;function i(o){return Ge(o)?tt(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Re(o)?t(o):n(o)}}const cE={continuation:{tokenize:cU},exit:dU,name:"blockQuote",tokenize:uU};function uU(e,t,n){const i=this;return l;function l(u){if(u===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Ge(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function cU(e,t,n){const i=this;return l;function l(u){return Ge(u)?tt(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(cE,t,n)(u)}}function dU(e){e.exit("blockQuote")}const dE={name:"characterEscape",tokenize:fU};function fU(e,t,n){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return JI(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const fE={name:"characterReference",tokenize:hU};function hU(e,t,n){const i=this;let l=0,o,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=mn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=XI,y):(e.enter("characterReferenceValue"),o=7,u=Kp,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return u===mn&&!Jg(i.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),y):n(g)}}const q1={partial:!0,tokenize:pU},H1={concrete:!0,name:"codeFenced",tokenize:mU};function mU(e,t,n){const i=this,l={partial:!0,tokenize:B};let o=0,u=0,f;return m;function m(z){return h(z)}function h(z){const F=i.events[i.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(z)}function y(z){return z===f?(u++,e.consume(z),y):u<3?n(z):(e.exit("codeFencedFenceSequence"),Ge(z)?tt(e,g,"whitespace")(z):g(z))}function g(z){return z===null||Re(z)?(e.exit("codeFencedFence"),i.interrupt?t(z):e.check(q1,j,U)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||Re(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(z)):Ge(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,x,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function x(z){return z===null||Re(z)?g(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||Re(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(z)):z===96&&z===f?n(z):(e.consume(z),k)}function j(z){return e.attempt(l,U,E)(z)}function E(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),N}function N(z){return o>0&&Ge(z)?tt(e,T,"linePrefix",o+1)(z):T(z)}function T(z){return z===null||Re(z)?e.check(q1,j,U)(z):(e.enter("codeFlowValue"),D(z))}function D(z){return z===null||Re(z)?(e.exit("codeFlowValue"),T(z)):(e.consume(z),D)}function U(z){return e.exit("codeFenced"),t(z)}function B(z,F,Z){let ee=0;return q;function q(W){return z.enter("lineEnding"),z.consume(W),z.exit("lineEnding"),ae}function ae(W){return z.enter("codeFencedFence"),Ge(W)?tt(z,re,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):re(W)}function re(W){return W===f?(z.enter("codeFencedFenceSequence"),pe(W)):Z(W)}function pe(W){return W===f?(ee++,z.consume(W),pe):ee>=u?(z.exit("codeFencedFenceSequence"),Ge(W)?tt(z,fe,"whitespace")(W):fe(W)):Z(W)}function fe(W){return W===null||Re(W)?(z.exit("codeFencedFence"),F(W)):Z(W)}}}function pU(e,t,n){const i=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}const Qm={name:"codeIndented",tokenize:yU},gU={partial:!0,tokenize:vU};function yU(e,t,n){const i=this;return l;function l(h){return e.enter("codeIndented"),tt(e,o,"linePrefix",5)(h)}function o(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?m(h):Re(h)?e.attempt(gU,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Re(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function vU(e,t,n){const i=this;return l;function l(u){return i.parser.lazy[i.now().line]?n(u):Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):tt(e,o,"linePrefix",5)(u)}function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Re(u)?l(u):n(u)}}const bU={name:"codeText",previous:SU,resolve:xU,tokenize:wU};function xU(e){let t=e.length-4,n=3,i,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)l===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(l=i):(i===t||e[i][1].type==="lineEnding")&&(e[l][1].type="codeTextData",i!==l+2&&(e[l][1].end=e[i-1][1].end,e.splice(l+2,i-l-2),t-=i-l-2,i=l+2),l=void 0);return e}function SU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wU(e,t,n){let i=0,l,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),i++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):Re(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Re(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class kU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&Go(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Go(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Go(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Go(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Go(this.left,n.reverse())}}}function Go(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function hE(e){const t={};let n=-1,i,l,o,u,f,m,h;const y=new kU(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(i=y.get(n),n&&i[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(m=i[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,jU(y,n)),n=t[n],h=!0);else if(i[1]._container){for(o=n,l=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(i[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(i),y.splice(l,n-l+1,f))}}return Xn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function jU(e,t){const n=e.get(t)[1],i=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let y,g,b=-1,x=n,k=0,j=0;const E=[j];for(;x;){for(;e.get(++l)[1]!==x;);o.push(l),x._tokenizer||(y=i.sliceStream(x),x.next||y.push(null),g&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):E.pop(),b=E.length;b--;){const N=f.slice(E[b],E[b+1]),T=o.pop();m.push([T,T+N.length-1]),e.splice(T,2,N)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const EU={resolve:_U,tokenize:NU},CU={partial:!0,tokenize:AU};function _U(e){return hE(e),e}function NU(e,t){let n;return i;function i(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Re(f)?e.check(CU,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function AU(e,t,n){const i=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),tt(e,o,"linePrefix")}function o(u){if(u===null||Re(u))return n(u);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(i.parser.constructs.flow,n,t)(u)}}function mE(e,t,n,i,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(N){return N===60?(e.enter(i),e.enter(l),e.enter(o),e.consume(N),e.exit(o),b):N===null||N===32||N===41||Rd(N)?n(N):(e.enter(i),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(N))}function b(N){return N===62?(e.enter(o),e.consume(N),e.exit(o),e.exit(l),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===62?(e.exit("chunkString"),e.exit(f),b(N)):N===null||N===60||Re(N)?n(N):(e.consume(N),N===92?k:x)}function k(N){return N===60||N===62||N===92?(e.consume(N),x):x(N)}function j(N){return!y&&(N===null||N===41||bt(N))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(i),t(N)):y<h&&N===40?(e.consume(N),y++,j):N===41?(e.consume(N),y--,j):N===null||N===32||N===40||Rd(N)?n(N):(e.consume(N),N===92?E:j)}function E(N){return N===40||N===41||N===92?(e.consume(N),j):j(N)}}function pE(e,t,n,i,l,o){const u=this;let f=0,m;return h;function h(x){return e.enter(i),e.enter(l),e.consume(x),e.exit(l),e.enter(o),y}function y(x){return f>999||x===null||x===91||x===93&&!m||x===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(x):x===93?(e.exit(o),e.enter(l),e.consume(x),e.exit(l),e.exit(i),t):Re(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||Re(x)||f++>999?(e.exit("chunkString"),y(x)):(e.consume(x),m||(m=!Ge(x)),x===92?b:g)}function b(x){return x===91||x===92||x===93?(e.consume(x),f++,g):g(x)}}function gE(e,t,n,i,l,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(i),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,m):n(b)}function m(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(i),t):(e.enter(o),h(b))}function h(b){return b===u?(e.exit(o),m(u)):b===null?n(b):Re(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===u||b===null||Re(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===u||b===92?(e.consume(b),y):y(b)}}function nu(e,t){let n;return i;function i(l){return Re(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,i):Ge(l)?tt(e,i,n?"linePrefix":"lineSuffix")(l):t(l)}}const TU={name:"definition",tokenize:zU},RU={partial:!0,tokenize:OU};function zU(e,t,n){const i=this;let l;return o;function o(x){return e.enter("definition"),u(x)}function u(x){return pE.call(i,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return l=Cr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),m):n(x)}function m(x){return bt(x)?nu(e,h)(x):h(x)}function h(x){return mE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return e.attempt(RU,g,g)(x)}function g(x){return Ge(x)?tt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||Re(x)?(e.exit("definition"),i.parser.defined.push(l),t(x)):n(x)}}function OU(e,t,n){return i;function i(f){return bt(f)?nu(e,l)(f):n(f)}function l(f){return gE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ge(f)?tt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Re(f)?t(f):n(f)}}const DU={name:"hardBreakEscape",tokenize:MU};function MU(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Re(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const LU={name:"headingAtx",resolve:IU,tokenize:UU};function IU(e,t){let n=e.length-2,i=3,l,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(l={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Xn(e,i,n-i+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function UU(e,t,n){let i=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&i++<6?(e.consume(y),u):y===null||bt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Re(y)?(e.exit("atxHeading"),t(y)):Ge(y)?tt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||bt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const BU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Z1=["pre","script","style","textarea"],PU={concrete:!0,name:"htmlFlow",resolveTo:qU,tokenize:HU},$U={partial:!0,tokenize:VU},FU={partial:!0,tokenize:ZU};function qU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function HU(e,t,n){const i=this;let l,o,u,f,m;return h;function h(C){return y(C)}function y(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),g}function g(C){return C===33?(e.consume(C),b):C===47?(e.consume(C),o=!0,j):C===63?(e.consume(C),l=3,i.interrupt?t:R):Sn(C)?(e.consume(C),u=String.fromCharCode(C),E):n(C)}function b(C){return C===45?(e.consume(C),l=2,x):C===91?(e.consume(C),l=5,f=0,k):Sn(C)?(e.consume(C),l=4,i.interrupt?t:R):n(C)}function x(C){return C===45?(e.consume(C),i.interrupt?t:R):n(C)}function k(C){const J="CDATA[";return C===J.charCodeAt(f++)?(e.consume(C),f===J.length?i.interrupt?t:re:k):n(C)}function j(C){return Sn(C)?(e.consume(C),u=String.fromCharCode(C),E):n(C)}function E(C){if(C===null||C===47||C===62||bt(C)){const J=C===47,Y=u.toLowerCase();return!J&&!o&&Z1.includes(Y)?(l=1,i.interrupt?t(C):re(C)):BU.includes(u.toLowerCase())?(l=6,J?(e.consume(C),N):i.interrupt?t(C):re(C)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(C):o?T(C):D(C))}return C===45||mn(C)?(e.consume(C),u+=String.fromCharCode(C),E):n(C)}function N(C){return C===62?(e.consume(C),i.interrupt?t:re):n(C)}function T(C){return Ge(C)?(e.consume(C),T):q(C)}function D(C){return C===47?(e.consume(C),q):C===58||C===95||Sn(C)?(e.consume(C),U):Ge(C)?(e.consume(C),D):q(C)}function U(C){return C===45||C===46||C===58||C===95||mn(C)?(e.consume(C),U):B(C)}function B(C){return C===61?(e.consume(C),z):Ge(C)?(e.consume(C),B):D(C)}function z(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),m=C,F):Ge(C)?(e.consume(C),z):Z(C)}function F(C){return C===m?(e.consume(C),m=null,ee):C===null||Re(C)?n(C):(e.consume(C),F)}function Z(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||bt(C)?B(C):(e.consume(C),Z)}function ee(C){return C===47||C===62||Ge(C)?D(C):n(C)}function q(C){return C===62?(e.consume(C),ae):n(C)}function ae(C){return C===null||Re(C)?re(C):Ge(C)?(e.consume(C),ae):n(C)}function re(C){return C===45&&l===2?(e.consume(C),P):C===60&&l===1?(e.consume(C),V):C===62&&l===4?(e.consume(C),L):C===63&&l===3?(e.consume(C),R):C===93&&l===5?(e.consume(C),be):Re(C)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check($U,A,pe)(C)):C===null||Re(C)?(e.exit("htmlFlowData"),pe(C)):(e.consume(C),re)}function pe(C){return e.check(FU,fe,A)(C)}function fe(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return C===null||Re(C)?pe(C):(e.enter("htmlFlowData"),re(C))}function P(C){return C===45?(e.consume(C),R):re(C)}function V(C){return C===47?(e.consume(C),u="",ce):re(C)}function ce(C){if(C===62){const J=u.toLowerCase();return Z1.includes(J)?(e.consume(C),L):re(C)}return Sn(C)&&u.length<8?(e.consume(C),u+=String.fromCharCode(C),ce):re(C)}function be(C){return C===93?(e.consume(C),R):re(C)}function R(C){return C===62?(e.consume(C),L):C===45&&l===2?(e.consume(C),R):re(C)}function L(C){return C===null||Re(C)?(e.exit("htmlFlowData"),A(C)):(e.consume(C),L)}function A(C){return e.exit("htmlFlow"),t(C)}}function ZU(e,t,n){const i=this;return l;function l(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}function VU(e,t,n){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Nu,t,n)}}const QU={name:"htmlText",tokenize:GU};function GU(e,t,n){const i=this;let l,o,u;return f;function f(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),m}function m(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),B):R===63?(e.consume(R),D):Sn(R)?(e.consume(R),Z):n(R)}function h(R){return R===45?(e.consume(R),y):R===91?(e.consume(R),o=0,k):Sn(R)?(e.consume(R),T):n(R)}function y(R){return R===45?(e.consume(R),x):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),b):Re(R)?(u=g,V(R)):(e.consume(R),g)}function b(R){return R===45?(e.consume(R),x):g(R)}function x(R){return R===62?P(R):R===45?b(R):g(R)}function k(R){const L="CDATA[";return R===L.charCodeAt(o++)?(e.consume(R),o===L.length?j:k):n(R)}function j(R){return R===null?n(R):R===93?(e.consume(R),E):Re(R)?(u=j,V(R)):(e.consume(R),j)}function E(R){return R===93?(e.consume(R),N):j(R)}function N(R){return R===62?P(R):R===93?(e.consume(R),N):j(R)}function T(R){return R===null||R===62?P(R):Re(R)?(u=T,V(R)):(e.consume(R),T)}function D(R){return R===null?n(R):R===63?(e.consume(R),U):Re(R)?(u=D,V(R)):(e.consume(R),D)}function U(R){return R===62?P(R):D(R)}function B(R){return Sn(R)?(e.consume(R),z):n(R)}function z(R){return R===45||mn(R)?(e.consume(R),z):F(R)}function F(R){return Re(R)?(u=F,V(R)):Ge(R)?(e.consume(R),F):P(R)}function Z(R){return R===45||mn(R)?(e.consume(R),Z):R===47||R===62||bt(R)?ee(R):n(R)}function ee(R){return R===47?(e.consume(R),P):R===58||R===95||Sn(R)?(e.consume(R),q):Re(R)?(u=ee,V(R)):Ge(R)?(e.consume(R),ee):P(R)}function q(R){return R===45||R===46||R===58||R===95||mn(R)?(e.consume(R),q):ae(R)}function ae(R){return R===61?(e.consume(R),re):Re(R)?(u=ae,V(R)):Ge(R)?(e.consume(R),ae):ee(R)}function re(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,pe):Re(R)?(u=re,V(R)):Ge(R)?(e.consume(R),re):(e.consume(R),fe)}function pe(R){return R===l?(e.consume(R),l=void 0,W):R===null?n(R):Re(R)?(u=pe,V(R)):(e.consume(R),pe)}function fe(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||bt(R)?ee(R):(e.consume(R),fe)}function W(R){return R===47||R===62||bt(R)?ee(R):n(R)}function P(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function V(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ce}function ce(R){return Ge(R)?tt(e,be,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):be(R)}function be(R){return e.enter("htmlTextData"),u(R)}}const Wg={name:"labelEnd",resolveAll:JU,resolveTo:WU,tokenize:e9},KU={tokenize:t9},YU={tokenize:n9},XU={tokenize:r9};function JU(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",t+=l}}return e.length!==n.length&&Xn(e,0,e.length,n),e}function WU(e,t){let n=e.length,i=0,l,o,u,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(u=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=mr(f,e.slice(o+1,o+i+3)),f=mr(f,[["enter",y,t]]),f=mr(f,nf(t.parser.constructs.insideSpan.null,e.slice(o+i+4,u-3),t)),f=mr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=mr(f,e.slice(u+1)),f=mr(f,[["exit",m,t]]),Xn(e,o,e.length,f),e}function e9(e,t,n){const i=this;let l=i.events.length,o,u;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){o=i.events[l][1];break}return f;function f(b){return o?o._inactive?g(b):(u=i.parser.defined.includes(Cr(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):n(b)}function m(b){return b===40?e.attempt(KU,y,u?y:g)(b):b===91?e.attempt(YU,y,u?h:g)(b):u?y(b):g(b)}function h(b){return e.attempt(XU,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function t9(e,t,n){return i;function i(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return bt(g)?nu(e,o)(g):o(g)}function o(g){return g===41?y(g):mE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return bt(g)?nu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?gE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return bt(g)?nu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function n9(e,t,n){const i=this;return l;function l(f){return pE.call(i,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return i.parser.defined.includes(Cr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function r9(e,t,n){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const a9={name:"labelStartImage",resolveAll:Wg.resolveAll,tokenize:i9};function i9(e,t,n){const i=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):t(f)}}const l9={name:"labelStartLink",resolveAll:Wg.resolveAll,tokenize:s9};function s9(e,t,n){const i=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):t(u)}}const Gm={name:"lineEnding",tokenize:o9};function o9(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,t,"linePrefix")}}const bd={name:"thematicBreak",tokenize:u9};function u9(e,t,n){let i=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):i>=3&&(h===null||Re(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),i++,m):(e.exit("thematicBreakSequence"),Ge(h)?tt(e,f,"whitespace")(h):f(h))}}const Tn={continuation:{tokenize:h9},exit:p9,name:"list",tokenize:f9},c9={partial:!0,tokenize:g9},d9={partial:!0,tokenize:m9};function f9(e,t,n){const i=this,l=i.events[i.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return f;function f(x){const k=i.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||x===i.containerState.marker:Kp(x)){if(i.containerState.type||(i.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(bd,n,h)(x):h(x);if(!i.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(x)}return n(x)}function m(x){return Kp(x)&&++u<10?(e.consume(x),m):(!i.interrupt||u<2)&&(i.containerState.marker?x===i.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||x,e.check(Nu,i.interrupt?n:y,e.attempt(c9,b,g))}function y(x){return i.containerState.initialBlankLine=!0,o++,b(x)}function g(x){return Ge(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function h9(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Nu,l,o);function l(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,tt(e,t,"listItemIndent",i.containerState.size+1)(f)}function o(f){return i.containerState.furtherBlankLines||!Ge(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(d9,t,u)(f))}function u(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,tt(e,e.attempt(Tn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function m9(e,t,n){const i=this;return tt(e,l,"listItemIndent",i.containerState.size+1);function l(o){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?t(o):n(o)}}function p9(e){e.exit(this.containerState.type)}function g9(e,t,n){const i=this;return tt(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=i.events[i.events.length-1];return!Ge(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const V1={name:"setextUnderline",resolveTo:y9,tokenize:v9};function y9(e,t){let n=e.length,i,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",u,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=u,e.push(["exit",u,t]),e}function v9(e,t,n){const i=this;let l;return o;function o(h){let y=i.events.length,g;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){g=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),l=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Ge(h)?tt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Re(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const b9={tokenize:x9};function x9(e){const t=this,n=e.attempt(Nu,i,e.attempt(this.parser.constructs.flowInitial,l,tt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(EU,l)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const S9={resolveAll:vE()},w9=yE("string"),k9=yE("text");function yE(e){return{resolveAll:vE(e==="text"?j9:void 0),tokenize:t};function t(n){const i=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const x=g[b];if(!x.previous||x.previous.call(i,i.previous))return!0}return!1}}}function vE(e){return t;function t(n,i){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,i):n}}function j9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],l=t.sliceStream(i);let o=l.length,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:i.start._bufferIndex+u,_index:i.start._index+o,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const E9={42:Tn,43:Tn,45:Tn,48:Tn,49:Tn,50:Tn,51:Tn,52:Tn,53:Tn,54:Tn,55:Tn,56:Tn,57:Tn,62:cE},C9={91:TU},_9={[-2]:Qm,[-1]:Qm,32:Qm},N9={35:LU,42:bd,45:[V1,bd],60:PU,61:V1,95:bd,96:H1,126:H1},A9={38:fE,92:dE},T9={[-5]:Gm,[-4]:Gm,[-3]:Gm,33:a9,38:fE,42:Yp,60:[lU,QU],91:l9,92:[DU,dE],93:Wg,95:Yp,96:bU},R9={null:[Yp,S9]},z9={null:[42,95]},O9={null:[]},D9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:z9,contentInitial:C9,disable:O9,document:E9,flow:N9,flowInitial:_9,insideSpan:R9,string:A9,text:T9},Symbol.toStringTag,{value:"Module"}));function M9(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let u=[],f=[];const m={attempt:F(B),check:F(z),consume:T,enter:D,exit:U,interrupt:F(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ae){return u=mr(u,ae),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=nf(o,h.events,h),h.events)}function b(ae,re){return I9(x(ae),re)}function x(ae){return L9(u,ae)}function k(){const{_bufferIndex:ae,_index:re,line:pe,column:fe,offset:W}=i;return{_bufferIndex:ae,_index:re,line:pe,column:fe,offset:W}}function j(ae){l[ae.line]=ae.column,q()}function E(){let ae;for(;i._index<u.length;){const re=u[i._index];if(typeof re=="string")for(ae=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===ae&&i._bufferIndex<re.length;)N(re.charCodeAt(i._bufferIndex));else N(re)}}function N(ae){y=y(ae)}function T(ae){Re(ae)?(i.line++,i.column=1,i.offset+=ae===-3?2:1,q()):ae!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=ae}function D(ae,re){const pe=re||{};return pe.type=ae,pe.start=k(),h.events.push(["enter",pe,h]),f.push(pe),pe}function U(ae){const re=f.pop();return re.end=k(),h.events.push(["exit",re,h]),re}function B(ae,re){Z(ae,re.from)}function z(ae,re){re.restore()}function F(ae,re){return pe;function pe(fe,W,P){let V,ce,be,R;return Array.isArray(fe)?A(fe):"tokenize"in fe?A([fe]):L(fe);function L(ue){return ge;function ge(Me){const xe=Me!==null&&ue[Me],_t=Me!==null&&ue.null,en=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(_t)?_t:_t?[_t]:[]];return A(en)(Me)}}function A(ue){return V=ue,ce=0,ue.length===0?P:C(ue[ce])}function C(ue){return ge;function ge(Me){return R=ee(),be=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?Y():ue.tokenize.call(re?Object.assign(Object.create(h),re):h,m,J,Y)(Me)}}function J(ue){return ae(be,R),W}function Y(ue){return R.restore(),++ce<V.length?C(V[ce]):P}}}function Z(ae,re){ae.resolveAll&&!o.includes(ae)&&o.push(ae),ae.resolve&&Xn(h.events,re,h.events.length-re,ae.resolve(h.events.slice(re),h)),ae.resolveTo&&(h.events=ae.resolveTo(h.events,h))}function ee(){const ae=k(),re=h.previous,pe=h.currentConstruct,fe=h.events.length,W=Array.from(f);return{from:fe,restore:P};function P(){i=ae,h.previous=re,h.currentConstruct=pe,h.events.length=fe,f=W,q()}}function q(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function L9(e,t){const n=t.start._index,i=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(i,o)];else{if(u=e.slice(n,l),i>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(i):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function I9(e,t){let n=-1;const i=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
334
- `;break}case-3:{u=`\r
335
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,i.push(u)}return i.join("")}function U9(e){const i={constructs:oE([D9,...(e||{}).extensions||[]]),content:l(WI),defined:[],document:l(tU),flow:l(b9),lazy:{},string:l(w9),text:l(k9)};return i;function l(o){return u;function u(f){return M9(i,o,f)}}}function B9(e){for(;!hE(e););return e}const Q1=/[\0\t\n\r]/g;function P9(){let e=1,t="",n=!0,i;return l;function l(o,u,f){const m=[];let h,y,g,b,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Q1.lastIndex=g,h=Q1.exec(o),b=h&&h.index!==void 0?h.index:o.length,x=o.charCodeAt(b),!h){t=o.slice(g);break}if(x===10&&g===b&&i)m.push(-3),i=void 0;else switch(i&&(m.push(-5),i=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),x){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:i=!0,e=1}g=b+1}return f&&(i&&m.push(-5),t&&m.push(t),m.push(null)),m}}const $9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function F9(e){return e.replace($9,q9)}function q9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return uE(n.slice(o?2:1),o?16:10)}return Jg(n)||e}const bE={}.hasOwnProperty;function H9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Z9(n)(B9(U9(n).document().write(P9()(e,t,!0))))}function Z9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Zr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:o(Na),blockQuote:o(_t),characterEscape:ee,characterReference:ee,codeFenced:o(en),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(en,u),codeText:o(Bn,u),codeTextData:ee,data:ee,codeFlowValue:ee,definition:o(tr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(tn),hardBreakEscape:o(ft),hardBreakTrailing:o(ft),htmlFlow:o(Gt,u),htmlFlowData:ee,htmlText:o(Gt,u),htmlTextData:ee,image:o(br),label:u,link:o(Zr),listItem:o(Ai),listItemValue:b,listOrdered:o(Vr,g),listUnordered:o(Vr),paragraph:o(Ti),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Na),strong:o(Vs),thematicBreak:o(Qs)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:xe,autolinkProtocol:Me,blockQuote:m(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:ue,characterReference:ge,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:m(N),codeText:m(W),codeTextData:q,data:q,definition:m(),definitionDestinationString:U,definitionLabelString:T,definitionTitleString:D,emphasis:m(),hardBreakEscape:m(re),hardBreakTrailing:m(re),htmlFlow:m(pe),htmlFlowData:q,htmlText:m(fe),htmlTextData:q,image:m(V),label:be,labelText:ce,lineEnding:ae,link:m(P),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:J,resourceDestinationString:R,resourceTitleString:L,resource:A,setextHeading:m(Z),setextHeadingLineSequence:F,setextHeadingText:z,strong:m(),thematicBreak:m()}};xE(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ne){let me={type:"root",children:[]};const Oe={stack:[me],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},$e=[];let nt=-1;for(;++nt<ne.length;)if(ne[nt][1].type==="listOrdered"||ne[nt][1].type==="listUnordered")if(ne[nt][0]==="enter")$e.push(nt);else{const cn=$e.pop();nt=l(ne,cn,nt)}for(nt=-1;++nt<ne.length;){const cn=t[ne[nt][0]];bE.call(cn,ne[nt][1].type)&&cn[ne[nt][1].type].call(Object.assign({sliceSerialize:ne[nt][2].sliceSerialize},Oe),ne[nt][1])}if(Oe.tokenStack.length>0){const cn=Oe.tokenStack[Oe.tokenStack.length-1];(cn[1]||G1).call(Oe,void 0,cn[0])}for(me.position={start:ai(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ai(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)me=t.transforms[nt](me)||me;return me}function l(ne,me,Oe){let $e=me-1,nt=-1,cn=!1,xr,rn,Dt,dn;for(;++$e<=Oe;){const ut=ne[$e];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?nt++:nt--,dn=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(xr&&!dn&&!nt&&!Dt&&(Dt=$e),dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dn=void 0}if(!nt&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||nt===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(xr){let Nr=$e;for(rn=void 0;Nr--;){const Pn=ne[Nr];if(Pn[1].type==="lineEnding"||Pn[1].type==="lineEndingBlank"){if(Pn[0]==="exit")continue;rn&&(ne[rn][1].type="lineEndingBlank",cn=!0),Pn[1].type="lineEnding",rn=Nr}else if(!(Pn[1].type==="linePrefix"||Pn[1].type==="blockQuotePrefix"||Pn[1].type==="blockQuotePrefixWhitespace"||Pn[1].type==="blockQuoteMarker"||Pn[1].type==="listItemIndent"))break}Dt&&(!rn||Dt<rn)&&(xr._spread=!0),xr.end=Object.assign({},rn?ne[rn][1].start:ut[1].end),ne.splice(rn||$e,0,["exit",xr,ut[2]]),$e++,Oe++}if(ut[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};xr=Nr,ne.splice($e,0,["enter",Nr,ut[2]]),$e++,Oe++,Dt=void 0,dn=!0}}}return ne[me][1]._spread=cn,Oe}function o(ne,me){return Oe;function Oe($e){f.call(this,ne($e),$e),me&&me.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ne,me,Oe){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([me,Oe||void 0]),ne.position={start:ai(me.start),end:void 0}}function m(ne){return me;function me(Oe){ne&&ne.call(this,Oe),h.call(this,Oe)}}function h(ne,me){const Oe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ne.type&&(me?me.call(this,ne,$e[0]):($e[1]||G1).call(this,ne,$e[0]));else throw new Error("Cannot close `"+ne.type+"` ("+tu({start:ne.start,end:ne.end})+"): it’s not open");Oe.position.end=ai(ne.end)}function y(){return Xg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(ne){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.lang=ne}function k(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.meta=ne}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/(\r?\n|\r)$/g,"")}function T(ne){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Cr(this.sliceSerialize(ne)).toLowerCase()}function D(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function U(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function B(ne){const me=this.stack[this.stack.length-1];if(!me.depth){const Oe=this.sliceSerialize(ne).length;me.depth=Oe}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function F(ne){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ne){const Oe=this.stack[this.stack.length-1].children;let $e=Oe[Oe.length-1];(!$e||$e.type!=="text")&&($e=nn(),$e.position={start:ai(ne.start),end:void 0},Oe.push($e)),this.stack.push($e)}function q(ne){const me=this.stack.pop();me.value+=this.sliceSerialize(ne),me.position.end=ai(ne.end)}function ae(ne){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=me.children[me.children.length-1];Oe.position.end=ai(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(ee.call(this,ne),q.call(this,ne))}function re(){this.data.atHardBreak=!0}function pe(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function fe(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function W(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function P(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ce(ne){const me=this.sliceSerialize(ne),Oe=this.stack[this.stack.length-2];Oe.label=F9(me),Oe.identifier=Cr(me).toLowerCase()}function be(){const ne=this.stack[this.stack.length-1],me=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const $e=ne.children;Oe.children=$e}else Oe.alt=me}function R(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function L(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function A(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function J(ne){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Cr(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function Y(ne){this.data.characterReferenceType=ne.type}function ue(ne){const me=this.sliceSerialize(ne),Oe=this.data.characterReferenceType;let $e;Oe?($e=uE(me,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Jg(me);const nt=this.stack[this.stack.length-1];nt.value+=$e}function ge(ne){const me=this.stack.pop();me.position.end=ai(ne.end)}function Me(ne){q.call(this,ne);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ne)}function xe(ne){q.call(this,ne);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ne)}function _t(){return{type:"blockquote",children:[]}}function en(){return{type:"code",lang:null,meta:null,value:""}}function Bn(){return{type:"inlineCode",value:""}}function tr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tn(){return{type:"emphasis",children:[]}}function Na(){return{type:"heading",depth:0,children:[]}}function ft(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function br(){return{type:"image",title:null,url:"",alt:null}}function Zr(){return{type:"link",title:null,url:"",children:[]}}function Vr(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Ai(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function Ti(){return{type:"paragraph",children:[]}}function Vs(){return{type:"strong",children:[]}}function nn(){return{type:"text",value:""}}function Qs(){return{type:"thematicBreak"}}}function ai(e){return{line:e.line,column:e.column,offset:e.offset}}function xE(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?xE(e,i):V9(e,i)}}function V9(e,t){let n;for(n in t)if(bE.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function G1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+tu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+tu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+tu({start:t.start,end:t.end})+") is still open")}function Q9(e){const t=this;t.parser=n;function n(i){return H9(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function G9(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function K9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
336
- `}]}function Y9(e,t){const n=t.value?t.value+`
337
- `:"",i={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(i.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function X9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=Zs(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let u,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(i,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function e8(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function SE(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=i:l.push({type:"text",value:i}),l}function n8(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return SE(e,t);const l={src:Zs(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(l.title=i.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function r8(e,t){const n={src:Zs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function a8(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function i8(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return SE(e,t);const l={href:Zs(i.url||"")};i.title!==null&&i.title!==void 0&&(l.title=i.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function l8(e,t){const n={href:Zs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function s8(e,t,n){const i=e.all(t),l=n?o8(n):wE(t),o={},u=[];if(typeof t.checked=="boolean"){const y=i[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const y=i[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
338
- `}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const m=i[i.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
339
- `});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function o8(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=wE(n[i])}return t}function wE(e){const t=e.spread;return t??e.children.length>1}function u8(e,t){const n={},i=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<i.length;){const u=i[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function c8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function f8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function h8(e,t){const n=e.all(t),i=n.shift(),l=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Qg(t.children[1]),m=tE(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function m8(e,t,n){const i=n?n.children:void 0,o=(i?i.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},x=u?u[m]:void 0;x&&(b.align=x);let k={type:"element",tagName:o,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function p8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const K1=9,Y1=32;function g8(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),l=0;const o=[];for(;i;)o.push(X1(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=n.exec(t);return o.push(X1(t.slice(l),l>0,!1)),o.join("")}function X1(e,t,n){let i=0,l=e.length;if(t){let o=e.codePointAt(i);for(;o===K1||o===Y1;)i++,o=e.codePointAt(i)}if(n){let o=e.codePointAt(l-1);for(;o===K1||o===Y1;)l--,o=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function y8(e,t){const n={type:"text",value:g8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function v8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const b8={blockquote:G9,break:K9,code:Y9,delete:X9,emphasis:J9,footnoteReference:W9,heading:e8,html:t8,imageReference:n8,image:r8,inlineCode:a8,linkReference:i8,link:l8,listItem:s8,list:u8,paragraph:c8,root:d8,strong:f8,table:h8,tableCell:p8,tableRow:m8,text:y8,thematicBreak:v8,toml:id,yaml:id,definition:id,footnoteDefinition:id};function id(){}const kE=-1,rf=0,ru=1,zd=2,ey=3,ty=4,ny=5,ry=6,jE=7,EE=8,J1=typeof self=="object"?self:globalThis,x8=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),i=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case rf:case kE:return n(u,l);case ru:{const f=n([],l);for(const m of u)f.push(i(m));return f}case zd:{const f=n({},l);for(const[m,h]of u)f[i(m)]=i(h);return f}case ey:return n(new Date(u),l);case ty:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case ny:{const f=n(new Map,l);for(const[m,h]of u)f.set(i(m),i(h));return f}case ry:{const f=n(new Set,l);for(const m of u)f.add(i(m));return f}case jE:{const{name:f,message:m}=u;return n(new J1[f](m),l)}case EE:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new J1[o](u),l)};return i},W1=e=>x8(new Map,e)(0),ds="",{toString:S8}={},{keys:w8}=Object,Ko=e=>{const t=typeof e;if(t!=="object"||!e)return[rf,t];const n=S8.call(e).slice(8,-1);switch(n){case"Array":return[ru,ds];case"Object":return[zd,ds];case"Date":return[ey,ds];case"RegExp":return[ty,ds];case"Map":return[ny,ds];case"Set":return[ry,ds];case"DataView":return[ru,n]}return n.includes("Array")?[ru,n]:n.includes("Error")?[jE,n]:[zd,n]},ld=([e,t])=>e===rf&&(t==="function"||t==="symbol"),k8=(e,t,n,i)=>{const l=(u,f)=>{const m=i.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=Ko(u);switch(f){case rf:{let y=u;switch(m){case"bigint":f=EE,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([kE],u)}return l([f,y],u)}case ru:{if(m){let b=u;return m==="DataView"?b=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(u)),l([m,[...b]],u)}const y=[],g=l([f,y],u);for(const b of u)y.push(o(b));return g}case zd:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],g=l([f,y],u);for(const b of w8(u))(e||!ld(Ko(u[b])))&&y.push([o(b),o(u[b])]);return g}case ey:return l([f,u.toISOString()],u);case ty:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case ny:{const y=[],g=l([f,y],u);for(const[b,x]of u)(e||!(ld(Ko(b))||ld(Ko(x))))&&y.push([o(b),o(x)]);return g}case ry:{const y=[],g=l([f,y],u);for(const b of u)(e||!ld(Ko(b)))&&y.push(o(b));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},eS=(e,{json:t,lossy:n}={})=>{const i=[];return k8(!(t||n),!!t,new Map,i)(e),i},Od=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?W1(eS(e,t)):structuredClone(e):(e,t)=>W1(eS(e,t));function j8(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function E8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function C8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||j8,i=e.options.footnoteBackLabel||E8,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),b=Zs(g.toLowerCase());let x=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++x<=j;){k.length>0&&k.push({type:"text",value:" "});let T=typeof n=="string"?n:n(m,x);typeof T=="string"&&(T={type:"text",value:T}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(m,x),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const T=E.children[E.children.length-1];T&&T.type==="text"?T.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Od(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
340
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
341
- `}]}}const af=(function(e){if(e==null)return T8;if(typeof e=="function")return lf(e);if(typeof e=="object")return Array.isArray(e)?_8(e):N8(e);if(typeof e=="string")return A8(e);throw new Error("Expected function, string, or object as test")});function _8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=af(e[n]);return lf(i);function i(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function N8(e){const t=e;return lf(n);function n(i){const l=i;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function A8(e){return lf(t);function t(n){return n&&n.type===e}}function lf(e){return t;function t(n,i,l){return!!(R8(n)&&e.call(this,n,typeof i=="number"?i:void 0,l||void 0))}}function T8(){return!0}function R8(e){return e!==null&&typeof e=="object"&&"type"in e}const CE=[],z8=!0,Xp=!1,O8="skip";function _E(e,t,n,i){let l;typeof t=="function"&&typeof n!="function"?(i=n,n=t):l=t;const o=af(l),u=i?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=CE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(x=D8(n(m,y)),x[0]===Xp))return x;if("children"in m&&m.children){const N=m;if(N.children&&x[0]!==O8)for(j=(i?N.children.length:-1)+u,E=y.concat(N);j>-1&&j<N.children.length;){const T=N.children[j];if(k=f(T,j,E)(),k[0]===Xp)return k;j=typeof k[1]=="number"?k[1]:j+u}}return x}}}function D8(e){return Array.isArray(e)?e:typeof e=="number"?[z8,e]:e==null?CE:[e]}function ay(e,t,n,i){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=i),_E(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return u(m,g,y)}}const Jp={}.hasOwnProperty,M8={};function L8(e,t){const n=t||M8,i=new Map,l=new Map,o=new Map,u={...b8,...n.handlers},f={all:h,applyData:U8,definitionById:i,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:I8,wrap:P8};return ay(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?i:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,x=f.handlers[b];if(Jp.call(f.handlers,b)&&x)return x(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,N=Od(E);return N.children=f.all(y),N}return Od(y)}return(f.options.unknownHandler||B8)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let x=-1;for(;++x<b.length;){const k=f.one(b[x],y);if(k){if(x&&b[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=tS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=tS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function I8(e,t){e.position&&(t.position=EI(e))}function U8(e,t){let n=t;if(e&&e.data){const i=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const u="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Od(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function B8(e,t){const n=t.data||{},i="value"in t&&!(Jp.call(n,"hProperties")||Jp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function P8(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
342
- `});++i<e.length;)i&&n.push({type:"text",value:`
343
- `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
344
- `}),n}function tS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nS(e,t){const n=L8(e,t),i=n.one(e,void 0),l=C8(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
345
- `},l),o}function $8(e,t){return e&&"run"in e?async function(n,i){const l=nS(n,{file:i,...t});await e.run(l,i)}:function(n,i){return nS(n,{file:i,...e||t})}}function rS(e){if(e)throw e}var Km,aS;function F8(){if(aS)return Km;aS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},u=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return Km=function m(){var h,y,g,b,x,k,j=arguments[0],E=1,N=arguments.length,T=!1;for(typeof j=="boolean"&&(T=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<N;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(T&&b&&(o(b)||(x=l(b)))?(x?(x=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(T,k,b)})):typeof b<"u"&&u(j,{name:y,newValue:b}));return j},Km}var q8=F8();const Ym=Md(q8);function Wp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function H8(){const e=[],t={run:n,use:i};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){u(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?Z8(y,f)(...h):u(null,...h)}}function i(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function Z8(e,t){let n;return i;function i(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Mr={basename:V8,dirname:Q8,extname:G8,join:K8,sep:"/"};function V8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Au(e);let n=0,i=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else i<0&&(o=!0,i=l+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(i=l):(f=-1,i=u));return n===i?i=u:i<0&&(i=e.length),e.slice(n,i)}function Q8(e){if(Au(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function G8(e){Au(e);let t=e.length,n=-1,i=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){i=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===i+1?"":e.slice(l,n)}function K8(...e){let t=-1,n;for(;++t<e.length;)Au(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Y8(n)}function Y8(e){Au(e);const t=e.codePointAt(0)===47;let n=X8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function X8(e,t){let n="",i=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",i=0):(n=n.slice(0,m),i=n.length-1-n.lastIndexOf("/")),l=u,o=0;continue}}else if(n.length>0){n="",i=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),i=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Au(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J8={cwd:W8};function W8(){return"/"}function eg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function eB(e){if(typeof e=="string")e=new URL(e);else if(!eg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return tB(e)}function tB(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Xm=["history","path","basename","stem","extname","dirname"];class NE{constructor(t){let n;t?eg(t)?n={path:t}:typeof t=="string"||nB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":J8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Xm.length;){const o=Xm[i];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Xm.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){Wm(t,"basename"),Jm(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){iS(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(Jm(t,"extname"),iS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eg(t)&&(t=eB(t)),Wm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){Wm(t,"stem"),Jm(t,"stem"),this.path=Mr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const l=this.message(t,n,i);throw l.fatal=!0,l}info(t,n,i){const l=this.message(t,n,i);return l.fatal=void 0,l}message(t,n,i){const l=new pn(t,n,i);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Jm(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function Wm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function iS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rB=(function(e){const i=this.constructor.prototype,l=i[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),aB={}.hasOwnProperty;class iy extends rB{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=H8()}copy(){const t=new iy;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Ym(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(np("data",this.frozen),this.namespace[t]=n,this):aB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(np("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const l=n.call(t,...i);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=sd(t),i=this.parser||this.Parser;return ep("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),ep("process",this.parser||this.Parser),tp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=sd(t),m=i.parse(f);i.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const x=g,k=i.stringify(x,b);sB(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?u(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,i;return this.freeze(),ep("processSync",this.parser||this.Parser),tp("processSync",this.compiler||this.Compiler),this.process(t,l),sS("processSync","process",n),i;function l(o,u){n=!0,rS(o),i=u}}run(t,n,i){lS(t),this.freeze();const l=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?o(void 0,i):new Promise(o);function o(u,f){const m=sd(n);l.run(t,m,h);function h(y,g,b){const x=g||t;y?f(y):u?u(x):i(void 0,x,b)}}}runSync(t,n){let i=!1,l;return this.run(t,n,o),sS("runSync","run",i),l;function o(u,f){rS(u),l=f,i=!0}}stringify(t,n){this.freeze();const i=sd(n),l=this.compiler||this.Compiler;return tp("stringify",l),lS(t),l(t,i)}use(t,...n){const i=this.attachers,l=this.namespace;if(np("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=Ym(!0,l.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,b=-1;for(;++g<i.length;)if(i[g][0]===h){b=g;break}if(b===-1)i.push([h,...y]);else if(y.length>0){let[x,...k]=y;const j=i[b][1];Wp(j)&&Wp(x)&&(x=Ym(!0,j,x)),i[b]=[h,x,...k]}}}}const iB=new iy().freeze();function ep(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function np(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lS(e){if(!Wp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sd(e){return lB(e)?e:new NE(e)}function lB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function sB(e){return typeof e=="string"||oB(e)}function oB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",oS=[],uS={allowDangerousHtml:!0},cB=/^(https?|ircs?|mailto|xmpp)$/i,dB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fB(e){const t=hB(e),n=mB(e);return pB(t.runSync(t.parse(n),n),e)}function hB(e){const t=e.rehypePlugins||oS,n=e.remarkPlugins||oS,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uS}:uS;return iB().use(Q9).use(n).use($8,i).use(t)}function mB(e){const t=e.children||"",n=new NE;return typeof t=="string"&&(n.value=t),n}function pB(e,t){const n=t.allowedElements,i=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||gB;for(const y of dB)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+uB+y.id,void 0);return ay(e,h),TI(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return u?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let x;for(x in Vm)if(Object.hasOwn(Vm,x)&&Object.hasOwn(y.properties,x)){const k=y.properties[x],j=Vm[x];(j===null||j.includes(y.tagName))&&(y.properties[x]=m(String(k||""),x,y))}}if(y.type==="element"){let x=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!x&&i&&typeof g=="number"&&(x=!i(y,g,b)),x&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function gB(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||i!==-1&&t>i||cB.test(e.slice(0,t))?e:""}function yB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function AE(e,t,n){const l=af((n||{}).ignore||[]),o=vB(t);let u=-1;for(;++u<o.length;)_E(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const x=y[g],k=b?b.children:void 0;if(l(x,k?k.indexOf(x):void 0,b))return;b=x}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[u][0],x=o[u][1];let k=0;const E=g.children.indexOf(h);let N=!1,T=[];b.lastIndex=0;let D=b.exec(h.value);for(;D;){const U=D.index,B={index:D.index,input:D.input,stack:[...y,h]};let z=x(...D,B);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=U+1:(k!==U&&T.push({type:"text",value:h.value.slice(k,U)}),Array.isArray(z)?T.push(...z):z&&T.push(z),k=U+D[0].length,N=!0),!b.global)break;D=b.exec(h.value)}return N?(k<h.value.length&&T.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...T)):T=[h],E+T.length}}function vB(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const l=n[i];t.push([bB(l[0]),xB(l[1])])}return t}function bB(e){return typeof e=="string"?new RegExp(yB(e),"g"):e}function xB(e){return typeof e=="function"?e:function(){return e}}function SB(e){AE(e,[/\r?\n|\r/g,wB])}function wB(){return{type:"break"}}function kB(){return function(e){SB(e)}}function cS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,l=n.indexOf(t);for(;l!==-1;)i++,l=n.indexOf(t,l+t.length);return i}const rp="phrasing",ap=["autolink","link","image","label"];function jB(){return{transforms:[RB],enter:{literalAutolink:CB,literalAutolinkEmail:ip,literalAutolinkHttp:ip,literalAutolinkWww:ip},exit:{literalAutolink:TB,literalAutolinkEmail:AB,literalAutolinkHttp:_B,literalAutolinkWww:NB}}}function EB(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:ap},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:ap},{character:":",before:"[ps]",after:"\\/",inConstruct:rp,notInConstruct:ap}]}}function CB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ip(e){this.config.enter.autolinkProtocol.call(this,e)}function _B(e){this.config.exit.autolinkProtocol.call(this,e)}function NB(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function AB(e){this.config.exit.autolinkEmail.call(this,e)}function TB(e){this.exit(e)}function RB(e){AE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),OB]],{ignore:["link","linkReference"]})}function zB(e,t,n,i,l){let o="";if(!TE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!DB(n)))return!1;const u=MB(n+i);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function OB(e,t,n,i){return!TE(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function DB(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function MB(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const l=cS(e,"(");let o=cS(e,")");for(;i!==-1&&l>o;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),o++;return[e,n]}function TE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pl(n)||tf(n))&&(!t||n!==47)}RE.peek=HB;function LB(){this.buffer()}function IB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function UB(){this.buffer()}function BB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function PB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $B(e){this.exit(e)}function FB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qB(e){this.exit(e)}function HB(){return"["}function RE(e,t,n,i){const l=n.createTracker(i);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function ZB(){return{enter:{gfmFootnoteCallString:LB,gfmFootnoteCall:IB,gfmFootnoteDefinitionLabelString:UB,gfmFootnoteDefinition:BB},exit:{gfmFootnoteCallString:PB,gfmFootnoteCall:$B,gfmFootnoteDefinitionLabelString:FB,gfmFootnoteDefinition:qB}}}function VB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:RE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(i),{before:m,after:"]"})),y(),m+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),m+=f.move((t?`
346
- `:" ")+o.indentLines(o.containerFlow(i,f.current()),t?zE:QB))),h(),m}}function QB(e,t,n){return t===0?e:zE(e,t,n)}function zE(e,t,n){return(n?"":" ")+e}const GB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];OE.peek=WB;function KB(){return{canContainEols:["delete"],enter:{strikethrough:XB},exit:{strikethrough:JB}}}function YB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GB}],handlers:{delete:OE}}}function XB(e){this.enter({type:"delete",children:[]},e)}function JB(e){this.exit(e)}function OE(e,t,n,i){const l=n.createTracker(i),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function WB(){return"~"}function eP(e){return e.length}function tP(e,t){const n=t||{},i=(n.align||[]).concat(),l=n.stringLength||eP,o=[],u=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let N=-1;for(e[y].length>h&&(h=e[y].length);++N<e[y].length;){const T=nP(e[y][N]);if(n.alignDelimiters!==!1){const D=l(T);E[N]=D,(m[N]===void 0||D>m[N])&&(m[N]=D)}j.push(T)}u[y]=j,f[y]=E}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<h;)o[g]=dS(i[g]);else{const j=dS(i);for(;++g<h;)o[g]=j}g=-1;const b=[],x=[];for(;++g<h;){const j=o[g];let E="",N="";j===99?(E=":",N=":"):j===108?E=":":j===114&&(N=":");let T=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-N.length);const D=E+"-".repeat(T)+N;n.alignDelimiters!==!1&&(T=E.length+T+N.length,T>m[g]&&(m[g]=T),x[g]=T),b[g]=D}u.splice(1,0,b),f.splice(1,0,x),y=-1;const k=[];for(;++y<u.length;){const j=u[y],E=f[y];g=-1;const N=[];for(;++g<h;){const T=j[g]||"";let D="",U="";if(n.alignDelimiters!==!1){const B=m[g]-(E[g]||0),z=o[g];z===114?D=" ".repeat(B):z===99?B%2?(D=" ".repeat(B/2+.5),U=" ".repeat(B/2-.5)):(D=" ".repeat(B/2),U=D):U=" ".repeat(B)}n.delimiterStart!==!1&&!g&&N.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||g)&&N.push(" "),n.alignDelimiters!==!1&&N.push(D),N.push(T),n.alignDelimiters!==!1&&N.push(U),n.padding!==!1&&N.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&N.push("|")}k.push(n.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return k.join(`
347
- `)}function nP(e){return e==null?"":String(e)}function dS(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function rP(e,t,n,i){const l=n.enter("blockquote"),o=n.createTracker(i);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),aP);return l(),u}function aP(e,t,n){return">"+(n?"":" ")+e}function iP(e,t){return fS(e,t.inConstruct,!0)&&!fS(e,t.notInConstruct,!1)}function fS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function hS(e,t,n,i){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
348
- `&&iP(n.stack,n.unsafe[l]))return/[ \t]/.test(i.before)?"":" ";return`\\
349
- `}function lP(e,t){const n=String(e);let i=n.indexOf(t),l=i,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===l?++o>u&&(u=o):o=1,l=i+t.length,i=n.indexOf(t,l);return u}function sP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function oP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uP(e,t,n,i){const l=oP(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(sP(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,cP);return g(),b}const f=n.createTracker(i),m=l.repeat(Math.max(lP(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
350
- `,encode:["`"],...f.current()})),g()}return y+=f.move(`
351
- `),o&&(y+=f.move(o+`
352
- `)),y+=f.move(m),h(),y}function cP(e,t,n){return(n?"":" ")+e}function ly(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function dP(e,t,n,i){const l=ly(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const m=n.createTracker(i);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
353
- `,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function fP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Dd(e,t,n){const i=Ls(e),l=Ls(t);return i===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}DE.peek=hP;function DE(e,t,n,i){const l=fP(n),o=n.enter("emphasis"),u=n.createTracker(i),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=Dd(i.before.charCodeAt(i.before.length-1),h,l);y.inside&&(m=mu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Dd(i.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+mu(g));const x=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+x}function hP(e,t,n){return n.options.emphasis||"*"}function mP(e,t){let n=!1;return ay(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Xp}),!!((!e.depth||e.depth<3)&&Xg(e)&&(t.options.setext||n))}function pP(e,t,n,i){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(i);if(mP(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
354
- `,after:`
355
- `});return g(),y(),b+`
356
- `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
357
- `))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
358
- `,...o.current()});return/^[\t ]/.test(h)&&(h=mu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}ME.peek=gP;function ME(e){return e.value||""}function gP(){return"<"}LE.peek=yP;function LE(e,t,n,i){const l=ly(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const m=n.createTracker(i);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),u(),h}function yP(){return"!"}IE.peek=vP;function IE(e,t,n,i){const l=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(i);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function vP(){return"!"}UE.peek=bP;function UE(e,t,n){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<n.unsafe.length;){const u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.atBreak)for(;m=f.exec(i);){let h=m.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(m.index+1)}}return l+i+l}function bP(){return"`"}function BE(e,t){const n=Xg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}PE.peek=xP;function PE(e,t,n,i){const l=ly(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(i);let f,m;if(BE(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=u.move("<");return g+=u.move(n.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function xP(e,t,n){return BE(e,n)?"<":"["}$E.peek=SP;function $E(e,t,n,i){const l=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(i);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function SP(){return"["}function sy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wP(e){const t=sy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function kP(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function FE(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function jP(e,t,n,i){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?kP(n):sy(n);const f=e.ordered?u==="."?")":".":wP(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),FE(n)===u&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,i);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function EP(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function CP(e,t,n,i){const l=EP(n);let o=n.bulletCurrent||sy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(i);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,x){return b?(x?"":" ".repeat(u))+g:(x?o:o+" ".repeat(u-o.length))+g}}function _P(e,t,n,i){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,i);return o(),l(),u}const NP=af(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AP(e,t,n,i){return(e.children.some(function(u){return NP(u)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function TP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}qE.peek=RP;function qE(e,t,n,i){const l=TP(n),o=n.enter("strong"),u=n.createTracker(i),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=Dd(i.before.charCodeAt(i.before.length-1),h,l);y.inside&&(m=mu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Dd(i.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+mu(g));const x=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+x}function RP(e,t,n){return n.options.strong||"*"}function zP(e,t,n,i){return n.safe(e.value,i)}function OP(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function DP(e,t,n){const i=(FE(n)+(n.options.ruleSpaces?" ":"")).repeat(OP(n));return n.options.ruleSpaces?i.slice(0,-1):i}const HE={blockquote:rP,break:hS,code:uP,definition:dP,emphasis:DE,hardBreak:hS,heading:pP,html:ME,image:LE,imageReference:IE,inlineCode:UE,link:PE,linkReference:$E,list:jP,listItem:CP,paragraph:_P,root:AP,strong:qE,text:zP,thematicBreak:DP};function MP(){return{enter:{table:LP,tableData:mS,tableHeader:mS,tableRow:UP},exit:{codeText:BP,table:IP,tableData:lp,tableHeader:lp,tableRow:lp}}}function LP(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function IP(e){this.exit(e),this.data.inTable=void 0}function UP(e){this.enter({type:"tableRow",children:[]},e)}function lp(e){this.exit(e)}function mS(e){this.enter({type:"tableCell",children:[]},e)}function BP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function PP(e,t){return t==="|"?t:e}function $P(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
359
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:m,tableRow:f}};function u(x,k,j,E){return h(y(x,j,E),x.align)}function f(x,k,j,E){const N=g(x,j,E),T=h([N]);return T.slice(0,T.indexOf(`
360
- `))}function m(x,k,j,E){const N=j.enter("tableCell"),T=j.enter("phrasing"),D=j.containerPhrasing(x,{...E,before:o,after:o});return T(),N(),D}function h(x,k){return tP(x,{align:k,alignDelimiters:i,padding:n,stringLength:l})}function y(x,k,j){const E=x.children;let N=-1;const T=[],D=k.enter("table");for(;++N<E.length;)T[N]=g(E[N],k,j);return D(),T}function g(x,k,j){const E=x.children;let N=-1;const T=[],D=k.enter("tableRow");for(;++N<E.length;)T[N]=m(E[N],x,k,j);return D(),T}function b(x,k,j){let E=HE.inlineCode(x,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function FP(){return{exit:{taskListCheckValueChecked:pS,taskListCheckValueUnchecked:pS,paragraph:HP}}}function qP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZP}}}function pS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function HP(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const l=t.children;let o=-1,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function ZP(e,t,n,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(i);o&&f.move(u);let m=HE.listItem(e,t,n,{...i,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+u}}function VP(){return[jB(),ZB(),KB(),MP(),FP()]}function QP(e){return{extensions:[EB(),VB(e),YB(),$P(e),qP()]}}const GP={tokenize:e$,partial:!0},ZE={tokenize:t$,partial:!0},VE={tokenize:n$,partial:!0},QE={tokenize:r$,partial:!0},KP={tokenize:a$,partial:!0},GE={name:"wwwAutolink",tokenize:JP,previous:YE},KE={name:"protocolAutolink",tokenize:WP,previous:XE},_a={name:"emailAutolink",tokenize:XP,previous:JE},Hr={};function YP(){return{text:Hr}}let Wi=48;for(;Wi<123;)Hr[Wi]=_a,Wi++,Wi===58?Wi=65:Wi===91&&(Wi=97);Hr[43]=_a;Hr[45]=_a;Hr[46]=_a;Hr[95]=_a;Hr[72]=[_a,KE];Hr[104]=[_a,KE];Hr[87]=[_a,GE];Hr[119]=[_a,GE];function XP(e,t,n){const i=this;let l,o;return u;function u(g){return!tg(g)||!JE.call(i,i.previous)||oy(i.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return tg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(KP,y,h)(g):g===45||g===95||mn(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&Sn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function JP(e,t,n){const i=this;return l;function l(u){return u!==87&&u!==119||!YE.call(i,i.previous)||oy(i.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(GP,e.attempt(ZE,e.attempt(VE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function WP(e,t,n){const i=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&XE.call(i,i.previous)&&!oy(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(Sn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||Rd(g)||bt(g)||pl(g)||tf(g)?n(g):e.attempt(ZE,e.attempt(VE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function e$(e,t,n){let i=0;return l;function l(u){return(u===87||u===119)&&i<3?(i++,e.consume(u),l):u===46&&i===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function t$(e,t,n){let i,l,o;return u;function u(h){return h===46||h===95?e.check(QE,m,f)(h):h===null||bt(h)||pl(h)||h!==45&&tf(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?i=!0:(l=i,i=void 0),e.consume(h),u}function m(h){return l||i||!o?n(h):t(h)}}function n$(e,t){let n=0,i=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&i<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(QE,t,o)(u):u===null||bt(u)||pl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&i++,e.consume(u),l}}function r$(e,t,n){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||bt(f)||pl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||bt(f)||pl(f)?t(f):i(f)}function o(f){return Sn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),i):Sn(f)?(e.consume(f),u):n(f)}}function a$(e,t,n){return i;function i(o){return e.consume(o),l}function l(o){return mn(o)?n(o):t(o)}}function YE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bt(e)}function XE(e){return!Sn(e)}function JE(e){return!(e===47||tg(e))}function tg(e){return e===43||e===45||e===46||e===95||mn(e)}function oy(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const i$={tokenize:h$,partial:!0};function l$(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:c$,continuation:{tokenize:d$},exit:f$}},text:{91:{name:"gfmFootnoteCall",tokenize:u$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:s$,resolveTo:o$}}}}function s$(e,t,n){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u;for(;l--;){const m=i.events[l][1];if(m.type==="labelImage"){u=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!u||!u._balanced)return n(m);const h=Cr(i.sliceSerialize({start:u.end,end:i.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function o$(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...f),e}function u$(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,u;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!u||g===null||g===91||bt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Cr(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return bt(g)||(u=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function c$(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,u=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(u>999||k===93&&!f||k===null||k===91||bt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Cr(i.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return bt(k)||(f=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),tt(e,x,"gfmFootnoteDefinitionWhitespace")):n(k)}function x(k){return t(k)}}function d$(e,t,n){return e.check(Nu,t,e.attempt(i$,t,n))}function f$(e){e.exit("gfmFootnoteDefinition")}function h$(e,t,n){const i=this;return tt(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=i.events[i.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function m$(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function l(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},g={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},b=[["enter",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",g,f]],x=f.parser.constructs.insideSpan.null;x&&Xn(b,b.length,0,nf(x,u.slice(h+1,m),f)),Xn(b,b.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),Xn(u,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,f,m){const h=this.previous,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const j=Ls(h);if(k===126)return g>1?m(k):(u.consume(k),g++,x);if(g<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),N=Ls(k);return E._open=!N||N===2&&!!j,E._close=!j||j===2&&!!N,f(k)}}}class p${constructor(){this.map=[]}add(t,n,i){g$(this,t,n,i)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let l=i.pop();for(;l;){for(const o of l)t.push(o);l=i.pop()}this.map.length=0}}function g$(e,t,n,i){let l=0;if(!(n===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...i);return}l+=1}e.map.push([t,n,i])}}function y$(e,t){let n=!1;const i=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function v$(){return{flow:{null:{name:"table",tokenize:b$,resolveAll:x$}}}}function b$(e,t,n){const i=this;let l=0,o=0,u;return f;function f(q){let ae=i.events.length-1;for(;ae>-1;){const fe=i.events[ae][1].type;if(fe==="lineEnding"||fe==="linePrefix")ae--;else break}const re=ae>-1?i.events[ae][1].type:null,pe=re==="tableHead"||re==="tableRow"?z:m;return pe===z&&i.parser.lazy[i.now().line]?n(q):pe(q)}function m(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(u=!0,o+=1),y(q)}function y(q){return q===null?n(q):Re(q)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),x):n(q):Ge(q)?tt(e,y,"whitespace")(q):(o+=1,u&&(u=!1,l+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(q)))}function g(q){return q===null||q===124||bt(q)?(e.exit("data"),y(q)):(e.consume(q),q===92?b:g)}function b(q){return q===92||q===124?(e.consume(q),g):g(q)}function x(q){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(q):(e.enter("tableDelimiterRow"),u=!1,Ge(q)?tt(e,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):k(q))}function k(q){return q===45||q===58?E(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),j):B(q)}function j(q){return Ge(q)?tt(e,E,"whitespace")(q):E(q)}function E(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),N):q===45?(o+=1,N(q)):q===null||Re(q)?U(q):B(q)}function N(q){return q===45?(e.enter("tableDelimiterFiller"),T(q)):B(q)}function T(q){return q===45?(e.consume(q),T):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),D):(e.exit("tableDelimiterFiller"),D(q))}function D(q){return Ge(q)?tt(e,U,"whitespace")(q):U(q)}function U(q){return q===124?k(q):q===null||Re(q)?!u||l!==o?B(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):B(q)}function B(q){return n(q)}function z(q){return e.enter("tableRow"),F(q)}function F(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),F):q===null||Re(q)?(e.exit("tableRow"),t(q)):Ge(q)?tt(e,F,"whitespace")(q):(e.enter("data"),Z(q))}function Z(q){return q===null||q===124||bt(q)?(e.exit("data"),F(q)):(e.consume(q),q===92?ee:Z)}function ee(q){return q===92||q===124?(e.consume(q),Z):Z(q)}}function x$(e,t){let n=-1,i=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,y,g;const b=new p$;for(;++n<e.length;){const x=e[n],k=x[1];x[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(gS(b,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,g=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=od(b,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(u[0]=u[1],g=od(b,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],g=od(b,t,o,l,n,g)):u[1]!==0&&(g=od(b,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&gS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=y$(t.events,n))}return e}function od(e,t,n,i,l,o){const u=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ms(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ms(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ms(t.events,n[2]),y=ms(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),i!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ms(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function gS(e,t,n,i,l){const o=[],u=ms(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),i.end=Object.assign({},u),o.push(["exit",i,t]),e.add(n+1,0,o)}function ms(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const S$={name:"tasklistCheck",tokenize:k$};function w$(){return{text:{91:S$}}}function k$(e,t,n){const i=this;return l;function l(m){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return bt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Re(m)?t(m):Ge(m)?e.check({tokenize:j$},t,n)(m):n(m)}}function j$(e,t,n){return tt(e,i,"whitespace");function i(l){return l===null?n(l):t(l)}}function E$(e){return oE([YP(),l$(),m$(e),v$(),w$()])}const C$={};function _$(e){const t=this,n=e||C$,i=t.data(),l=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),u=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);l.push(E$(n)),o.push(VP()),u.push(QP(n))}function WE({children:e,className:t}){return d.jsx("div",{className:Te("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:d.jsx(fB,{remarkPlugins:[_$,kB],children:e})})}function N$({value:e,baseline:t,onChange:n,onRevert:i,disabled:l}){const[o,u]=S.useState(!1),f=S.useRef(null),m=e!==t;return S.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${m?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["System Prompt Append",m&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),d.jsx("div",{className:"flex gap-2",children:!o&&!l&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[d.jsx($d,{className:"h-3 w-3"})," Edit"]})})]}),d.jsx("div",{className:"px-4 py-3",children:o?d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{size:"xs",variant:"ghost",onClick:()=>{i(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(ve,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):d.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?d.jsx(WE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}const A$={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function T$(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage?null:d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-warn-soft/95 px-6 py-3 backdrop-blur",children:d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-body",children:[e.summary.anyDirty&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{"aria-hidden":!0,children:"🟡"}),d.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),d.jsx("span",{className:"text-muted-foreground",children:"·"}),d.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(t=>d.jsx("button",{type:"button",className:"rounded bg-card px-2 py-0.5 text-caption border hover:bg-warn-soft",onClick:()=>e.onJumpTo(t),children:A$[t]},t))})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-caption text-warn font-medium",children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-caption text-error font-medium",children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&d.jsx(ve,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(ve,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(ve,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?"Saving…":"Save"})]})]})})}function Er(e){return`agent-cfg-${e}`}function R$(e){return e.isUnclaimed?"Saving: configuration stored; will apply when a computer claims this agent.":e.isOffline?"Saving: configuration stored; will apply when the computer reconnects.":e.activeSessions>0?`Saving: new chats use this immediately; ${e.activeSessions} active chat${e.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function z$(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function O$(e,t){return JSON.stringify(e)===JSON.stringify(t)}function sp(e,t){return e.map((n,i)=>({key:`${t}-${i+1}`,value:n,baseline:n,status:"unchanged"}))}function yS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:O$(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function op(e,t){const n=e;return{add:i=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=z$(n,u),m=[...o,{key:f,value:i,baseline:null,status:"added"}];return{...l,[e]:yS(m)}}),update:(i,l)=>t(o=>{const f=o[e].map(m=>m.key===i?{...m,value:l}:m);return{...o,[e]:yS(f)}}),remove:i=>t(l=>{const u=l[e].map(f=>f.key!==i?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:i=>t(l=>{const u=l[e].map(f=>f.key!==i||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function D$(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:sp(e.payload.mcpServers,"mcp"),env:sp(e.payload.env,"env"),git:sp(e.payload.gitRepos,"git")}}function M$(e){const[t,n]=S.useState(null);S.useEffect(()=>{e&&t===null&&n(D$(e))},[e,t]);const i=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",u=i.promptAppend!==l,f=i.model!==o,m=S.useMemo(()=>{const D=[],U=Z=>Z.reduce((ee,q)=>q.status==="unchanged"?ee:ee+1,0),B=U(i.mcp),z=U(i.env),F=U(i.git);return u&&D.push("prompt"),f&&D.push("model"),B>0&&D.push("mcp"),z>0&&D.push("env"),F>0&&D.push("git"),{anyDirty:D.length>0,dirtySections:D,counts:{prompt:u?1:0,model:f?1:0,mcp:B,env:z,git:F}}},[i,u,f]),h=S.useCallback(D=>{n(U=>U&&D(U))},[]),y=S.useCallback(D=>h(U=>({...U,promptAppend:D})),[h]),g=S.useCallback(()=>h(D=>({...D,promptAppend:l})),[h,l]),b=S.useCallback(D=>h(U=>({...U,model:D})),[h]),x=S.useCallback(()=>h(D=>({...D,model:o})),[h,o]),k=S.useMemo(()=>op("mcp",h),[h]),j=S.useMemo(()=>op("env",h),[h]),E=S.useMemo(()=>op("git",h),[h]),N=S.useCallback(()=>{n(null)},[]),T=S.useCallback(()=>{if(!t||!e)return{};const D={};u&&(D.prompt={append:t.promptAppend}),f&&(D.model=t.model);const U=m.counts.mcp>0,B=m.counts.env>0,z=m.counts.git>0;return U&&(D.mcpServers=t.mcp.filter(F=>F.status!=="deleted").map(F=>F.value)),B&&(D.env=t.env.filter(F=>F.status!=="deleted").map(F=>{const Z=F.value;return Z.sensitive&&Z.value===qp?{key:Z.key,value:qp,sensitive:!0}:Z})),z&&(D.gitRepos=t.git.filter(F=>F.status!=="deleted").map(F=>F.value)),D},[t,e,u,f,m]);return{draft:i,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:x,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:N,buildPayloadPatch:T}}const L$=Object.values(v6);function I$(e){const t=[{key:"identity",label:"Profile",anchor:"ad-identity"},{key:"bindings",label:"Bindings",anchor:"ad-bindings"}],n=e?[]:[{key:"prompt",label:"Prompt",anchor:Er("prompt")},{key:"model",label:"Model",anchor:Er("model")},{key:"mcp",label:"MCP tools",anchor:Er("mcp")},{key:"env",label:"Environment",anchor:Er("env")},{key:"git",label:"Git",anchor:Er("git")}],i=[{key:"danger",label:"Danger zone",anchor:"ad-danger"}],l=[{label:"Identity",items:t}];return n.length>0&&l.push({label:"Runtime",items:n}),l.push({label:"Danger zone",items:i}),l}function U$(){var Ri,zi,Oi,Ar,Di,Ta,Tu,Gs,Sl,Ra,Ru,Ks;const t=nA().uuid??"",n=qr(),i=Wn(),l=qe({queryKey:["agent",t],queryFn:()=>Uk(t),enabled:!!t}),o=qe({queryKey:["agent-config",t],queryFn:()=>OL(t),enabled:!!t&&((Ri=l.data)==null?void 0:Ri.type)!=="human"}),u=qe({queryKey:["agent-client-status",t],queryFn:()=>LL(t),enabled:!!t&&((zi=l.data)==null?void 0:zi.type)!=="human"}),f=qe({queryKey:["agent-sessions-active",t],queryFn:()=>Fs(t,{state:"active"}),enabled:!!t&&((Oi=l.data)==null?void 0:Oi.type)!=="human"}),m=qe({queryKey:["adapters"],queryFn:Qj}),h=qe({queryKey:["adapter-mappings"],queryFn:Zj}),{data:y}=qe({queryKey:["adapter-statuses"],queryFn:Vj,refetchInterval:15e3}),g=((Ar=m.data)==null?void 0:Ar.filter(oe=>oe.agentId===t))??[],b=((Di=h.data)==null?void 0:Di.filter(oe=>oe.agentId===t))??[],x=M$(o.data),[k,j]=S.useState(null),[E,N]=S.useState(null),T=yt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const oe=x.buildPayloadPatch();return DL(t,{expectedVersion:o.data.version,payload:oe})},onSuccess:oe=>{i.setQueryData(["agent-config",t],oe),j(null),N(null)},onError:oe=>{if(oe instanceof Bd&&oe.status===409){N("Someone else saved a newer version while you were editing."),j(null);return}j(oe instanceof Error?oe.message:String(oe))}}),D=S.useCallback(()=>{N(null),j(null),i.invalidateQueries({queryKey:["agent-config",t]}),x.resetAll()},[i,t,x]),U=S.useCallback(oe=>{const Ze=document.getElementById(oe);Ze&&Ze.scrollIntoView({behavior:"smooth",block:"start"})},[]),B=yt({mutationFn:oe=>J0(t,oe),onSuccess:()=>{i.invalidateQueries({queryKey:["agent",t]}),i.invalidateQueries({queryKey:["agents"]})}}),z=yt({mutationFn:()=>kD(t),onSuccess:()=>i.invalidateQueries({queryKey:["agent",t]})}),F=yt({mutationFn:()=>jD(t),onSuccess:()=>i.invalidateQueries({queryKey:["agent",t]})}),Z=yt({mutationFn:()=>wD(t),onSuccess:()=>n("/agents")}),ee=yt({mutationFn:()=>ED(t)}),[q,ae]=S.useState(!1),[re,pe]=S.useState(""),[fe,W]=S.useState(null),P=qe({queryKey:["clients"],queryFn:qd,enabled:q}),V=yt({mutationFn:oe=>J0(t,{clientId:oe}),onSuccess:()=>{i.invalidateQueries({queryKey:["agent",t]}),i.invalidateQueries({queryKey:["agent-client-status",t]}),i.invalidateQueries({queryKey:["agents"]}),ae(!1),pe(""),W(null)},onError:oe=>W(oe instanceof Error?oe.message:String(oe))}),[ce,be]=S.useState(!1),[R,L]=S.useState(null),[A,C]=S.useState(up),[J,Y]=S.useState(""),ue=yt({mutationFn:async()=>{const oe=vS(A);if(!oe)throw new Error("Credentials are required");return TL({platform:A.platform,agentId:t,credentials:oe,status:A.status})},onSuccess:()=>{i.invalidateQueries({queryKey:["adapters"]}),me()}}),ge=yt({mutationFn:()=>{if(!R)throw new Error("No adapter selected");const oe={status:A.status},Ze=vS(A);return Ze&&(oe.credentials=Ze),RL(R,oe)},onSuccess:()=>{i.invalidateQueries({queryKey:["adapters"]}),me()}}),Me=yt({mutationFn:zL,onSuccess:()=>i.invalidateQueries({queryKey:["adapters"]})}),xe=yt({mutationFn:()=>NL({platform:A.platform,externalUserId:A.externalUserId,agentId:t,boundVia:"manual",displayName:A.displayName||void 0}),onSuccess:()=>{i.invalidateQueries({queryKey:["adapter-mappings"]}),me()}}),_t=yt({mutationFn:AL,onSuccess:()=>i.invalidateQueries({queryKey:["adapter-mappings"]})}),[en,Bn]=S.useState(null),tr=yt({mutationFn:()=>ML(t,x.buildPayloadPatch()),onSuccess:oe=>{const Ze=oe.diff.length?oe.diff.map(Kt=>`${Kt.op} ${Kt.path}`).join(`
361
- `):"(no changes)";Bn(Ze)},onError:oe=>Bn(`Dry run failed: ${oe instanceof Error?oe.message:String(oe)}`)});S.useEffect(()=>{if(!x.summary.anyDirty)return;const oe=Ze=>{Ze.preventDefault(),Ze.returnValue=""};return window.addEventListener("beforeunload",oe),()=>window.removeEventListener("beforeunload",oe)},[x.summary.anyDirty]);const tn=((Ta=l.data)==null?void 0:Ta.type)==="human",Na=S.useMemo(()=>I$(tn),[tn]);if(l.isLoading)return d.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:d.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return d.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const ft=l.data;if(!ft)return d.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Gt=ft.type==="human",br=u.data,Zr=((Tu=f.data)==null?void 0:Tu.length)??0,Vr=!Gt&&!(br!=null&&br.clientId),Ai=!Gt&&br?!br.online&&!!br.clientId:!1,Ti=ft,Vs=Ti.runtimeState??null,nn=Ti.runtimeType??null,Qs=Ti.totalSessions??null,ne=ft.uuid.slice(0,8);function me(){be(!1),L(null),C(up),Y("")}function Oe(oe){L(oe.id),C({...up,platform:oe.platform,status:oe.status}),be(!0)}function $e(oe){if(oe.preventDefault(),Y(""),Gt){if(!A.externalUserId)return;xe.mutate();return}if(A.platform==="feishu"){if(!R&&(!A.feishuAppId||!A.feishuAppSecret)){Y("App ID and App Secret are required");return}}else if(A.platform==="kael"){if(!R&&(!A.kaelUserId||!A.kaelProjectId)){Y("User ID and Project ID are required");return}}else{const Ze=A.credentialsJson.trim();if(!R&&!Ze){Y("Credentials are required");return}if(Ze)try{JSON.parse(Ze)}catch{Y("Invalid JSON");return}}R?ge.mutate():ue.mutate()}const nt=ue.error??ge.error??xe.error,cn=ue.isPending||ge.isPending||xe.isPending,xr=R$({activeSessions:Zr,isUnclaimed:Vr,isOffline:Ai}),rn=x.draft.mcp.filter(oe=>oe.status!=="deleted"),Dt=x.draft.env.filter(oe=>oe.status!=="deleted"),dn=x.draft.git.filter(oe=>oe.status!=="deleted"),ut=oe=>new Set(rn.filter(Ze=>Ze.key!==oe).map(Ze=>Ze.value.name.toLowerCase())),Nr=oe=>new Set(Dt.filter(Ze=>Ze.key!==oe).map(Ze=>Ze.value.key)),Pn=oe=>new Set(dn.filter(Ze=>Ze.key!==oe).map(Ze=>{const{value:Kt}=Ze;return Kt.localPath?Kt.localPath:((Kt.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Aa={sessions:Qs??"—",active:Zr,runtime:nn??(Gt?"human":"—"),model:((Sl=(Gs=o.data)==null?void 0:Gs.payload.model)==null?void 0:Sl.trim())||"—"};return d.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[d.jsx("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:Na.map(oe=>d.jsxs("div",{style:{marginBottom:12},children:[d.jsx(Cu,{style:{display:"block",padding:"var(--sp-1) var(--sp-4)"},children:oe.label}),oe.items.map(Ze=>d.jsx("button",{type:"button",onClick:()=>U(Ze.anchor),className:"block w-full text-left bg-transparent text-body",style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",color:"var(--fg-3)",border:"none",borderLeft:"var(--hairline-bold) solid transparent",cursor:"pointer"},onMouseEnter:Kt=>{Kt.currentTarget.style.color="var(--fg)",Kt.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:Kt=>{Kt.currentTarget.style.color="var(--fg-3)",Kt.currentTarget.style.background="transparent"},children:Ze.label},Ze.key))]},oe.label))}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[d.jsxs(IL,{style:{marginBottom:8},children:[d.jsx(UL,{onClick:()=>n("/agents"),children:"Agents"}),d.jsx(BL,{}),d.jsx(PL,{mono:!0,children:ft.name??ne})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:d.jsx(ju,{width:18,height:20,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-title",children:ft.displayName??ft.name??ne}),d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",ft.name??ne]})]}),d.jsxs("div",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:["agt_",ne," · ",ft.type,ft.visibility?` · ${ft.visibility}`:""]})]}),d.jsx(ml,{state:Vs}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(ve,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${ft.uuid}`),children:"Open chat →"}),!Gt&&ft.status==="active"&&d.jsxs(ve,{variant:"outline",size:"xs",onClick:()=>{ee.reset(),ee.mutate()},disabled:ee.isPending,children:[d.jsx(BT,{className:"h-3 w-3"}),ee.isPending?"Testing…":"Test"]})]})]}),d.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[d.jsx(ad,{label:"sessions",value:Aa.sessions}),d.jsx(ad,{label:"active",value:Aa.active,accent:typeof Aa.active=="number"&&Aa.active>0?"var(--accent)":void 0}),d.jsx(ad,{label:"runtime",value:Aa.runtime}),d.jsx(ad,{label:"model",value:Aa.model})]})]}),d.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:16},children:[(ee.data||ee.error)&&d.jsx(H$,{result:ee.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>ee.reset()}),Vr&&ft.status==="active"&&d.jsxs("div",{className:"flex items-center justify-between gap-3",style:{borderRadius:"var(--radius-panel)",padding:"var(--sp-2_5) var(--sp-3_5)",background:"color-mix(in oklch, var(--state-blocked) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsxs("div",{className:"text-body",children:[d.jsx("div",{className:"font-medium",children:"No computer bound"}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:"Bind this agent to a computer so it can run. A computer will also claim it on first WebSocket connect."})]}),d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>ae(!0),children:[d.jsx(Tp,{className:"h-3 w-3"}),"Bind computer"]})]}),d.jsx("div",{id:"ad-identity",children:d.jsx(YL,{agent:ft,onSave:async oe=>{await B.mutateAsync(oe)}})}),!Gt&&d.jsxs(B$,{loaded:!!o.data,loading:o.isLoading,error:o.error?String(o.error):null,version:((Ra=o.data)==null?void 0:Ra.version)??null,dirty:x.summary.anyDirty,children:[d.jsx("div",{id:Er("prompt"),children:d.jsx(N$,{value:x.draft.promptAppend,baseline:((Ru=o.data)==null?void 0:Ru.payload.prompt.append)??"",onChange:x.setPromptAppend,onRevert:x.revertPrompt,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("model"),children:d.jsx(tI,{value:x.draft.model,baseline:((Ks=o.data)==null?void 0:Ks.payload.model)??"",onChange:x.setModel,onRevert:x.revertModel,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("mcp"),children:d.jsx(JL,{items:x.draft.mcp,otherNames:ut,onAdd:x.addMcp,onUpdate:x.updateMcp,onDelete:x.deleteMcp,onUndoDelete:x.undoDeleteMcp,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("env"),children:d.jsx(VL,{items:x.draft.env,otherKeys:Nr,onAdd:x.addEnv,onUpdate:x.updateEnv,onDelete:x.deleteEnv,onUndoDelete:x.undoDeleteEnv,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("git"),children:d.jsx(GL,{items:x.draft.git,otherPaths:Pn,onAdd:x.addGit,onUpdate:x.updateGit,onDelete:x.deleteGit,onUndoDelete:x.undoDeleteGit,disabled:ft.status!=="active"})}),en&&d.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:8,borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:en})]}),d.jsx("div",{id:"ad-bindings",children:d.jsxs(Fr,{children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"inline-flex items-center gap-2 text-body font-semibold",children:[Gt?d.jsx(Tp,{className:"h-3.5 w-3.5"}):d.jsx(fT,{className:"h-3.5 w-3.5"}),"Platform bindings"]}),d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>be(!0),children:[d.jsx(gl,{className:"h-3 w-3"}),Gt?"Bind user":"Bind bot"]})]}),Gt?d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"External user ID"}),d.jsx(Ae,{children:"Display name"}),d.jsx(Ae,{children:"Bound via"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{style:{width:32}})]})}),d.jsx(ka,{children:b.length===0?d.jsx(Qt,{children:d.jsx(Ee,{colSpan:6,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):b.map(oe=>d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx(Wt,{children:oe.platform})}),d.jsx(Ee,{className:"mono text-label",children:oe.externalUserId}),d.jsx(Ee,{children:oe.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:"outline",children:oe.boundVia??"—"})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(oe.createdAt)}),d.jsx(Ee,{children:d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{confirm("Remove this binding?")&&_t.mutate(oe.id)},disabled:_t.isPending,children:d.jsx(su,{className:"h-3.5 w-3.5"})})})]},oe.id))})]}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Connection"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{style:{width:64}})]})}),d.jsx(ka,{children:g.length===0?d.jsx(Qt,{children:d.jsx(Ee,{colSpan:5,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):g.map(oe=>{const Ze=y==null?void 0:y.find(wl=>wl.configId===oe.id),Kt=oe.platform==="kael"?oe.status==="active":!!(Ze!=null&&Ze.connected);return d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx(Wt,{children:oe.platform})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:oe.status==="active"?"accent":"outline",children:oe.status})}),d.jsx(Ee,{children:d.jsx(ml,{state:Kt?"idle":"offline"})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(oe.createdAt)}),d.jsx(Ee,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Oe(oe),title:"Edit",children:"…"}),d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{confirm("Remove this bot binding?")&&Me.mutate(oe.id)},disabled:Me.isPending,title:"Delete",children:d.jsx(su,{className:"h-3.5 w-3.5"})})]})})]},oe.id)})})]})]})}),d.jsx("div",{id:"ad-danger",children:d.jsx(FL,{agent:ft,suspendPending:z.isPending,reactivatePending:F.isPending,deletePending:Z.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&z.mutate()},onReactivate:()=>F.mutate(),onDelete:()=>Z.mutate()})}),!Gt&&x.summary.anyDirty&&d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:d.jsx("button",{type:"button",onClick:()=>tr.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:tr.isPending,children:tr.isPending?"Computing dry-run…":"Preview server-side diff"})})]}),!Gt&&d.jsx(T$,{summary:x.summary,saveHint:xr,conflictMessage:E,errorMessage:k,saving:T.isPending,onSave:()=>T.mutate(),onDiscard:()=>{(!x.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(x.resetAll(),j(null),N(null))},onReloadRemote:D,onJumpTo:oe=>U(Er(oe))})]}),d.jsx(On,{open:q,onOpenChange:oe=>{ae(oe),oe||(pe(""),W(null),V.reset())},children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),P.isLoading?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):P.error?d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",P.error instanceof Error?P.error.message:"Unknown"]}):d.jsx(P$,{clients:P.data??[],selected:re,onSelect:pe}),fe&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:fe})]}),d.jsxs(Dn,{children:[d.jsx(ve,{variant:"outline",onClick:()=>ae(!1),children:"Cancel"}),d.jsx(ve,{disabled:!re||V.isPending,onClick:()=>{W(null),V.mutate(re)},children:V.isPending?"Binding…":"Bind"})]})]})}),d.jsx(On,{open:ce,onOpenChange:oe=>oe?be(!0):me(),children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:Gt?"Bind External User":R?"Edit Bot Binding":"Bind Bot"})}),d.jsxs("form",{onSubmit:$e,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:A.platform,onChange:oe=>C({...A,platform:oe.target.value}),disabled:!!R,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:L$.map(oe=>d.jsx("option",{value:oe,children:oe},oe))})]}),Gt?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"binding-ext-id",children:"External User ID"}),d.jsx(vt,{id:"binding-ext-id",value:A.externalUserId,onChange:oe=>C({...A,externalUserId:oe.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"binding-name",children:"Display Name (optional)"}),d.jsx(vt,{id:"binding-name",value:A.displayName,onChange:oe=>C({...A,displayName:oe.target.value})})]})]}):d.jsxs(d.Fragment,{children:[A.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(et,{htmlFor:"feishu-app-id",children:["App ID",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"feishu-app-id",value:A.feishuAppId,onChange:oe=>C({...A,feishuAppId:oe.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(et,{htmlFor:"feishu-app-secret",children:["App Secret",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:A.feishuAppSecret,onChange:oe=>C({...A,feishuAppSecret:oe.target.value}),placeholder:"••••••••"})]})]}):A.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(et,{htmlFor:"kael-user-id",children:["User ID",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"kael-user-id",value:A.kaelUserId,onChange:oe=>C({...A,kaelUserId:oe.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(et,{htmlFor:"kael-project-id",children:["Project ID",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"kael-project-id",value:A.kaelProjectId,onChange:oe=>C({...A,kaelProjectId:oe.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!R&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(et,{htmlFor:"binding-creds",children:["Credentials (JSON)",R?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:A.credentialsJson,onChange:oe=>C({...A,credentialsJson:oe.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),J&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:J}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:A.status,onChange:oe=>C({...A,status:oe.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),nt instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:nt.message}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:cn,children:cn?"Saving...":R?"Update":"Create"})})]})]})})]})}function B$(e){return d.jsxs("section",{className:"space-y-3",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsx("h2",{className:"text-subtitle",children:"Behavior"}),e.version!=null&&d.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:["v",e.version]}),e.dirty&&d.jsx(Cu,{style:{color:"var(--state-blocked)"},children:"draft"})]})}),e.loading&&d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),e.error&&d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",e.error]}),e.loaded&&d.jsx("div",{className:"space-y-3",children:e.children})]})}const up={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function vS(e){if(e.platform==="feishu"){if(!e.feishuAppId&&!e.feishuAppSecret)return null;if(!e.feishuAppId||!e.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:e.feishuAppId,app_secret:e.feishuAppSecret}}if(e.platform==="kael"){if(!e.kaelUserId&&!e.kaelProjectId)return null;if(!e.kaelUserId||!e.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId}}const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function P$({clients:e,selected:t,onSelect:n}){const i=e.filter(l=>l.status==="connected");return i.length===0?d.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",d.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):d.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:i.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return d.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Te("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[d.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),d.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const $$={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},F$={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},q$={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function H$({result:e,onDismiss:t}){const n=F$[e.status],i=q$[e.status],l=e.connection;return d.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Wt,{tone:i,children:$$[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&d.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[d.jsx("div",{children:l.runtimeState&&d.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?d.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),d.jsx(ve,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function Z$(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function V$({agent:e,open:t,onClose:n,onBound:i}){var g;const[l,o]=S.useState(!1),u=qe({queryKey:["connect-token",e.uuid],queryFn:()=>Uw(),enabled:t,staleTime:6e4}),f=qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Uk(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});S.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&i(b)},[f.data,i]);const m=((g=u.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${Z$(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(On,{open:t,onOpenChange:b=>!b&&n(),children:d.jsxs(wn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[d.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(ve,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?d.jsx(Pd,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(Sg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[d.jsx(hl,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),d.jsx(Dn,{children:d.jsx(ve,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const Q$=/^[a-z0-9_-]+$/,ud=100;function G$(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const i of e){const l=i.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=i.message)}else t._root=i.message}return t}function K$(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,100)}function Y$({open:e,onOpenChange:t,onCreated:n}){const i=Wn(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(""),[y,g]=S.useState(!1),[b,x]=S.useState("claude-code"),[k,j]=S.useState("form"),[E,N]=S.useState([]),[T,D]=S.useState(null),[U,B]=S.useState(!1),[z,F]=S.useState({});S.useEffect(()=>{e&&(o(""),f(!1),h(""),g(!1),x("claude-code"),j("form"),N([]),D(null),B(!1),F({}))},[e]);const Z=K$(l),ee=yt({mutationFn:async P=>{const V=m.trim()||l.trim()||"Untitled assistant";return SD({name:Z||void 0,type:"personal_assistant",displayName:V,clientId:P.clientId})},onSuccess:P=>{i.invalidateQueries({queryKey:["agents"]}),i.invalidateQueries({queryKey:["activity"]}),n(P,b)}}),ae={...S.useMemo(()=>{const P=ee.error;if(!P)return{};if(P instanceof Bd){const V=G$(P.issues);return Object.keys(V).length>0?V:P.status===409?{name:"That hub ID is already in use in this organization. Pick a different one."}:{_root:P.message}}return P instanceof Error?{_root:P.message}:{}},[ee.error]),...z};function re(){const P={};return Z?Z.length>ud?P.name=`Hub ID must be at most ${ud} characters (got ${Z.length}).`:Q$.test(Z)||(P.name="Hub ID must contain only lowercase letters, digits, hyphens (-), and underscores (_)."):l.trim().length>0&&(P.name="Name must contain at least one letter or digit (e.g. a-z, 0-9)."),m.length>200&&(P.displayName=`Display name must be at most 200 characters (got ${m.length}).`),P}async function pe(P){var ce,be;P.preventDefault();const V=re();if(F(V),!(Object.keys(V).length>0)){if(b!=="claude-code"){ee.mutate({clientId:void 0});return}B(!0);try{const L=(await qd()).filter(C=>C.status==="connected");if(L.length===0){ee.mutate({clientId:void 0});return}if(L.length===1){ee.mutate({clientId:(ce=L[0])==null?void 0:ce.id});return}const A=[...L].sort((C,J)=>J.lastSeenAt.localeCompare(C.lastSeenAt));N(A),D(((be=A[0])==null?void 0:be.id)??null),j("pick-computer")}catch{ee.mutate({clientId:void 0})}finally{B(!1)}}}function fe(){T&&ee.mutate({clientId:T})}const W=l.trim().length>0&&!ee.isPending&&!U;return k==="pick-computer"?d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(wn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",d.jsx("span",{className:"font-medium",children:l})," should run:"]}),d.jsx("div",{className:"space-y-2",children:E.map(P=>{const V=T===P.id;return d.jsxs("label",{className:V?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"target-computer",checked:V,onChange:()=>D(P.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-body font-medium truncate",children:P.hostname??P.id}),d.jsxs("div",{className:"text-caption text-muted-foreground",children:[P.os??"unknown OS"," · last seen ",new Date(P.lastSeenAt).toLocaleString()]})]})]},P.id)})}),ae.clientId&&d.jsx("p",{className:"text-body text-destructive",children:ae.clientId}),ae._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:ae._root})]}),d.jsxs(Dn,{children:[d.jsx(ve,{variant:"outline",onClick:()=>j("form"),disabled:ee.isPending,children:"Back"}),d.jsx(ve,{onClick:fe,disabled:!T||ee.isPending,children:ee.isPending?"Creating…":"Create"})]})]})}):d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(wn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"New Agent"})}),d.jsxs("form",{onSubmit:pe,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"new-agent-name",children:"Name"}),d.jsx(vt,{id:"new-agent-name",value:l,onChange:P=>{const V=P.target.value;o(V),f(!0),y||h(V),z.name&&F(ce=>({...ce,name:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:ud,"aria-invalid":ae.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error"}),d.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Hub ID: lowercase letters, digits, hyphens (-), and underscores (_). Up to ",ud," characters. Permanent after creation — you can't rename the agent later."]}),u&&Z&&d.jsxs("p",{className:"text-caption text-muted-foreground",children:["ID on hub: ",d.jsx("span",{className:"font-mono",children:Z})]}),ae.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:ae.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(vt,{id:"new-agent-display-name",value:m,onChange:P=>{h(P.target.value),g(!0),z.displayName&&F(V=>({...V,displayName:void 0}))},placeholder:"How teammates see this agent",maxLength:200,"aria-invalid":ae.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),d.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"Shown in chats and lists. Defaults to the Name above; you can change it anytime later."}),ae.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:ae.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:b==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"runtime",checked:b==="claude-code",onChange:()=>x("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),d.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[d.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),d.jsxs("div",{children:[d.jsxs("div",{className:"text-body font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-caption font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),ae._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:ae._root}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:!W,children:U?"Checking computers…":ee.isPending?"Creating…":"Create"})})]})]})})}function Wo({active:e,count:t,warn:n,className:i,children:l,style:o,...u}){return d.jsxs("button",{type:"button",className:Te("mono inline-flex items-center gap-1 text-caption leading-[1.6]",i),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&d.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const X$=Object.values(S6);function bS(e){return[...e].sort((t,n)=>{const i=(t.name??t.displayName??"").toLowerCase(),l=(n.name??n.displayName??"").toLowerCase();return i.localeCompare(l)})}function J$(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null,activeSessions:(n==null?void 0:n.activeSessions)??null,totalSessions:(n==null?void 0:n.totalSessions)??null}}function cp(e,t,n){var l;let i=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&i++;return i}function W$(){const e=qr(),{memberId:t}=ja(),[n,i]=S.useState(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(null),[y,g]=S.useState("all"),[b,x]=S.useState(""),k=Ei(),j=qg(),{data:E,isLoading:N,error:T}=qe({queryKey:["agents",n,l],queryFn:()=>Ng({limit:100,cursor:n,type:l||void 0})}),{data:D}=qe({queryKey:["activity"],queryFn:wu,refetchInterval:1e4}),U=S.useMemo(()=>{const V=new Map;for(const ce of(D==null?void 0:D.agents)??[])V.set(ce.agentId,ce);return V},[D==null?void 0:D.agents]),{myAgents:B,teamAgents:z}=S.useMemo(()=>{if(!(E!=null&&E.items))return{myAgents:[],teamAgents:[]};const V=[],ce=[];for(const be of E.items)t&&be.managerId===t?V.push(be):ce.push(be);return{myAgents:bS(V),teamAgents:bS(ce)}},[E,t]),F=(E==null?void 0:E.items.length)??0,Z=B.length,ee=z.length,q=S.useMemo(()=>((E==null?void 0:E.items)??[]).filter(V=>{var ce;return((ce=U.get(V.uuid))==null?void 0:ce.runtimeState)==="working"}).length,[E==null?void 0:E.items,U]),ae=S.useMemo(()=>((E==null?void 0:E.items)??[]).filter(V=>{var be;const ce=(be=U.get(V.uuid))==null?void 0:be.runtimeState;return ce==="blocked"||ce==="error"}).length,[E==null?void 0:E.items,U]);function re(V){var be;const ce=(be=U.get(V.uuid))==null?void 0:be.runtimeState;return y==="mine"?t!=null&&V.managerId===t:y==="running"?ce==="working":y==="attn"?ce==="blocked"||ce==="error":!0}function pe(V){if(!b.trim())return!0;const ce=b.toLowerCase(),be=V.delegateMention?k(V.delegateMention):"",R=j(V.managerId);return(V.name??"").toLowerCase().includes(ce)||(V.displayName??"").toLowerCase().includes(ce)||be.toLowerCase().includes(ce)||R.toLowerCase().includes(ce)}const fe=B.filter(V=>re(V)&&pe(V)),W=z.filter(V=>re(V)&&pe(V));function P(V,ce){if(f(!1),V.clientId){e(`/?a=${V.uuid}`);return}if(ce==="claude-code"){h(V);return}e(`/?a=${V.uuid}`)}return d.jsxs("div",{className:"-m-6",children:[d.jsx(ef,{title:"Agents",subtitle:F>0?d.jsxs(d.Fragment,{children:[F," total · ",Z," mine · ",ee," team"]}):null,right:d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ve,{variant:"outline",size:"xs",children:"Import"}),d.jsxs(ve,{size:"xs",onClick:()=>f(!0),children:[d.jsx(gl,{className:"h-3 w-3"}),"New agent"]})]})}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("div",{className:"relative",style:{width:240},children:[d.jsx(Fd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),d.jsx("input",{value:b,onChange:V=>x(V.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Wo,{active:y==="all",count:F,onClick:()=>g("all"),children:"all"}),d.jsx(Wo,{active:y==="mine",count:Z,onClick:()=>g("mine"),children:"mine"}),d.jsx(Wo,{active:y==="running",count:q,onClick:()=>g("running"),children:"running"}),d.jsx(Wo,{active:y==="attn",count:ae,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),d.jsx("div",{style:{flex:1}}),d.jsxs("select",{value:l,onChange:V=>{o(V.target.value),i(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[d.jsx("option",{value:"",children:"all types"}),X$.map(V=>d.jsx("option",{value:V,children:V},V))]}),d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",children:[d.jsx(wT,{className:"h-3 w-3"})," Columns"]})]}),N?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):T?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",T instanceof Error?T.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsx(xS,{title:`My agents · ${fe.length}`,agents:fe,runtimeMap:U,resolveAgentName:k,resolveMemberName:j,navigate:e,emptyLabel:B.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:d.jsx(eF,{items:[{state:"working",count:cp(B,U,"working")},{state:"blocked",count:cp(B,U,"blocked")},{state:"error",count:cp(B,U,"error")}]}),className:"mb-4"}),z.length>0&&d.jsx(xS,{title:`Team agents · ${W.length}`,agents:W,runtimeMap:U,resolveAgentName:k,resolveMemberName:j,navigate:e,emptyLabel:"No agents match the current filter"})]}),(E==null?void 0:E.nextCursor)&&d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(ve,{variant:"outline",size:"xs",onClick:()=>i(E.nextCursor??void 0),children:"Next page"})})]}),d.jsx(Y$,{open:u,onOpenChange:f,onCreated:P}),m&&d.jsx(V$,{agent:m,open:m!==null,onClose:()=>{const V=m.uuid;h(null),e(`/?a=${V}`)},onBound:V=>{h(null),e(`/?a=${V.uuid}`)}})]})}function xS({title:e,agents:t,runtimeMap:n,resolveAgentName:i,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m}){return d.jsxs(Fr,{className:m,children:[d.jsx(Ms,{right:f,children:e}),t.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:u}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Name"}),d.jsx(Ae,{children:"Display"}),d.jsx(Ae,{children:"Type"}),d.jsx(Ae,{children:"Delegate"}),d.jsx(Ae,{children:"Owner"}),d.jsx(Ae,{children:"Runtime"}),d.jsx(Ae,{children:"Sessions"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Created"})]})}),d.jsx(ka,{children:t.map(h=>d.jsx(tF,{agent:h,runtime:J$(h,n),resolveAgentName:i,resolveMemberName:l,navigate:o},h.uuid))})]})]})}function eF({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center",children:t.map((n,i)=>d.jsxs("span",{className:"inline-flex items-center",children:[i>0&&d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function tF({agent:e,runtime:t,resolveAgentName:n,resolveMemberName:i,navigate:l}){const{runtimeState:o,activeSessions:u,totalSessions:f}=t,m=o==="idle"||o==="working"||o==="blocked"||o==="error"||o==="offline";return d.jsxs(Qt,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",children:e.name})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:e.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),d.jsx(Ee,{className:"mono text-label",style:{color:e.delegateMention?"var(--accent-dim)":"var(--fg-4)"},children:e.delegateMention?n(e.delegateMention):"—"}),d.jsx(Ee,{className:"text-label",style:{color:"var(--fg-2)"},children:i(e.managerId)}),d.jsx(Ee,{children:o&&m?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(hl,{state:o,size:7}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:o})]}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Ee,{children:u===null&&f===null?d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"}):d.jsxs("span",{className:"mono tnum text-label",children:[d.jsx("span",{style:{color:"var(--fg-2)"},children:u??0}),d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",f??0]})]})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:e.status==="active"?"accent":"outline",children:e.status})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(e.createdAt)})]})}function nF(){const{data:e}=qe({queryKey:["members","user-name-map"],queryFn:Fg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function rF(){const[e,t]=S.useState(null),[n,i]=S.useState(!1),l=yt({mutationFn:Uw,onSuccess:u=>{t(u),i(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),i(!0),setTimeout(()=>i(!1),2e3))};return d.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[d.jsx(KT,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?d.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",d.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),d.jsxs(ve,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?d.jsx(Pd,{className:"h-3 w-3"}):d.jsx(Sg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),d.jsx(ve,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function aF(){const e=Wn(),t=Ei(),n=nF(),{role:i}=ja(),l=i==="admin",[o,u]=S.useState(null),[f,m]=S.useState(null),[h,y]=S.useState(null),[g,b]=S.useState(null),{data:x}=qe({queryKey:["clients"],queryFn:qd,refetchInterval:1e4}),{data:k}=qe({queryKey:["activity"],queryFn:wu,refetchInterval:1e4}),j=yt({mutationFn:GR,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=yt({mutationFn:QR,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:B=>{B instanceof Bd?b(B.message):b(B instanceof Error?B.message:String(B))}}),N=S.useMemo(()=>{const B=new Map;for(const z of(k==null?void 0:k.agents)??[]){if(!z.clientId)continue;const F=B.get(z.clientId)??[];F.push(z),B.set(z.clientId,F)}return B},[k==null?void 0:k.agents]),T=B=>N.get(B)??[],D=(x??[]).filter(B=>B.status==="connected").length,U=(x??[]).reduce((B,z)=>B+z.agentCount,0);return d.jsxs("div",{className:"-m-6",children:[d.jsx(ef,{title:"Computers",subtitle:x&&x.length>0?d.jsxs(d.Fragment,{children:[x.length," total · ",D," connected · ",U," agents bound"]}):null}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsx(rF,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),T(h.id).length>0&&d.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-body space-y-0.5",children:T(h.id).map(B=>d.jsx("li",{className:"font-medium",children:t(B.agentId)},B.agentId))})]}),g&&d.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:g}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),d.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:T(f.id).length===0?d.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):T(f.id).map(B=>d.jsxs("li",{className:"text-body flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(B.agentId)}),d.jsx(ml,{state:B.runtimeState})]},B.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!x||x.length===0?d.jsx(Fr,{children:d.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):d.jsxs(Fr,{children:[d.jsxs(Ms,{right:d.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",x.length]}),d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{style:{width:16}}),d.jsx(Ae,{children:"Hostname"}),l&&d.jsx(Ae,{children:"Owner"}),d.jsx(Ae,{children:"OS"}),d.jsx(Ae,{children:"SDK"}),d.jsx(Ae,{children:"Agents"}),d.jsx(Ae,{children:"Connected"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{})]})}),d.jsx(ka,{children:x.map(B=>{const z=o===B.id,F=T(B.id);return d.jsx(iF,{client:B,boundAgents:F,isExpanded:z,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(z?null:B.id),onDisconnect:()=>m(B),onRetire:()=>{b(null),y(B)}},B.id)})})]})]})]})]})}function iF({client:e,boundAgents:t,isExpanded:n,agentName:i,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return d.jsxs(d.Fragment,{children:[d.jsxs(Qt,{interactive:!0,selected:n,onClick:u,children:[d.jsx(Ee,{style:{width:16},children:d.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?d.jsx(pT,{className:"h-3.5 w-3.5"}):d.jsx(yT,{className:"h-3.5 w-3.5"})})}),d.jsx(Ee,{className:"font-medium",children:e.hostname??"—"}),l&&d.jsx(Ee,{style:{color:"var(--fg-2)"},children:o(e.userId)}),d.jsx(Ee,{style:{color:"var(--fg-3)"},children:e.os??"—"}),d.jsx(Ee,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),d.jsx(Ee,{children:d.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?xa(e.connectedAt):"—"}),d.jsx(Ee,{children:d.jsx(ml,{state:y})}),d.jsx(Ee,{style:{width:1,whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-1 justify-end",children:[d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[d.jsx(nR,{className:"h-3 w-3"})," Disconnect"]}),d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[d.jsx(su,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&d.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[d.jsx(Ee,{}),d.jsxs(Ee,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[d.jsxs(Cu,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):d.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>d.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[d.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:i(g.agentId)}),d.jsx(ml,{state:g.runtimeState}),g.activeSessions!==null&&d.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}const eC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));eC.displayName="Card";const tC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));tC.displayName="CardHeader";const nC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("text-subtitle leading-none",e),...t}));nC.displayName="CardTitle";const rC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("text-body text-muted-foreground",e),...t}));rC.displayName="CardDescription";const aC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));aC.displayName="CardContent";const lF=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));lF.displayName="CardFooter";function sF(){const{isAuthenticated:e,login:t}=ja(),[n,i]=S.useState(""),[l,o]=S.useState(""),[u,f]=S.useState(null),[m,h]=S.useState(!1);if(e)return d.jsx(pg,{to:"/",replace:!0});const y=async g=>{g.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(b){f(b instanceof Error?b.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(eC,{className:"w-full max-w-sm",children:[d.jsxs(tC,{className:"text-center",children:[d.jsx(nC,{className:"text-title",children:"First Tree"}),d.jsx(rC,{children:"Sign in to your workspace"})]}),d.jsx(aC,{children:d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-body text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"username",children:"Username"}),d.jsx(vt,{id:"username",value:n,onChange:g=>i(g.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(et,{htmlFor:"password",children:"Password"}),d.jsx(vt,{id:"password",type:"password",value:l,onChange:g=>o(g.target.value),required:!0})]}),d.jsx(ve,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function oF(){const e=qr(),t=Ei(),{data:n,isLoading:i}=qe({queryKey:["adapters"],queryFn:Qj}),{data:l,isLoading:o}=qe({queryKey:["adapter-mappings"],queryFn:Zj}),{data:u}=qe({queryKey:["adapter-statuses"],queryFn:Vj,refetchInterval:15e3}),f=i||o,m=S.useMemo(()=>{const g=new Map;for(const b of u??[])g.set(b.configId,b);return g},[u]),{onlineBots:h,offlineBots:y}=S.useMemo(()=>{var x;let g=0,b=0;for(const k of n??[])(x=m.get(k.id))!=null&&x.connected?g++:b++;return{onlineBots:g,offlineBots:b}},[n,m]);return d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Overview of platform bindings for agents you can manage. Configure each binding from the Agent detail page."}),d.jsxs(Fr,{className:"mb-3.5",children:[d.jsxs(Ms,{right:d.jsxs("span",{className:"inline-flex items-center",children:[d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),h," online"]}),d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx("span",{"aria-hidden":!0,children:"○"}),y," offline"]})]}),children:["Bot bindings · ",(n==null?void 0:n.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n!=null&&n.length?d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Agent"}),d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Connection"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{})]})}),d.jsx(ka,{children:n.map(g=>{var x;const b=((x=m.get(g.id))==null?void 0:x.connected)??!1;return d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",children:t(g.agentId)})}),d.jsx(Ee,{children:d.jsx(Wt,{children:g.platform})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:g.status==="active"?"accent":"outline",children:g.status})}),d.jsx(Ee,{children:d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[d.jsx(hl,{state:b?"idle":"offline",size:7}),d.jsx("span",{style:{color:"var(--fg-3)"},children:b?"Online":"Offline"})]})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(g.createdAt)}),d.jsx(Ee,{style:{textAlign:"right",whiteSpace:"nowrap"},children:d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),e(`/agents/${g.agentId}`)},children:[d.jsx(Tp,{className:"h-3 w-3"}),"Manage"]})})]},g.id)})})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No bot bindings"})]}),d.jsxs(Fr,{children:[d.jsxs(Ms,{children:["User bindings · ",(l==null?void 0:l.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l!=null&&l.length?d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Agent"}),d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"External user ID"}),d.jsx(Ae,{children:"Display name"}),d.jsx(Ae,{children:"Bound via"}),d.jsx(Ae,{children:"Created"})]})}),d.jsx(ka,{children:l.map(g=>d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:t(g.agentId)})}),d.jsx(Ee,{children:d.jsx(Wt,{children:g.platform})}),d.jsx(Ee,{children:d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:g.externalUserId})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:g.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:"outline",children:g.boundVia??"—"})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(g.createdAt)})]},g.id))})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No user bindings"})]})]})}function uF(){return d.jsxs("div",{className:"-m-6",children:[d.jsx(ef,{title:"Settings",subtitle:"Per-member controls"}),d.jsx(Uj,{children:d.jsx(Bj,{active:!0,children:"Bindings"})}),d.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:d.jsx(oF,{})})]})}function cF(e){return De.get(`/admin/chats/${encodeURIComponent(e)}`)}function dF(e,t){return De.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function SS(e,t){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function fF(e,t){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function hF(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const l=i.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},i.onerror=()=>n(i.error??new Error("FileReader error")),i.readAsDataURL(e)})}function mF(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function pF(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const i=n.toString();return De.get(`/admin/chats/${encodeURIComponent(e)}/messages${i?`?${i}`:""}`)}const gF="first-tree-hub-images",yF=1,Is="images";let cd=null;function iC(){return cd||(cd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(gF,yF);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Is)||n.createObjectStore(Is,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),cd)}async function vF(e){const t=await iC();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,i)=>{const l=t.transaction(Is,"readwrite"),o=l.objectStore(Is),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),l.oncomplete=()=>n(),l.onerror=()=>i(l.error??new Error("Image storage write failed")),l.onabort=()=>i(l.error??new Error("Image storage write aborted"))})}async function bF(e){const t=await iC();return t?new Promise(n=>{const o=t.transaction(Is,"readonly").objectStore(Is).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function lC(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function xF(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const n=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),i=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=wS(l.payload);if(!o)continue;const u=i.get(o)??-1;l.seq>u&&i.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=wS(l.payload);return o?i.get(o)===l.seq:!0})}function wS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function sf(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),i=l=>{var o;return((o=n.find(u=>u.type===l))==null?void 0:o.value)??""};return`${i("month")}/${i("day")} ${i("hour")}:${i("minute")}`}function sC(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const i=Math.round(n/60);if(i<60)return`${i}m ago`;const l=Math.round(i/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function SF(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function kS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function wF({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function kF({agentId:e,chatId:t,session:n}){const i=Wn(),[,l]=vg(),[o,u]=S.useState(!1),[f,m]=S.useState(null),h=Bw(e,t),y=Op(e),g=E=>{i.setQueryData(h,N=>N&&{...N,state:E}),i.setQueryData(y,N=>N&&N.map(T=>T.chatId===t?{...T,state:E}:T))},b=yt({mutationFn:()=>WR(e,t),onMutate:async()=>{await i.cancelQueries({queryKey:h}),await i.cancelQueries({queryKey:y});const E=i.getQueryData(h),N=i.getQueryData(y);return g("suspended"),{previousSession:E,previousList:N}},onError:(E,N,T)=>{T!=null&&T.previousSession&&i.setQueryData(h,T.previousSession),T!=null&&T.previousList&&i.setQueryData(y,T.previousList)},onSuccess:E=>{g(E.state)}}),x=yt({mutationFn:()=>ez(e,t),onMutate:async()=>{await i.cancelQueries({queryKey:h}),await i.cancelQueries({queryKey:y});const E=i.getQueryData(h),N=i.getQueryData(y);return i.setQueryData(y,T=>T&&T.filter(D=>D.chatId!==t)),{previousSession:E,previousList:N}},onError:(E,N,T)=>{T!=null&&T.previousSession&&i.setQueryData(h,T.previousSession),T!=null&&T.previousList&&i.setQueryData(y,T.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,N,T)=>{if(E.state!=="evicted"){T!=null&&T.previousList&&i.setQueryData(y,T.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&d.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[d.jsx(LT,{className:"h-3 w-3"})," Suspend",d.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&d.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},disabled:x.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(ZT,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(jF,{open:o,onOpenChange:E=>{x.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:x.isPending,onConfirm:()=>x.mutate()})]})}function jF(e){const{open:t,onOpenChange:n,session:i,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(On,{open:t,onOpenChange:n,children:d.jsxs(wn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),d.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[d.jsxs("span",{children:["chat: ",d.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(i==null?void 0:i.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",sC(i.lastActivityAt)]}),typeof(i==null?void 0:i.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",i.messageCount]})]}),u&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:u}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),d.jsx(ve,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function EF({event:e}){const t=KR(e.payload);if(!t)return null;const n=t.status==="error",i=t.status==="pending",l=n?"var(--state-error)":i?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":i?"using":"used";return d.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[i?d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):d.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?kS(t.args):void 0,children:[d.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",d.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?d.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",kS(t.args),")"]}):null,t.durationMs!==void 0&&!i?d.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",SF(t.durationMs)]}):null]})]})}function CF({event:e,agentNameFn:t,agentId:n}){const i=XR(e.payload);if(!i||i.text.length===0)return null;const l=t(n);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[d.jsx(oC,{name:l,isSelf:!1}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:sf(e.createdAt)}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:i.text})]})]})}function _F({event:e}){return d.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),d.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:sf(e.createdAt)})]})}function NF({event:e}){const t=YR(e.payload),n=sf(e.createdAt);return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[d.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),d.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function oC({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return d.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:d.jsx(ju,{width:9,height:10,style:{color:"var(--accent)"}})})}function AF({msg:e,myAgentId:t,agentNameFn:n}){const i=n(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[d.jsx(oC,{name:i,isSelf:l}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:i}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:sf(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(wF,{msg:e,myAgentId:t})})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&TF(e.content)?d.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&RF(e.content)?d.jsx(zF,{content:e.content}):e.format==="text"?d.jsx(WE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function TF(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.data=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function RF(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.imageId=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")&&typeof t.filename=="string"}function zF({content:e}){const[t,n]=S.useState({kind:"loading"});return S.useEffect(()=>{let i=!1;return bF(e.imageId).then(l=>{i||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{i=!0}},[e.imageId]),t.kind==="hit"?d.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?d.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):d.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function OF({agentId:e,chatId:t}){var L;const n=Wn(),i=Ei(),{agentId:l}=ja(),[o,u]=S.useState(""),[f,m]=S.useState([]),[h,y]=S.useState(!1),[g,b]=S.useState(null),x=S.useRef(null),k=S.useRef(null),{data:j}=qe({queryKey:["chat-messages",t],queryFn:()=>pF(t,{limit:50}),refetchInterval:5e3}),{data:E}=qe({queryKey:["session-events",e,t],queryFn:()=>JR(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:N}=qe({queryKey:Bw(e,t),queryFn:()=>Fs(e).then(A=>A.find(C=>C.chatId===t)??null),refetchInterval:5e3}),{data:T}=qe({queryKey:["chat-detail",t],queryFn:()=>cF(t),enabled:!!t}),D=yt({mutationFn:A=>SS(t,A),onSuccess:()=>{u(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),U=S.useCallback(A=>{const J=A.filter(ge=>ge.type.startsWith("image/"));if(J.length===0)return;const Y=J.find(ge=>ge.size>5242880);if(Y){b(`Image too large (${(Y.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const ue=J.map(ge=>({id:crypto.randomUUID(),file:ge,previewUrl:URL.createObjectURL(ge)}));m(ge=>[...ge,...ue]),b(null)},[]),B=S.useCallback(A=>{m(C=>{const J=C.find(Y=>Y.id===A);return J&&URL.revokeObjectURL(J.previewUrl),C.filter(Y=>Y.id!==A)})},[]),z=async()=>{const A=o.trim(),C=f;if(!(!A&&C.length===0)&&!h){if(C.length>0){y(!0),b(null);try{for(const J of C){const Y=await hF(J.file),ue=crypto.randomUUID();await vF({imageId:ue,base64:Y,mimeType:J.file.type}),await fF(t,{data:Y,mimeType:J.file.type,filename:J.file.name,size:J.file.size,imageId:ue}),URL.revokeObjectURL(J.previewUrl)}m([]),A&&await SS(t,A),u(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(J){b(J instanceof Error?J.message:"Failed to send image")}finally{y(!1)}return}D.mutate(A)}},[F,Z]=S.useState(!1),[ee,q]=S.useState(""),ae=S.useRef(null);S.useEffect(()=>{var A;F&&((A=ae.current)==null||A.focus())},[F]);const re=yt({mutationFn:A=>dF(t,A),onSuccess:()=>{Z(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),pe=()=>{const A=ee.trim();re.mutate(A.length>0?A:null)},fe=S.useMemo(()=>{const A=(j==null?void 0:j.items)??[],C=xF((E==null?void 0:E.items)??[]),J=[...A.map(Y=>({kind:"message",at:Y.createdAt,key:`m-${Y.id}`,data:Y})),...C.map(Y=>({kind:"event",at:Y.createdAt,key:`e-${Y.id}`,data:Y}))];return J.sort((Y,ue)=>Y.at.localeCompare(ue.at)),J},[j,E]),W=fe.length;S.useEffect(()=>{var A;W>0&&((A=k.current)==null||A.scrollIntoView({behavior:"smooth"}))},[W]);const P=T!=null&&T.participants?T.participants.map(A=>{const C=i(A.agentId);return`@${C.length>20?`${C.slice(0,17)}…`:C}`}).join(" "):`@${i(e)}`,V=i(e),ce=(N==null?void 0:N.runtimeState)??"idle",be=lC((N==null?void 0:N.runtimeState)??null,e?"connected":null),R=(N==null?void 0:N.messageCount)??((L=j==null?void 0:j.items)==null?void 0:L.length)??0;return d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center",style:{gap:8},children:[d.jsx(hl,{state:be,size:8}),F?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:ae,value:ee,onChange:A=>q(A.target.value),onKeyDown:A=>{A.key==="Enter"?(A.preventDefault(),pe()):A.key==="Escape"&&(A.preventDefault(),Z(!1))},disabled:re.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),d.jsx("button",{type:"button",onClick:pe,disabled:re.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(Pd,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>Z(!1),disabled:re.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(Rp,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(T==null?void 0:T.topic)||(N==null?void 0:N.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{q((T==null?void 0:T.topic)??""),Z(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:A=>A.currentTarget.style.color="var(--fg-2)",onMouseLeave:A=>A.currentTarget.style.color="var(--fg-4)",children:d.jsx($d,{className:"h-3 w-3"})})]}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),d.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[d.jsx("span",{className:"mono",children:P}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["started ",sC((N==null?void 0:N.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[R," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:be==="error"?"var(--state-error)":"var(--fg-2)"},children:ce})]})]})]}),d.jsx(kF,{agentId:e,chatId:t,session:N??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[W===0&&d.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[d.jsx(Sw,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),d.jsx("div",{className:"flex flex-col",style:{gap:4},children:fe.map(A=>{if(A.kind==="event"){const C=A.data;switch(C.kind){case"tool_call":return d.jsx(EF,{event:C},A.key);case"assistant_text":return d.jsx(CF,{event:C,agentId:e,agentNameFn:i},A.key);case"thinking":return d.jsx(_F,{event:C},A.key);case"error":return d.jsx(NF,{event:C},A.key);default:return null}}return d.jsx(AF,{msg:A.data,myAgentId:l,agentNameFn:i},A.key)})}),d.jsx("div",{ref:k})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:A=>A.preventDefault(),onDrop:A=>{A.preventDefault(),U(Array.from(A.dataTransfer.files))},children:[f.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:f.map(A=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:A.previewUrl,alt:A.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>B(A.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:d.jsx(Rp,{className:"h-2 w-2"})})]},A.id))}),d.jsx("textarea",{value:o,onChange:A=>u(A.target.value),onPaste:A=>{const C=Array.from(A.clipboardData.files);C.length>0&&(A.preventDefault(),U(C))},placeholder:`Message @${V} · / for commands · @ to mention`,rows:2,onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),z())},disabled:D.isPending||h,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}}),d.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[d.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[d.jsx("button",{type:"button",onClick:()=>{var A;return(A=x.current)==null?void 0:A.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:d.jsx(DT,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:x,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:A=>{A.target.files&&(U(Array.from(A.target.files)),A.target.value="")}}),d.jsx("span",{children:"/suspend"}),d.jsx("span",{children:"/resume"}),d.jsx("span",{children:"/branch"}),d.jsx("span",{children:"/promote"})]}),d.jsxs("span",{className:"flex items-center",style:{gap:8},children:[h&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),d.jsxs("span",{children:[d.jsx("span",{className:"kbd",children:"⏎"})," send ",d.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),d.jsxs("button",{type:"button",onClick:z,disabled:D.isPending||h||!o.trim()&&f.length===0,className:Te("inline-flex items-center transition-colors text-label font-semibold",(D.isPending||h||!o.trim()&&f.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[d.jsx(qT,{className:"h-3 w-3"})," Send"]})]})]})]}),(D.isError||g)&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:g??(D.error instanceof Error?D.error.message:"Failed to send")})]})]})}function DF(){return d.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx(ju,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),d.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function MF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(OF,{agentId:e,chatId:t}):d.jsx(DF,{})}function uC(){const{data:e}=qe({queryKey:["clients"],queryFn:qd,staleTime:1e4,refetchInterval:1e4});return S.useMemo(()=>{const t=e??[],n=new Map;for(const i of t)n.set(i.id,i);return{resolve:i=>i?n.get(i)??null:null,clients:t,connectedClients:t.filter(i=>i.status==="connected")}},[e])}function ng({children:e}){return d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function cC({children:e}){return d.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Pr({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{color:"var(--fg-3)"},children:e}),d.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function jS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const i=Math.round(n/60);if(i<60)return`${i}m ago`;const l=Math.round(i/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function ES(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h ${n%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function dp({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[d.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function LF({notifications:e,agentId:t}){const[,n]=vg(),i=Wn(),l=yt({mutationFn:o=>Bk(o),onSuccess:()=>{i.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(Pk,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function dC({agentId:e}){var h;const t=Ei(),{resolve:n}=uC(),{data:i}=qe({queryKey:["activity"],queryFn:wu,refetchInterval:1e4}),l=(h=i==null?void 0:i.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:u}=qe({queryKey:["notifications","agent",e],queryFn:()=>Bp({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:d.jsx(ju,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),d.jsx(ml,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(dp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),d.jsx(dp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),d.jsx(dp,{label:"uptime",value:ES((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(ng,{children:"Computer · runtime"}),d.jsxs(cC,{children:[d.jsx(Pr,{label:"host",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),d.jsx(Pr,{label:"os",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),d.jsx(Pr,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx(Pr,{label:"sdk",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx(Pr,{label:"connected",children:d.jsx("span",{className:"mono text-label",children:ES((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[d.jsx(ng,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):d.jsx(LF,{notifications:u.items,agentId:e})]})]})}function IF({agentId:e,chatId:t}){const{data:n}=qe({queryKey:["session",e,t],queryFn:()=>Fs(e).then(i=>i.find(l=>l.chatId===t)??null),refetchInterval:5e3});return d.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(ng,{children:"Session"}),d.jsxs(cC,{children:[d.jsx(Pr,{label:"state",children:d.jsx(ml,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),d.jsx(Pr,{label:"chat",children:d.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),d.jsx(Pr,{label:"started",children:jS((n==null?void 0:n.startedAt)??null)}),d.jsx(Pr,{label:"last",children:jS((n==null?void 0:n.lastActivityAt)??null)}),d.jsx(Pr,{label:"messages",children:d.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),d.jsx(dC,{agentId:e})]})}function UF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(IF,{agentId:e,chatId:t}):e?d.jsx(dC,{agentId:e}):null}const BF=32;function PF({aggregated:e,stale:t,className:n}){const i=Math.max(1,...e.map(l=>l.workingCount));return d.jsx("div",{className:Te("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:BF}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/i,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return d.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const $F={error:0,blocked:1,working:2,idle:3};function FF(e,t){return t?e?$F[e]??4:4:5}function qF(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function HF({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:i}){const l=Ei(),{resolve:o}=uC(),u=Wn(),f=uL(),[m,h]=S.useState(""),[y,g]=S.useState("all"),{data:b}=qe({queryKey:["activity"],queryFn:wu,refetchInterval:1e4}),{data:x}=qe({queryKey:e?Op(e):["agent-sessions",null],queryFn:()=>e?Fs(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=yt({mutationFn:z=>mF(z),onSuccess:(z,F)=>{u.invalidateQueries({queryKey:Op(F)}),i(F,z.id)}}),{humans:j,agents:E,totalAll:N}=S.useMemo(()=>{const z=(b==null?void 0:b.agents)??[],F=m.trim().toLowerCase(),Z=z.filter(re=>{var W;if(!qF(re,y))return!1;if(!F)return!0;const pe=l(re.agentId).toLowerCase(),fe=re.clientId?(((W=o(re.clientId))==null?void 0:W.hostname)??"").toLowerCase():"";return pe.includes(F)||fe.includes(F)||re.agentId.toLowerCase().includes(F)}),ee=re=>FF(re.runtimeState,re.clientId),q=[],ae=[];for(const re of Z)(re.type==="human"?q:ae).push(re);return q.sort((re,pe)=>ee(re)-ee(pe)),ae.sort((re,pe)=>ee(re)-ee(pe)),{humans:q,agents:ae,totalAll:z.length}},[b,m,y,l,o]),T=S.useMemo(()=>{const z=(b==null?void 0:b.agents)??[];return{working:z.filter(F=>F.runtimeState==="working").length,blocked:z.filter(F=>F.runtimeState==="blocked").length,error:z.filter(F=>F.runtimeState==="error").length}},[b]),D=[{value:"all",label:"all",count:N},{value:"active",label:"active",count:T.working},{value:"attn",label:"attn",count:T.blocked+T.error,warn:T.blocked+T.error>0}],U=z=>{var re;const F=e===z.agentId,Z=lC(z.runtimeState,z.clientId),ee=z.clientId?((re=o(z.clientId))==null?void 0:re.hostname)??z.clientId.slice(0,8):null,q=z.activeSessions??0,ae=z.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>n(F?null:z.agentId),className:Te("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:F?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${F?"var(--accent)":"transparent"}`},children:[d.jsx(hl,{state:Z,size:8}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(z.agentId)}),z.type==="human"&&d.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),d.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:Z==="offline"?"disconnected":ee||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:ae>0&&d.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[q,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",ae]})]})})]}),F&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!x||x.length===0)&&d.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),x==null?void 0:x.filter(pe=>pe.state!=="evicted").map(pe=>{const fe=pe.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>i(z.agentId,pe.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===pe.chatId?"var(--bg-hover)":"transparent",color:pe.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:W=>{t!==pe.chatId&&(W.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:W=>{t!==pe.chatId&&(W.currentTarget.style.background="transparent")},children:[d.jsx(hl,{state:fe,size:6}),d.jsx("span",{className:"truncate text-body",style:{color:pe.topic||pe.summary?"var(--fg-2)":"var(--fg-4)"},children:pe.topic||pe.summary||`Chat · ${pe.chatId.slice(0,8)}`})]},pe.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(z.agentId),disabled:k.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:pe=>{pe.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:pe=>{pe.currentTarget.style.background="transparent"},children:[d.jsx(gl,{className:"h-3 w-3"}),"New chat"]})]})]},z.agentId)},B=j.length+E.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[N," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(Fd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),d.jsx("input",{value:m,onChange:z=>h(z.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:D.map(z=>d.jsx(Wo,{active:y===z.value,count:z.count,warn:z.warn,onClick:()=>g(z.value),children:z.label},z.value))})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[d.jsx(ZF,{}),"5m"]}),d.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(PF,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[T.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[T.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[T.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[B===0&&d.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:m||y!=="all"?"No matches":"No agents"}),E.length>0&&d.jsxs("div",{children:[d.jsx(CS,{label:"Agents",count:E.length}),E.map(U)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(CS,{label:"Humans",count:j.length}),j.map(U)]})]})]})}function CS({label:e,count:t}){return d.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function ZF(){return d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[d.jsx("title",{children:"pulse"}),d.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function VF(){const[e,t]=vg(),n=e.get("a"),i=e.get("c");Lj();const l=S.useCallback(f=>{t(f?{a:f}:{})},[t]),o=S.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=qe({queryKey:["agent-sessions",n],queryFn:()=>n?Fs(n):Promise.resolve([]),enabled:!!n&&!i});return S.useEffect(()=>{if(!n||i||!u||u.length===0)return;const f=[...u].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,i,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(HF,{selectedAgentId:n,selectedChatId:i,onSelectAgent:l,onSelectChat:o}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:d.jsx(MF,{selectedAgentId:n,selectedChatId:i})}),n&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(UF,{selectedAgentId:n,selectedChatId:i})})]})}const QF=new i2({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function GF(){return d.jsx(l2,{client:QF,children:d.jsx(eT,{children:d.jsx(FA,{children:d.jsxs(yA,{children:[d.jsx(Dr,{path:"/login",element:d.jsx(sF,{})}),d.jsx(Dr,{element:d.jsx(tT,{}),children:d.jsxs(Dr,{element:d.jsx(oL,{children:d.jsx(MD,{})}),children:[d.jsx(Dr,{index:!0,element:d.jsx(VF,{})}),d.jsx(Dr,{path:"agents",element:d.jsx(W$,{})}),d.jsx(Dr,{path:"agents/:uuid",element:d.jsx(U$,{})}),d.jsx(Dr,{path:"clients",element:d.jsx(aF,{})}),d.jsx(Dr,{path:"settings",element:d.jsx(uF,{})}),d.jsx(Dr,{path:"admin",element:d.jsx(_L,{})})]})})]})})})})}const fC=document.getElementById("root");if(!fC)throw new Error("Root element not found");DN.createRoot(fC).render(d.jsx(S.StrictMode,{children:d.jsx(GF,{})}));