@agent-team-foundation/first-tree-hub 0.11.1 → 0.11.2

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.
@@ -0,0 +1,388 @@
1
+ var u1=e=>{throw TypeError(e)};var Gm=(e,t,n)=>t.has(e)||u1("Cannot "+n);var D=(e,t,n)=>(Gm(e,t,"read from private field"),n?n.call(e):t.get(e)),ke=(e,t,n)=>t.has(e)?u1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),me=(e,t,n,a)=>(Gm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Le=(e,t,n)=>(Gm(e,t,"access private method"),n);var vd=(e,t,n,a)=>({set _(l){me(e,t,l,n)},get _(){return D(e,t,a)}});function Y2(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[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"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).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 a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},Xo={};/**
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 c1;function X2(){if(c1)return Xo;c1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+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:a,key:c,ref:l!==void 0?l:null,props:o}}return Xo.Fragment=t,Xo.jsx=n,Xo.jsxs=n,Xo}var d1;function J2(){return d1||(d1=1,Ym.exports=X2()),Ym.exports}var u=J2(),Xm={exports:{}},Fe={};/**
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 f1;function W2(){if(f1)return Fe;f1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=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 w(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 C(L,P,T){this.props=L,this.context=P,this.refs=E,this.updater=T||k}C.prototype.isReactComponent={},C.prototype.setState=function(L,P){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,P,"setState")},C.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=C.prototype;function O(L,P,T){this.props=L,this.context=P,this.refs=E,this.updater=T||k}var M=O.prototype=new R;M.constructor=O,j(M,C.prototype),M.isPureReactComponent=!0;var B=Array.isArray;function z(){}var $={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function Q(L,P,T){var Z=T.ref;return{$$typeof:e,type:L,key:P,ref:Z!==void 0?Z:null,props:T}}function I(L,P){return Q(L.type,P,L.props)}function ne(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function le(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(T){return P[T]})}var we=/\/+/g;function Y(L,P){return typeof L=="object"&&L!==null&&L.key!=null?le(""+L.key):P.toString(36)}function J(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(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function H(L,P,T,Z,W){var ce=typeof L;(ce==="undefined"||ce==="boolean")&&(L=null);var ve=!1;if(L===null)ve=!0;else switch(ce){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(L.$$typeof){case e:case t:ve=!0;break;case y:return ve=L._init,H(ve(L._payload),P,T,Z,W)}}if(ve)return W=W(L),ve=Z===""?"."+Y(L,0):Z,B(W)?(T="",ve!=null&&(T=ve.replace(we,"$&/")+"/"),H(W,P,T,"",function(Qe){return Qe})):W!=null&&(ne(W)&&(W=I(W,T+(W.key==null||L&&L.key===W.key?"":(""+W.key).replace(we,"$&/")+"/")+ve)),P.push(W)),1;ve=0;var ge=Z===""?".":Z+":";if(B(L))for(var fe=0;fe<L.length;fe++)Z=L[fe],ce=ge+Y(Z,fe),ve+=H(Z,P,T,ce,W);else if(fe=w(L),typeof fe=="function")for(L=fe.call(L),fe=0;!(Z=L.next()).done;)Z=Z.value,ce=ge+Y(Z,fe++),ve+=H(Z,P,T,ce,W);else if(ce==="object"){if(typeof L.then=="function")return H(J(L),P,T,Z,W);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ve}function ee(L,P,T){if(L==null)return L;var Z=[],W=0;return H(L,Z,"","",function(ce){return P.call(T,ce,W++)}),Z}function be(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(T){(L._status===0||L._status===-1)&&(L._status=1,L._result=T)},function(T){(L._status===0||L._status===-1)&&(L._status=2,L._result=T)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var Ae=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=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(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},A={map:ee,forEach:function(L,P,T){ee(L,function(){P.apply(this,arguments)},T)},count:function(L){var P=0;return ee(L,function(){P++}),P},toArray:function(L){return ee(L,function(P){return P})||[]},only:function(L){if(!ne(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Fe.Activity=g,Fe.Children=A,Fe.Component=C,Fe.Fragment=n,Fe.Profiler=l,Fe.PureComponent=O,Fe.StrictMode=a,Fe.Suspense=m,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return $.H.useMemoCache(L)}},Fe.cache=function(L){return function(){return L.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(L,P,T){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Z=j({},L.props),W=L.key;if(P!=null)for(ce in P.key!==void 0&&(W=""+P.key),P)!U.call(P,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&P.ref===void 0||(Z[ce]=P[ce]);var ce=arguments.length-2;if(ce===1)Z.children=T;else if(1<ce){for(var ve=Array(ce),ge=0;ge<ce;ge++)ve[ge]=arguments[ge+2];Z.children=ve}return Q(L.type,W,Z)},Fe.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Fe.createElement=function(L,P,T){var Z,W={},ce=null;if(P!=null)for(Z in P.key!==void 0&&(ce=""+P.key),P)U.call(P,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(W[Z]=P[Z]);var ve=arguments.length-2;if(ve===1)W.children=T;else if(1<ve){for(var ge=Array(ve),fe=0;fe<ve;fe++)ge[fe]=arguments[fe+2];W.children=ge}if(L&&L.defaultProps)for(Z in ve=L.defaultProps,ve)W[Z]===void 0&&(W[Z]=ve[Z]);return Q(L,ce,W)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(L){return{$$typeof:f,render:L}},Fe.isValidElement=ne,Fe.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:be}},Fe.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},Fe.startTransition=function(L){var P=$.T,T={};$.T=T;try{var Z=L(),W=$.S;W!==null&&W(T,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(z,Ae)}catch(ce){Ae(ce)}finally{P!==null&&T.types!==null&&(P.types=T.types),$.T=P}},Fe.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Fe.use=function(L){return $.H.use(L)},Fe.useActionState=function(L,P,T){return $.H.useActionState(L,P,T)},Fe.useCallback=function(L,P){return $.H.useCallback(L,P)},Fe.useContext=function(L){return $.H.useContext(L)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(L,P){return $.H.useDeferredValue(L,P)},Fe.useEffect=function(L,P){return $.H.useEffect(L,P)},Fe.useEffectEvent=function(L){return $.H.useEffectEvent(L)},Fe.useId=function(){return $.H.useId()},Fe.useImperativeHandle=function(L,P,T){return $.H.useImperativeHandle(L,P,T)},Fe.useInsertionEffect=function(L,P){return $.H.useInsertionEffect(L,P)},Fe.useLayoutEffect=function(L,P){return $.H.useLayoutEffect(L,P)},Fe.useMemo=function(L,P){return $.H.useMemo(L,P)},Fe.useOptimistic=function(L,P){return $.H.useOptimistic(L,P)},Fe.useReducer=function(L,P,T){return $.H.useReducer(L,P,T)},Fe.useRef=function(L){return $.H.useRef(L)},Fe.useState=function(L){return $.H.useState(L)},Fe.useSyncExternalStore=function(L,P,T){return $.H.useSyncExternalStore(L,P,T)},Fe.useTransition=function(){return $.H.useTransition()},Fe.version="19.2.4",Fe}var h1;function Xg(){return h1||(h1=1,Xm.exports=W2()),Xm.exports}var x=Xg();const eT=hf(x),Jg=Y2({__proto__:null,default:eT},[x]);var Jm={exports:{}},Jo={},Wm={exports:{}},ep={};/**
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 m1;function tT(){return m1||(m1=1,(function(e){function t(H,ee){var be=H.length;H.push(ee);e:for(;0<be;){var Ae=be-1>>>1,A=H[Ae];if(0<l(A,ee))H[Ae]=ee,H[be]=A,be=Ae;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var ee=H[0],be=H.pop();if(be!==ee){H[0]=be;e:for(var Ae=0,A=H.length,L=A>>>1;Ae<L;){var P=2*(Ae+1)-1,T=H[P],Z=P+1,W=H[Z];if(0>l(T,be))Z<A&&0>l(W,T)?(H[Ae]=W,H[Z]=be,Ae=Z):(H[Ae]=T,H[P]=be,Ae=P);else if(Z<A&&0>l(W,be))H[Ae]=W,H[Z]=be,Ae=Z;else break e}}return ee}function l(H,ee){var be=H.sortIndex-ee.sortIndex;return be!==0?be:H.id-ee.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 c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],y=1,g=null,b=3,w=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M(H){for(var ee=n(h);ee!==null;){if(ee.callback===null)a(h);else if(ee.startTime<=H)a(h),ee.sortIndex=ee.expirationTime,t(m,ee);else break;ee=n(h)}}function B(H){if(j=!1,M(H),!k)if(n(m)!==null)k=!0,z||(z=!0,le());else{var ee=n(h);ee!==null&&J(B,ee.startTime-H)}}var z=!1,$=-1,U=5,Q=-1;function I(){return E?!0:!(e.unstable_now()-Q<U)}function ne(){if(E=!1,z){var H=e.unstable_now();Q=H;var ee=!0;try{e:{k=!1,j&&(j=!1,R($),$=-1),w=!0;var be=b;try{t:{for(M(H),g=n(m);g!==null&&!(g.expirationTime>H&&I());){var Ae=g.callback;if(typeof Ae=="function"){g.callback=null,b=g.priorityLevel;var A=Ae(g.expirationTime<=H);if(H=e.unstable_now(),typeof A=="function"){g.callback=A,M(H),ee=!0;break t}g===n(m)&&a(m),M(H)}else a(m);g=n(m)}if(g!==null)ee=!0;else{var L=n(h);L!==null&&J(B,L.startTime-H),ee=!1}}break e}finally{g=null,b=be,w=!1}ee=void 0}}finally{ee?le():z=!1}}}var le;if(typeof O=="function")le=function(){O(ne)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Y=we.port2;we.port1.onmessage=ne,le=function(){Y.postMessage(null)}}else le=function(){C(ne,0)};function J(H,ee){$=C(function(){H(e.unstable_now())},ee)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var ee=3;break;default:ee=b}var be=b;b=ee;try{return H()}finally{b=be}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var be=b;b=H;try{return ee()}finally{b=be}},e.unstable_scheduleCallback=function(H,ee,be){var Ae=e.unstable_now();switch(typeof be=="object"&&be!==null?(be=be.delay,be=typeof be=="number"&&0<be?Ae+be:Ae):be=Ae,H){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=be+A,H={id:y++,callback:ee,priorityLevel:H,startTime:be,expirationTime:A,sortIndex:-1},be>Ae?(H.sortIndex=be,t(h,H),n(m)===null&&H===n(h)&&(j?(R($),$=-1):j=!0,J(B,be-Ae))):(H.sortIndex=A,t(m,H),k||w||(k=!0,z||(z=!0,le()))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var ee=b;return function(){var be=b;b=ee;try{return H.apply(this,arguments)}finally{b=be}}}})(ep)),ep}var p1;function nT(){return p1||(p1=1,Wm.exports=tT()),Wm.exports}var tp={exports:{}},jn={};/**
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 g1;function rT(){if(g1)return jn;g1=1;var e=Xg();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 a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},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 c=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 jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,jn.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)},jn.flushSync=function(m){var h=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=y,a.d.f()}},jn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},jn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},jn.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,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},jn.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);a.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&&a.d.M(m)},jn.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);a.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})}},jn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);a.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 a.d.m(m)},jn.requestFormReset=function(m){a.d.r(m)},jn.unstable_batchedUpdates=function(m,h){return m(h)},jn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},jn.useFormStatus=function(){return c.H.useHostTransitionStatus()},jn.version="19.2.4",jn}var y1;function lk(){if(y1)return tp.exports;y1=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(),tp.exports=rT(),tp.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 v1;function aT(){if(v1)return Jo;v1=1;var e=nT(),t=Xg(),n=lk();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var S=!1,_=p.child;_;){if(_===s){S=!0,s=p,d=v;break}if(_===d){S=!0,d=p,s=v;break}_=_.sibling}if(!S){for(_=v.child;_;){if(_===s){S=!0,s=v,d=p;break}if(_===d){S=!0,d=v,s=p;break}_=_.sibling}if(!S)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),O=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var we=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===we?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case z:return"SuspenseList";case Q:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case R:return(r._context.displayName||"Context")+".Consumer";case M:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case $:return i=r.displayName||null,i!==null?i:Y(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return Y(r(i))}catch{}}return null}var J=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},Ae=[],A=-1;function L(r){return{current:r}}function P(r){0>A||(r.current=Ae[A],Ae[A]=null,A--)}function T(r,i){A++,Ae[A]=r.current,r.current=i}var Z=L(null),W=L(null),ce=L(null),ve=L(null);function ge(r,i){switch(T(ce,i),T(W,r),T(Z,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?z0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=z0(i),r=O0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}P(Z),T(Z,r)}function fe(){P(Z),P(W),P(ce)}function Qe(r){r.memoizedState!==null&&T(ve,r);var i=Z.current,s=O0(i,r.type);i!==s&&(T(W,r),T(Z,s))}function Oe(r){W.current===r&&(P(Z),P(W)),ve.current===r&&(P(ve),Qo._currentValue=be)}var ut,re;function Se(r){if(ut===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ut=i&&i[1]||"",re=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+ut+r+re}var Me=!1;function Ge(r,i){if(!r||Me)return"";Me=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(te){var X=te}Reflect.construct(r,[],de)}else{try{de.call()}catch(te){X=te}r.call(de.prototype)}}else{try{throw Error()}catch(te){X=te}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(te){if(te&&X&&typeof te.stack=="string")return[te.stack,X.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),S=v[0],_=v[1];if(S&&_){var F=S.split(`
44
+ `),G=_.split(`
45
+ `);for(p=d=0;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===F.length||p===G.length)for(d=F.length-1,p=G.length-1;1<=d&&0<=p&&F[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if(F[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||F[d]!==G[p]){var ie=`
46
+ `+F[d].replace(" at new "," at ");return r.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",r.displayName)),ie}while(1<=d&&0<=p);break}}}finally{Me=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Se(s):""}function Rn(r,i){switch(r.tag){case 26:case 27:case 5:return Se(r.type);case 16:return Se("Lazy");case 13:return r.child!==i&&i!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return Ge(r.type,!1);case 11:return Ge(r.type.render,!1);case 1:return Ge(r.type,!0);case 31:return Se("Activity");default:return""}}function zn(r){try{var i="",s=null;do i+=Rn(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
47
+ Error generating stack: `+d.message+`
48
+ `+d.stack}}var Da=Object.prototype.hasOwnProperty,Ia=e.unstable_scheduleCallback,ra=e.unstable_cancelCallback,ro=e.unstable_shouldYield,ao=e.unstable_requestPaint,mn=e.unstable_now,io=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,rt=e.unstable_IdlePriority,pn=e.log,hr=e.unstable_setDisableYieldValue,nn=null,qt=null;function gn(r){if(typeof pn=="function"&&hr(r),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(nn,r)}catch{}}var mt=Math.clz32?Math.clz32:rc,Or=Math.log,Pn=Math.LN2;function rc(r){return r>>>=0,r===0?32:31-(Or(r)/Pn|0)|0}var Ii=256,Li=262144,Ui=4194304;function Zr(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Pi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var _=d&134217727;return _!==0?(d=_&~v,d!==0?p=Zr(d):(S&=_,S!==0?p=Zr(S):s||(s=_&~r,s!==0&&(p=Zr(s))))):(_=d&~v,_!==0?p=Zr(_):S!==0?p=Zr(S):s||(s=d&~r,s!==0&&(p=Zr(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function La(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function ac(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xe(){var r=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),r}function Ye(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function yn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function aa(r,i,s,d,p,v){var S=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,F=r.expirationTimes,G=r.hiddenUpdates;for(s=S&~s;0<s;){var ie=31-mt(s),de=1<<ie;_[ie]=0,F[ie]=-1;var X=G[ie];if(X!==null)for(G[ie]=null,ie=0;ie<X.length;ie++){var te=X[ie];te!==null&&(te.lane&=-536870913)}s&=~de}d!==0&&lo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function lo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-mt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function ic(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-mt(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function gv(r,i){var s=i&-i;return s=(s&42)!==0?1:Uf(s),(s&(r.suspendedLanes|i))!==0?0:s}function Uf(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 Pf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function yv(){var r=ee.p;return r!==0?r:(r=window.event,r===void 0?32:n1(r.type))}function vv(r,i){var s=ee.p;try{return ee.p=r,i()}finally{ee.p=s}}var Ua=Math.random().toString(36).slice(2),vn="__reactFiber$"+Ua,Bn="__reactProps$"+Ua,Cl="__reactContainer$"+Ua,Bf="__reactEvents$"+Ua,PN="__reactListeners$"+Ua,BN="__reactHandles$"+Ua,bv="__reactResources$"+Ua,so="__reactMarker$"+Ua;function $f(r){delete r[vn],delete r[Bn],delete r[Bf],delete r[PN],delete r[BN]}function El(r){var i=r[vn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Cl]||s[vn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=B0(r);r!==null;){if(s=r[vn])return s;r=B0(r)}return i}r=s,s=r.parentNode}return null}function Nl(r){if(r=r[vn]||r[Cl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function oo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function _l(r){var i=r[bv];return i||(i=r[bv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function on(r){r[so]=!0}var xv=new Set,wv={};function Bi(r,i){Tl(r,i),Tl(r+"Capture",i)}function Tl(r,i){for(wv[r]=i,r=0;r<i.length;r++)xv.add(i[r])}var $N=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]*$"),Sv={},kv={};function FN(r){return Da.call(kv,r)?!0:Da.call(Sv,r)?!1:$N.test(r)?kv[r]=!0:(Sv[r]=!0,!1)}function lc(r,i,s){if(FN(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function sc(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function ia(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function mr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function jv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function qN(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){s=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ff(r){if(!r._valueTracker){var i=jv(r)?"checked":"value";r._valueTracker=qN(r,i,""+r[i])}}function Cv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=jv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function oc(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 HN=/[\n"\\]/g;function pr(r){return r.replace(HN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function qf(r,i,s,d,p,v,S,_){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+mr(i)):r.value!==""+mr(i)&&(r.value=""+mr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Hf(r,S,mr(i)):s!=null?Hf(r,S,mr(s)):d!=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=""+mr(_):r.removeAttribute("name")}function Ev(r,i,s,d,p,v,S,_){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Ff(r);return}s=s!=null?""+mr(s):"",i=i!=null?""+mr(i):s,_||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=_?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Ff(r)}function Hf(r,i,s){i==="number"&&oc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Al(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+mr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Nv(r,i,s){if(i!=null&&(i=""+mr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+mr(s):""}function _v(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(J(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=mr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Ff(r)}function Rl(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var ZN=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 Tv(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||ZN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function Av(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&Tv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&Tv(r,v,i[v])}function Zf(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 VN=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"]]),QN=/^[\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 uc(r){return QN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function la(){}var Vf=null;function Qf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var zl=null,Ol=null;function Rv(r){var i=Nl(r);if(i&&(r=i.stateNode)){var s=r[Bn]||null;e:switch(r=i.stateNode,i.type){case"input":if(qf(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+pr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Bn]||null;if(!p)throw Error(a(90));qf(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&Cv(d)}break e;case"textarea":Nv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Al(r,!!s.multiple,i,!1)}}}var Kf=!1;function zv(r,i,s){if(Kf)return r(i,s);Kf=!0;try{var d=r(i);return d}finally{if(Kf=!1,(zl!==null||Ol!==null)&&(Yc(),zl&&(i=zl,r=Ol,Ol=zl=null,Rv(i),r)))for(i=0;i<r.length;i++)Rv(r[i])}}function uo(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Bn]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gf=!1;if(sa)try{var co={};Object.defineProperty(co,"passive",{get:function(){Gf=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Gf=!1}var Pa=null,Yf=null,cc=null;function Ov(){if(cc)return cc;var r,i=Yf,s=i.length,d,p="value"in Pa?Pa.value:Pa.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return cc=p.slice(r,1<d?1-d:void 0)}function dc(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function fc(){return!0}function Mv(){return!1}function $n(r){function i(s,d,p,v,S){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=S,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)?fc:Mv,this.isPropagationStopped=Mv,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=fc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=fc)},persist:function(){},isPersistent:fc}),i}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hc=$n($i),fo=g({},$i,{view:0,detail:0}),KN=$n(fo),Xf,Jf,ho,mc=g({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eh,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!==ho&&(ho&&r.type==="mousemove"?(Xf=r.screenX-ho.screenX,Jf=r.screenY-ho.screenY):Jf=Xf=0,ho=r),Xf)},movementY:function(r){return"movementY"in r?r.movementY:Jf}}),Dv=$n(mc),GN=g({},mc,{dataTransfer:0}),YN=$n(GN),XN=g({},fo,{relatedTarget:0}),Wf=$n(XN),JN=g({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),WN=$n(JN),e_=g({},$i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),t_=$n(e_),n_=g({},$i,{data:0}),Iv=$n(n_),r_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a_={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"},i_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l_(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=i_[r])?!!i[r]:!1}function eh(){return l_}var s_=g({},fo,{key:function(r){if(r.key){var i=r_[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=dc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?a_[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eh,charCode:function(r){return r.type==="keypress"?dc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?dc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),o_=$n(s_),u_=g({},mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lv=$n(u_),c_=g({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eh}),d_=$n(c_),f_=g({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),h_=$n(f_),m_=g({},mc,{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}),p_=$n(m_),g_=g({},$i,{newState:0,oldState:0}),y_=$n(g_),v_=[9,13,27,32],th=sa&&"CompositionEvent"in window,mo=null;sa&&"documentMode"in document&&(mo=document.documentMode);var b_=sa&&"TextEvent"in window&&!mo,Uv=sa&&(!th||mo&&8<mo&&11>=mo),Pv=" ",Bv=!1;function $v(r,i){switch(r){case"keyup":return v_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ml=!1;function x_(r,i){switch(r){case"compositionend":return Fv(i);case"keypress":return i.which!==32?null:(Bv=!0,Pv);case"textInput":return r=i.data,r===Pv&&Bv?null:r;default:return null}}function w_(r,i){if(Ml)return r==="compositionend"||!th&&$v(r,i)?(r=Ov(),cc=Yf=Pa=null,Ml=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Uv&&i.locale!=="ko"?null:i.data;default:return null}}var S_={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 qv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!S_[r.type]:i==="textarea"}function Hv(r,i,s,d){zl?Ol?Ol.push(d):Ol=[d]:zl=d,i=rd(i,"onChange"),0<i.length&&(s=new hc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var po=null,go=null;function k_(r){E0(r,0)}function pc(r){var i=oo(r);if(Cv(i))return r}function Zv(r,i){if(r==="change")return i}var Vv=!1;if(sa){var nh;if(sa){var rh="oninput"in document;if(!rh){var Qv=document.createElement("div");Qv.setAttribute("oninput","return;"),rh=typeof Qv.oninput=="function"}nh=rh}else nh=!1;Vv=nh&&(!document.documentMode||9<document.documentMode)}function Kv(){po&&(po.detachEvent("onpropertychange",Gv),go=po=null)}function Gv(r){if(r.propertyName==="value"&&pc(go)){var i=[];Hv(i,go,r,Qf(r)),zv(k_,i)}}function j_(r,i,s){r==="focusin"?(Kv(),po=i,go=s,po.attachEvent("onpropertychange",Gv)):r==="focusout"&&Kv()}function C_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return pc(go)}function E_(r,i){if(r==="click")return pc(i)}function N_(r,i){if(r==="input"||r==="change")return pc(i)}function __(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var er=typeof Object.is=="function"?Object.is:__;function yo(r,i){if(er(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Da.call(i,p)||!er(r[p],i[p]))return!1}return!0}function Yv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Xv(r,i){var s=Yv(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Yv(s)}}function Jv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Jv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Wv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=oc(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=oc(r.document)}return i}function ah(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var T_=sa&&"documentMode"in document&&11>=document.documentMode,Dl=null,ih=null,vo=null,lh=!1;function eb(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;lh||Dl==null||Dl!==oc(d)||(d=Dl,"selectionStart"in d&&ah(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),vo&&yo(vo,d)||(vo=d,d=rd(ih,"onSelect"),0<d.length&&(i=new hc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Dl)))}function Fi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Il={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},sh={},tb={};sa&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete Il.animationend.animation,delete Il.animationiteration.animation,delete Il.animationstart.animation),"TransitionEvent"in window||delete Il.transitionend.transition);function qi(r){if(sh[r])return sh[r];if(!Il[r])return r;var i=Il[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in tb)return sh[r]=i[s];return r}var nb=qi("animationend"),rb=qi("animationiteration"),ab=qi("animationstart"),A_=qi("transitionrun"),R_=qi("transitionstart"),z_=qi("transitioncancel"),ib=qi("transitionend"),lb=new Map,oh="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(" ");oh.push("scrollEnd");function Mr(r,i){lb.set(r,i),Bi(i,[r])}var gc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},gr=[],Ll=0,uh=0;function yc(){for(var r=Ll,i=uh=Ll=0;i<r;){var s=gr[i];gr[i++]=null;var d=gr[i];gr[i++]=null;var p=gr[i];gr[i++]=null;var v=gr[i];if(gr[i++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}v!==0&&sb(s,p,v)}}function vc(r,i,s,d){gr[Ll++]=r,gr[Ll++]=i,gr[Ll++]=s,gr[Ll++]=d,uh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function ch(r,i,s,d){return vc(r,i,s,d),bc(r)}function Hi(r,i){return vc(r,null,null,i),bc(r)}function sb(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,d=v.alternate,d!==null&&(d.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&&i!==null&&(p=31-mt(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function bc(r){if(50<Bo)throw Bo=0,bm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ul={};function O_(r,i,s,d){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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tr(r,i,s,d){return new O_(r,i,s,d)}function dh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function oa(r,i){var s=r.alternate;return s===null?(s=tr(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,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,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function ob(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=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,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function xc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")dh(r)&&(S=1);else if(typeof r=="string")S=U2(r,s,Z.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Q:return r=tr(31,s,i,p),r.elementType=Q,r.lanes=v,r;case j:return Zi(s.children,p,v,i);case E:S=8,p|=24;break;case C:return r=tr(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case B:return r=tr(13,s,i,p),r.elementType=B,r.lanes=v,r;case z:return r=tr(19,s,i,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:S=10;break e;case R:S=9;break e;case M:S=11;break e;case $:S=14;break e;case U:S=16,d=null;break e}S=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=tr(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Zi(r,i,s,d){return r=tr(7,r,d,i),r.lanes=s,r}function fh(r,i,s){return r=tr(6,r,null,i),r.lanes=s,r}function ub(r){var i=tr(18,null,null,0);return i.stateNode=r,i}function hh(r,i,s){return i=tr(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var cb=new WeakMap;function yr(r,i){if(typeof r=="object"&&r!==null){var s=cb.get(r);return s!==void 0?s:(i={value:r,source:i,stack:zn(i)},cb.set(r,i),i)}return{value:r,source:i,stack:zn(i)}}var Pl=[],Bl=0,wc=null,bo=0,vr=[],br=0,Ba=null,Vr=1,Qr="";function ua(r,i){Pl[Bl++]=bo,Pl[Bl++]=wc,wc=r,bo=i}function db(r,i,s){vr[br++]=Vr,vr[br++]=Qr,vr[br++]=Ba,Ba=r;var d=Vr;r=Qr;var p=32-mt(d)-1;d&=~(1<<p),s+=1;var v=32-mt(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,Vr=1<<32-mt(i)+p|s<<p|d,Qr=v+r}else Vr=1<<v|s<<p|d,Qr=r}function mh(r){r.return!==null&&(ua(r,1),db(r,1,0))}function ph(r){for(;r===wc;)wc=Pl[--Bl],Pl[Bl]=null,bo=Pl[--Bl],Pl[Bl]=null;for(;r===Ba;)Ba=vr[--br],vr[br]=null,Qr=vr[--br],vr[br]=null,Vr=vr[--br],vr[br]=null}function fb(r,i){vr[br++]=Vr,vr[br++]=Qr,vr[br++]=Ba,Vr=i.id,Qr=i.overflow,Ba=r}var bn=null,_t=null,at=!1,$a=null,xr=!1,gh=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xo(yr(i,r)),gh}function hb(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[vn]=r,i[Bn]=d,s){case"dialog":Je("cancel",i),Je("close",i);break;case"iframe":case"object":case"embed":Je("load",i);break;case"video":case"audio":for(s=0;s<Fo.length;s++)Je(Fo[s],i);break;case"source":Je("error",i);break;case"img":case"image":case"link":Je("error",i),Je("load",i);break;case"details":Je("toggle",i);break;case"input":Je("invalid",i),Ev(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",i);break;case"textarea":Je("invalid",i),_v(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||A0(i.textContent,s)?(d.popover!=null&&(Je("beforetoggle",i),Je("toggle",i)),d.onScroll!=null&&Je("scroll",i),d.onScrollEnd!=null&&Je("scrollend",i),d.onClick!=null&&(i.onclick=la),i=!0):i=!1,i||Fa(r,!0)}function mb(r){for(bn=r.return;bn;)switch(bn.tag){case 5:case 31:case 13:xr=!1;return;case 27:case 3:xr=!0;return;default:bn=bn.return}}function $l(r){if(r!==bn)return!1;if(!at)return mb(r),at=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Mm(r.type,r.memoizedProps)),s=!s),s&&_t&&Fa(r),mb(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));_t=P0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));_t=P0(r)}else i===27?(i=_t,ni(r.type)?(r=Pm,Pm=null,_t=r):_t=i):_t=bn?Sr(r.stateNode.nextSibling):null;return!0}function Vi(){_t=bn=null,at=!1}function yh(){var r=$a;return r!==null&&(Zn===null?Zn=r:Zn.push.apply(Zn,r),$a=null),r}function xo(r){$a===null?$a=[r]:$a.push(r)}var vh=L(null),Qi=null,ca=null;function qa(r,i,s){T(vh,i._currentValue),i._currentValue=s}function da(r){r._currentValue=vh.current,P(vh)}function bh(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function xh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var S=p.child;v=v.firstContext;e:for(;v!==null;){var _=v;v=p;for(var F=0;F<i.length;F++)if(_.context===i[F]){v.lanes|=s,_=v.alternate,_!==null&&(_.lanes|=s),bh(v.return,s,r),d||(S=null);break e}v=_.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=s,v=S.alternate,v!==null&&(v.lanes|=s),bh(S,s,r),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===r){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Fl(r,i,s,d){r=null;for(var p=i,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 S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var _=p.type;er(p.pendingProps.value,S.value)||(r!==null?r.push(_):r=[_])}}else if(p===ve.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Qo):r=[Qo])}p=p.return}r!==null&&xh(i,r,s,d),i.flags|=262144}function Sc(r){for(r=r.firstContext;r!==null;){if(!er(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ki(r){Qi=r,ca=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function xn(r){return pb(Qi,r)}function kc(r,i){return Qi===null&&Ki(r),pb(r,i)}function pb(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ca===null){if(r===null)throw Error(a(308));ca=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ca=ca.next=i;return s}var M_=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},D_=e.unstable_scheduleCallback,I_=e.unstable_NormalPriority,Qt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wh(){return{controller:new M_,data:new Map,refCount:0}}function wo(r){r.refCount--,r.refCount===0&&D_(I_,function(){r.controller.abort()})}var So=null,Sh=0,ql=0,Hl=null;function L_(r,i){if(So===null){var s=So=[];Sh=0,ql=Cm(),Hl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return Sh++,i.then(gb,gb),i}function gb(){if(--Sh===0&&So!==null){Hl!==null&&(Hl.status="fulfilled");var r=So;So=null,ql=0,Hl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function U_(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var yb=H.S;H.S=function(r,i){e0=mn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&L_(r,i),yb!==null&&yb(r,i)};var Gi=L(null);function kh(){var r=Gi.current;return r!==null?r:St.pooledCache}function jc(r,i){i===null?T(Gi,Gi.current):T(Gi,i.pool)}function vb(){var r=kh();return r===null?null:{parent:Qt._currentValue,pool:r}}var Zl=Error(a(460)),jh=Error(a(474)),Cc=Error(a(542)),Ec={then:function(){}};function bb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function xb(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(la,la),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Sb(r),r;default:if(typeof i.status=="string")i.then(la,la);else{if(r=St,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Sb(r),r}throw Xi=i,Zl}}function Yi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Xi=s,Zl):s}}var Xi=null;function wb(){if(Xi===null)throw Error(a(459));var r=Xi;return Xi=null,r}function Sb(r){if(r===Zl||r===Cc)throw Error(a(483))}var Vl=null,ko=0;function Nc(r){var i=ko;return ko+=1,Vl===null&&(Vl=[]),xb(Vl,r,i)}function jo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function _c(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function kb(r){function i(V,q){if(r){var K=V.deletions;K===null?(V.deletions=[q],V.flags|=16):K.push(q)}}function s(V,q){if(!r)return null;for(;q!==null;)i(V,q),q=q.sibling;return null}function d(V){for(var q=new Map;V!==null;)V.key!==null?q.set(V.key,V):q.set(V.index,V),V=V.sibling;return q}function p(V,q){return V=oa(V,q),V.index=0,V.sibling=null,V}function v(V,q,K){return V.index=K,r?(K=V.alternate,K!==null?(K=K.index,K<q?(V.flags|=67108866,q):K):(V.flags|=67108866,q)):(V.flags|=1048576,q)}function S(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function _(V,q,K,ue){return q===null||q.tag!==6?(q=fh(K,V.mode,ue),q.return=V,q):(q=p(q,K),q.return=V,q)}function F(V,q,K,ue){var ze=K.type;return ze===j?ie(V,q,K.props.children,ue,K.key):q!==null&&(q.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===U&&Yi(ze)===q.type)?(q=p(q,K.props),jo(q,K),q.return=V,q):(q=xc(K.type,K.key,K.props,null,V.mode,ue),jo(q,K),q.return=V,q)}function G(V,q,K,ue){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=hh(K,V.mode,ue),q.return=V,q):(q=p(q,K.children||[]),q.return=V,q)}function ie(V,q,K,ue,ze){return q===null||q.tag!==7?(q=Zi(K,V.mode,ue,ze),q.return=V,q):(q=p(q,K),q.return=V,q)}function de(V,q,K){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=fh(""+q,V.mode,K),q.return=V,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case w:return K=xc(q.type,q.key,q.props,null,V.mode,K),jo(K,q),K.return=V,K;case k:return q=hh(q,V.mode,K),q.return=V,q;case U:return q=Yi(q),de(V,q,K)}if(J(q)||le(q))return q=Zi(q,V.mode,K,null),q.return=V,q;if(typeof q.then=="function")return de(V,Nc(q),K);if(q.$$typeof===O)return de(V,kc(V,q),K);_c(V,q)}return null}function X(V,q,K,ue){var ze=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ze!==null?null:_(V,q,""+K,ue);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===ze?F(V,q,K,ue):null;case k:return K.key===ze?G(V,q,K,ue):null;case U:return K=Yi(K),X(V,q,K,ue)}if(J(K)||le(K))return ze!==null?null:ie(V,q,K,ue,null);if(typeof K.then=="function")return X(V,q,Nc(K),ue);if(K.$$typeof===O)return X(V,q,kc(V,K),ue);_c(V,K)}return null}function te(V,q,K,ue,ze){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return V=V.get(K)||null,_(q,V,""+ue,ze);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case w:return V=V.get(ue.key===null?K:ue.key)||null,F(q,V,ue,ze);case k:return V=V.get(ue.key===null?K:ue.key)||null,G(q,V,ue,ze);case U:return ue=Yi(ue),te(V,q,K,ue,ze)}if(J(ue)||le(ue))return V=V.get(K)||null,ie(q,V,ue,ze,null);if(typeof ue.then=="function")return te(V,q,K,Nc(ue),ze);if(ue.$$typeof===O)return te(V,q,K,kc(q,ue),ze);_c(q,ue)}return null}function je(V,q,K,ue){for(var ze=null,ct=null,_e=q,He=q=0,nt=null;_e!==null&&He<K.length;He++){_e.index>He?(nt=_e,_e=null):nt=_e.sibling;var dt=X(V,_e,K[He],ue);if(dt===null){_e===null&&(_e=nt);break}r&&_e&&dt.alternate===null&&i(V,_e),q=v(dt,q,He),ct===null?ze=dt:ct.sibling=dt,ct=dt,_e=nt}if(He===K.length)return s(V,_e),at&&ua(V,He),ze;if(_e===null){for(;He<K.length;He++)_e=de(V,K[He],ue),_e!==null&&(q=v(_e,q,He),ct===null?ze=_e:ct.sibling=_e,ct=_e);return at&&ua(V,He),ze}for(_e=d(_e);He<K.length;He++)nt=te(_e,V,He,K[He],ue),nt!==null&&(r&&nt.alternate!==null&&_e.delete(nt.key===null?He:nt.key),q=v(nt,q,He),ct===null?ze=nt:ct.sibling=nt,ct=nt);return r&&_e.forEach(function(si){return i(V,si)}),at&&ua(V,He),ze}function Ie(V,q,K,ue){if(K==null)throw Error(a(151));for(var ze=null,ct=null,_e=q,He=q=0,nt=null,dt=K.next();_e!==null&&!dt.done;He++,dt=K.next()){_e.index>He?(nt=_e,_e=null):nt=_e.sibling;var si=X(V,_e,dt.value,ue);if(si===null){_e===null&&(_e=nt);break}r&&_e&&si.alternate===null&&i(V,_e),q=v(si,q,He),ct===null?ze=si:ct.sibling=si,ct=si,_e=nt}if(dt.done)return s(V,_e),at&&ua(V,He),ze;if(_e===null){for(;!dt.done;He++,dt=K.next())dt=de(V,dt.value,ue),dt!==null&&(q=v(dt,q,He),ct===null?ze=dt:ct.sibling=dt,ct=dt);return at&&ua(V,He),ze}for(_e=d(_e);!dt.done;He++,dt=K.next())dt=te(_e,V,He,dt.value,ue),dt!==null&&(r&&dt.alternate!==null&&_e.delete(dt.key===null?He:dt.key),q=v(dt,q,He),ct===null?ze=dt:ct.sibling=dt,ct=dt);return r&&_e.forEach(function(G2){return i(V,G2)}),at&&ua(V,He),ze}function wt(V,q,K,ue){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var ze=K.key;q!==null;){if(q.key===ze){if(ze=K.type,ze===j){if(q.tag===7){s(V,q.sibling),ue=p(q,K.props.children),ue.return=V,V=ue;break e}}else if(q.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===U&&Yi(ze)===q.type){s(V,q.sibling),ue=p(q,K.props),jo(ue,K),ue.return=V,V=ue;break e}s(V,q);break}else i(V,q);q=q.sibling}K.type===j?(ue=Zi(K.props.children,V.mode,ue,K.key),ue.return=V,V=ue):(ue=xc(K.type,K.key,K.props,null,V.mode,ue),jo(ue,K),ue.return=V,V=ue)}return S(V);case k:e:{for(ze=K.key;q!==null;){if(q.key===ze)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){s(V,q.sibling),ue=p(q,K.children||[]),ue.return=V,V=ue;break e}else{s(V,q);break}else i(V,q);q=q.sibling}ue=hh(K,V.mode,ue),ue.return=V,V=ue}return S(V);case U:return K=Yi(K),wt(V,q,K,ue)}if(J(K))return je(V,q,K,ue);if(le(K)){if(ze=le(K),typeof ze!="function")throw Error(a(150));return K=ze.call(K),Ie(V,q,K,ue)}if(typeof K.then=="function")return wt(V,q,Nc(K),ue);if(K.$$typeof===O)return wt(V,q,kc(V,K),ue);_c(V,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,q!==null&&q.tag===6?(s(V,q.sibling),ue=p(q,K),ue.return=V,V=ue):(s(V,q),ue=fh(K,V.mode,ue),ue.return=V,V=ue),S(V)):s(V,q)}return function(V,q,K,ue){try{ko=0;var ze=wt(V,q,K,ue);return Vl=null,ze}catch(_e){if(_e===Zl||_e===Cc)throw _e;var ct=tr(29,_e,null,V.mode);return ct.lanes=ue,ct.return=V,ct}finally{}}}var Ji=kb(!0),jb=kb(!1),Ha=!1;function Ch(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Va(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ht&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=bc(r),sb(r,null,s),i}return vc(r,d,i,s),bc(r)}function Co(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ic(r,s)}}function Nh(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=S:v=v.next=S,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var _h=!1;function Eo(){if(_h){var r=Hl;if(r!==null)throw r}}function No(r,i,s,d){_h=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var F=_,G=F.next;F.next=null,S===null?v=G:S.next=G,S=F;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,_=ie.lastBaseUpdate,_!==S&&(_===null?ie.firstBaseUpdate=G:_.next=G,ie.lastBaseUpdate=F))}if(v!==null){var de=p.baseState;S=0,ie=G=F=null,_=v;do{var X=_.lane&-536870913,te=X!==_.lane;if(te?(tt&X)===X:(d&X)===X){X!==0&&X===ql&&(_h=!0),ie!==null&&(ie=ie.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var je=r,Ie=_;X=i;var wt=s;switch(Ie.tag){case 1:if(je=Ie.payload,typeof je=="function"){de=je.call(wt,de,X);break e}de=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Ie.payload,X=typeof je=="function"?je.call(wt,de,X):je,X==null)break e;de=g({},de,X);break e;case 2:Ha=!0}}X=_.callback,X!==null&&(r.flags|=64,te&&(r.flags|=8192),te=p.callbacks,te===null?p.callbacks=[X]:te.push(X))}else te={lane:X,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ie===null?(G=ie=te,F=de):ie=ie.next=te,S|=X;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;te=_,_=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);ie===null&&(F=de),p.baseState=F,p.firstBaseUpdate=G,p.lastBaseUpdate=ie,v===null&&(p.shared.lanes=0),Xa|=S,r.lanes=S,r.memoizedState=de}}function Cb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Eb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Cb(s[r],i)}var Ql=L(null),Tc=L(0);function Nb(r,i){r=xa,T(Tc,r),T(Ql,i),xa=r|i.baseLanes}function Th(){T(Tc,xa),T(Ql,Ql.current)}function Ah(){xa=Tc.current,P(Ql),P(Tc)}var nr=L(null),wr=null;function Qa(r){var i=r.alternate;T(Ht,Ht.current&1),T(nr,r),wr===null&&(i===null||Ql.current!==null||i.memoizedState!==null)&&(wr=r)}function Rh(r){T(Ht,Ht.current),T(nr,r),wr===null&&(wr=r)}function _b(r){r.tag===22?(T(Ht,Ht.current),T(nr,r),wr===null&&(wr=r)):Ka()}function Ka(){T(Ht,Ht.current),T(nr,nr.current)}function rr(r){P(nr),wr===r&&(wr=null),P(Ht)}var Ht=L(0);function Ac(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Lm(s)||Um(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var fa=0,qe=null,bt=null,Kt=null,Rc=!1,Kl=!1,Wi=!1,zc=0,_o=0,Gl=null,P_=0;function Pt(){throw Error(a(321))}function zh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!er(r[s],i[s]))return!1;return!0}function Oh(r,i,s,d,p,v){return fa=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=r===null||r.memoizedState===null?dx:Kh,Wi=!1,v=s(d,p),Wi=!1,Kl&&(v=Ab(i,s,d,p)),Tb(r),v}function Tb(r){H.H=Ro;var i=bt!==null&&bt.next!==null;if(fa=0,Kt=bt=qe=null,Rc=!1,_o=0,Gl=null,i)throw Error(a(300));r===null||Gt||(r=r.dependencies,r!==null&&Sc(r)&&(Gt=!0))}function Ab(r,i,s,d){qe=r;var p=0;do{if(Kl&&(Gl=null),_o=0,Kl=!1,25<=p)throw Error(a(301));if(p+=1,Kt=bt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}H.H=fx,v=i(s,d)}while(Kl);return v}function B_(){var r=H.H,i=r.useState()[0];return i=typeof i.then=="function"?To(i):i,r=r.useState()[0],(bt!==null?bt.memoizedState:null)!==r&&(qe.flags|=1024),i}function Mh(){var r=zc!==0;return zc=0,r}function Dh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Ih(r){if(Rc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rc=!1}fa=0,Kt=bt=qe=null,Kl=!1,_o=zc=0,Gl=null}function On(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?qe.memoizedState=Kt=r:Kt=Kt.next=r,Kt}function Zt(){if(bt===null){var r=qe.alternate;r=r!==null?r.memoizedState:null}else r=bt.next;var i=Kt===null?qe.memoizedState:Kt.next;if(i!==null)Kt=i,bt=r;else{if(r===null)throw qe.alternate===null?Error(a(467)):Error(a(310));bt=r,r={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Kt===null?qe.memoizedState=Kt=r:Kt=Kt.next=r}return Kt}function Oc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(r){var i=_o;return _o+=1,Gl===null&&(Gl=[]),r=xb(Gl,r,i),i=qe,(Kt===null?i.memoizedState:Kt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?dx:Kh),r}function Mc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return To(r);if(r.$$typeof===O)return xn(r)}throw Error(a(438,String(r)))}function Lh(r){var i=null,s=qe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=qe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Oc(),qe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=I;return i.index++,s}function ha(r,i){return typeof i=="function"?i(r):i}function Dc(r){var i=Zt();return Uh(i,bt,r)}function Uh(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var S=p.next;p.next=v.next,v.next=S}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var _=S=null,F=null,G=i,ie=!1;do{var de=G.lane&-536870913;if(de!==G.lane?(tt&de)===de:(fa&de)===de){var X=G.revertLane;if(X===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),de===ql&&(ie=!0);else if((fa&X)===X){G=G.next,X===ql&&(ie=!0);continue}else de={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},F===null?(_=F=de,S=v):F=F.next=de,qe.lanes|=X,Xa|=X;de=G.action,Wi&&s(v,de),v=G.hasEagerState?G.eagerState:s(v,de)}else X={lane:de,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},F===null?(_=F=X,S=v):F=F.next=X,qe.lanes|=de,Xa|=de;G=G.next}while(G!==null&&G!==i);if(F===null?S=v:F.next=_,!er(v,r.memoizedState)&&(Gt=!0,ie&&(s=Hl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=F,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Ph(r){var i=Zt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);er(v,i.memoizedState)||(Gt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function Rb(r,i,s){var d=qe,p=Zt(),v=at;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!er((bt||p).memoizedState,s);if(S&&(p.memoizedState=s,Gt=!0),p=p.queue,Fh(Mb.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Kt!==null&&Kt.memoizedState.tag&1){if(d.flags|=2048,Yl(9,{destroy:void 0},Ob.bind(null,d,p,s,i),null),St===null)throw Error(a(349));v||(fa&127)!==0||zb(d,i,s)}return s}function zb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=Oc(),qe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Ob(r,i,s,d){i.value=s,i.getSnapshot=d,Db(i)&&Ib(r)}function Mb(r,i,s){return s(function(){Db(i)&&Ib(r)})}function Db(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!er(r,s)}catch{return!0}}function Ib(r){var i=Hi(r,2);i!==null&&Vn(i,r,2)}function Bh(r){var i=On();if(typeof r=="function"){var s=r;if(r=s(),Wi){gn(!0);try{s()}finally{gn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:r},i}function Lb(r,i,s,d){return r.baseState=s,Uh(r,bt,typeof d=="function"?d:ha)}function $_(r,i,s,d,p){if(Uc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){v.listeners.push(S)}};H.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,Ub(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Ub(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=H.T,S={};H.T=S;try{var _=s(p,d),F=H.S;F!==null&&F(S,_),Pb(r,i,_)}catch(G){$h(r,i,G)}finally{v!==null&&S.types!==null&&(v.types=S.types),H.T=v}}else try{v=s(p,d),Pb(r,i,v)}catch(G){$h(r,i,G)}}function Pb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Bb(r,i,d)},function(d){return $h(r,i,d)}):Bb(r,i,s)}function Bb(r,i,s){i.status="fulfilled",i.value=s,$b(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Ub(r,s)))}function $h(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,$b(i),i=i.next;while(i!==d)}r.action=null}function $b(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Fb(r,i){return i}function qb(r,i){if(at){var s=St.formState;if(s!==null){e:{var d=qe;if(at){if(_t){t:{for(var p=_t,v=xr;p.nodeType!==8;){if(!v){p=null;break t}if(p=Sr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){_t=Sr(p.nextSibling),d=p.data==="F!";break e}}Fa(d)}d=!1}d&&(i=s[0])}}return s=On(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fb,lastRenderedState:i},s.queue=d,s=ox.bind(null,qe,d),d.dispatch=s,d=Bh(!1),v=Qh.bind(null,qe,!1,d.queue),d=On(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=$_.bind(null,qe,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Hb(r){var i=Zt();return Zb(i,bt,r)}function Zb(r,i,s){if(i=Uh(r,i,Fb)[0],r=Dc(ha)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=To(i)}catch(S){throw S===Zl?Cc:S}else d=i;i=Zt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,Yl(9,{destroy:void 0},F_.bind(null,p,s),null)),[d,v,r]}function F_(r,i){r.action=i}function Vb(r){var i=Zt(),s=bt;if(s!==null)return Zb(i,s,r);Zt(),i=i.memoizedState,s=Zt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Yl(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=qe.updateQueue,i===null&&(i=Oc(),qe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function Qb(){return Zt().memoizedState}function Ic(r,i,s,d){var p=On();qe.flags|=r,p.memoizedState=Yl(1|i,{destroy:void 0},s,d===void 0?null:d)}function Lc(r,i,s,d){var p=Zt();d=d===void 0?null:d;var v=p.memoizedState.inst;bt!==null&&d!==null&&zh(d,bt.memoizedState.deps)?p.memoizedState=Yl(i,v,s,d):(qe.flags|=r,p.memoizedState=Yl(1|i,v,s,d))}function Kb(r,i){Ic(8390656,8,r,i)}function Fh(r,i){Lc(2048,8,r,i)}function q_(r){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=Oc(),qe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Gb(r){var i=Zt().memoizedState;return q_({ref:i,nextImpl:r}),function(){if((ht&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Yb(r,i){return Lc(4,2,r,i)}function Xb(r,i){return Lc(4,4,r,i)}function Jb(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Wb(r,i,s){s=s!=null?s.concat([r]):null,Lc(4,4,Jb.bind(null,i,r),s)}function qh(){}function ex(r,i){var s=Zt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&zh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function tx(r,i){var s=Zt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&zh(i,d[1]))return d[0];if(d=r(),Wi){gn(!0);try{r()}finally{gn(!1)}}return s.memoizedState=[d,i],d}function Hh(r,i,s){return s===void 0||(fa&1073741824)!==0&&(tt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=n0(),qe.lanes|=r,Xa|=r,s)}function nx(r,i,s,d){return er(s,i)?s:Ql.current!==null?(r=Hh(r,s,d),er(r,i)||(Gt=!0),r):(fa&42)===0||(fa&1073741824)!==0&&(tt&261930)===0?(Gt=!0,r.memoizedState=s):(r=n0(),qe.lanes|=r,Xa|=r,i)}function rx(r,i,s,d,p){var v=ee.p;ee.p=v!==0&&8>v?v:8;var S=H.T,_={};H.T=_,Qh(r,!1,i,s);try{var F=p(),G=H.S;if(G!==null&&G(_,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var ie=U_(F,d);Ao(r,i,ie,lr(r))}else Ao(r,i,d,lr(r))}catch(de){Ao(r,i,{then:function(){},status:"rejected",reason:de},lr())}finally{ee.p=v,S!==null&&_.types!==null&&(S.types=_.types),H.T=S}}function H_(){}function Zh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=ax(r).queue;rx(r,p,i,be,s===null?H_:function(){return ix(r),s(d)})}function ax(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:be},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function ix(r){var i=ax(r);i.next===null&&(i=r.alternate.memoizedState),Ao(r,i.next.queue,{},lr())}function Vh(){return xn(Qo)}function lx(){return Zt().memoizedState}function sx(){return Zt().memoizedState}function Z_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=lr();r=Za(s);var d=Va(i,r,s);d!==null&&(Vn(d,i,s),Co(d,i,s)),i={cache:wh()},r.payload=i;return}i=i.return}}function V_(r,i,s){var d=lr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Uc(r)?ux(i,s):(s=ch(r,i,s,d),s!==null&&(Vn(s,r,d),cx(s,i,d)))}function ox(r,i,s){var d=lr();Ao(r,i,s,d)}function Ao(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Uc(r))ux(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,_=v(S,s);if(p.hasEagerState=!0,p.eagerState=_,er(_,S))return vc(r,i,p,0),St===null&&yc(),!1}catch{}finally{}if(s=ch(r,i,p,d),s!==null)return Vn(s,r,d),cx(s,i,d),!0}return!1}function Qh(r,i,s,d){if(d={lane:2,revertLane:Cm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Uc(r)){if(i)throw Error(a(479))}else i=ch(r,s,d,2),i!==null&&Vn(i,r,2)}function Uc(r){var i=r.alternate;return r===qe||i!==null&&i===qe}function ux(r,i){Kl=Rc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function cx(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ic(r,s)}}var Ro={readContext:xn,use:Mc,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};Ro.useEffectEvent=Pt;var dx={readContext:xn,use:Mc,useCallback:function(r,i){return On().memoizedState=[r,i===void 0?null:i],r},useContext:xn,useEffect:Kb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Ic(4194308,4,Jb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Ic(4194308,4,r,i)},useInsertionEffect:function(r,i){Ic(4,2,r,i)},useMemo:function(r,i){var s=On();i=i===void 0?null:i;var d=r();if(Wi){gn(!0);try{r()}finally{gn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=On();if(s!==void 0){var p=s(i);if(Wi){gn(!0);try{s(i)}finally{gn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=V_.bind(null,qe,r),[d.memoizedState,r]},useRef:function(r){var i=On();return r={current:r},i.memoizedState=r},useState:function(r){r=Bh(r);var i=r.queue,s=ox.bind(null,qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:qh,useDeferredValue:function(r,i){var s=On();return Hh(s,r,i)},useTransition:function(){var r=Bh(!1);return r=rx.bind(null,qe,r.queue,!0,!1),On().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=qe,p=On();if(at){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),St===null)throw Error(a(349));(tt&127)!==0||zb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Kb(Mb.bind(null,d,v,r),[r]),d.flags|=2048,Yl(9,{destroy:void 0},Ob.bind(null,d,v,s,i),null),s},useId:function(){var r=On(),i=St.identifierPrefix;if(at){var s=Qr,d=Vr;s=(d&~(1<<32-mt(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=zc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=P_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Vh,useFormState:qb,useActionState:qb,useOptimistic:function(r){var i=On();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Qh.bind(null,qe,!0,s),s.dispatch=i,[r,i]},useMemoCache:Lh,useCacheRefresh:function(){return On().memoizedState=Z_.bind(null,qe)},useEffectEvent:function(r){var i=On(),s={impl:r};return i.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Kh={readContext:xn,use:Mc,useCallback:ex,useContext:xn,useEffect:Fh,useImperativeHandle:Wb,useInsertionEffect:Yb,useLayoutEffect:Xb,useMemo:tx,useReducer:Dc,useRef:Qb,useState:function(){return Dc(ha)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return nx(s,bt.memoizedState,r,i)},useTransition:function(){var r=Dc(ha)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:To(r),i]},useSyncExternalStore:Rb,useId:lx,useHostTransitionStatus:Vh,useFormState:Hb,useActionState:Hb,useOptimistic:function(r,i){var s=Zt();return Lb(s,bt,r,i)},useMemoCache:Lh,useCacheRefresh:sx};Kh.useEffectEvent=Gb;var fx={readContext:xn,use:Mc,useCallback:ex,useContext:xn,useEffect:Fh,useImperativeHandle:Wb,useInsertionEffect:Yb,useLayoutEffect:Xb,useMemo:tx,useReducer:Ph,useRef:Qb,useState:function(){return Ph(ha)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return bt===null?Hh(s,r,i):nx(s,bt.memoizedState,r,i)},useTransition:function(){var r=Ph(ha)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:To(r),i]},useSyncExternalStore:Rb,useId:lx,useHostTransitionStatus:Vh,useFormState:Vb,useActionState:Vb,useOptimistic:function(r,i){var s=Zt();return bt!==null?Lb(s,bt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Lh,useCacheRefresh:sx};fx.useEffectEvent=Gb;function Gh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Yh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=lr(),p=Za(d);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(Vn(i,r,d),Co(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=lr(),p=Za(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(Vn(i,r,d),Co(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=lr(),d=Za(s);d.tag=2,i!=null&&(d.callback=i),i=Va(r,d,s),i!==null&&(Vn(i,r,s),Co(i,r,s))}};function hx(r,i,s,d,p,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!yo(s,d)||!yo(p,v):!0}function mx(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Yh.enqueueReplaceState(i,i.state,null)}function el(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function px(r){gc(r)}function gx(r){console.error(r)}function yx(r){gc(r)}function Pc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function vx(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Xh(r,i,s){return s=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){Pc(r,i)},s}function bx(r){return r=Za(r),r.tag=3,r}function xx(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){vx(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){vx(i,s,d),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function Q_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Fl(i,s,p,!0),s=nr.current,s!==null){switch(s.tag){case 31:case 13:return wr===null?Xc():s.alternate===null&&Bt===0&&(Bt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===Ec?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),Sm(r,d,p)),!1;case 22:return s.flags|=65536,d===Ec?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),Sm(r,d,p)),!1}throw Error(a(435,s.tag))}return Sm(r,d,p),Xc(),!1}if(at)return i=nr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==gh&&(r=Error(a(422),{cause:d}),xo(yr(r,s)))):(d!==gh&&(i=Error(a(423),{cause:d}),xo(yr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=yr(d,s),p=Xh(r.stateNode,d,p),Nh(r,p),Bt!==4&&(Bt=2)),!1;var v=Error(a(520),{cause:d});if(v=yr(v,s),Po===null?Po=[v]:Po.push(v),Bt!==4&&(Bt=2),i===null)return!0;d=yr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Xh(s.stateNode,d,r),Nh(s,r),!1;case 1:if(i=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ja===null||!Ja.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=bx(p),xx(p,r,s,d),Nh(s,p),!1}s=s.return}while(s!==null);return!1}var Jh=Error(a(461)),Gt=!1;function wn(r,i,s,d){i.child=r===null?jb(i,null,s,d):Ji(i,r.child,s,d)}function wx(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var _ in d)_!=="ref"&&(S[_]=d[_])}else S=d;return Ki(i),d=Oh(r,i,s,S,v,p),_=Mh(),r!==null&&!Gt?(Dh(r,i,p),ma(r,i,p)):(at&&_&&mh(i),i.flags|=1,wn(r,i,d,p),i.child)}function Sx(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!dh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,kx(r,i,v,d,p)):(r=xc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!lm(r,p)){var S=v.memoizedProps;if(s=s.compare,s=s!==null?s:yo,s(S,d)&&r.ref===i.ref)return ma(r,i,p)}return i.flags|=1,r=oa(v,d),r.ref=i.ref,r.return=i,i.child=r}function kx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(yo(v,d)&&r.ref===i.ref)if(Gt=!1,i.pendingProps=d=v,lm(r,p))(r.flags&131072)!==0&&(Gt=!0);else return i.lanes=r.lanes,ma(r,i,p)}return Wh(r,i,s,d,p)}function jx(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return Cx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&jc(i,v!==null?v.cachePool:null),v!==null?Nb(i,v):Th(),_b(i);else return d=i.lanes=536870912,Cx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(jc(i,v.cachePool),Nb(i,v),Ka(),i.memoizedState=null):(r!==null&&jc(i,null),Th(),Ka());return wn(r,i,p,s),i.child}function zo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Cx(r,i,s,d,p){var v=kh();return v=v===null?null:{parent:Qt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&jc(i,null),Th(),_b(i),r!==null&&Fl(r,i,d,!0),i.childLanes=p,null}function Bc(r,i){return i=Fc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Ex(r,i,s){return Ji(i,r.child,null,s),r=Bc(i,i.pendingProps),r.flags|=2,rr(i),i.memoizedState=null,r}function K_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(at){if(d.mode==="hidden")return r=Bc(i,d),i.lanes=536870912,zo(null,r);if(Rh(i),(r=_t)?(r=U0(r,xr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Vr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=ub(r),s.return=i,i.child=s,bn=i,_t=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return Bc(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(Rh(i),p)if(i.flags&256)i.flags&=-257,i=Ex(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Gt||Fl(r,i,s,!1),p=(s&r.childLanes)!==0,Gt||p){if(d=St,d!==null&&(S=gv(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,Hi(r,S),Vn(d,r,S),Jh;Xc(),i=Ex(r,i,s)}else r=v.treeContext,_t=Sr(S.nextSibling),bn=i,at=!0,$a=null,xr=!1,r!==null&&fb(i,r),i=Bc(i,d),i.flags|=4096;return i}return r=oa(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function $c(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Wh(r,i,s,d,p){return Ki(i),s=Oh(r,i,s,d,void 0,p),d=Mh(),r!==null&&!Gt?(Dh(r,i,p),ma(r,i,p)):(at&&d&&mh(i),i.flags|=1,wn(r,i,s,p),i.child)}function Nx(r,i,s,d,p,v){return Ki(i),i.updateQueue=null,s=Ab(i,d,s,p),Tb(r),d=Mh(),r!==null&&!Gt?(Dh(r,i,v),ma(r,i,v)):(at&&d&&mh(i),i.flags|=1,wn(r,i,s,v),i.child)}function _x(r,i,s,d,p){if(Ki(i),i.stateNode===null){var v=Ul,S=s.contextType;typeof S=="object"&&S!==null&&(v=xn(S)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Yh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Ch(i),S=s.contextType,v.context=typeof S=="object"&&S!==null?xn(S):Ul,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Gh(i,s,S,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Yh.enqueueReplaceState(v,v.state,null),No(i,d,v,p),Eo(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var _=i.memoizedProps,F=el(s,_);v.props=F;var G=v.context,ie=s.contextType;S=Ul,typeof ie=="object"&&ie!==null&&(S=xn(ie));var de=s.getDerivedStateFromProps;ie=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,ie||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_||G!==S)&&mx(i,v,d,S),Ha=!1;var X=i.memoizedState;v.state=X,No(i,d,v,p),Eo(),G=i.memoizedState,_||X!==G||Ha?(typeof de=="function"&&(Gh(i,s,de,d),G=i.memoizedState),(F=Ha||hx(i,s,F,d,X,G,S))?(ie||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"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=G),v.props=d,v.state=G,v.context=S,d=F):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Eh(r,i),S=i.memoizedProps,ie=el(s,S),v.props=ie,de=i.pendingProps,X=v.context,G=s.contextType,F=Ul,typeof G=="object"&&G!==null&&(F=xn(G)),_=s.getDerivedStateFromProps,(G=typeof _=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==de||X!==F)&&mx(i,v,d,F),Ha=!1,X=i.memoizedState,v.state=X,No(i,d,v,p),Eo();var te=i.memoizedState;S!==de||X!==te||Ha||r!==null&&r.dependencies!==null&&Sc(r.dependencies)?(typeof _=="function"&&(Gh(i,s,_,d),te=i.memoizedState),(ie=Ha||hx(i,s,ie,d,X,te,F)||r!==null&&r.dependencies!==null&&Sc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,te,F),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,te,F)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=te),v.props=d,v.state=te,v.context=F,d=ie):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,$c(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Ji(i,r.child,null,p),i.child=Ji(i,null,s,p)):wn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ma(r,i,p),r}function Tx(r,i,s,d){return Vi(),i.flags|=256,wn(r,i,s,d),i.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(r){return{baseLanes:r,cachePool:vb()}}function nm(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=ir),r}function Ax(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(Ht.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(at){if(p?Qa(i):Ka(),(r=_t)?(r=U0(r,xr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Vr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=ub(r),s.return=i,i.child=s,bn=i,_t=null)):r=null,r===null)throw Fa(i);return Um(r)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,p?(Ka(),p=i.mode,_=Fc({mode:"hidden",children:_},p),d=Zi(d,p,s,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,S,s),i.memoizedState=em,zo(null,d)):(Qa(i),rm(i,_))}var F=r.memoizedState;if(F!==null&&(_=F.dehydrated,_!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=am(r,i,s)):i.memoizedState!==null?(Ka(),i.child=r.child,i.flags|=128,i=null):(Ka(),_=d.fallback,p=i.mode,d=Fc({mode:"visible",children:d.children},p),_=Zi(_,p,s,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,Ji(i,r.child,null,s),d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,S,s),i.memoizedState=em,i=zo(null,d));else if(Qa(i),Um(_)){if(S=_.nextSibling&&_.nextSibling.dataset,S)var G=S.dgst;S=G,d=Error(a(419)),d.stack="",d.digest=S,xo({value:d,source:null,stack:null}),i=am(r,i,s)}else if(Gt||Fl(r,i,s,!1),S=(s&r.childLanes)!==0,Gt||S){if(S=St,S!==null&&(d=gv(S,s),d!==0&&d!==F.retryLane))throw F.retryLane=d,Hi(r,d),Vn(S,r,d),Jh;Lm(_)||Xc(),i=am(r,i,s)}else Lm(_)?(i.flags|=192,i.child=r.child,i=null):(r=F.treeContext,_t=Sr(_.nextSibling),bn=i,at=!0,$a=null,xr=!1,r!==null&&fb(i,r),i=rm(i,d.children),i.flags|=4096);return i}return p?(Ka(),_=d.fallback,p=i.mode,F=r.child,G=F.sibling,d=oa(F,{mode:"hidden",children:d.children}),d.subtreeFlags=F.subtreeFlags&65011712,G!==null?_=oa(G,_):(_=Zi(_,p,s,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,zo(null,d),d=i.child,_=r.child.memoizedState,_===null?_=tm(s):(p=_.cachePool,p!==null?(F=Qt._currentValue,p=p.parent!==F?{parent:F,pool:F}:p):p=vb(),_={baseLanes:_.baseLanes|s,cachePool:p}),d.memoizedState=_,d.childLanes=nm(r,S,s),i.memoizedState=em,zo(r.child,d)):(Qa(i),s=r.child,r=s.sibling,s=oa(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=s,i.memoizedState=null,s)}function rm(r,i){return i=Fc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Fc(r,i){return r=tr(22,r,null,i),r.lanes=0,r}function am(r,i,s){return Ji(i,r.child,null,s),r=rm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Rx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),bh(r.return,i,s)}function im(r,i,s,d,p,v){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=s,S.tailMode=p,S.treeForkCount=v)}function zx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=Ht.current,_=(S&2)!==0;if(_?(S=S&1|2,i.flags|=128):S&=1,T(Ht,S),wn(r,i,d,s),d=at?bo:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Rx(r,s,i);else if(r.tag===19)Rx(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&Ac(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),im(i,!1,p,s,v,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Ac(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}im(i,!0,s,null,v,d);break;case"together":im(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ma(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Xa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Fl(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=oa(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=oa(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function lm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Sc(r)))}function G_(r,i,s){switch(i.tag){case 3:ge(i,i.stateNode.containerInfo),qa(i,Qt,r.memoizedState.cache),Vi();break;case 27:case 5:Qe(i);break;case 4:ge(i,i.stateNode.containerInfo);break;case 10:qa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Rh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Ax(r,i,s):(Qa(i),r=ma(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Fl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return zx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(Ht,Ht.current),d)break;return null;case 22:return i.lanes=0,jx(r,i,s,i.pendingProps);case 24:qa(i,Qt,r.memoizedState.cache)}return ma(r,i,s)}function Ox(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Gt=!0;else{if(!lm(r,s)&&(i.flags&128)===0)return Gt=!1,G_(r,i,s);Gt=(r.flags&131072)!==0}else Gt=!1,at&&(i.flags&1048576)!==0&&db(i,bo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Yi(i.elementType),i.type=r,typeof r=="function")dh(r)?(d=el(r,d),i.tag=1,i=_x(null,i,r,d,s)):(i.tag=0,i=Wh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===M){i.tag=11,i=wx(null,i,r,d,s);break e}else if(p===$){i.tag=14,i=Sx(null,i,r,d,s);break e}}throw i=Y(r)||r,Error(a(306,i,""))}}return i;case 0:return Wh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=el(d,i.pendingProps),_x(r,i,d,p,s);case 3:e:{if(ge(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Eh(r,i),No(i,d,null,s);var S=i.memoizedState;if(d=S.cache,qa(i,Qt,d),d!==v.cache&&xh(i,[Qt],s,!0),Eo(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Tx(r,i,d,s);break e}else if(d!==p){p=yr(Error(a(424)),i),xo(p),i=Tx(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(_t=Sr(r.firstChild),bn=i,at=!0,$a=null,xr=!0,s=jb(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Vi(),d===p){i=ma(r,i,s);break e}wn(r,i,d,s)}i=i.child}return i;case 26:return $c(r,i),r===null?(s=H0(i.type,null,i.pendingProps,null))?i.memoizedState=s:at||(s=i.type,r=i.pendingProps,d=ad(ce.current).createElement(s),d[vn]=i,d[Bn]=r,Sn(d,s,r),on(d),i.stateNode=d):i.memoizedState=H0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Qe(i),r===null&&at&&(d=i.stateNode=$0(i.type,i.pendingProps,ce.current),bn=i,xr=!0,p=_t,ni(i.type)?(Pm=p,_t=Sr(d.firstChild)):_t=p),wn(r,i,i.pendingProps.children,s),$c(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&at&&((p=d=_t)&&(d=C2(d,i.type,i.pendingProps,xr),d!==null?(i.stateNode=d,bn=i,_t=Sr(d.firstChild),xr=!1,p=!0):p=!1),p||Fa(i)),Qe(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Mm(p,v)?d=null:S!==null&&Mm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Oh(r,i,B_,null,null,s),Qo._currentValue=p),$c(r,i),wn(r,i,d,s),i.child;case 6:return r===null&&at&&((r=s=_t)&&(s=E2(s,i.pendingProps,xr),s!==null?(i.stateNode=s,bn=i,_t=null,r=!0):r=!1),r||Fa(i)),null;case 13:return Ax(r,i,s);case 4:return ge(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Ji(i,null,d,s):wn(r,i,d,s),i.child;case 11:return wx(r,i,i.type,i.pendingProps,s);case 7:return wn(r,i,i.pendingProps,s),i.child;case 8:return wn(r,i,i.pendingProps.children,s),i.child;case 12:return wn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,qa(i,i.type,d.value),wn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Ki(i),p=xn(p),d=d(p),i.flags|=1,wn(r,i,d,s),i.child;case 14:return Sx(r,i,i.type,i.pendingProps,s);case 15:return kx(r,i,i.type,i.pendingProps,s);case 19:return zx(r,i,s);case 31:return K_(r,i,s);case 22:return jx(r,i,s,i.pendingProps);case 24:return Ki(i),d=xn(Qt),r===null?(p=kh(),p===null&&(p=St,v=wh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Ch(i),qa(i,Qt,p)):((r.lanes&s)!==0&&(Eh(r,i),No(i,null,null,s),Eo()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),qa(i,Qt,d)):(d=v.cache,qa(i,Qt,d),d!==p.cache&&xh(i,[Qt],s,!0))),wn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function pa(r){r.flags|=4}function sm(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(l0())r.flags|=8192;else throw Xi=Ec,jh}else r.flags&=-16777217}function Mx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!G0(i))if(l0())r.flags|=8192;else throw Xi=Ec,jh}function qc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?xe():536870912,r.lanes|=i,es|=i)}function Oo(r,i){if(!at)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Tt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function Y_(r,i,s){var d=i.pendingProps;switch(ph(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(i),null;case 1:return Tt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),da(Qt),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&($l(i)?pa(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,yh())),Tt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(pa(i),v!==null?(Tt(i),Mx(i,v)):(Tt(i),sm(i,p,null,d,s))):v?v!==r.memoizedState?(pa(i),Tt(i),Mx(i,v)):(Tt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&pa(i),Tt(i),sm(i,p,r,d,s)),null;case 27:if(Oe(i),s=ce.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&pa(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Tt(i),null}r=Z.current,$l(i)?hb(i):(r=$0(p,d,s),i.stateNode=r,pa(i))}return Tt(i),null;case 5:if(Oe(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&pa(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Tt(i),null}if(v=Z.current,$l(i))hb(i);else{var S=ad(ce.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}v[vn]=i,v[Bn]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(Sn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&pa(i)}}return Tt(i),sm(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&pa(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ce.current,$l(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=bn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[vn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||A0(r.nodeValue,s)),r||Fa(i,!0)}else r=ad(r).createTextNode(d),r[vn]=i,i.stateNode=r}return Tt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=$l(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[vn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Tt(i),r=!1}else s=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(rr(i),i):(rr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Tt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=$l(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[vn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Tt(i),p=!1}else p=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(rr(i),i):(rr(i),null)}return rr(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),qc(i,i.updateQueue),Tt(i),null);case 4:return fe(),r===null&&Tm(i.stateNode.containerInfo),Tt(i),null;case 10:return da(i.type),Tt(i),null;case 19:if(P(Ht),d=i.memoizedState,d===null)return Tt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Oo(d,!1);else{if(Bt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Ac(r),v!==null){for(i.flags|=128,Oo(d,!1),r=v.updateQueue,i.updateQueue=r,qc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)ob(s,r),s=s.sibling;return T(Ht,Ht.current&1|2),at&&ua(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&mn()>Kc&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304)}else{if(!p)if(r=Ac(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,qc(i,r),Oo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!at)return Tt(i),null}else 2*mn()-d.renderingStartTime>Kc&&s!==536870912&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=mn(),r.sibling=null,s=Ht.current,T(Ht,p?s&1|2:s&1),at&&ua(i,d.treeForkCount),r):(Tt(i),null);case 22:case 23:return rr(i),Ah(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(Tt(i),i.subtreeFlags&6&&(i.flags|=8192)):Tt(i),s=i.updateQueue,s!==null&&qc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&P(Gi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),da(Qt),Tt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function X_(r,i){switch(ph(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return da(Qt),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Oe(i),null;case 31:if(i.memoizedState!==null){if(rr(i),i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(rr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return P(Ht),null;case 4:return fe(),null;case 10:return da(i.type),null;case 22:case 23:return rr(i),Ah(),r!==null&&P(Gi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return da(Qt),null;case 25:return null;default:return null}}function Dx(r,i){switch(ph(i),i.tag){case 3:da(Qt),fe();break;case 26:case 27:case 5:Oe(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&rr(i);break;case 13:rr(i);break;case 19:P(Ht);break;case 10:da(i.type);break;case 22:case 23:rr(i),Ah(),r!==null&&P(Gi);break;case 24:da(Qt)}}function Mo(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,S=s.inst;d=v(),S.destroy=d}s=s.next}while(s!==p)}}catch(_){vt(i,i.return,_)}}function Ga(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var S=d.inst,_=S.destroy;if(_!==void 0){S.destroy=void 0,p=i;var F=s,G=_;try{G()}catch(ie){vt(p,F,ie)}}}d=d.next}while(d!==v)}}catch(ie){vt(i,i.return,ie)}}function Ix(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{Eb(i,s)}catch(d){vt(r,r.return,d)}}}function Lx(r,i,s){s.props=el(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){vt(r,i,d)}}function Do(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){vt(r,i,p)}}function Kr(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){vt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){vt(r,i,p)}else s.current=null}function Ux(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){vt(r,r.return,p)}}function om(r,i,s){try{var d=r.stateNode;b2(d,r.type,s,i),d[Bn]=i}catch(p){vt(r,r.return,p)}}function Px(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Px(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&&ni(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 cm(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=la));else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(cm(r,i,s),r=r.sibling;r!==null;)cm(r,i,s),r=r.sibling}function Hc(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Hc(r,i,s),r=r.sibling;r!==null;)Hc(r,i,s),r=r.sibling}function Bx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Sn(i,d,s),i[vn]=r,i[Bn]=s}catch(v){vt(r,r.return,v)}}var ga=!1,Yt=!1,dm=!1,$x=typeof WeakSet=="function"?WeakSet:Set,un=null;function J_(r,i){if(r=r.containerInfo,zm=dd,r=Wv(r),ah(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var S=0,_=-1,F=-1,G=0,ie=0,de=r,X=null;t:for(;;){for(var te;de!==s||p!==0&&de.nodeType!==3||(_=S+p),de!==v||d!==0&&de.nodeType!==3||(F=S+d),de.nodeType===3&&(S+=de.nodeValue.length),(te=de.firstChild)!==null;)X=de,de=te;for(;;){if(de===r)break t;if(X===s&&++G===p&&(_=S),X===v&&++ie===d&&(F=S),(te=de.nextSibling)!==null)break;de=X,X=de.parentNode}de=te}s=_===-1||F===-1?null:{start:_,end:F}}else s=null}s=s||{start:0,end:0}}else s=null;for(Om={focusedElem:r,selectionRange:s},dd=!1,un=i;un!==null;)if(i=un,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,un=r;else for(;un!==null;){switch(i=un,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(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=i,p=v.memoizedProps,v=v.memoizedState,d=s.stateNode;try{var je=el(s.type,p);r=d.getSnapshotBeforeUpdate(je,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Ie){vt(s,s.return,Ie)}}break;case 3:if((r&1024)!==0){if(r=i.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(a(163))}if(r=i.sibling,r!==null){r.return=i.return,un=r;break}un=i.return}}function Fx(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:va(r,s),d&4&&Mo(5,s);break;case 1:if(va(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){vt(s,s.return,S)}else{var p=el(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){vt(s,s.return,S)}}d&64&&Ix(s),d&512&&Do(s,s.return);break;case 3:if(va(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{Eb(r,i)}catch(S){vt(s,s.return,S)}}break;case 27:i===null&&d&4&&Bx(s);case 26:case 5:va(r,s),i===null&&d&4&&Ux(s),d&512&&Do(s,s.return);break;case 12:va(r,s);break;case 31:va(r,s),d&4&&Zx(r,s);break;case 13:va(r,s),d&4&&Vx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=s2.bind(null,s),N2(r,s))));break;case 22:if(d=s.memoizedState!==null||ga,!d){i=i!==null&&i.memoizedState!==null||Yt,p=ga;var v=Yt;ga=d,(Yt=i)&&!v?ba(r,s,(s.subtreeFlags&8772)!==0):va(r,s),ga=p,Yt=v}break;case 30:break;default:va(r,s)}}function qx(r){var i=r.alternate;i!==null&&(r.alternate=null,qx(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&$f(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Rt=null,Fn=!1;function ya(r,i,s){for(s=s.child;s!==null;)Hx(r,i,s),s=s.sibling}function Hx(r,i,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(nn,s)}catch{}switch(s.tag){case 26:Yt||Kr(s,i),ya(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Yt||Kr(s,i);var d=Rt,p=Fn;ni(s.type)&&(Rt=s.stateNode,Fn=!1),ya(r,i,s),Ho(s.stateNode),Rt=d,Fn=p;break;case 5:Yt||Kr(s,i);case 6:if(d=Rt,p=Fn,Rt=null,ya(r,i,s),Rt=d,Fn=p,Rt!==null)if(Fn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(s.stateNode)}catch(v){vt(s,i,v)}else try{Rt.removeChild(s.stateNode)}catch(v){vt(s,i,v)}break;case 18:Rt!==null&&(Fn?(r=Rt,I0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),os(r)):I0(Rt,s.stateNode));break;case 4:d=Rt,p=Fn,Rt=s.stateNode.containerInfo,Fn=!0,ya(r,i,s),Rt=d,Fn=p;break;case 0:case 11:case 14:case 15:Ga(2,s,i),Yt||Ga(4,s,i),ya(r,i,s);break;case 1:Yt||(Kr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Lx(s,i,d)),ya(r,i,s);break;case 21:ya(r,i,s);break;case 22:Yt=(d=Yt)||s.memoizedState!==null,ya(r,i,s),Yt=d;break;default:ya(r,i,s)}}function Zx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{os(r)}catch(s){vt(i,i.return,s)}}}function Vx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{os(r)}catch(s){vt(i,i.return,s)}}function W_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new $x),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new $x),i;default:throw Error(a(435,r.tag))}}function Zc(r,i){var s=W_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=o2.bind(null,r,d);d.then(p,p)}})}function qn(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,S=i,_=S;e:for(;_!==null;){switch(_.tag){case 27:if(ni(_.type)){Rt=_.stateNode,Fn=!1;break e}break;case 5:Rt=_.stateNode,Fn=!1;break e;case 3:case 4:Rt=_.stateNode.containerInfo,Fn=!0;break e}_=_.return}if(Rt===null)throw Error(a(160));Hx(v,S,p),Rt=null,Fn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Qx(i,r),i=i.sibling}var Dr=null;function Qx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:qn(i,r),Hn(r),d&4&&(Ga(3,r,r.return),Mo(3,r),Ga(5,r,r.return));break;case 1:qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),d&64&&ga&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=Dr;if(qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[so]||v[vn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),Sn(v,d,s),v[vn]=r,on(v),d=v;break e;case"link":var S=Q0("link","href",p).get(d+(s.href||""));if(S){for(var _=0;_<S.length;_++)if(v=S[_],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)){S.splice(_,1);break t}}v=p.createElement(d),Sn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=Q0("meta","content",p).get(d+(s.content||""))){for(_=0;_<S.length;_++)if(v=S[_],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)){S.splice(_,1);break t}}v=p.createElement(d),Sn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[vn]=r,on(v),d=v}r.stateNode=d}else K0(p,r.type,r.stateNode);else r.stateNode=V0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?K0(p,r.type,r.stateNode):V0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&om(r,r.memoizedProps,s.memoizedProps)}break;case 27:qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),s!==null&&d&4&&om(r,r.memoizedProps,s.memoizedProps);break;case 5:if(qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),r.flags&32){p=r.stateNode;try{Rl(p,"")}catch(je){vt(r,r.return,je)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,om(r,p,s!==null?s.memoizedProps:p)),d&1024&&(dm=!0);break;case 6:if(qn(i,r),Hn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(je){vt(r,r.return,je)}}break;case 3:if(sd=null,p=Dr,Dr=id(i.containerInfo),qn(i,r),Dr=p,Hn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{os(i.containerInfo)}catch(je){vt(r,r.return,je)}dm&&(dm=!1,Kx(r));break;case 4:d=Dr,Dr=id(r.stateNode.containerInfo),qn(i,r),Hn(r),Dr=d;break;case 12:qn(i,r),Hn(r);break;case 31:qn(i,r),Hn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Zc(r,d)));break;case 13:qn(i,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Qc=mn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Zc(r,d)));break;case 22:p=r.memoizedState!==null;var F=s!==null&&s.memoizedState!==null,G=ga,ie=Yt;if(ga=G||p,Yt=ie||F,qn(i,r),Yt=ie,ga=G,Hn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||F||ga||Yt||tl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){F=s=i;try{if(v=F.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{_=F.stateNode;var de=F.memoizedProps.style,X=de!=null&&de.hasOwnProperty("display")?de.display:null;_.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(je){vt(F,F.return,je)}}}else if(i.tag===6){if(s===null){F=i;try{F.stateNode.nodeValue=p?"":F.memoizedProps}catch(je){vt(F,F.return,je)}}}else if(i.tag===18){if(s===null){F=i;try{var te=F.stateNode;p?L0(te,!0):L0(F.stateNode,!1)}catch(je){vt(F,F.return,je)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Zc(r,s))));break;case 19:qn(i,r),Hn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Zc(r,d)));break;case 30:break;case 21:break;default:qn(i,r),Hn(r)}}function Hn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Px(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=um(r);Hc(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(Rl(S,""),s.flags&=-33);var _=um(r);Hc(r,_,S);break;case 3:case 4:var F=s.stateNode.containerInfo,G=um(r);cm(r,G,F);break;default:throw Error(a(161))}}catch(ie){vt(r,r.return,ie)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Kx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Kx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function va(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Fx(r,i.alternate,i),i=i.sibling}function tl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ga(4,i,i.return),tl(i);break;case 1:Kr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Lx(i,i.return,s),tl(i);break;case 27:Ho(i.stateNode);case 26:case 5:Kr(i,i.return),tl(i);break;case 22:i.memoizedState===null&&tl(i);break;case 30:tl(i);break;default:tl(i)}r=r.sibling}}function ba(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,S=v.flags;switch(v.tag){case 0:case 11:case 15:ba(p,v,s),Mo(4,v);break;case 1:if(ba(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){vt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var _=d.stateNode;try{var F=p.shared.hiddenCallbacks;if(F!==null)for(p.shared.hiddenCallbacks=null,p=0;p<F.length;p++)Cb(F[p],_)}catch(G){vt(d,d.return,G)}}s&&S&64&&Ix(v),Do(v,v.return);break;case 27:Bx(v);case 26:case 5:ba(p,v,s),s&&d===null&&S&4&&Ux(v),Do(v,v.return);break;case 12:ba(p,v,s);break;case 31:ba(p,v,s),s&&S&4&&Zx(p,v);break;case 13:ba(p,v,s),s&&S&4&&Vx(p,v);break;case 22:v.memoizedState===null&&ba(p,v,s),Do(v,v.return);break;case 30:break;default:ba(p,v,s)}i=i.sibling}}function fm(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&wo(s))}function hm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wo(r))}function Ir(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Gx(r,i,s,d),i=i.sibling}function Gx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Ir(r,i,s,d),p&2048&&Mo(9,i);break;case 1:Ir(r,i,s,d);break;case 3:Ir(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wo(r)));break;case 12:if(p&2048){Ir(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,_=v.onPostCommit;typeof _=="function"&&_(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(F){vt(i,i.return,F)}}else Ir(r,i,s,d);break;case 31:Ir(r,i,s,d);break;case 13:Ir(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?Ir(r,i,s,d):Io(r,i):v._visibility&2?Ir(r,i,s,d):(v._visibility|=2,Xl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&fm(S,i);break;case 24:Ir(r,i,s,d),p&2048&&hm(i.alternate,i);break;default:Ir(r,i,s,d)}}function Xl(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,_=s,F=d,G=S.flags;switch(S.tag){case 0:case 11:case 15:Xl(v,S,_,F,p),Mo(8,S);break;case 23:break;case 22:var ie=S.stateNode;S.memoizedState!==null?ie._visibility&2?Xl(v,S,_,F,p):Io(v,S):(ie._visibility|=2,Xl(v,S,_,F,p)),p&&G&2048&&fm(S.alternate,S);break;case 24:Xl(v,S,_,F,p),p&&G&2048&&hm(S.alternate,S);break;default:Xl(v,S,_,F,p)}i=i.sibling}}function Io(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:Io(s,d),p&2048&&fm(d.alternate,d);break;case 24:Io(s,d),p&2048&&hm(d.alternate,d);break;default:Io(s,d)}i=i.sibling}}var Lo=8192;function Jl(r,i,s){if(r.subtreeFlags&Lo)for(r=r.child;r!==null;)Yx(r,i,s),r=r.sibling}function Yx(r,i,s){switch(r.tag){case 26:Jl(r,i,s),r.flags&Lo&&r.memoizedState!==null&&P2(s,Dr,r.memoizedState,r.memoizedProps);break;case 5:Jl(r,i,s);break;case 3:case 4:var d=Dr;Dr=id(r.stateNode.containerInfo),Jl(r,i,s),Dr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Lo,Lo=16777216,Jl(r,i,s),Lo=d):Jl(r,i,s));break;default:Jl(r,i,s)}}function Xx(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Uo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];un=d,Wx(d,r)}Xx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Jx(r),r=r.sibling}function Jx(r){switch(r.tag){case 0:case 11:case 15:Uo(r),r.flags&2048&&Ga(9,r,r.return);break;case 3:Uo(r);break;case 12:Uo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Vc(r)):Uo(r);break;default:Uo(r)}}function Vc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];un=d,Wx(d,r)}Xx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ga(8,i,i.return),Vc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Vc(i));break;default:Vc(i)}r=r.sibling}}function Wx(r,i){for(;un!==null;){var s=un;switch(s.tag){case 0:case 11:case 15:Ga(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:wo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,un=d;else e:for(s=r;un!==null;){d=un;var p=d.sibling,v=d.return;if(qx(d),d===s){un=null;break e}if(p!==null){p.return=v,un=p;break e}un=v}}}var e2={getCacheForType:function(r){var i=xn(Qt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return xn(Qt).controller.signal}},t2=typeof WeakMap=="function"?WeakMap:Map,ht=0,St=null,Xe=null,tt=0,yt=0,ar=null,Ya=!1,Wl=!1,mm=!1,xa=0,Bt=0,Xa=0,nl=0,pm=0,ir=0,es=0,Po=null,Zn=null,gm=!1,Qc=0,e0=0,Kc=1/0,Gc=null,Ja=null,rn=0,Wa=null,ts=null,wa=0,ym=0,vm=null,t0=null,Bo=0,bm=null;function lr(){return(ht&2)!==0&&tt!==0?tt&-tt:H.T!==null?Cm():yv()}function n0(){if(ir===0)if((tt&536870912)===0||at){var r=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),ir=r}else ir=536870912;return r=nr.current,r!==null&&(r.flags|=32),ir}function Vn(r,i,s){(r===St&&(yt===2||yt===9)||r.cancelPendingCommit!==null)&&(ns(r,0),ei(r,tt,ir,!1)),yn(r,s),((ht&2)===0||r!==St)&&(r===St&&((ht&2)===0&&(nl|=s),Bt===4&&ei(r,tt,ir,!1)),Gr(r))}function r0(r,i,s){if((ht&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||La(r,i),p=d?a2(r,i):wm(r,i,!0),v=d;do{if(p===0){Wl&&!d&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!n2(s)){p=wm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var _=r;p=Po;var F=_.current.memoizedState.isDehydrated;if(F&&(ns(_,S).flags|=256),S=wm(_,S,!1),S!==2){if(mm&&!F){_.errorRecoveryDisabledLanes|=v,nl|=v,p=4;break e}v=Zn,Zn=p,v!==null&&(Zn===null?Zn=v:Zn.push.apply(Zn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){ns(r,0),ei(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ei(d,i,ir,!Ya);break e;case 2:Zn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Qc+300-mn(),10<p)){if(ei(d,i,ir,!Ya),Pi(d,0,!0)!==0)break e;wa=i,d.timeoutHandle=M0(a0.bind(null,d,s,Zn,Gc,gm,i,ir,nl,es,Ya,v,"Throttled",-0,0),p);break e}a0(d,s,Zn,Gc,gm,i,ir,nl,es,Ya,v,null,-0,0)}}break}while(!0);Gr(r)}function a0(r,i,s,d,p,v,S,_,F,G,ie,de,X,te){if(r.timeoutHandle=-1,de=i.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},Yx(i,v,de);var je=(v&62914560)===v?Qc-mn():(v&4194048)===v?e0-mn():0;if(je=B2(de,je),je!==null){wa=v,r.cancelPendingCommit=je(f0.bind(null,r,i,v,s,d,p,S,_,F,ie,de,null,X,te)),ei(r,v,S,!G);return}}f0(r,i,v,s,d,p,S,_,F)}function n2(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],v=p.getSnapshot;p=p.value;try{if(!er(v(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ei(r,i,s,d){i&=~pm,i&=~nl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-mt(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&lo(r,s,i)}function Yc(){return(ht&6)===0?($o(0),!1):!0}function xm(){if(Xe!==null){if(yt===0)var r=Xe.return;else r=Xe,ca=Qi=null,Ih(r),Vl=null,ko=0,r=Xe;for(;r!==null;)Dx(r.alternate,r),r=r.return;Xe=null}}function ns(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,S2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),wa=0,xm(),St=r,Xe=s=oa(r.current,null),tt=i,yt=0,ar=null,Ya=!1,Wl=La(r,i),mm=!1,es=ir=pm=nl=Xa=Bt=0,Zn=Po=null,gm=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-mt(d),v=1<<p;i|=r[p],d&=~v}return xa=i,yc(),s}function i0(r,i){qe=null,H.H=Ro,i===Zl||i===Cc?(i=wb(),yt=3):i===jh?(i=wb(),yt=4):yt=i===Jh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ar=i,Xe===null&&(Bt=1,Pc(r,yr(i,r.current)))}function l0(){var r=nr.current;return r===null?!0:(tt&4194048)===tt?wr===null:(tt&62914560)===tt||(tt&536870912)!==0?r===wr:!1}function s0(){var r=H.H;return H.H=Ro,r===null?Ro:r}function o0(){var r=H.A;return H.A=e2,r}function Xc(){Bt=4,Ya||(tt&4194048)!==tt&&nr.current!==null||(Wl=!0),(Xa&134217727)===0&&(nl&134217727)===0||St===null||ei(St,tt,ir,!1)}function wm(r,i,s){var d=ht;ht|=2;var p=s0(),v=o0();(St!==r||tt!==i)&&(Gc=null,ns(r,i)),i=!1;var S=Bt;e:do try{if(yt!==0&&Xe!==null){var _=Xe,F=ar;switch(yt){case 8:xm(),S=6;break e;case 3:case 2:case 9:case 6:nr.current===null&&(i=!0);var G=yt;if(yt=0,ar=null,rs(r,_,F,G),s&&Wl){S=0;break e}break;default:G=yt,yt=0,ar=null,rs(r,_,F,G)}}r2(),S=Bt;break}catch(ie){i0(r,ie)}while(!0);return i&&r.shellSuspendCounter++,ca=Qi=null,ht=d,H.H=p,H.A=v,Xe===null&&(St=null,tt=0,yc()),S}function r2(){for(;Xe!==null;)u0(Xe)}function a2(r,i){var s=ht;ht|=2;var d=s0(),p=o0();St!==r||tt!==i?(Gc=null,Kc=mn()+500,ns(r,i)):Wl=La(r,i);e:do try{if(yt!==0&&Xe!==null){i=Xe;var v=ar;t:switch(yt){case 1:yt=0,ar=null,rs(r,i,v,1);break;case 2:case 9:if(bb(v)){yt=0,ar=null,c0(i);break}i=function(){yt!==2&&yt!==9||St!==r||(yt=7),Gr(r)},v.then(i,i);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:bb(v)?(yt=0,ar=null,c0(i)):(yt=0,ar=null,rs(r,i,v,7));break;case 5:var S=null;switch(Xe.tag){case 26:S=Xe.memoizedState;case 5:case 27:var _=Xe;if(S?G0(S):_.stateNode.complete){yt=0,ar=null;var F=_.sibling;if(F!==null)Xe=F;else{var G=_.return;G!==null?(Xe=G,Jc(G)):Xe=null}break t}}yt=0,ar=null,rs(r,i,v,5);break;case 6:yt=0,ar=null,rs(r,i,v,6);break;case 8:xm(),Bt=6;break e;default:throw Error(a(462))}}i2();break}catch(ie){i0(r,ie)}while(!0);return ca=Qi=null,H.H=d,H.A=p,ht=s,Xe!==null?0:(St=null,tt=0,yc(),Bt)}function i2(){for(;Xe!==null&&!ro();)u0(Xe)}function u0(r){var i=Ox(r.alternate,r,xa);r.memoizedProps=r.pendingProps,i===null?Jc(r):Xe=i}function c0(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=Nx(s,i,i.pendingProps,i.type,void 0,tt);break;case 11:i=Nx(s,i,i.pendingProps,i.type.render,i.ref,tt);break;case 5:Ih(i);default:Dx(s,i),i=Xe=ob(i,xa),i=Ox(s,i,xa)}r.memoizedProps=r.pendingProps,i===null?Jc(r):Xe=i}function rs(r,i,s,d){ca=Qi=null,Ih(i),Vl=null,ko=0;var p=i.return;try{if(Q_(r,p,i,s,tt)){Bt=1,Pc(r,yr(s,r.current)),Xe=null;return}}catch(v){if(p!==null)throw Xe=p,v;Bt=1,Pc(r,yr(s,r.current)),Xe=null;return}i.flags&32768?(at||d===1?r=!0:Wl||(tt&536870912)!==0?r=!1:(Ya=r=!0,(d===2||d===9||d===3||d===6)&&(d=nr.current,d!==null&&d.tag===13&&(d.flags|=16384))),d0(i,r)):Jc(i)}function Jc(r){var i=r;do{if((i.flags&32768)!==0){d0(i,Ya);return}r=i.return;var s=Y_(i.alternate,i,xa);if(s!==null){Xe=s;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=r}while(i!==null);Bt===0&&(Bt=5)}function d0(r,i){do{var s=X_(r.alternate,r);if(s!==null){s.flags&=32767,Xe=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Xe=r;return}Xe=r=s}while(r!==null);Bt=6,Xe=null}function f0(r,i,s,d,p,v,S,_,F){r.cancelPendingCommit=null;do Wc();while(rn!==0);if((ht&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=uh,aa(r,s,v,S,_,F),r===St&&(Xe=St=null,tt=0),ts=i,Wa=r,wa=s,ym=v,vm=p,t0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,u2(Pe,function(){return y0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=H.T,H.T=null,p=ee.p,ee.p=2,S=ht,ht|=4;try{J_(r,i,s)}finally{ht=S,ee.p=p,H.T=d}}rn=1,h0(),m0(),p0()}}function h0(){if(rn===1){rn=0;var r=Wa,i=ts,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=H.T,H.T=null;var d=ee.p;ee.p=2;var p=ht;ht|=4;try{Qx(i,r);var v=Om,S=Wv(r.containerInfo),_=v.focusedElem,F=v.selectionRange;if(S!==_&&_&&_.ownerDocument&&Jv(_.ownerDocument.documentElement,_)){if(F!==null&&ah(_)){var G=F.start,ie=F.end;if(ie===void 0&&(ie=G),"selectionStart"in _)_.selectionStart=G,_.selectionEnd=Math.min(ie,_.value.length);else{var de=_.ownerDocument||document,X=de&&de.defaultView||window;if(X.getSelection){var te=X.getSelection(),je=_.textContent.length,Ie=Math.min(F.start,je),wt=F.end===void 0?Ie:Math.min(F.end,je);!te.extend&&Ie>wt&&(S=wt,wt=Ie,Ie=S);var V=Xv(_,Ie),q=Xv(_,wt);if(V&&q&&(te.rangeCount!==1||te.anchorNode!==V.node||te.anchorOffset!==V.offset||te.focusNode!==q.node||te.focusOffset!==q.offset)){var K=de.createRange();K.setStart(V.node,V.offset),te.removeAllRanges(),Ie>wt?(te.addRange(K),te.extend(q.node,q.offset)):(K.setEnd(q.node,q.offset),te.addRange(K))}}}}for(de=[],te=_;te=te.parentNode;)te.nodeType===1&&de.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<de.length;_++){var ue=de[_];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}dd=!!zm,Om=zm=null}finally{ht=p,ee.p=d,H.T=s}}r.current=i,rn=2}}function m0(){if(rn===2){rn=0;var r=Wa,i=ts,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=H.T,H.T=null;var d=ee.p;ee.p=2;var p=ht;ht|=4;try{Fx(r,i.alternate,i)}finally{ht=p,ee.p=d,H.T=s}}rn=3}}function p0(){if(rn===4||rn===3){rn=0,ao();var r=Wa,i=ts,s=wa,d=t0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?rn=5:(rn=0,ts=Wa=null,g0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),Pf(s),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(nn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=H.T,p=ee.p,ee.p=2,H.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var _=d[S];v(_.value,{componentStack:_.stack})}}finally{H.T=i,ee.p=p}}(wa&3)!==0&&Wc(),Gr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===bm?Bo++:(Bo=0,bm=r):Bo=0,$o(0)}}function g0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,wo(i)))}function Wc(){return h0(),m0(),p0(),y0()}function y0(){if(rn!==5)return!1;var r=Wa,i=ym;ym=0;var s=Pf(wa),d=H.T,p=ee.p;try{ee.p=32>s?32:s,H.T=null,s=vm,vm=null;var v=Wa,S=wa;if(rn=0,ts=Wa=null,wa=0,(ht&6)!==0)throw Error(a(331));var _=ht;if(ht|=4,Jx(v.current),Gx(v,v.current,S,s),ht=_,$o(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(nn,v)}catch{}return!0}finally{ee.p=p,H.T=d,g0(r,i)}}function v0(r,i,s){i=yr(s,i),i=Xh(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(yn(r,2),Gr(r))}function vt(r,i,s){if(r.tag===3)v0(r,r,s);else for(;i!==null;){if(i.tag===3){v0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ja===null||!Ja.has(d))){r=yr(s,r),s=bx(2),d=Va(i,s,2),d!==null&&(xx(s,d,i,r),yn(d,2),Gr(d));break}}i=i.return}}function Sm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new t2;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(mm=!0,p.add(s),r=l2.bind(null,r,i,s),i.then(r,r))}function l2(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,St===r&&(tt&s)===s&&(Bt===4||Bt===3&&(tt&62914560)===tt&&300>mn()-Qc?(ht&2)===0&&ns(r,0):pm|=s,es===tt&&(es=0)),Gr(r)}function b0(r,i){i===0&&(i=xe()),r=Hi(r,i),r!==null&&(yn(r,i),Gr(r))}function s2(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),b0(r,s)}function o2(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),b0(r,s)}function u2(r,i){return Ia(r,i)}var ed=null,as=null,km=!1,td=!1,jm=!1,ti=0;function Gr(r){r!==as&&r.next===null&&(as===null?ed=as=r:as=as.next=r),td=!0,km||(km=!0,d2())}function $o(r,i){if(!jm&&td){jm=!0;do for(var s=!1,d=ed;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,_=d.pingedLanes;v=(1<<31-mt(42|r)+1)-1,v&=p&~(S&~_),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,k0(d,v))}else v=tt,v=Pi(d,d===St?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||La(d,v)||(s=!0,k0(d,v));d=d.next}while(s);jm=!1}}function c2(){x0()}function x0(){td=km=!1;var r=0;ti!==0&&w2()&&(r=ti);for(var i=mn(),s=null,d=ed;d!==null;){var p=d.next,v=w0(d,i);v===0?(d.next=null,s===null?ed=p:s.next=p,p===null&&(as=s)):(s=d,(r!==0||(v&3)!==0)&&(td=!0)),d=p}rn!==0&&rn!==5||$o(r),ti!==0&&(ti=0)}function w0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-mt(v),_=1<<S,F=p[S];F===-1?((_&s)===0||(_&d)!==0)&&(p[S]=ac(_,i)):F<=i&&(r.expiredLanes|=_),v&=~_}if(i=St,s=tt,s=Pi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(yt===2||yt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&ra(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||La(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&ra(d),Pf(s)){case 2:case 8:s=ye;break;case 32:s=Pe;break;case 268435456:s=rt;break;default:s=Pe}return d=S0.bind(null,r),s=Ia(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&ra(d),r.callbackPriority=2,r.callbackNode=null,2}function S0(r,i){if(rn!==0&&rn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Wc()&&r.callbackNode!==s)return null;var d=tt;return d=Pi(r,r===St?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(r0(r,d,i),w0(r,mn()),r.callbackNode!=null&&r.callbackNode===s?S0.bind(null,r):null)}function k0(r,i){if(Wc())return null;r0(r,i,!0)}function d2(){k2(function(){(ht&6)!==0?Ia(se,c2):x0()})}function Cm(){if(ti===0){var r=ql;r===0&&(r=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),ti=r}return ti}function j0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:uc(""+r)}function C0(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function f2(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=j0((p[Bn]||null).action),S=d.submitter;S&&(i=(i=S[Bn]||null)?j0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var _=new hc("action","action",null,d,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ti!==0){var F=S?C0(p,S):new FormData(p);Zh(s,{pending:!0,data:F,method:p.method,action:v},null,F)}}else typeof v=="function"&&(_.preventDefault(),F=S?C0(p,S):new FormData(p),Zh(s,{pending:!0,data:F,method:p.method,action:v},v,F))},currentTarget:p}]})}}for(var Em=0;Em<oh.length;Em++){var Nm=oh[Em],h2=Nm.toLowerCase(),m2=Nm[0].toUpperCase()+Nm.slice(1);Mr(h2,"on"+m2)}Mr(nb,"onAnimationEnd"),Mr(rb,"onAnimationIteration"),Mr(ab,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr(A_,"onTransitionRun"),Mr(R_,"onTransitionStart"),Mr(z_,"onTransitionCancel"),Mr(ib,"onTransitionEnd"),Tl("onMouseEnter",["mouseout","mouseover"]),Tl("onMouseLeave",["mouseout","mouseover"]),Tl("onPointerEnter",["pointerout","pointerover"]),Tl("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),p2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fo));function E0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var S=d.length-1;0<=S;S--){var _=d[S],F=_.instance,G=_.currentTarget;if(_=_.listener,F!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(ie){gc(ie)}p.currentTarget=null,v=F}else for(S=0;S<d.length;S++){if(_=d[S],F=_.instance,G=_.currentTarget,_=_.listener,F!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(ie){gc(ie)}p.currentTarget=null,v=F}}}}function Je(r,i){var s=i[Bf];s===void 0&&(s=i[Bf]=new Set);var d=r+"__bubble";s.has(d)||(N0(i,r,2,!1),s.add(d))}function _m(r,i,s){var d=0;i&&(d|=4),N0(s,r,d,i)}var nd="_reactListening"+Math.random().toString(36).slice(2);function Tm(r){if(!r[nd]){r[nd]=!0,xv.forEach(function(s){s!=="selectionchange"&&(p2.has(s)||_m(s,!1,r),_m(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[nd]||(i[nd]=!0,_m("selectionchange",!1,i))}}function N0(r,i,s,d){switch(n1(i)){case 2:var p=q2;break;case 8:p=H2;break;default:p=Hm}s=p.bind(null,i,s,r),p=void 0,!Gf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function Am(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var _=d.stateNode.containerInfo;if(_===p)break;if(S===4)for(S=d.return;S!==null;){var F=S.tag;if((F===3||F===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;_!==null;){if(S=El(_),S===null)return;if(F=S.tag,F===5||F===6||F===26||F===27){d=v=S;continue e}_=_.parentNode}}d=d.return}zv(function(){var G=v,ie=Qf(s),de=[];e:{var X=lb.get(r);if(X!==void 0){var te=hc,je=r;switch(r){case"keypress":if(dc(s)===0)break e;case"keydown":case"keyup":te=o_;break;case"focusin":je="focus",te=Wf;break;case"focusout":je="blur",te=Wf;break;case"beforeblur":case"afterblur":te=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":te=Dv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=YN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=d_;break;case nb:case rb:case ab:te=WN;break;case ib:te=h_;break;case"scroll":case"scrollend":te=KN;break;case"wheel":te=p_;break;case"copy":case"cut":case"paste":te=t_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Lv;break;case"toggle":case"beforetoggle":te=y_}var Ie=(i&4)!==0,wt=!Ie&&(r==="scroll"||r==="scrollend"),V=Ie?X!==null?X+"Capture":null:X;Ie=[];for(var q=G,K;q!==null;){var ue=q;if(K=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||K===null||V===null||(ue=uo(q,V),ue!=null&&Ie.push(qo(q,ue,K))),wt)break;q=q.return}0<Ie.length&&(X=new te(X,je,null,s,ie),de.push({event:X,listeners:Ie}))}}if((i&7)===0){e:{if(X=r==="mouseover"||r==="pointerover",te=r==="mouseout"||r==="pointerout",X&&s!==Vf&&(je=s.relatedTarget||s.fromElement)&&(El(je)||je[Cl]))break e;if((te||X)&&(X=ie.window===ie?ie:(X=ie.ownerDocument)?X.defaultView||X.parentWindow:window,te?(je=s.relatedTarget||s.toElement,te=G,je=je?El(je):null,je!==null&&(wt=o(je),Ie=je.tag,je!==wt||Ie!==5&&Ie!==27&&Ie!==6)&&(je=null)):(te=null,je=G),te!==je)){if(Ie=Dv,ue="onMouseLeave",V="onMouseEnter",q="mouse",(r==="pointerout"||r==="pointerover")&&(Ie=Lv,ue="onPointerLeave",V="onPointerEnter",q="pointer"),wt=te==null?X:oo(te),K=je==null?X:oo(je),X=new Ie(ue,q+"leave",te,s,ie),X.target=wt,X.relatedTarget=K,ue=null,El(ie)===G&&(Ie=new Ie(V,q+"enter",je,s,ie),Ie.target=K,Ie.relatedTarget=wt,ue=Ie),wt=ue,te&&je)t:{for(Ie=g2,V=te,q=je,K=0,ue=V;ue;ue=Ie(ue))K++;ue=0;for(var ze=q;ze;ze=Ie(ze))ue++;for(;0<K-ue;)V=Ie(V),K--;for(;0<ue-K;)q=Ie(q),ue--;for(;K--;){if(V===q||q!==null&&V===q.alternate){Ie=V;break t}V=Ie(V),q=Ie(q)}Ie=null}else Ie=null;te!==null&&_0(de,X,te,Ie,!1),je!==null&&wt!==null&&_0(de,wt,je,Ie,!0)}}e:{if(X=G?oo(G):window,te=X.nodeName&&X.nodeName.toLowerCase(),te==="select"||te==="input"&&X.type==="file")var ct=Zv;else if(qv(X))if(Vv)ct=N_;else{ct=C_;var _e=j_}else te=X.nodeName,!te||te.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?G&&Zf(G.elementType)&&(ct=Zv):ct=E_;if(ct&&(ct=ct(r,G))){Hv(de,ct,s,ie);break e}_e&&_e(r,X,G),r==="focusout"&&G&&X.type==="number"&&G.memoizedProps.value!=null&&Hf(X,"number",X.value)}switch(_e=G?oo(G):window,r){case"focusin":(qv(_e)||_e.contentEditable==="true")&&(Dl=_e,ih=G,vo=null);break;case"focusout":vo=ih=Dl=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,eb(de,s,ie);break;case"selectionchange":if(T_)break;case"keydown":case"keyup":eb(de,s,ie)}var He;if(th)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Ml?$v(r,s)&&(nt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(nt="onCompositionStart");nt&&(Uv&&s.locale!=="ko"&&(Ml||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Ml&&(He=Ov()):(Pa=ie,Yf="value"in Pa?Pa.value:Pa.textContent,Ml=!0)),_e=rd(G,nt),0<_e.length&&(nt=new Iv(nt,r,null,s,ie),de.push({event:nt,listeners:_e}),He?nt.data=He:(He=Fv(s),He!==null&&(nt.data=He)))),(He=b_?x_(r,s):w_(r,s))&&(nt=rd(G,"onBeforeInput"),0<nt.length&&(_e=new Iv("onBeforeInput","beforeinput",null,s,ie),de.push({event:_e,listeners:nt}),_e.data=He)),f2(de,r,G,s,ie)}E0(de,i)})}function qo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function rd(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=uo(r,s),p!=null&&d.unshift(qo(r,p,v)),p=uo(r,i),p!=null&&d.push(qo(r,p,v))),r.tag===3)return d;r=r.return}return[]}function g2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function _0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var _=s,F=_.alternate,G=_.stateNode;if(_=_.tag,F!==null&&F===d)break;_!==5&&_!==26&&_!==27||G===null||(F=G,p?(G=uo(s,v),G!=null&&S.unshift(qo(s,G,F))):p||(G=uo(s,v),G!=null&&S.push(qo(s,G,F)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var y2=/\r\n?/g,v2=/\u0000|\uFFFD/g;function T0(r){return(typeof r=="string"?r:""+r).replace(y2,`
49
+ `).replace(v2,"")}function A0(r,i){return i=T0(i),T0(r)===i}function xt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Rl(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Rl(r,""+d);break;case"className":sc(r,"class",d);break;case"tabIndex":sc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":sc(r,s,d);break;case"style":Av(r,d,v);break;case"data":if(i!=="object"){sc(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=uc(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="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"?(i!=="input"&&xt(r,i,"name",p.name,p,null),xt(r,i,"formEncType",p.formEncType,p,null),xt(r,i,"formMethod",p.formMethod,p,null),xt(r,i,"formTarget",p.formTarget,p,null)):(xt(r,i,"encType",p.encType,p,null),xt(r,i,"method",p.method,p,null),xt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=uc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=la);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=uc(""+d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":Je("beforetoggle",r),Je("toggle",r),lc(r,"popover",d);break;case"xlinkActuate":ia(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ia(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ia(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ia(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ia(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ia(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ia(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ia(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ia(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":lc(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=VN.get(s)||s,lc(r,s,d))}}function Rm(r,i,s,d,p,v){switch(s){case"style":Av(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Rl(r,d):(typeof d=="number"||typeof d=="bigint")&&Rl(r,""+d);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"onClick":d!=null&&(r.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wv.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),v=r[Bn]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):lc(r,s,d)}}}function Sn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",r),Je("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var S=s[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:xt(r,i,v,S,s,null)}}p&&xt(r,i,"srcSet",s.srcSet,s,null),d&&xt(r,i,"src",s.src,s,null);return;case"input":Je("invalid",r);var _=v=S=p=null,F=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var ie=s[d];if(ie!=null)switch(d){case"name":p=ie;break;case"type":S=ie;break;case"checked":F=ie;break;case"defaultChecked":G=ie;break;case"value":v=ie;break;case"defaultValue":_=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,i));break;default:xt(r,i,d,ie,s,null)}}Ev(r,v,_,F,G,S,p,!1);return;case"select":Je("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":v=_;break;case"defaultValue":S=_;break;case"multiple":d=_;default:xt(r,i,p,_,s,null)}i=v,s=S,r.multiple=!!d,i!=null?Al(r,!!d,i,!1):s!=null&&Al(r,!!d,s,!0);return;case"textarea":Je("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(_=s[S],_!=null))switch(S){case"value":d=_;break;case"defaultValue":p=_;break;case"children":v=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:xt(r,i,S,_,s,null)}_v(r,d,p,v);return;case"option":for(F in s)if(s.hasOwnProperty(F)&&(d=s[F],d!=null))switch(F){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:xt(r,i,F,d,s,null)}return;case"dialog":Je("beforetoggle",r),Je("toggle",r),Je("cancel",r),Je("close",r);break;case"iframe":case"object":Je("load",r);break;case"video":case"audio":for(d=0;d<Fo.length;d++)Je(Fo[d],r);break;case"image":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"embed":case"source":case"link":Je("error",r),Je("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)&&(d=s[G],d!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:xt(r,i,G,d,s,null)}return;default:if(Zf(i)){for(ie in s)s.hasOwnProperty(ie)&&(d=s[ie],d!==void 0&&Rm(r,i,ie,d,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(d=s[_],d!=null&&xt(r,i,_,d,s,null))}function b2(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,S=null,_=null,F=null,G=null,ie=null;for(te in s){var de=s[te];if(s.hasOwnProperty(te)&&de!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":F=de;default:d.hasOwnProperty(te)||xt(r,i,te,null,d,de)}}for(var X in d){var te=d[X];if(de=s[X],d.hasOwnProperty(X)&&(te!=null||de!=null))switch(X){case"type":v=te;break;case"name":p=te;break;case"checked":G=te;break;case"defaultChecked":ie=te;break;case"value":S=te;break;case"defaultValue":_=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:te!==de&&xt(r,i,X,te,d,de)}}qf(r,S,_,F,G,ie,v,p);return;case"select":te=S=_=X=null;for(v in s)if(F=s[v],s.hasOwnProperty(v)&&F!=null)switch(v){case"value":break;case"multiple":te=F;default:d.hasOwnProperty(v)||xt(r,i,v,null,d,F)}for(p in d)if(v=d[p],F=s[p],d.hasOwnProperty(p)&&(v!=null||F!=null))switch(p){case"value":X=v;break;case"defaultValue":_=v;break;case"multiple":S=v;default:v!==F&&xt(r,i,p,v,d,F)}i=_,s=S,d=te,X!=null?Al(r,!!s,X,!1):!!d!=!!s&&(i!=null?Al(r,!!s,i,!0):Al(r,!!s,s?[]:"",!1));return;case"textarea":te=X=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:xt(r,i,_,null,d,p)}for(S in d)if(p=d[S],v=s[S],d.hasOwnProperty(S)&&(p!=null||v!=null))switch(S){case"value":X=p;break;case"defaultValue":te=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&xt(r,i,S,p,d,v)}Nv(r,X,te);return;case"option":for(var je in s)if(X=s[je],s.hasOwnProperty(je)&&X!=null&&!d.hasOwnProperty(je))switch(je){case"selected":r.selected=!1;break;default:xt(r,i,je,null,d,X)}for(F in d)if(X=d[F],te=s[F],d.hasOwnProperty(F)&&X!==te&&(X!=null||te!=null))switch(F){case"selected":r.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:xt(r,i,F,X,d,te)}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 Ie in s)X=s[Ie],s.hasOwnProperty(Ie)&&X!=null&&!d.hasOwnProperty(Ie)&&xt(r,i,Ie,null,d,X);for(G in d)if(X=d[G],te=s[G],d.hasOwnProperty(G)&&X!==te&&(X!=null||te!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:xt(r,i,G,X,d,te)}return;default:if(Zf(i)){for(var wt in s)X=s[wt],s.hasOwnProperty(wt)&&X!==void 0&&!d.hasOwnProperty(wt)&&Rm(r,i,wt,void 0,d,X);for(ie in d)X=d[ie],te=s[ie],!d.hasOwnProperty(ie)||X===te||X===void 0&&te===void 0||Rm(r,i,ie,X,d,te);return}}for(var V in s)X=s[V],s.hasOwnProperty(V)&&X!=null&&!d.hasOwnProperty(V)&&xt(r,i,V,null,d,X);for(de in d)X=d[de],te=s[de],!d.hasOwnProperty(de)||X===te||X==null&&te==null||xt(r,i,de,X,d,te)}function R0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,S=p.initiatorType,_=p.duration;if(v&&_&&R0(S)){for(S=0,_=p.responseEnd,d+=1;d<s.length;d++){var F=s[d],G=F.startTime;if(G>_)break;var ie=F.transferSize,de=F.initiatorType;ie&&R0(de)&&(F=F.responseEnd,S+=ie*(F<_?1:(_-G)/(F-G)))}if(--d,i+=8*(v+S)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var zm=null,Om=null;function ad(r){return r.nodeType===9?r:r.ownerDocument}function z0(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 O0(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Mm(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Dm=null;function w2(){var r=window.event;return r&&r.type==="popstate"?r===Dm?!1:(Dm=r,!0):(Dm=null,!1)}var M0=typeof setTimeout=="function"?setTimeout:void 0,S2=typeof clearTimeout=="function"?clearTimeout:void 0,D0=typeof Promise=="function"?Promise:void 0,k2=typeof queueMicrotask=="function"?queueMicrotask:typeof D0<"u"?function(r){return D0.resolve(null).then(r).catch(j2)}:M0;function j2(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function I0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),os(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Ho(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ho(s);for(var v=s.firstChild;v;){var S=v.nextSibling,_=v.nodeName;v[so]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Ho(r.ownerDocument.body);s=p}while(s);os(i)}function L0(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Im(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Im(s),$f(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function C2(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[so])switch(i){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(i==="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=Sr(r.nextSibling),r===null)break}return null}function E2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Sr(r.nextSibling),r===null))return null;return r}function U0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=Sr(r.nextSibling),r===null))return null;return r}function Lm(r){return r.data==="$?"||r.data==="$~"}function Um(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function N2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function Sr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Pm=null;function P0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return Sr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function B0(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function $0(r,i,s){switch(i=ad(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Ho(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);$f(r)}var kr=new Map,F0=new Set;function id(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Sa=ee.d;ee.d={f:_2,r:T2,D:A2,C:R2,L:z2,m:O2,X:D2,S:M2,M:I2};function _2(){var r=Sa.f(),i=Yc();return r||i}function T2(r){var i=Nl(r);i!==null&&i.tag===5&&i.type==="form"?ix(i):Sa.r(r)}var is=typeof document>"u"?null:document;function q0(r,i,s){var d=is;if(d&&typeof i=="string"&&i){var p=pr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),F0.has(p)||(F0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Sn(i,"link",r),on(i),d.head.appendChild(i)))}}function A2(r){Sa.D(r),q0("dns-prefetch",r,null)}function R2(r,i){Sa.C(r,i),q0("preconnect",r,i)}function z2(r,i,s){Sa.L(r,i,s);var d=is;if(d&&r&&i){var p='link[rel="preload"][as="'+pr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+pr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+pr(s.imageSizes)+'"]')):p+='[href="'+pr(r)+'"]';var v=p;switch(i){case"style":v=ls(r);break;case"script":v=ss(r)}kr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),kr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Zo(v))||i==="script"&&d.querySelector(Vo(v))||(i=d.createElement("link"),Sn(i,"link",r),on(i),d.head.appendChild(i)))}}function O2(r,i){Sa.m(r,i);var s=is;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+pr(d)+'"][href="'+pr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ss(r)}if(!kr.has(v)&&(r=g({rel:"modulepreload",href:r},i),kr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Vo(v)))return}d=s.createElement("link"),Sn(d,"link",r),on(d),s.head.appendChild(d)}}}function M2(r,i,s){Sa.S(r,i,s);var d=is;if(d&&r){var p=_l(d).hoistableStyles,v=ls(r);i=i||"default";var S=p.get(v);if(!S){var _={loading:0,preload:null};if(S=d.querySelector(Zo(v)))_.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=kr.get(v))&&Bm(r,s);var F=S=d.createElement("link");on(F),Sn(F,"link",r),F._p=new Promise(function(G,ie){F.onload=G,F.onerror=ie}),F.addEventListener("load",function(){_.loading|=1}),F.addEventListener("error",function(){_.loading|=2}),_.loading|=4,ld(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:_},p.set(v,S)}}}function D2(r,i){Sa.X(r,i);var s=is;if(s&&r){var d=_l(s).hoistableScripts,p=ss(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0},i),(i=kr.get(p))&&$m(r,i),v=s.createElement("script"),on(v),Sn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function I2(r,i){Sa.M(r,i);var s=is;if(s&&r){var d=_l(s).hoistableScripts,p=ss(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=kr.get(p))&&$m(r,i),v=s.createElement("script"),on(v),Sn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function H0(r,i,s,d){var p=(p=ce.current)?id(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ls(s.href),s=_l(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=ls(s.href);var v=_l(p).hoistableStyles,S=v.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=p.querySelector(Zo(r)))&&!v._p&&(S.instance=v,S.state.loading=5),kr.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},kr.set(r,s),v||L2(p,r,s,S.state))),i&&d===null)throw Error(a(528,""));return S}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ss(s),s=_l(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ls(r){return'href="'+pr(r)+'"'}function Zo(r){return'link[rel="stylesheet"]['+r+"]"}function Z0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function L2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Sn(i,"link",s),on(i),r.head.appendChild(i))}function ss(r){return'[src="'+pr(r)+'"]'}function Vo(r){return"script[async]"+r}function V0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+pr(s.href)+'"]');if(d)return i.instance=d,on(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),on(d),Sn(d,"style",p),ld(d,s.precedence,r),i.instance=d;case"stylesheet":p=ls(s.href);var v=r.querySelector(Zo(p));if(v)return i.state.loading|=4,i.instance=v,on(v),v;d=Z0(s),(p=kr.get(p))&&Bm(d,p),v=(r.ownerDocument||r).createElement("link"),on(v);var S=v;return S._p=new Promise(function(_,F){S.onload=_,S.onerror=F}),Sn(v,"link",d),i.state.loading|=4,ld(v,s.precedence,r),i.instance=v;case"script":return v=ss(s.src),(p=r.querySelector(Vo(v)))?(i.instance=p,on(p),p):(d=s,(p=kr.get(v))&&(d=g({},s),$m(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),on(p),Sn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,ld(d,s.precedence,r));return i.instance}function ld(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,S=0;S<d.length;S++){var _=d[S];if(_.dataset.precedence===i)v=_;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function Bm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function $m(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var sd=null;function Q0(r,i,s){if(sd===null){var d=new Map,p=sd=new Map;p.set(s,d)}else p=sd,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[so]||v[vn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var _=d.get(S);_?_.push(v):d.set(S,[v])}}return d}function K0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function U2(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function G0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function P2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=ls(d.href),v=i.querySelector(Zo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=od.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,on(v);return}v=i.ownerDocument||i,d=Z0(d),(p=kr.get(p))&&Bm(d,p),v=v.createElement("link"),on(v);var S=v;S._p=new Promise(function(_,F){S.onload=_,S.onerror=F}),Sn(v,"link",d),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=od.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Fm=0;function B2(r,i){return r.stylesheets&&r.count===0&&cd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&cd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Fm===0&&(Fm=62500*x2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&cd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Fm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function od(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ud=null;function cd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ud=new Map,i.forEach($2,r),ud=null,od.call(r))}function $2(r,i){if(!(i.state.loading&4)){var s=ud.get(r);if(s)var d=s.get(null);else{s=new Map,ud.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var S=p[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),d=S)}d&&s.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),v=s.get(S)||d,v===d&&s.set(null,p),s.set(S,p),this.count++,d=od.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Qo={$$typeof:O,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_threadCount:0};function F2(r,i,s,d,p,v,S,_,F){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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function Y0(r,i,s,d,p,v,S,_,F,G,ie,de){return r=new F2(r,i,s,S,F,G,ie,de,_),i=1,v===!0&&(i|=24),v=tr(3,null,null,i),r.current=v,v.stateNode=r,i=wh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Ch(v),r}function X0(r){return r?(r=Ul,r):Ul}function J0(r,i,s,d,p,v){p=X0(p),d.context===null?d.context=p:d.pendingContext=p,d=Za(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Va(r,d,i),s!==null&&(Vn(s,r,i),Co(s,r,i))}function W0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function qm(r,i){W0(r,i),(r=r.alternate)&&W0(r,i)}function e1(r){if(r.tag===13||r.tag===31){var i=Hi(r,67108864);i!==null&&Vn(i,r,67108864),qm(r,67108864)}}function t1(r){if(r.tag===13||r.tag===31){var i=lr();i=Uf(i);var s=Hi(r,i);s!==null&&Vn(s,r,i),qm(r,i)}}var dd=!0;function q2(r,i,s,d){var p=H.T;H.T=null;var v=ee.p;try{ee.p=2,Hm(r,i,s,d)}finally{ee.p=v,H.T=p}}function H2(r,i,s,d){var p=H.T;H.T=null;var v=ee.p;try{ee.p=8,Hm(r,i,s,d)}finally{ee.p=v,H.T=p}}function Hm(r,i,s,d){if(dd){var p=Zm(d);if(p===null)Am(r,i,d,fd,s),r1(r,d);else if(V2(p,r,i,s,d))d.stopPropagation();else if(r1(r,d),i&4&&-1<Z2.indexOf(r)){for(;p!==null;){var v=Nl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var S=Zr(v.pendingLanes);if(S!==0){var _=v;for(_.pendingLanes|=2,_.entangledLanes|=2;S;){var F=1<<31-mt(S);_.entanglements[1]|=F,S&=~F}Gr(v),(ht&6)===0&&(Kc=mn()+500,$o(0))}}break;case 31:case 13:_=Hi(v,2),_!==null&&Vn(_,v,2),Yc(),qm(v,2)}if(v=Zm(d),v===null&&Am(r,i,d,fd,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Am(r,i,d,null,s)}}function Zm(r){return r=Qf(r),Vm(r)}var fd=null;function Vm(r){if(fd=null,r=El(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return fd=r,null}function n1(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(io()){case se:return 2;case ye:return 8;case Pe:case $e:return 32;case rt:return 268435456;default:return 32}default:return 32}}var Qm=!1,ri=null,ai=null,ii=null,Ko=new Map,Go=new Map,li=[],Z2="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 r1(r,i){switch(r){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(i.pointerId)}}function Yo(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Nl(i),i!==null&&e1(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function V2(r,i,s,d,p){switch(i){case"focusin":return ri=Yo(ri,r,i,s,d,p),!0;case"dragenter":return ai=Yo(ai,r,i,s,d,p),!0;case"mouseover":return ii=Yo(ii,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Ko.set(v,Yo(Ko.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,Go.set(v,Yo(Go.get(v)||null,r,i,s,d,p)),!0}return!1}function a1(r){var i=El(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,vv(r.priority,function(){t1(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,vv(r.priority,function(){t1(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function hd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Zm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Vf=d,s.target.dispatchEvent(d),Vf=null}else return i=Nl(s),i!==null&&e1(i),r.blockedOn=s,!1;i.shift()}return!0}function i1(r,i,s){hd(r)&&s.delete(i)}function Q2(){Qm=!1,ri!==null&&hd(ri)&&(ri=null),ai!==null&&hd(ai)&&(ai=null),ii!==null&&hd(ii)&&(ii=null),Ko.forEach(i1),Go.forEach(i1)}function md(r,i){r.blockedOn===i&&(r.blockedOn=null,Qm||(Qm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Q2)))}var pd=null;function l1(r){pd!==r&&(pd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pd===r&&(pd=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(Vm(d||s)===null)continue;break}var v=Nl(s);v!==null&&(r.splice(i,3),i-=3,Zh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function os(r){function i(F){return md(F,r)}ri!==null&&md(ri,r),ai!==null&&md(ai,r),ii!==null&&md(ii,r),Ko.forEach(i),Go.forEach(i);for(var s=0;s<li.length;s++){var d=li[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)a1(s),s.blockedOn===null&&li.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],S=p[Bn]||null;if(typeof v=="function")S||l1(s);else if(S){var _=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[Bn]||null)_=S.formAction;else if(Vm(p)!==null)continue}else _=S.action;typeof _=="function"?s[d+1]=_:(s.splice(d,3),d-=3),l1(s)}}}function s1(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!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 d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Km(r){this._internalRoot=r}gd.prototype.render=Km.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=lr();J0(s,d,r,i,null,null)},gd.prototype.unmount=Km.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;J0(r.current,2,null,r,null,null),Yc(),i[Cl]=null}};function gd(r){this._internalRoot=r}gd.prototype.unstable_scheduleHydration=function(r){if(r){var i=yv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<li.length&&i!==0&&i<li[s].priority;s++);li.splice(s,0,r),s===0&&a1(r)}};var o1=t.version;if(o1!=="19.2.4")throw Error(a(527,o1,"19.2.4"));ee.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var K2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yd.isDisabled&&yd.supportsFiber)try{nn=yd.inject(K2),qt=yd}catch{}}return Jo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=px,v=gx,S=yx;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=Y0(r,1,!1,null,null,s,d,null,p,v,S,s1),r[Cl]=i.current,Tm(r),new Km(i)},Jo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=px,S=gx,_=yx,F=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(F=s.formState)),i=Y0(r,1,!0,i,s??null,d,p,F,v,S,_,s1),i.context=X0(null),s=i.current,d=lr(),d=Uf(d),p=Za(d),p.callback=null,Va(s,p,d),s=d,i.current.lanes=s,yn(i,s),Gr(i),r[Cl]=i.current,Tm(r),new gd(i)},Jo.version="19.2.4",Jo}var b1;function iT(){if(b1)return Jm.exports;b1=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=aT(),Jm.exports}var lT=iT(),xl=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(){}},sl,pi,ks,KS,sT=(KS=class extends xl{constructor(){super();ke(this,sl);ke(this,pi);ke(this,ks);me(this,ks,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,pi)||this.setEventListener(D(this,ks))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,pi))==null||t.call(this),me(this,pi,void 0))}setEventListener(t){var n;me(this,ks,t),(n=D(this,pi))==null||n.call(this),me(this,pi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){D(this,sl)!==t&&(me(this,sl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,sl)=="boolean"?D(this,sl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sl=new WeakMap,pi=new WeakMap,ks=new WeakMap,KS),Wg=new sT,oT={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gi,Yg,GS,uT=(GS=class{constructor(){ke(this,gi,oT);ke(this,Yg,!1)}setTimeoutProvider(e){me(this,gi,e)}setTimeout(e,t){return D(this,gi).setTimeout(e,t)}clearTimeout(e){D(this,gi).clearTimeout(e)}setInterval(e,t){return D(this,gi).setInterval(e,t)}clearInterval(e){D(this,gi).clearInterval(e)}},gi=new WeakMap,Yg=new WeakMap,GS),il=new uT;function cT(e){setTimeout(e,0)}var dT=typeof window>"u"||"Deno"in globalThis;function Nn(){}function fT(e,t){return typeof e=="function"?e(t):e}function Qp(e){return typeof e=="number"&&e>=0&&e!==1/0}function sk(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function x1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==ey(c,t.options))return!1}else if(!vu(t.queryKey,c))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 w1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(gl(t.options.mutationKey)!==gl(o))return!1}else if(!vu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function ey(e,t){return((t==null?void 0:t.queryKeyHashFn)||gl)(e)}function gl(e){return JSON.stringify(e,(t,n)=>Kp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function vu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>vu(e[n],t[n])):!1}var hT=Object.prototype.hasOwnProperty;function ty(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=S1(e)&&S1(t);if(!a&&!(Kp(e)&&Kp(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],b=e[g],w=t[g];if(b===w){m[g]=b,(a?y<o:hT.call(e,g))&&h++;continue}if(b===null||w===null||typeof b!="object"||typeof w!="object"){m[g]=w;continue}const k=ty(b,w,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function bu(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 S1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kp(e){if(!k1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!k1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function k1(e){return Object.prototype.toString.call(e)==="[object Object]"}function mT(e){return new Promise(t=>{il.setTimeout(t,e)})}function Gp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ty(e,t):t}function pT(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function gT(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var ny=Symbol();function ok(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ny?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ry(e,t){return typeof e=="function"?e(...t):!!e}function yT(e,t,n){let a=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),a||(a=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var xu=(()=>{let e=()=>dT;return{isServer(){return e()},setIsServer(t){e=t}}})();function Yp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function a(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{a({status:"fulfilled",value:l}),e(l)},n.reject=l=>{a({status:"rejected",reason:l}),t(l)},n}var vT=cT;function bT(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=vT;const o=f=>{t?e.push(f):l(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Ft=bT(),js,yi,Cs,YS,xT=(YS=class extends xl{constructor(){super();ke(this,js,!0);ke(this,yi);ke(this,Cs);me(this,Cs,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){D(this,yi)||this.setEventListener(D(this,Cs))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,yi))==null||t.call(this),me(this,yi,void 0))}setEventListener(t){var n;me(this,Cs,t),(n=D(this,yi))==null||n.call(this),me(this,yi,t(this.setOnline.bind(this)))}setOnline(t){D(this,js)!==t&&(me(this,js,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return D(this,js)}},js=new WeakMap,yi=new WeakMap,Cs=new WeakMap,YS),Kd=new xT;function wT(e){return Math.min(1e3*2**e,3e4)}function uk(e){return(e??"online")==="online"?Kd.isOnline():!0}var Xp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ck(e){let t=!1,n=0,a;const l=Yp(),o=()=>l.status!=="pending",c=j=>{var E;if(!o()){const C=new Xp(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Wg.isFocused()&&(e.networkMode==="always"||Kd.isOnline())&&e.canRun(),y=()=>uk(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},w=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=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(C){j=Promise.reject(C)}Promise.resolve(j).then(g).catch(C=>{var z;if(o())return;const R=e.retry??(xu.isServer()?0:3),O=e.retryDelay??wT,M=typeof O=="function"?O(n,C):O,B=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,C);if(t||!B){b(C);return}n++,(z=e.onFail)==null||z.call(e,n,C),mT(M).then(()=>h()?void 0:w()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var ol,XS,dk=(XS=class{constructor(){ke(this,ol)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qp(this.gcTime)&&me(this,ol,il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xu.isServer()?1/0:300*1e3))}clearGcTimeout(){D(this,ol)&&(il.clearTimeout(D(this,ol)),me(this,ol,void 0))}},ol=new WeakMap,XS),ul,Es,jr,cl,cn,Mu,dl,cr,fk,ja,JS,ST=(JS=class extends dk{constructor(t){super();ke(this,cr);ke(this,ul);ke(this,Es);ke(this,jr);ke(this,cl);ke(this,cn);ke(this,Mu);ke(this,dl);me(this,dl,!1),me(this,Mu,t.defaultOptions),this.setOptions(t.options),this.observers=[],me(this,cl,t.client),me(this,jr,D(this,cl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,me(this,ul,C1(this.options)),this.state=t.state??D(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,cn))==null?void 0:t.promise}setOptions(t){if(this.options={...D(this,Mu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=C1(this.options);n.data!==void 0&&(this.setState(j1(n.data,n.dataUpdatedAt)),me(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,jr).remove(this)}setData(t,n){const a=Gp(this.state.data,t,this.options);return Le(this,cr,ja).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Le(this,cr,ja).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=D(this,cn))==null?void 0:a.promise;return(l=D(this,cn))==null||l.cancel(t),n?n.then(Nn).catch(Nn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return D(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Er(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ny||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ci(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:!sk(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,cn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,cn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,jr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(D(this,cn)&&(D(this,dl)||Le(this,cr,fk).call(this)?D(this,cn).cancel({revert:!0}):D(this,cn).cancelRetry()),this.scheduleGc()),D(this,jr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,cr,ja).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,w,k,j,E,C,R,O;if(this.state.fetchStatus!=="idle"&&((m=D(this,cn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,cn))return D(this,cn).continueRetry(),D(this,cn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(B=>B.options.queryFn);M&&this.setOptions(M.options)}const a=new AbortController,l=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(me(this,dl,!0),a.signal)})},o=()=>{const M=ok(this.options,n),z=(()=>{const $={client:D(this,cl),queryKey:this.queryKey,meta:this.meta};return l($),$})();return me(this,dl,!1),this.options.persister?this.options.persister(M,z,this):M(z)},f=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,cl),state:this.state,fetchFn:o};return l(M),M})();(h=this.options.behavior)==null||h.onFetch(f,this),me(this,Es,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Le(this,cr,ja).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),me(this,cn,ck({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:M=>{M instanceof Xp&&M.revert&&this.setState({...D(this,Es),fetchStatus:"idle"}),a.abort()},onFail:(M,B)=>{Le(this,cr,ja).call(this,{type:"failed",failureCount:M,error:B})},onPause:()=>{Le(this,cr,ja).call(this,{type:"pause"})},onContinue:()=>{Le(this,cr,ja).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const M=await D(this,cn).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(w=(b=D(this,jr).config).onSuccess)==null||w.call(b,M,this),(j=(k=D(this,jr).config).onSettled)==null||j.call(k,M,this.state.error,this),M}catch(M){if(M instanceof Xp){if(M.silent)return D(this,cn).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Le(this,cr,ja).call(this,{type:"error",error:M}),(C=(E=D(this,jr).config).onError)==null||C.call(E,M,this),(O=(R=D(this,jr).config).onSettled)==null||O.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},ul=new WeakMap,Es=new WeakMap,jr=new WeakMap,cl=new WeakMap,cn=new WeakMap,Mu=new WeakMap,dl=new WeakMap,cr=new WeakSet,fk=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ja=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...hk(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...j1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return me(this,Es,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Ft.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),D(this,jr).notify({query:this,type:"updated",action:t})})},JS);function hk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function j1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function C1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kn,it,Du,Dn,fl,Ns,Ca,vi,Iu,_s,Ts,hl,ml,bi,As,gt,uu,Jp,Wp,eg,tg,ng,rg,ag,mk,WS,ay=(WS=class extends xl{constructor(t,n){super();ke(this,gt);ke(this,Kn);ke(this,it);ke(this,Du);ke(this,Dn);ke(this,fl);ke(this,Ns);ke(this,Ca);ke(this,vi);ke(this,Iu);ke(this,_s);ke(this,Ts);ke(this,hl);ke(this,ml);ke(this,bi);ke(this,As,new Set);this.options=n,me(this,Kn,t),me(this,vi,null),me(this,Ca,Yp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,it).addObserver(this),E1(D(this,it),this.options)?Le(this,gt,uu).call(this):this.updateResult(),Le(this,gt,tg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ig(D(this,it),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ig(D(this,it),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,gt,ng).call(this),Le(this,gt,rg).call(this),D(this,it).removeObserver(this)}setOptions(t){const n=this.options,a=D(this,it);if(this.options=D(this,Kn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Er(this.options.enabled,D(this,it))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,gt,ag).call(this),D(this,it).setOptions(this.options),n._defaulted&&!bu(this.options,n)&&D(this,Kn).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,it),observer:this});const l=this.hasListeners();l&&N1(D(this,it),a,this.options,n)&&Le(this,gt,uu).call(this),this.updateResult(),l&&(D(this,it)!==a||Er(this.options.enabled,D(this,it))!==Er(n.enabled,D(this,it))||Ci(this.options.staleTime,D(this,it))!==Ci(n.staleTime,D(this,it)))&&Le(this,gt,Jp).call(this);const o=Le(this,gt,Wp).call(this);l&&(D(this,it)!==a||Er(this.options.enabled,D(this,it))!==Er(n.enabled,D(this,it))||o!==D(this,bi))&&Le(this,gt,eg).call(this,o)}getOptimisticResult(t){const n=D(this,Kn).getQueryCache().build(D(this,Kn),t),a=this.createResult(n,t);return jT(this,a)&&(me(this,Dn,a),me(this,Ns,this.options),me(this,fl,D(this,it).state)),a}getCurrentResult(){return D(this,Dn)}trackResult(t,n){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&D(this,Ca).status==="pending"&&D(this,Ca).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){D(this,As).add(t)}getCurrentQuery(){return D(this,it)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,Kn).defaultQueryOptions(t),a=D(this,Kn).getQueryCache().build(D(this,Kn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Le(this,gt,uu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,Dn)))}createResult(t,n){var Q;const a=D(this,it),l=this.options,o=D(this,Dn),c=D(this,fl),f=D(this,Ns),h=t!==a?t.state:D(this,Du),{state:y}=t;let g={...y},b=!1,w;if(n._optimisticResults){const I=this.hasListeners(),ne=!I&&E1(t,n),le=I&&N1(t,a,n,l);(ne||le)&&(g={...g,...hk(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;w=g.data;let C=!1;if(n.placeholderData!==void 0&&w===void 0&&E==="pending"){let I;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(I=o.data,C=!0):I=typeof n.placeholderData=="function"?n.placeholderData((Q=D(this,Ts))==null?void 0:Q.state.data,D(this,Ts)):n.placeholderData,I!==void 0&&(E="success",w=Gp(o==null?void 0:o.data,I,n),b=!0)}if(n.select&&w!==void 0&&!C)if(o&&w===(c==null?void 0:c.data)&&n.select===D(this,Iu))w=D(this,_s);else try{me(this,Iu,n.select),w=n.select(w),w=Gp(o==null?void 0:o.data,w,n),me(this,_s,w),me(this,vi,null)}catch(I){me(this,vi,I)}D(this,vi)&&(k=D(this,vi),w=D(this,_s),j=Date.now(),E="error");const R=g.fetchStatus==="fetching",O=E==="pending",M=E==="error",B=O&&R,z=w!==void 0,U={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:M,isInitialLoading:B,isLoading:B,data:w,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:R,isRefetching:R&&!O,isLoadingError:M&&!z,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:M&&z,isStale:iy(t,n),refetch:this.refetch,promise:D(this,Ca),isEnabled:Er(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=U.data!==void 0,ne=U.status==="error"&&!I,le=J=>{ne?J.reject(U.error):I&&J.resolve(U.data)},we=()=>{const J=me(this,Ca,U.promise=Yp());le(J)},Y=D(this,Ca);switch(Y.status){case"pending":t.queryHash===a.queryHash&&le(Y);break;case"fulfilled":(ne||U.data!==Y.value)&&we();break;case"rejected":(!ne||U.error!==Y.reason)&&we();break}}return U}updateResult(){const t=D(this,Dn),n=this.createResult(D(this,it),this.options);if(me(this,fl,D(this,it).state),me(this,Ns,this.options),D(this,fl).data!==void 0&&me(this,Ts,D(this,it)),bu(n,t))return;me(this,Dn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!D(this,As).size)return!0;const c=new Set(o??D(this,As));return this.options.throwOnError&&c.add("error"),Object.keys(D(this,Dn)).some(f=>{const m=f;return D(this,Dn)[m]!==t[m]&&c.has(m)})};Le(this,gt,mk).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,gt,tg).call(this)}},Kn=new WeakMap,it=new WeakMap,Du=new WeakMap,Dn=new WeakMap,fl=new WeakMap,Ns=new WeakMap,Ca=new WeakMap,vi=new WeakMap,Iu=new WeakMap,_s=new WeakMap,Ts=new WeakMap,hl=new WeakMap,ml=new WeakMap,bi=new WeakMap,As=new WeakMap,gt=new WeakSet,uu=function(t){Le(this,gt,ag).call(this);let n=D(this,it).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nn)),n},Jp=function(){Le(this,gt,ng).call(this);const t=Ci(this.options.staleTime,D(this,it));if(xu.isServer()||D(this,Dn).isStale||!Qp(t))return;const a=sk(D(this,Dn).dataUpdatedAt,t)+1;me(this,hl,il.setTimeout(()=>{D(this,Dn).isStale||this.updateResult()},a))},Wp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,it)):this.options.refetchInterval)??!1},eg=function(t){Le(this,gt,rg).call(this),me(this,bi,t),!(xu.isServer()||Er(this.options.enabled,D(this,it))===!1||!Qp(D(this,bi))||D(this,bi)===0)&&me(this,ml,il.setInterval(()=>{(this.options.refetchIntervalInBackground||Wg.isFocused())&&Le(this,gt,uu).call(this)},D(this,bi)))},tg=function(){Le(this,gt,Jp).call(this),Le(this,gt,eg).call(this,Le(this,gt,Wp).call(this))},ng=function(){D(this,hl)&&(il.clearTimeout(D(this,hl)),me(this,hl,void 0))},rg=function(){D(this,ml)&&(il.clearInterval(D(this,ml)),me(this,ml,void 0))},ag=function(){const t=D(this,Kn).getQueryCache().build(D(this,Kn),this.options);if(t===D(this,it))return;const n=D(this,it);me(this,it,t),me(this,Du,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},mk=function(t){Ft.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(D(this,Dn))}),D(this,Kn).getQueryCache().notify({query:D(this,it),type:"observerResultsUpdated"})})},WS);function kT(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function E1(e,t){return kT(e,t)||e.state.data!==void 0&&ig(e,t,t.refetchOnMount)}function ig(e,t,n){if(Er(t.enabled,e)!==!1&&Ci(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&iy(e,t)}return!1}function N1(e,t,n,a){return(e!==t||Er(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&iy(e,n)}function iy(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function jT(e,t){return!bu(e.getCurrentResult(),t)}function _1(e){return{onFetch:(t,n)=>{var y,g,b,w,k;const a=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{yT(O,()=>t.signal,()=>j=!0)},C=ok(t.options,t.fetchOptions),R=async(O,M,B)=>{if(j)return Promise.reject();if(M==null&&O.pages.length)return Promise.resolve(O);const $=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:M,direction:B?"backward":"forward",meta:t.options.meta};return E(ne),ne})(),U=await C($),{maxPages:Q}=t.options,I=B?gT:pT;return{pages:I(O.pages,U,Q),pageParams:I(O.pageParams,M,Q)}};if(l&&o.length){const O=l==="backward",M=O?CT:T1,B={pages:o,pageParams:c},z=M(a,B);f=await R(B,z,O)}else{const O=e??o.length;do{const M=m===0?c[0]??a.initialPageParam:T1(a,f);if(m>0&&M==null)break;f=await R(f,M),m++}while(m<O)}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 T1(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function CT(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Lu,Xr,Cn,pl,Jr,di,ek,ET=(ek=class extends dk{constructor(t){super();ke(this,Jr);ke(this,Lu);ke(this,Xr);ke(this,Cn);ke(this,pl);me(this,Lu,t.client),this.mutationId=t.mutationId,me(this,Cn,t.mutationCache),me(this,Xr,[]),this.state=t.state||pk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Xr).includes(t)||(D(this,Xr).push(t),this.clearGcTimeout(),D(this,Cn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){me(this,Xr,D(this,Xr).filter(n=>n!==t)),this.scheduleGc(),D(this,Cn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():D(this,Cn).remove(this))}continue(){var t;return((t=D(this,pl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,w,k,j,E,C,R,O,M,B,z,$;const n=()=>{Le(this,Jr,di).call(this,{type:"continue"})},a={client:D(this,Lu),meta:this.options.meta,mutationKey:this.options.mutationKey};me(this,pl,ck({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,Q)=>{Le(this,Jr,di).call(this,{type:"failed",failureCount:U,error:Q})},onPause:()=>{Le(this,Jr,di).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,Cn).canRun(this)}));const l=this.state.status==="pending",o=!D(this,pl).canStart();try{if(l)n();else{Le(this,Jr,di).call(this,{type:"pending",variables:t,isPaused:o}),D(this,Cn).config.onMutate&&await D(this,Cn).config.onMutate(t,this,a);const Q=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));Q!==this.state.context&&Le(this,Jr,di).call(this,{type:"pending",context:Q,variables:t,isPaused:o})}const U=await D(this,pl).start();return await((h=(m=D(this,Cn).config).onSuccess)==null?void 0:h.call(m,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((w=(b=D(this,Cn).config).onSettled)==null?void 0:w.call(b,U,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,U,null,t,this.state.context,a)),Le(this,Jr,di).call(this,{type:"success",data:U}),U}catch(U){try{await((C=(E=D(this,Cn).config).onError)==null?void 0:C.call(E,U,t,this.state.context,this,a))}catch(Q){Promise.reject(Q)}try{await((O=(R=this.options).onError)==null?void 0:O.call(R,U,t,this.state.context,a))}catch(Q){Promise.reject(Q)}try{await((B=(M=D(this,Cn).config).onSettled)==null?void 0:B.call(M,void 0,U,this.state.variables,this.state.context,this,a))}catch(Q){Promise.reject(Q)}try{await(($=(z=this.options).onSettled)==null?void 0:$.call(z,void 0,U,t,this.state.context,a))}catch(Q){Promise.reject(Q)}throw Le(this,Jr,di).call(this,{type:"error",error:U}),U}finally{D(this,Cn).runNext(this)}}},Lu=new WeakMap,Xr=new WeakMap,Cn=new WeakMap,pl=new WeakMap,Jr=new WeakSet,di=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,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{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ft.batch(()=>{D(this,Xr).forEach(a=>{a.onMutationUpdate(t)}),D(this,Cn).notify({mutation:this,type:"updated",action:t})})},ek);function pk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ea,Lr,Uu,tk,NT=(tk=class extends xl{constructor(t={}){super();ke(this,Ea);ke(this,Lr);ke(this,Uu);this.config=t,me(this,Ea,new Set),me(this,Lr,new Map),me(this,Uu,0)}build(t,n,a){const l=new ET({client:t,mutationCache:this,mutationId:++vd(this,Uu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){D(this,Ea).add(t);const n=bd(t);if(typeof n=="string"){const a=D(this,Lr).get(n);a?a.push(t):D(this,Lr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Ea).delete(t)){const n=bd(t);if(typeof n=="string"){const a=D(this,Lr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&D(this,Lr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=bd(t);if(typeof n=="string"){const a=D(this,Lr).get(n),l=a==null?void 0:a.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var a;const n=bd(t);if(typeof n=="string"){const l=(a=D(this,Lr).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ft.batch(()=>{D(this,Ea).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Ea).clear(),D(this,Lr).clear()})}getAll(){return Array.from(D(this,Ea))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>w1(n,a))}findAll(t={}){return this.getAll().filter(n=>w1(t,n))}notify(t){Ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ft.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nn))))}},Ea=new WeakMap,Lr=new WeakMap,Uu=new WeakMap,tk);function bd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Na,xi,Gn,_a,Aa,Pd,lg,nk,_T=(nk=class extends xl{constructor(n,a){super();ke(this,Aa);ke(this,Na);ke(this,xi);ke(this,Gn);ke(this,_a);me(this,Na,n),this.setOptions(a),this.bindMethods(),Le(this,Aa,Pd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const a=this.options;this.options=D(this,Na).defaultMutationOptions(n),bu(this.options,a)||D(this,Na).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,Gn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&gl(a.mutationKey)!==gl(this.options.mutationKey)?this.reset():((l=D(this,Gn))==null?void 0:l.state.status)==="pending"&&D(this,Gn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=D(this,Gn))==null||n.removeObserver(this)}onMutationUpdate(n){Le(this,Aa,Pd).call(this),Le(this,Aa,lg).call(this,n)}getCurrentResult(){return D(this,xi)}reset(){var n;(n=D(this,Gn))==null||n.removeObserver(this),me(this,Gn,void 0),Le(this,Aa,Pd).call(this),Le(this,Aa,lg).call(this)}mutate(n,a){var l;return me(this,_a,a),(l=D(this,Gn))==null||l.removeObserver(this),me(this,Gn,D(this,Na).getMutationCache().build(D(this,Na),this.options)),D(this,Gn).addObserver(this),D(this,Gn).execute(n)}},Na=new WeakMap,xi=new WeakMap,Gn=new WeakMap,_a=new WeakMap,Aa=new WeakSet,Pd=function(){var a;const n=((a=D(this,Gn))==null?void 0:a.state)??pk();me(this,xi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},lg=function(n){Ft.batch(()=>{var a,l,o,c,f,m,h,y;if(D(this,_a)&&this.hasListeners()){const g=D(this,xi).variables,b=D(this,xi).context,w={client:D(this,Na),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=D(this,_a)).onSuccess)==null||l.call(a,n.data,g,b,w)}catch(k){Promise.reject(k)}try{(c=(o=D(this,_a)).onSettled)==null||c.call(o,n.data,null,g,b,w)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=D(this,_a)).onError)==null||m.call(f,n.error,g,b,w)}catch(k){Promise.reject(k)}try{(y=(h=D(this,_a)).onSettled)==null||y.call(h,void 0,n.error,g,b,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(D(this,xi))})})},nk);function A1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function TT(e,t,n){const a=e.slice(0);return a[t]=n,a}var Rs,or,zs,Os,Cr,wi,Pu,Bu,$u,Fu,kn,sg,og,ug,cg,dg,rk,AT=(rk=class extends xl{constructor(t,n,a){super();ke(this,kn);ke(this,Rs);ke(this,or);ke(this,zs);ke(this,Os);ke(this,Cr);ke(this,wi);ke(this,Pu);ke(this,Bu);ke(this,$u);ke(this,Fu,[]);me(this,Rs,t),me(this,Os,a),me(this,zs,[]),me(this,Cr,[]),me(this,or,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&D(this,Cr).forEach(t=>{t.subscribe(n=>{Le(this,kn,cg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,D(this,Cr).forEach(t=>{t.destroy()})}setQueries(t,n){me(this,zs,t),me(this,Os,n),Ft.batch(()=>{const a=D(this,Cr),l=Le(this,kn,ug).call(this,D(this,zs));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,b)=>g!==a[b]),h=f||m,y=h?!0:c.some((g,b)=>{const w=D(this,or)[b];return!w||!bu(g,w)});!h&&!y||(h&&(me(this,Fu,l),me(this,Cr,o)),me(this,or,c),this.hasListeners()&&(h&&(A1(a,o).forEach(g=>{g.destroy()}),A1(o,a).forEach(g=>{g.subscribe(b=>{Le(this,kn,cg).call(this,g,b)})})),Le(this,kn,dg).call(this)))})}getCurrentResult(){return D(this,or)}getQueries(){return D(this,Cr).map(t=>t.getCurrentQuery())}getObservers(){return D(this,Cr)}getOptimisticResult(t,n){const a=Le(this,kn,ug).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>Le(this,kn,og).call(this,c??l,n,o),()=>Le(this,kn,sg).call(this,l,a)]}},Rs=new WeakMap,or=new WeakMap,zs=new WeakMap,Os=new WeakMap,Cr=new WeakMap,wi=new WeakMap,Pu=new WeakMap,Bu=new WeakMap,$u=new WeakMap,Fu=new WeakMap,kn=new WeakSet,sg=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},og=function(t,n,a){if(n){const l=D(this,$u),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!D(this,wi)||D(this,or)!==D(this,Bu)||o||n!==D(this,Pu))&&(me(this,Pu,n),me(this,Bu,D(this,or)),a!==void 0&&me(this,$u,a),me(this,wi,ty(D(this,wi),n(t)))),D(this,wi)}return t},ug=function(t){const n=new Map;D(this,Cr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=D(this,Rs).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new ay(D(this,Rs),o);a.push({defaultedQueryOptions:o,observer:f})}),a},cg=function(t,n){const a=D(this,Cr).indexOf(t);a!==-1&&(me(this,or,TT(D(this,or),a,n)),Le(this,kn,dg).call(this))},dg=function(){var t;if(this.hasListeners()){const n=D(this,wi),a=Le(this,kn,sg).call(this,D(this,or),D(this,Fu)),l=Le(this,kn,og).call(this,a,(t=D(this,Os))==null?void 0:t.combine);n!==l&&Ft.batch(()=>{this.listeners.forEach(o=>{o(D(this,or))})})}},rk),Wr,ak,RT=(ak=class extends xl{constructor(t={}){super();ke(this,Wr);this.config=t,me(this,Wr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??ey(l,n);let c=this.get(o);return c||(c=new ST({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){D(this,Wr).has(t.queryHash)||(D(this,Wr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,Wr).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,Wr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Wr).get(t)}getAll(){return[...D(this,Wr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>x1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>x1(t,a)):n}notify(t){Ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ft.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ft.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Wr=new WeakMap,ak),$t,Si,ki,Ms,Ds,ji,Is,Ls,ik,zT=(ik=class{constructor(e={}){ke(this,$t);ke(this,Si);ke(this,ki);ke(this,Ms);ke(this,Ds);ke(this,ji);ke(this,Is);ke(this,Ls);me(this,$t,e.queryCache||new RT),me(this,Si,e.mutationCache||new NT),me(this,ki,e.defaultOptions||{}),me(this,Ms,new Map),me(this,Ds,new Map),me(this,ji,0)}mount(){vd(this,ji)._++,D(this,ji)===1&&(me(this,Is,Wg.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,$t).onFocus())})),me(this,Ls,Kd.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,$t).onOnline())})))}unmount(){var e,t;vd(this,ji)._--,D(this,ji)===0&&((e=D(this,Is))==null||e.call(this),me(this,Is,void 0),(t=D(this,Ls))==null||t.call(this),me(this,Ls,void 0))}isFetching(e){return D(this,$t).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,Si).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,$t).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,$t).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ci(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return D(this,$t).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=D(this,$t).get(a.queryHash),o=l==null?void 0:l.state.data,c=fT(t,o);if(c!==void 0)return D(this,$t).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Ft.batch(()=>D(this,$t).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,$t).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,$t);Ft.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,$t);return Ft.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Ft.batch(()=>D(this,$t).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Nn).catch(Nn)}invalidateQueries(e,t={}){return Ft.batch(()=>(D(this,$t).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},a=Ft.batch(()=>D(this,$t).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(Nn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(Nn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,$t).build(this,t);return n.isStaleByTime(Ci(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nn).catch(Nn)}fetchInfiniteQuery(e){return e.behavior=_1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nn).catch(Nn)}ensureInfiniteQueryData(e){return e.behavior=_1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Kd.isOnline()?D(this,Si).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,$t)}getMutationCache(){return D(this,Si)}getDefaultOptions(){return D(this,ki)}setDefaultOptions(e){me(this,ki,e)}setQueryDefaults(e,t){D(this,Ms).set(gl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,Ms).values()],n={};return t.forEach(a=>{vu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){D(this,Ds).set(gl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,Ds).values()],n={};return t.forEach(a=>{vu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,ki).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ey(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===ny&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,ki).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,$t).clear(),D(this,Si).clear()}},$t=new WeakMap,Si=new WeakMap,ki=new WeakMap,Ms=new WeakMap,Ds=new WeakMap,ji=new WeakMap,Is=new WeakMap,Ls=new WeakMap,ik),gk=x.createContext(void 0),fn=e=>{const t=x.useContext(gk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},OT=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(gk.Provider,{value:e,children:t})),yk=x.createContext(!1),vk=()=>x.useContext(yk);yk.Provider;function MT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var DT=x.createContext(MT()),bk=()=>x.useContext(DT),xk=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ry(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},wk=e=>{x.useEffect(()=>{e.clearReset()},[e])},Sk=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||ry(n,[e.error,a])),kk=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>n(a(...l)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},IT=(e,t)=>e.isLoading&&e.isFetching&&!t,fg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function LT({queries:e,...t},n){const a=fn(),l=vk(),o=bk(),c=x.useMemo(()=>e.map(j=>{const E=a.defaultQueryOptions(j);return E._optimisticResults=l?"isRestoring":"optimistic",E}),[e,a,l]);c.forEach(j=>{kk(j);const E=a.getQueryCache().get(j.queryHash);xk(j,o,E)}),wk(o);const[f]=x.useState(()=>new AT(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Ft.batchCalls(j)):Nn,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const w=m.some((j,E)=>fg(c[E],j))?m.flatMap((j,E)=>{const C=c[E];if(C&&fg(C,j)){const R=new ay(a,C);return hg(C,R,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,E)=>{const C=c[E];return C&&Sk({result:j,errorResetBoundary:o,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function UT(e,t,n){var b,w,k,j;const a=vk(),l=bk(),o=fn(),c=o.defaultQueryOptions(e);(w=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||w.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",kk(c),xk(c,l,f),wk(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=g?h.subscribe(Ft.batchCalls(E)):Nn;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),fg(c,y))throw hg(c,h,l);if(Sk({result:y,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,y),c.experimental_prefetchInRender&&!xu.isServer()&&IT(y,a)){const E=m?hg(c,h,l):f==null?void 0:f.promise;E==null||E.catch(Nn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function Ve(e,t){return UT(e,ay)}function Ct(e,t){const n=fn(),[a]=x.useState(()=>new _T(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Ft.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(Nn)},[a]);if(l.error&&ry(a.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 R1="popstate";function z1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function PT(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return mg("",{pathname:c,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:wu(l)}return $T(t,n,null,e)}function Ot(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _r(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function BT(){return Math.random().toString(36).substring(2,10)}function O1(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 mg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Qs(t):t,state:n,key:t&&t.key||a||BT(),unstable_mask:l}}function wu({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 Qs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function $T(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let E=y(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let R=z1(E)?E:mg(j.location,E,C);h=y()+1;let O=O1(R,h),M=j.createHref(R.unstable_mask||R);try{c.pushState(O,"",M)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(M)}o&&m&&m({action:f,location:j.location,delta:1})}function w(E,C){f="REPLACE";let R=z1(E)?E:mg(j.location,E,C);h=y();let O=O1(R,h),M=j.createHref(R.unstable_mask||R);c.replaceState(O,"",M),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return FT(E)}let j={get action(){return f},get location(){return e(l,c)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(R1,g),m=E,()=>{l.removeEventListener(R1,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:w,go(E){return c.go(E)}};return j}function FT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ot(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:wu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function jk(e,t,n="/"){return qT(e,t,n,!1)}function qT(e,t,n,a){let l=typeof t=="string"?Qs(t):t,o=Ra(l.pathname||"/",n);if(o==null)return null;let c=Ck(e);HT(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=tA(o);f=WT(c[m],h,a)}return f}function Ck(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;Ot(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=ta([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(Ot(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Ck(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:XT(g,c.index),routesMeta:b})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of Ek(c.path))o(c,f,!0,h)}),t}function Ek(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let c=Ek(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function HT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:JT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var ZT=/^:[\w-]+$/,VT=3,QT=2,KT=1,GT=10,YT=-2,M1=e=>e==="*";function XT(e,t){let n=e.split("/"),a=n.length;return n.some(M1)&&(a+=YT),t&&(a+=QT),n.filter(l=>!M1(l)).reduce((l,o)=>l+(ZT.test(o)?VT:o===""?KT:GT),a)}function JT(e,t){return e.length===t.length&&e.slice(0,-1).every((a,l)=>a===t[l])?e[e.length-1]-t[t.length-1]:0}function WT(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=Gd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Gd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:ta([o,g.pathname]),pathnameBase:iA(ta([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=ta([o,g.pathnameBase]))}return c}function Gd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=eA(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[b];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function eA(e,t=!1,n=!0){_r(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function tA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _r(!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 Ra(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var nA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function rA(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Qs(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=D1(n.substring(1),"/"):o=D1(n,t)):o=t,{pathname:o,search:lA(a),hash:sA(l)}}function D1(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 np(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ly(e){let t=aA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function mf(e,t,n,a=!1){let l;typeof e=="string"?l=Qs(e):(l={...e},Ot(!l.pathname||!l.pathname.includes("?"),np("?","pathname","search",l)),Ot(!l.pathname||!l.pathname.includes("#"),np("#","pathname","hash",l)),Ot(!l.search||!l.search.includes("#"),np("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=rA(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var ta=e=>e.join("/").replace(/\/\/+/g,"/"),iA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oA=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function cA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Nk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _k(e,t){let n=e;if(typeof n!="string"||!nA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(Nk)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ra(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{_r(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Tk=["POST","PUT","PATCH","DELETE"];new Set(Tk);var dA=["GET",...Tk];new Set(dA);var Ks=x.createContext(null);Ks.displayName="DataRouter";var pf=x.createContext(null);pf.displayName="DataRouterState";var fA=x.createContext(!1),Ak=x.createContext({isTransitioning:!1});Ak.displayName="ViewTransition";var hA=x.createContext(new Map);hA.displayName="Fetchers";var mA=x.createContext(null);mA.displayName="Await";var fr=x.createContext(null);fr.displayName="Navigation";var qu=x.createContext(null);qu.displayName="Location";var Tr=x.createContext({outlet:null,matches:[],isDataRoute:!1});Tr.displayName="Route";var sy=x.createContext(null);sy.displayName="RouteError";var Rk="REACT_ROUTER_ERROR",pA="REDIRECT",gA="ROUTE_ERROR_RESPONSE";function yA(e){if(e.startsWith(`${Rk}:${pA}:{`))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 vA(e){if(e.startsWith(`${Rk}:${gA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new oA(t.status,t.statusText,t.data)}catch{}}function bA(e,{relative:t}={}){Ot(Gs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(fr),{hash:l,pathname:o,search:c}=Hu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:ta([n,o])),a.createHref({pathname:f,search:c,hash:l})}function Gs(){return x.useContext(qu)!=null}function Yn(){return Ot(Gs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(qu).location}var zk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ok(e){x.useContext(fr).static||x.useLayoutEffect(e)}function Un(){let{isDataRoute:e}=x.useContext(Tr);return e?MA():xA()}function xA(){Ot(Gs(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ks),{basename:t,navigator:n}=x.useContext(fr),{matches:a}=x.useContext(Tr),{pathname:l}=Yn(),o=JSON.stringify(ly(a)),c=x.useRef(!1);return Ok(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(_r(c.current,zk),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=mf(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:ta([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var wA=x.createContext(null);function SA(e){let t=x.useContext(Tr).outlet;return x.useMemo(()=>t&&x.createElement(wA.Provider,{value:e},t),[t,e])}function Mk(){let{matches:e}=x.useContext(Tr),t=e[e.length-1];return t?t.params:{}}function Hu(e,{relative:t}={}){let{matches:n}=x.useContext(Tr),{pathname:a}=Yn(),l=JSON.stringify(ly(n));return x.useMemo(()=>mf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function kA(e,t){return Dk(e,t)}function Dk(e,t,n){var E;Ot(Gs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(fr),{matches:l}=x.useContext(Tr),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";Lk(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=Yn(),g;if(t){let C=typeof t=="string"?Qs(t):t;Ot(m==="/"||((E=C.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 "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=y;let b=g.pathname||"/",w=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=jk(e,{pathname:w});_r(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),_r(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=_A(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:ta([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:ta([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(qu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function jA(){let e=OA(),t=uA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,c)}var CA=x.createElement(jA,null),Ik=class extends x.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=vA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Tr.Provider,{value:this.props.routeContext},x.createElement(sy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(EA,{error:e},t):t}};Ik.contextType=fA;var rp=new WeakMap;function EA({children:e,error:t}){let{basename:n}=x.useContext(fr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=yA(t.digest);if(a){let l=rp.get(t);if(l)throw l;let o=_k(a.location,n);if(Nk&&!rp.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw rp.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function NA({routeContext:e,match:t,children:n}){let a=x.useContext(Ks);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Tr.Provider,{value:e},n)}function _A(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Ot(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 c=!1,f=-1;if(n&&a){c=a.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:w}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var b,w;m(y,{location:a.location,params:((w=(b=a.matches)==null?void 0:b[0])==null?void 0:w.params)??{},unstable_pattern:cA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let w,k=!1,j=null,E=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||CA,c&&(f<0&&b===0?(Lk("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 C=t.concat(l.slice(0,b+1)),R=()=>{let O;return w?O=j:k?O=E:g.route.Component?O=x.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,x.createElement(NA,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(Ik,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:R(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):R()},null)}function oy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TA(e){let t=x.useContext(Ks);return Ot(t,oy(e)),t}function AA(e){let t=x.useContext(pf);return Ot(t,oy(e)),t}function RA(e){let t=x.useContext(Tr);return Ot(t,oy(e)),t}function uy(e){let t=RA(e),n=t.matches[t.matches.length-1];return Ot(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function zA(){return uy("useRouteId")}function OA(){var a;let e=x.useContext(sy),t=AA("useRouteError"),n=uy("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function MA(){let{router:e}=TA("useNavigate"),t=uy("useNavigate"),n=x.useRef(!1);return Ok(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{_r(n.current,zk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var I1={};function Lk(e,t,n){!t&&!I1[e]&&(I1[e]=!0,_r(!1,n))}x.memo(DA);function DA({routes:e,future:t,state:n,isStatic:a,onError:l}){return Dk(e,void 0,{state:n,isStatic:a,onError:l})}function ur({to:e,replace:t,state:n,relative:a}){Ot(Gs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(fr);_r(!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}=x.useContext(Tr),{pathname:c}=Yn(),f=Un(),m=mf(e,ly(o),c,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function Us(e){return SA(e.context)}function zt(e){Ot(!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 IA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){Ot(!Gs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:c,future:{}}),[f,l,o,c]);typeof n=="string"&&(n=Qs(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:w="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Ra(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,b,w,a,k]);return _r(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:x.createElement(fr.Provider,{value:m},x.createElement(qu.Provider,{children:t,value:j}))}function LA({children:e,location:t}){return kA(pg(e),t)}function pg(e,t=[]){let n=[];return x.Children.forEach(e,(a,l)=>{if(!x.isValidElement(a))return;let o=[...t,l];if(a.type===x.Fragment){n.push.apply(n,pg(a.props.children,o));return}Ot(a.type===zt,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ot(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=pg(a.props.children,o)),n.push(c)}),n}var Bd="get",$d="application/x-www-form-urlencoded";function gf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function UA(e){return gf(e)&&e.tagName.toLowerCase()==="button"}function PA(e){return gf(e)&&e.tagName.toLowerCase()==="form"}function BA(e){return gf(e)&&e.tagName.toLowerCase()==="input"}function $A(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function FA(e,t){return e.button===0&&(!t||t==="_self")&&!$A(e)}function gg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(l=>[n,l]):[[n,a]])},[]))}function qA(e,t){let n=gg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var xd=null;function HA(){if(xd===null)try{new FormData(document.createElement("form"),0),xd=!1}catch{xd=!0}return xd}var ZA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ap(e){return e!=null&&!ZA.has(e)?(_r(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$d}"`),null):e}function VA(e,t){let n,a,l,o,c;if(PA(e)){let f=e.getAttribute("action");a=f?Ra(f,t):null,n=e.getAttribute("method")||Bd,l=ap(e.getAttribute("enctype"))||$d,o=new FormData(e)}else if(UA(e)||BA(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(a=m?Ra(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Bd,l=ap(e.getAttribute("formenctype"))||ap(f.getAttribute("enctype"))||$d,o=new FormData(f,e),!HA()){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(gf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Bd,a=null,l=$d,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cy(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function QA(e,t,n,a){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}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&Ra(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function KA(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 GA(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 YA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await KA(o,n);return c.links?c.links():[]}return[]}));return eR(a.flat(1).filter(GA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function L1(e,t,n,a,l,o){let c=(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)=>c(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(c(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 XA(e,t,{includeHydrateFallback:n}={}){return JA(e.map(a=>{let l=t.routes[a.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 JA(e){return[...new Set(e)]}function WA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function eR(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(WA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function Uk(){let e=x.useContext(Ks);return cy(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tR(){let e=x.useContext(pf);return cy(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var dy=x.createContext(void 0);dy.displayName="FrameworkContext";function Pk(){let e=x.useContext(dy);return cy(e,"You must render this element inside a <HydratedRouter> element"),e}function nR(e,t){let n=x.useContext(dy),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(R=>{c(R.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:Wo(f,w),onBlur:Wo(m,k),onMouseEnter:Wo(h,w),onMouseLeave:Wo(y,k),onTouchStart:Wo(g,w)}]:[!1,b,{}]}function Wo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rR({page:e,...t}){let{router:n}=Uk(),a=x.useMemo(()=>jk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(iR,{page:e,matches:a,...t}):null}function aR(e){let{manifest:t,routeModules:n}=Pk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return YA(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function iR({page:e,matches:t,...n}){let a=Yn(),{future:l,manifest:o,routeModules:c}=Pk(),{basename:f}=Uk(),{loaderData:m,matches:h}=tR(),y=x.useMemo(()=>L1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>L1(e,t,h,o,a,"assets"),[e,t,h,o,a]),b=x.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(R=>{var M;let O=o.routes[R.route.id];!O||!O.hasLoader||(!y.some(B=>B.route.id===R.route.id)&&R.route.id in m&&((M=c[R.route.id])!=null&&M.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(R.route.id))}),j.size===0)return[];let C=QA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),w=x.useMemo(()=>XA(g,o),[g,o]),k=aR(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function lR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var sR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sR&&(window.__reactRouterVersion="7.13.1")}catch{}function oR({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=PT({window:a,v5Compat:!0}));let o=l.current,[c,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(IA,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var Bk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zu=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w,...k},j){let{basename:E,navigator:C,unstable_useTransitions:R}=x.useContext(fr),O=typeof y=="string"&&Bk.test(y),M=_k(y,E);y=M.to;let B=bA(y,{relative:l}),z=Yn(),$=null;if(f){let J=mf(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);E!=="/"&&(J.pathname=J.pathname==="/"?E:ta([E,J.pathname])),$=C.createHref(J)}let[U,Q,I]=nR(a,k),ne=dR(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:R});function le(J){t&&t(J),J.defaultPrevented||ne(J)}let we=!(M.isExternal||o),Y=x.createElement("a",{...k,...I,href:(we?$:void 0)||M.absoluteURL||B,onClick:we?le:t,ref:lR(j,Q),target:h,"data-discover":!O&&n==="render"?"true":void 0});return U&&!O?x.createElement(x.Fragment,null,Y,x.createElement(rR,{page:B})):Y});Zu.displayName="Link";var yf=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},y){let g=Hu(c,{relative:h.relative}),b=Yn(),w=x.useContext(pf),{navigator:k,basename:j}=x.useContext(fr),E=w!=null&&gR(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,R=b.pathname,O=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(R=R.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=Ra(O,j)||O);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let B=R===C||!l&&R.startsWith(C)&&R.charAt(M)==="/",z=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),$={isActive:B,isPending:z,isTransitioning:E},U=B?t:void 0,Q;typeof a=="function"?Q=a($):Q=[a,B?"active":null,z?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let I=typeof o=="function"?o($):o;return x.createElement(Zu,{...h,"aria-current":U,className:Q,ref:y,style:I,to:c,viewTransition:f},typeof m=="function"?m($):m)});yf.displayName="NavLink";var uR=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Bd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...w},k)=>{let{unstable_useTransitions:j}=x.useContext(fr),E=mR(),C=pR(f,{relative:h}),R=c.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&Bk.test(f),M=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let z=B.nativeEvent.submitter,$=(z==null?void 0:z.getAttribute("formmethod"))||c,U=()=>E(z||B.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>U()):U()};return x.createElement("form",{ref:k,method:R,action:C,onSubmit:a?m:M,...w,"data-discover":!O&&e==="render"?"true":void 0})});uR.displayName="Form";function cR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $k(e){let t=x.useContext(Ks);return Ot(t,cR(e)),t}function dR(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=Un(),g=Yn(),b=Hu(e,{relative:c});return x.useCallback(w=>{if(FA(w,t)){w.preventDefault();let k=n!==void 0?n:wu(g)===wu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,c,f,m,h])}function Fk(e){_r(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=x.useRef(gg(e)),n=x.useRef(!1),a=Yn(),l=x.useMemo(()=>qA(a.search,n.current?null:t.current),[a.search]),o=Un(),c=x.useCallback((f,m)=>{const h=gg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var fR=0,hR=()=>`__${String(++fR)}__`;function mR(){let{router:e}=$k("useSubmit"),{basename:t}=x.useContext(fr),n=zA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=VA(o,t);if(c.navigate===!1){let b=c.fetcherKey||hR();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,l,t,n])}function pR(e,{relative:t}={}){let{basename:n}=x.useContext(fr),a=x.useContext(Tr);Ot(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Hu(e||".",{relative:t})},c=Yn();if(e==null){o.search=c.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:ta([n,o.pathname])),wu(o)}function gR(e,{relative:t}={}){let n=x.useContext(Ak);Ot(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=$k("useViewTransitionState"),l=Hu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ra(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Ra(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Gd(l.pathname,c)!=null||Gd(l.pathname,o)!=null}const yR="/api/v1";async function vR(e,t){const n=await fetch(`${yR}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const a=await n.text();let l;try{l=JSON.parse(a).error??a}catch{l=a}throw new Error(l)}return await n.json()}const qk="/api/v1",fy="first-tree-hub:tokens";let yg=null;function eu(e){yg=e}function hn(e){if(!yg)throw new Error(`withOrg("${e}") called before an organization is selected`);return`/orgs/${encodeURIComponent(yg)}${e}`}function U1(e,t){return`/orgs/${encodeURIComponent(e)}${t}`}function vf(){const e=localStorage.getItem(fy);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function vg(e){localStorage.setItem(fy,JSON.stringify(e))}function Hk(){localStorage.removeItem(fy)}class Vu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let tu=null;async function bR(){const e=vf();return e!=null&&e.refreshToken?Zk(e.refreshToken):null}async function Zk(e){return tu||(tu=(async()=>{try{const t=await fetch(`${qk}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),a={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return vg(a),a}catch{return null}finally{tu=null}})(),tu)}async function wd(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${qk}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=vf();let c=await l(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await Zk(o.refreshToken);f&&(c=await l(f.accessToken))}if(!c.ok){c.status===401&&(Hk(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await c.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 Vu(c.status,m,h)}if(c.status!==204)return await c.json()}const Ee={get:e=>wd(e),post:(e,t)=>wd(e,{method:"POST",body:t}),patch:(e,t)=>wd(e,{method:"PATCH",body:t}),delete:e=>wd(e,{method:"DELETE"})},hy="onboarding:joinPath",xR="onboarding:draft";function Vk(e){typeof window>"u"||window.sessionStorage.setItem(hy,e)}function wR(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(hy);return e==="solo"||e==="invite"?e:null}function SR(){typeof window>"u"||window.sessionStorage.removeItem(hy)}function kR(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function my(e){return`${xR}:${e}`}function jR(e){if(!e||typeof e!="object"||!("displayName"in e)||typeof e.displayName!="string")return null;const t="selectedRuntime"in e?e.selectedRuntime:null;if(t!==null&&typeof t!="string")return null;const n="connectToken"in e?e.connectToken:null;if(n!==null&&typeof n!="string")return null;const a="connectTokenExpiresAt"in e?e.connectTokenExpiresAt:null;return a!==null&&typeof a!="number"?null:{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a}}function CR(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(my(e));if(!t)return null;try{return jR(JSON.parse(t))}catch{return null}}function ER(e,t){typeof window>"u"||window.sessionStorage.setItem(my(e),JSON.stringify(t))}function NR(e){typeof window>"u"||window.sessionStorage.removeItem(my(e))}const Qk=x.createContext(null),bg="first-tree-hub:selectedOrganizationId";function _R(){try{return localStorage.getItem(bg)}catch{return null}}function ip(e){try{e===null?localStorage.removeItem(bg):localStorage.setItem(bg,e)}catch{}}function TR({children:e}){const t=fn(),[n,a]=x.useState(()=>!!vf()),[l,o]=x.useState(null),[c,f]=x.useState([]),[m,h]=x.useState(()=>{const M=_R();return eu(M),M}),[y,g]=x.useState(null),[b,w]=x.useState(!1),k=x.useCallback(()=>{Hk(),ip(null),eu(null),t.clear(),a(!1),o(null),f([]),h(null),g(null),w(!1)},[t]),j=x.useCallback(async()=>{var M;try{const B=await Ee.get("/me");o(B.user??null);const z=B.memberships??[];f(z);const $=((M=B.wizard)==null?void 0:M.step)??null;g($),$==="completed"&&SR(),h(U=>{var ne;const Q=U&&z.some(le=>le.organizationId===U)?U:null;if(Q)return eu(Q),Q;const I=B.defaultOrganizationId??((ne=z[0])==null?void 0:ne.organizationId)??null;return ip(I),eu(I),I})}catch{}finally{w(!0)}},[]),E=x.useCallback(async(M,B)=>{const z=await vR(M,B);vg({accessToken:z.accessToken,refreshToken:z.refreshToken}),a(!0),await j()},[j]),C=x.useCallback(async M=>{vg(M),a(!0),await j()},[j]),R=x.useCallback(async M=>{ip(M),eu(M),t.clear(),h(M),await j()},[j,t]);x.useEffect(()=>{n&&!l&&j()},[n,l,j]),x.useEffect(()=>{const M=()=>k();return window.addEventListener("auth:logout",M),()=>window.removeEventListener("auth:logout",M)},[k]);const O=x.useMemo(()=>c.length===0?null:c.find(B=>B.organizationId===m)??c[0]??null,[c,m]);return u.jsx(Qk.Provider,{value:{isAuthenticated:n,meLoaded:b,user:l,memberships:c,currentMembership:O,organizationId:(O==null?void 0:O.organizationId)??null,memberId:(O==null?void 0:O.id)??null,role:(O==null?void 0:O.role)??null,agentId:(O==null?void 0:O.agentId)??null,wizardStep:y,login:E,adoptTokens:C,selectOrganization:R,refreshMe:j,logout:k},children:e})}function Dt(){const e=x.useContext(Qk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const AR="modulepreload",RR=function(e){return"/"+e},P1={},zR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(n.map(h=>{if(h=RR(h),h in P1)return;P1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":AR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,k)=>{b.addEventListener("load",w),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},OR=x.lazy(()=>zR(()=>import("./index-CD7rTdqm.js"),[]).then(e=>({default:e.LandingPage}))),B1=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function MR(){const{isAuthenticated:e,meLoaded:t}=Dt(),n=Yn();return e?t?u.jsx(Us,{}):u.jsx(B1,{}):n.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(B1,{}),children:u.jsx(OR,{})}):u.jsx(ur,{to:"/login",replace:!0,state:{from:n}})}/**
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 Kk=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.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 DR=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 IR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.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 $1=e=>{const t=IR(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 LR={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 UR=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 PR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},m)=>x.createElement("svg",{ref:m,...LR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Kk("lucide",l),...!o&&!UR(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>x.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 st=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(PR,{ref:o,iconNode:t,className:Kk(`lucide-${DR($1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=$1(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 BR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],py=st("arrow-left",BR);/**
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 $R=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],FR=st("arrow-right",$R);/**
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 qR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Gk=st("arrow-up",qR);/**
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 HR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],ZR=st("at-sign",HR);/**
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 VR=[["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"}]],QR=st("bell",VR);/**
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 KR=[["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"}]],GR=st("bot",KR);/**
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 YR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$r=st("check",YR);/**
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 XR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yk=st("chevron-down",XR);/**
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 JR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],WR=st("chevron-right",JR);/**
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 ez=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tz=st("circle-check",ez);/**
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 nz=[["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"}]],gy=st("copy",nz);/**
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 rz=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],az=st("eye-off",rz);/**
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 iz=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xk=st("eye",iz);/**
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 lz=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],sz=st("folder-tree",lz);/**
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 oz=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Jk=st("github",oz);/**
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 uz=[["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"}]],cz=st("layout-dashboard",uz);/**
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 dz=[["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"}]],xg=st("link-2",dz);/**
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 fz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],hz=st("loader-circle",fz);/**
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 mz=[["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"}]],Wk=st("lock",mz);/**
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 pz=[["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"}]],gz=st("log-out",pz);/**
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 yz=[["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"}]],yy=st("message-square",yz);/**
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 vz=[["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"}]],bz=st("moon",vz);/**
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 xz=[["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"}]],wz=st("paperclip",xz);/**
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 Sz=[["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"}]],bf=st("pencil",Sz);/**
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 kz=[["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"}]],ej=st("play",kz);/**
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 jz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fr=st("plus",jz);/**
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 Cz=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ez=st("refresh-cw",Cz);/**
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 Nz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vy=st("search",Nz);/**
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 _z=[["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"}]],Tz=st("sun",_z);/**
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 Az=[["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=st("trash-2",Az);/**
251
+ * @license lucide-react v0.577.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const Rz=[["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"}]],Ys=st("triangle-alert",Rz);/**
256
+ * @license lucide-react v0.577.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const zz=[["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"}]],Oz=st("undo-2",zz);/**
261
+ * @license lucide-react v0.577.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const Mz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],tj=st("user-plus",Mz);/**
266
+ * @license lucide-react v0.577.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const Dz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ku=st("x",Dz);/**
271
+ * @license lucide-react v0.577.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const Iz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Lz=st("zap",Iz);function nj(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=nj(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function rj(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=nj(e))&&(a&&(a+=" "),a+=t);return a}const Uz=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},Pz=(e,t)=>({classGroupId:e,validator:t}),aj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Yd="-",F1=[],Bz="arbitrary..",$z=e=>{const t=qz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Fz(c);const f=c.split(Yd),m=f[0]===""&&f.length>1?1:0;return ij(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?Uz(h,m):m:h||F1}return n[c]||F1}}},ij=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=ij(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Yd):e.slice(t).join(Yd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},Fz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?Bz+a:void 0})(),qz=e=>{const{theme:t,classGroups:n}=e;return Hz(n,t)},Hz=(e,t)=>{const n=aj();for(const a in e){const l=e[a];by(l,n,a,t)}return n},by=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Zz(c,t,n,a)}},Zz=(e,t,n,a)=>{if(typeof e=="string"){Vz(e,t,n);return}if(typeof e=="function"){Qz(e,t,n,a);return}Kz(e,t,n,a)},Vz=(e,t,n)=>{const a=e===""?t:lj(t,e);a.classGroupId=n},Qz=(e,t,n,a)=>{if(Gz(e)){by(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Pz(n,e))},Kz=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];by(m,lj(t,f),n,a)}},lj=(e,t)=>{let n=e;const a=t.split(Yd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=aj(),n.nextPart.set(c,f)),n=f}return n},Gz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Yz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},wg="!",q1=":",Xz=[],H1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Jz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(c===0&&f===0){if(E===q1){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,w=!1;g.endsWith(wg)?(b=g.slice(0,-1),w=!0):g.startsWith(wg)&&(b=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return H1(o,w,b,k)};if(t){const l=t+q1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):H1(Xz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Wz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],f=c[0]==="[",m=t.has(c);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},eO=e=>({cache:Yz(e.cacheSize),parseClassName:Jz(e),sortModifiers:Wz(e),...$z(e)}),tO=/\s+/,nO=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(tO);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=y+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=y+(m.length>0?" "+m:m);continue}E=!1}const R=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=w?R+wg:R,M=O+C;if(c.indexOf(M)>-1)continue;c.push(M);const B=l(C,E);for(let z=0;z<B.length;++z){const $=B[z];c.push(O+$)}m=y+(m.length>0?" "+m:m)}return m},rO=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=sj(n))&&(l&&(l+=" "),l+=a);return l},sj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=sj(e[a]))&&(n&&(n+=" "),n+=t);return n},aO=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=eO(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const y=nO(m,n);return l(m,y),y};return o=c,(...m)=>o(rO(...m))},iO=[],an=e=>{const t=n=>n[e]||iO;return t.isThemeGetter=!0,t},oj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oO=/\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$/,uO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>lO.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),lp=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),ka=e=>sO.test(e),cj=()=>!0,fO=e=>oO.test(e)&&!uO.test(e),xy=()=>!1,hO=e=>cO.test(e),mO=e=>dO.test(e),pO=e=>!Ce(e)&&!Ne(e),gO=e=>zi(e,hj,xy),Ce=e=>oj.test(e),rl=e=>zi(e,mj,fO),Z1=e=>zi(e,jO,Ke),yO=e=>zi(e,gj,cj),vO=e=>zi(e,pj,xy),V1=e=>zi(e,dj,xy),bO=e=>zi(e,fj,mO),Sd=e=>zi(e,yj,hO),Ne=e=>uj.test(e),nu=e=>wl(e,mj),xO=e=>wl(e,pj),Q1=e=>wl(e,dj),wO=e=>wl(e,hj),SO=e=>wl(e,fj),kd=e=>wl(e,yj,!0),kO=e=>wl(e,gj,!0),zi=(e,t,n)=>{const a=oj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},wl=(e,t,n=!1)=>{const a=uj.exec(e);return a?a[1]?t(a[1]):n:!1},dj=e=>e==="position"||e==="percentage",fj=e=>e==="image"||e==="url",hj=e=>e==="length"||e==="size"||e==="bg-size",mj=e=>e==="length",jO=e=>e==="number",pj=e=>e==="family-name",gj=e=>e==="number"||e==="weight",yj=e=>e==="shadow",CO=()=>{const e=an("color"),t=an("font"),n=an("text"),a=an("font-weight"),l=an("tracking"),o=an("leading"),c=an("breakpoint"),f=an("container"),m=an("spacing"),h=an("radius"),y=an("shadow"),g=an("inset-shadow"),b=an("text-shadow"),w=an("drop-shadow"),k=an("blur"),j=an("perspective"),E=an("aspect"),C=an("ease"),R=an("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...M(),Ne,Ce],z=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],U=()=>[Ne,Ce,m],Q=()=>[oi,"full","auto",...U()],I=()=>[ui,"none","subgrid",Ne,Ce],ne=()=>["auto",{span:["full",ui,Ne,Ce]},ui,Ne,Ce],le=()=>[ui,"auto",Ne,Ce],we=()=>["auto","min","max","fr",Ne,Ce],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...U()],ee=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],be=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Ae=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],A=()=>[e,Ne,Ce],L=()=>[...M(),Q1,V1,{position:[Ne,Ce]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",wO,gO,{size:[Ne,Ce]}],Z=()=>[lp,nu,rl],W=()=>["","none","full",h,Ne,Ce],ce=()=>["",Ke,nu,rl],ve=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Ke,lp,Q1,V1],Qe=()=>["","none",k,Ne,Ce],Oe=()=>["none",Ke,Ne,Ce],ut=()=>["none",Ke,Ne,Ce],re=()=>[Ke,Ne,Ce],Se=()=>[oi,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ka],breakpoint:[ka],color:[cj],container:[ka],"drop-shadow":[ka],ease:["in","out","in-out"],font:[pO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ka],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ka],shadow:[ka],spacing:["px",Ke],text:[ka],"text-shadow":[ka],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,Ce,Ne,E]}],container:["container"],columns:[{columns:[Ke,Ce,Ne,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",Ne,Ce]}],basis:[{basis:[oi,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,oi,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Ne,Ce]}],shrink:[{shrink:["",Ke,Ne,Ce]}],order:[{order:[ui,"first","last","none",Ne,Ce]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...be()]}],"min-inline-size":[{"min-inline":["auto",...be()]}],"max-inline-size":[{"max-inline":["none",...be()]}],"block-size":[{block:["auto",...Ae()]}],"min-block-size":[{"min-block":["auto",...Ae()]}],"max-block-size":[{"max-block":["none",...Ae()]}],w:[{w:[f,"screen",...ee()]}],"min-w":[{"min-w":[f,"screen","none",...ee()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,nu,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,kO,yO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lp,Ce]}],"font-family":[{font:[xO,vO,t]}],"font-features":[{"font-features":[Ce]}],"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,Ne,Ce]}],"line-clamp":[{"line-clamp":[Ke,"none",Ne,Z1]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ne,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ne,rl]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ne,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,Ce]}],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",Ne,Ce]}],"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:P()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,Ne,Ce],radial:["",Ne,Ce],conic:[ui,Ne,Ce]},SO,bO]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ne,Ce]}],"outline-w":[{outline:["",Ke,nu,rl]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,kd,Sd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,kd,Sd]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ke,rl]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,kd,Sd]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ke,Ne,Ce]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ne,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,Ce]}],filter:[{filter:["","none",Ne,Ce]}],blur:[{blur:Qe()}],brightness:[{brightness:[Ke,Ne,Ce]}],contrast:[{contrast:[Ke,Ne,Ce]}],"drop-shadow":[{"drop-shadow":["","none",w,kd,Sd]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ke,Ne,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Ne,Ce]}],invert:[{invert:["",Ke,Ne,Ce]}],saturate:[{saturate:[Ke,Ne,Ce]}],sepia:[{sepia:["",Ke,Ne,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,Ce]}],"backdrop-blur":[{"backdrop-blur":Qe()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ne,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ne,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ne,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ne,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ne,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ne,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ne,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ne,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ne,Ce]}],ease:[{ease:["linear","initial",C,Ne,Ce]}],delay:[{delay:[Ke,Ne,Ce]}],animate:[{animate:["none",R,Ne,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ne,Ce]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:ut()}],"scale-x":[{"scale-x":ut()}],"scale-y":[{"scale-y":ut()}],"scale-z":[{"scale-z":ut()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[Ne,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Ne,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ne,Ce]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ke,nu,rl,Z1]}],stroke:[{stroke:["none",...A()]}],"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"]}},EO=aO(CO);function Te(...e){return EO(rj(e))}function ju(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 vj(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(e)):"—"}function NO(e){return Ee.delete(`/clients/${encodeURIComponent(e)}`)}function Qu(){return Ee.get(hn("/activity"))}function Ni(){return Ee.get("/me/clients")}function wy(e){return Ee.get(`/clients/${e}`)}function _O(e){return Ee.post(`/clients/${e}/disconnect`)}function TO(){return Ee.post("/me/connect-tokens")}const K1=e=>["agent-sessions",e];function AO(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 RO(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 zO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function bj(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 a=n.toString();return Ee.get(`/agents/${e}/sessions${a?`?${a}`:""}`)}function OO(e,t,n){const a=new URLSearchParams;a.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&a.set("cursor",String(n.cursor)),n!=null&&n.direction&&a.set("direction",n.direction);const l=a.toString();return Ee.get(`/agents/${e}/sessions/${t}/events${l?`?${l}`:""}`)}var G1=1,MO=.9,DO=.8,IO=.17,sp=.1,op=.999,LO=.9999,UO=.99,PO=/[\\\/_+.#"@\[\(\{&]/,BO=/[\\\/_+.#"@\[\(\{&]/g,$O=/[\s-]/,xj=/[\s-]/g;function Sg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?G1:UO;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,w,k;h>=0;)g=Sg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=G1:PO.test(e.charAt(h-1))?(g*=DO,w=e.slice(l,h-1).match(BO),w&&l>0&&(g*=Math.pow(op,w.length))):$O.test(e.charAt(h-1))?(g*=MO,k=e.slice(l,h-1).match(xj),k&&l>0&&(g*=Math.pow(op,k.length))):(g*=IO,l>0&&(g*=Math.pow(op,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=LO)),(g<sp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Sg(e,t,n,a,h+1,o+2,c),b*sp>g&&(g=b*sp)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function Y1(e){return e.toLowerCase().replace(xj," ")}function FO(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Sg(e,t,Y1(e),Y1(t),0,0,{})}function Ei(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 X1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _i(...e){return t=>{let n=!1;const a=e.map(l=>{const o=X1(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<a.length;l++){const o=a[l];typeof o=="function"?o():X1(e[l],null)}}}}function Sl(...e){return x.useCallback(_i(...e),e)}function qO(e,t){const n=x.createContext(t),a=o=>{const{children:c,...f}=o,m=x.useMemo(()=>f,Object.values(f));return u.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function l(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function HO(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var C;const{scope:b,children:w,...k}=g,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:E,children:w})};h.displayName=o+"Provider";function y(g,b){var j;const w=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(w);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(c=>x.createContext(c));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,ZO(l,...t)]}function ZO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Cu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},VO=Jg[" useId ".trim().toString()]||(()=>{}),QO=0;function Ta(e){const[t,n]=x.useState(VO());return Cu(()=>{n(a=>a??String(QO++))},[e]),t?`radix-${t}`:""}var KO=Jg[" useInsertionEffect ".trim().toString()]||Cu;function GO({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=YO({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} 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,a])}const h=x.useCallback(y=>{var g;if(f){const b=XO(y)?y(e):y;b!==e&&((g=c.current)==null||g.call(c,b))}else o(y)},[f,e,o,c]);return[m,h]}function YO({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return KO(()=>{o.current=t},[t]),x.useEffect(()=>{var c;l.current!==n&&((c=o.current)==null||c.call(o,n),l.current=n)},[n,l]),[n,a,o]}function XO(e){return typeof e=="function"}var Sy=lk();const JO=hf(Sy);function wj(e){const t=WO(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(t3);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function WO(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=r3(l),f=n3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e3=Symbol("radix.slottable");function t3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e3}function n3(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function r3(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.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 a3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],za=a3.reduce((e,t)=>{const n=wj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function i3(e,t){e&&Sy.flushSync(()=>e.dispatchEvent(t))}function Eu(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function l3(e,t=globalThis==null?void 0:globalThis.document){const n=Eu(e);x.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var s3="DismissableLayer",kg="dismissableLayer.update",o3="dismissableLayer.pointerDownOutside",u3="dismissableLayer.focusOutside",J1,Sj=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(Sj),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),k=Sl(t,$=>g($)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),R=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,M=R>=C,B=f3($=>{const U=$.target,Q=[...h.branches].some(I=>I.contains(U));!M||Q||(l==null||l($),c==null||c($),$.defaultPrevented||f==null||f())},b),z=h3($=>{const U=$.target;[...h.branches].some(I=>I.contains(U))||(o==null||o($),c==null||c($),$.defaultPrevented||f==null||f())},b);return l3($=>{R===h.layers.size-1&&(a==null||a($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(J1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),W1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=J1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),W1())},[y,h]),x.useEffect(()=>{const $=()=>w({});return document.addEventListener(kg,$),()=>document.removeEventListener(kg,$)},[]),u.jsx(za.div,{...m,ref:k,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:Ei(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Ei(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ei(e.onPointerDownCapture,B.onPointerDownCapture)})});kj.displayName=s3;var c3="DismissableLayerBranch",d3=x.forwardRef((e,t)=>{const n=x.useContext(Sj),a=x.useRef(null),l=Sl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(za.div,{...e,ref:l})});d3.displayName=c3;function f3(e,t=globalThis==null?void 0:globalThis.document){const n=Eu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){jj(o3,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);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function h3(e,t=globalThis==null?void 0:globalThis.document){const n=Eu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&jj(u3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function W1(){const e=new CustomEvent(kg);document.dispatchEvent(e)}function jj(e,t,n,{discrete:a}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?i3(l,o):l.dispatchEvent(o)}var up="focusScope.autoFocusOnMount",cp="focusScope.autoFocusOnUnmount",ew={bubbles:!1,cancelable:!0},m3="FocusScope",Cj=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=Eu(l),y=Eu(o),g=x.useRef(null),b=Sl(t,j=>m(j)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(w.paused||!f)return;const M=O.target;f.contains(M)?g.current=M:fi(g.current,{select:!0})},E=function(O){if(w.paused||!f)return;const M=O.relatedTarget;M!==null&&(f.contains(M)||fi(g.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const B of O)B.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const R=new MutationObserver(C);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),R.disconnect()}}},[a,f,w.paused]),x.useEffect(()=>{if(f){nw.add(w);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(up,ew);f.addEventListener(up,h),f.dispatchEvent(C),C.defaultPrevented||(p3(x3(Ej(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(up,h),setTimeout(()=>{const C=new CustomEvent(cp,ew);f.addEventListener(cp,y),f.dispatchEvent(C),C.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(cp,y),nw.remove(w)},0)}}},[f,h,y,w]);const k=x.useCallback(j=>{if(!n&&!a||w.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const R=j.currentTarget,[O,M]=g3(R);O&&M?!j.shiftKey&&C===M?(j.preventDefault(),n&&fi(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&fi(M,{select:!0})):C===R&&j.preventDefault()}},[n,a,w.paused]);return u.jsx(za.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});Cj.displayName=m3;function p3(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function g3(e){const t=Ej(e),n=tw(t,e),a=tw(t.reverse(),e);return[n,a]}function Ej(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function tw(e,t){for(const n of e)if(!y3(n,{upTo:t}))return n}function y3(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 v3(e){return e instanceof HTMLInputElement&&"select"in e}function fi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&v3(e)&&t&&e.select()}}var nw=b3();function b3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=rw(e,t),e.unshift(t)},remove(t){var n;e=rw(e,t),(n=e[0])==null||n.resume()}}}function rw(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function x3(e){return e.filter(t=>t.tagName!=="A")}var w3="Portal",Nj=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Cu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?JO.createPortal(u.jsx(za.div,{...a,ref:t}),c):null});Nj.displayName=w3;function S3(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var xf=e=>{const{present:t,children:n}=e,a=k3(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=Sl(a.ref,j3(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};xf.displayName="Presence";function k3(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=S3(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=jd(a.current);o.current=f==="mounted"?h:"none"},[f]),Cu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,w=jd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Cu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=jd(a.current).includes(CSS.escape(w.animationName));if(w.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=w=>{w.target===t&&(o.current=jd(a.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:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function jd(e){return(e==null?void 0:e.animationName)||"none"}function j3(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.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 dp=0;function C3(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??aw()),document.body.insertAdjacentElement("beforeend",e[1]??aw()),dp++,()=>{dp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),dp--}},[])}function aw(){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 ea=function(){return ea=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ea.apply(this,arguments)};function _j(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function E3(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var Fd="right-scroll-bar-position",qd="width-before-scroll-bar",N3="with-scroll-bars-hidden",_3="--removed-body-scroll-bar-size";function fp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function T3(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var A3=typeof window<"u"?x.useLayoutEffect:x.useEffect,iw=new WeakMap;function R3(e,t){var n=T3(null,function(a){return e.forEach(function(l){return fp(l,a)})});return A3(function(){var a=iw.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||fp(f,null)}),o.forEach(function(f){l.has(f)||fp(f,c)})}iw.set(n,e)},[e]),n}function z3(e){return e}function O3(e,t){t===void 0&&(t=z3);var n=[],a=!1,l={read:function(){if(a)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 c=t(o,a);return n.push(c),function(){n=n.filter(function(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var y=c;c=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return l}function M3(e){e===void 0&&(e={});var t=O3(null);return t.options=ea({async:!0,ssr:!1},e),t}var Tj=function(e){var t=e.sideCar,n=_j(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,ea({},n))};Tj.isSideCarExport=!0;function D3(e,t){return e.useMedium(t),Tj}var Aj=M3(),hp=function(){},wf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:hp,onWheelCapture:hp,onTouchMoveCapture:hp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,R=C===void 0?"div":C,O=e.gapMode,M=_j(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=b,z=R3([n,t]),$=ea(ea({},M),l);return x.createElement(x.Fragment,null,y&&x.createElement(B,{sideCar:Aj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),c?x.cloneElement(x.Children.only(f),ea(ea({},$),{ref:z})):x.createElement(R,ea({},$,{className:m,ref:z}),f))});wf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wf.classNames={fullWidth:qd,zeroRight:Fd};var I3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function L3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=I3();return t&&e.setAttribute("nonce",t),e}function U3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function P3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var B3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=L3())&&(U3(t,n),P3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$3=function(){var e=B3();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Rj=function(){var e=$3(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},F3={left:0,top:0,right:0,gap:0},mp=function(e){return parseInt(e||"",10)||0},q3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[mp(n),mp(a),mp(l)]},H3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return F3;var t=q3(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},Z3=Rj(),xs="data-scroll-locked",V3=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
276
+ .`.concat(N3,` {
277
+ overflow: hidden `).concat(a,`;
278
+ padding-right: `).concat(f,"px ").concat(a,`;
279
+ }
280
+ body[`).concat(xs,`] {
281
+ overflow: hidden `).concat(a,`;
282
+ overscroll-behavior: contain;
283
+ `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
284
+ padding-left: `.concat(l,`px;
285
+ padding-top: `).concat(o,`px;
286
+ padding-right: `).concat(c,`px;
287
+ margin-left:0;
288
+ margin-top:0;
289
+ margin-right: `).concat(f,"px ").concat(a,`;
290
+ `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
291
+ }
292
+
293
+ .`).concat(Fd,` {
294
+ right: `).concat(f,"px ").concat(a,`;
295
+ }
296
+
297
+ .`).concat(qd,` {
298
+ margin-right: `).concat(f,"px ").concat(a,`;
299
+ }
300
+
301
+ .`).concat(Fd," .").concat(Fd,` {
302
+ right: 0 `).concat(a,`;
303
+ }
304
+
305
+ .`).concat(qd," .").concat(qd,` {
306
+ margin-right: 0 `).concat(a,`;
307
+ }
308
+
309
+ body[`).concat(xs,`] {
310
+ `).concat(_3,": ").concat(f,`px;
311
+ }
312
+ `)},lw=function(){var e=parseInt(document.body.getAttribute(xs)||"0",10);return isFinite(e)?e:0},Q3=function(){x.useEffect(function(){return document.body.setAttribute(xs,(lw()+1).toString()),function(){var e=lw()-1;e<=0?document.body.removeAttribute(xs):document.body.setAttribute(xs,e.toString())}},[])},K3=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;Q3();var o=x.useMemo(function(){return H3(l)},[l]);return x.createElement(Z3,{styles:V3(o,!t,l,n?"":"!important")})},jg=!1;if(typeof window<"u")try{var Cd=Object.defineProperty({},"passive",{get:function(){return jg=!0,!0}});window.addEventListener("test",Cd,Cd),window.removeEventListener("test",Cd,Cd)}catch{jg=!1}var us=jg?{passive:!1}:!1,G3=function(e){return e.tagName==="TEXTAREA"},zj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G3(e)&&n[t]==="visible")},Y3=function(e){return zj(e,"overflowY")},X3=function(e){return zj(e,"overflowX")},sw=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Oj(e,a);if(l){var o=Mj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},J3=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},W3=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Oj=function(e,t){return e==="v"?Y3(t):X3(t)},Mj=function(e,t){return e==="v"?J3(t):W3(t)},eM=function(e,t){return e==="h"&&t==="rtl"?-1:1},tM=function(e,t,n,a,l){var o=eM(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,y=c>0,g=0,b=0;do{if(!f)break;var w=Mj(e,f),k=w[0],j=w[1],E=w[2],C=j-E-o*k;(k||C)&&Oj(e,f)&&(g+=C,b+=k);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}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},Ed=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ow=function(e){return[e.deltaX,e.deltaY]},uw=function(e){return e&&"current"in e?e.current:e},nM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rM=function(e){return`
313
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
314
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
315
+ `)},aM=0,cs=[];function iM(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(aM++)[0],o=x.useState(Rj)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=E3([e.lockRef.current],(e.shards||[]).map(uw),!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=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var C=Ed(j),R=n.current,O="deltaX"in j?j.deltaX:R[0]-C[0],M="deltaY"in j?j.deltaY:R[1]-C[1],B,z=j.target,$=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in j&&$==="h"&&z.type==="range")return!1;var U=window.getSelection(),Q=U&&U.anchorNode,I=Q?Q===z||Q.contains(z):!1;if(I)return!1;var ne=sw($,z);if(!ne)return!0;if(ne?B=$:(B=$==="v"?"h":"v",ne=sw($,z)),!ne)return!1;if(!a.current&&"changedTouches"in j&&(O||M)&&(a.current=B),!B)return!0;var le=a.current||B;return tM(le,E,j,le==="h"?O:M)},[]),m=x.useCallback(function(j){var E=j;if(!(!cs.length||cs[cs.length-1]!==o)){var C="deltaY"in E?ow(E):Ed(E),R=t.current.filter(function(B){return B.name===E.type&&(B.target===E.target||E.target===B.shadowParent)&&nM(B.delta,C)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var O=(c.current.shards||[]).map(uw).filter(Boolean).filter(function(B){return B.contains(E.target)}),M=O.length>0?f(E,O[0]):!c.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,R){var O={name:j,delta:E,target:C,should:R,shadowParent:lM(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(M){return M!==O})},1)},[]),y=x.useCallback(function(j){n.current=Ed(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,ow(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,Ed(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return cs.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,us),document.addEventListener("touchmove",m,us),document.addEventListener("touchstart",y,us),function(){cs=cs.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,us),document.removeEventListener("touchmove",m,us),document.removeEventListener("touchstart",y,us)}},[]);var w=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:rM(l)}):null,w?x.createElement(K3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sM=D3(Aj,iM);var Dj=x.forwardRef(function(e,t){return x.createElement(wf,ea({},e,{ref:t,sideCar:sM}))});Dj.classNames=wf.classNames;var oM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ds=new WeakMap,Nd=new WeakMap,_d={},pp=0,Ij=function(e){return e&&(e.host||Ij(e.parentNode))},uM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=Ij(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},cM=function(e,t,n,a){var l=uM(t,Array.isArray(e)?e:[e]);_d[n]||(_d[n]=new WeakMap);var o=_d[n],c=[],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 w=b.getAttribute(a),k=w!==null&&w!=="false",j=(ds.get(b)||0)+1,E=(o.get(b)||0)+1;ds.set(b,j),o.set(b,E),c.push(b),j===1&&k&&Nd.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return y(t),f.clear(),pp++,function(){c.forEach(function(g){var b=ds.get(g)-1,w=o.get(g)-1;ds.set(g,b),o.set(g,w),b||(Nd.has(g)||g.removeAttribute(a),Nd.delete(g)),w||g.removeAttribute(n)}),pp--,pp||(ds=new WeakMap,ds=new WeakMap,Nd=new WeakMap,_d={})}},dM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=oM(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),cM(a,l,n,"aria-hidden")):function(){return null}},Sf="Dialog",[Lj]=HO(Sf),[fM,Hr]=Lj(Sf),Uj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=GO({prop:a,defaultProp:l??!1,onChange:o,caller:Sf});return u.jsx(fM,{scope:t,triggerRef:f,contentRef:m,contentId:Ta(),titleId:Ta(),descriptionId:Ta(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};Uj.displayName=Sf;var Pj="DialogTrigger",hM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Pj,n),o=Sl(t,l.triggerRef);return u.jsx(za.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Cy(l.open),...a,ref:o,onClick:Ei(e.onClick,l.onOpenToggle)})});hM.displayName=Pj;var ky="DialogPortal",[mM,Bj]=Lj(ky,{forceMount:void 0}),$j=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Hr(ky,t);return u.jsx(mM,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(xf,{present:n||o.open,children:u.jsx(Nj,{asChild:!0,container:l,children:c})}))})};$j.displayName=ky;var Xd="DialogOverlay",Fj=x.forwardRef((e,t)=>{const n=Bj(Xd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Hr(Xd,e.__scopeDialog);return o.modal?u.jsx(xf,{present:a||o.open,children:u.jsx(gM,{...l,ref:t})}):null});Fj.displayName=Xd;var pM=wj("DialogOverlay.RemoveScroll"),gM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Xd,n);return u.jsx(Dj,{as:pM,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(za.div,{"data-state":Cy(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),yl="DialogContent",qj=x.forwardRef((e,t)=>{const n=Bj(yl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Hr(yl,e.__scopeDialog);return u.jsx(xf,{present:a||o.open,children:o.modal?u.jsx(yM,{...l,ref:t}):u.jsx(vM,{...l,ref:t})})});qj.displayName=yl;var yM=x.forwardRef((e,t)=>{const n=Hr(yl,e.__scopeDialog),a=x.useRef(null),l=Sl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return dM(o)},[]),u.jsx(Hj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ei(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ei(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ei(e.onFocusOutside,o=>o.preventDefault())})}),vM=x.forwardRef((e,t)=>{const n=Hr(yl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(Hj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Hj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Hr(yl,n),m=x.useRef(null),h=Sl(t,m);return C3(),u.jsxs(u.Fragment,{children:[u.jsx(Cj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(kj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Cy(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(bM,{titleId:f.titleId}),u.jsx(wM,{contentRef:m,descriptionId:f.descriptionId})]})]})}),jy="DialogTitle",Zj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(jy,n);return u.jsx(za.h2,{id:l.titleId,...a,ref:t})});Zj.displayName=jy;var Vj="DialogDescription",Qj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Vj,n);return u.jsx(za.p,{id:l.descriptionId,...a,ref:t})});Qj.displayName=Vj;var Kj="DialogClose",Gj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Kj,n);return u.jsx(za.button,{type:"button",...a,ref:t,onClick:Ei(e.onClick,()=>l.onOpenChange(!1))})});Gj.displayName=Kj;function Cy(e){return e?"open":"closed"}var Yj="DialogTitleWarning",[zV,Xj]=qO(Yj,{contentName:yl,titleName:jy,docsSlug:"dialog"}),bM=({titleId:e})=>{const t=Xj(Yj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
316
+
317
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
318
+
319
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},xM="DialogDescriptionWarning",wM=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xj(xM).contentName}}.`;return x.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Jj=Uj,Wj=$j,eC=Fj,tC=qj,SM=Zj,kM=Qj,jM=Gj,CM=Symbol.for("react.lazy"),Jd=Jg[" use ".trim().toString()];function EM(e){return typeof e=="object"&&e!==null&&"then"in e}function nC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CM&&"_payload"in e&&EM(e._payload)}function rC(e){const t=_M(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;nC(o)&&typeof Jd=="function"&&(o=Jd(o._payload));const f=x.Children.toArray(o),m=f.find(AM);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var NM=rC("Slot");function _M(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(nC(l)&&typeof Jd=="function"&&(l=Jd(l._payload)),x.isValidElement(l)){const c=zM(l),f=RM(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TM=Symbol("radix.slottable");function AM(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TM}function RM(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function zM(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.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=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oa=OM.reduce((e,t)=>{const n=rC(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),ru='[cmdk-group=""]',gp='[cmdk-group-items=""]',MM='[cmdk-group-heading=""]',aC='[cmdk-item=""]',cw=`${aC}:not([aria-disabled="true"])`,Cg="cmdk-item-select",ms="data-value",DM=(e,t,n)=>FO(e,t,n),iC=x.createContext(void 0),Ku=()=>x.useContext(iC),lC=x.createContext(void 0),Ey=()=>x.useContext(lC),sC=x.createContext(void 0),oC=x.forwardRef((e,t)=>{let n=ps(()=>{var P,T;return{search:"",value:(T=(P=e.value)!=null?P:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ps(()=>new Set),l=ps(()=>new Map),o=ps(()=>new Map),c=ps(()=>new Set),f=uC(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,R=Ta(),O=Ta(),M=Ta(),B=x.useRef(null),z=VM();vl(()=>{if(y!==void 0){let P=y.trim();n.current.value=P,$.emit()}},[y]),vl(()=>{z(6,we)},[]);let $=x.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,T,Z)=>{var W,ce,ve,ge;if(!Object.is(n.current[P],T)){if(n.current[P]=T,P==="search")le(),I(),z(1,ne);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(M);fe?fe.focus():(W=document.getElementById(R))==null||W.focus()}if(z(7,()=>{var fe;n.current.selectedItemId=(fe=Y())==null?void 0:fe.id,$.emit()}),Z||z(5,we),((ce=f.current)==null?void 0:ce.value)!==void 0){let fe=T??"";(ge=(ve=f.current).onValueChange)==null||ge.call(ve,fe);return}}$.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),U=x.useMemo(()=>({value:(P,T,Z)=>{var W;T!==((W=o.current.get(P))==null?void 0:W.value)&&(o.current.set(P,{value:T,keywords:Z}),n.current.filtered.items.set(P,Q(T,Z)),z(2,()=>{I(),$.emit()}))},item:(P,T)=>(a.current.add(P),T&&(l.current.has(T)?l.current.get(T).add(P):l.current.set(T,new Set([P]))),z(3,()=>{le(),I(),n.current.value||ne(),$.emit()}),()=>{o.current.delete(P),a.current.delete(P),n.current.filtered.items.delete(P);let Z=Y();z(4,()=>{le(),(Z==null?void 0:Z.getAttribute("id"))===P&&ne(),$.emit()})}),group:P=>(l.current.has(P)||l.current.set(P,new Set),()=>{o.current.delete(P),l.current.delete(P)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:R,inputId:M,labelId:O,listInnerRef:B}),[]);function Q(P,T){var Z,W;let ce=(W=(Z=f.current)==null?void 0:Z.filter)!=null?W:DM;return P?ce(P,n.current.search,T):0}function I(){if(!n.current.search||f.current.shouldFilter===!1)return;let P=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(W=>{let ce=l.current.get(W),ve=0;ce.forEach(ge=>{let fe=P.get(ge);ve=Math.max(fe,ve)}),T.push([W,ve])});let Z=B.current;J().sort((W,ce)=>{var ve,ge;let fe=W.getAttribute("id"),Qe=ce.getAttribute("id");return((ve=P.get(Qe))!=null?ve:0)-((ge=P.get(fe))!=null?ge:0)}).forEach(W=>{let ce=W.closest(gp);ce?ce.appendChild(W.parentElement===ce?W:W.closest(`${gp} > *`)):Z.appendChild(W.parentElement===Z?W:W.closest(`${gp} > *`))}),T.sort((W,ce)=>ce[1]-W[1]).forEach(W=>{var ce;let ve=(ce=B.current)==null?void 0:ce.querySelector(`${ru}[${ms}="${encodeURIComponent(W[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function ne(){let P=J().find(Z=>Z.getAttribute("aria-disabled")!=="true"),T=P==null?void 0:P.getAttribute(ms);$.setState("value",T||void 0)}function le(){var P,T,Z,W;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let ve of a.current){let ge=(T=(P=o.current.get(ve))==null?void 0:P.value)!=null?T:"",fe=(W=(Z=o.current.get(ve))==null?void 0:Z.keywords)!=null?W:[],Qe=Q(ge,fe);n.current.filtered.items.set(ve,Qe),Qe>0&&ce++}for(let[ve,ge]of l.current)for(let fe of ge)if(n.current.filtered.items.get(fe)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=ce}function we(){var P,T,Z;let W=Y();W&&(((P=W.parentElement)==null?void 0:P.firstChild)===W&&((Z=(T=W.closest(ru))==null?void 0:T.querySelector(MM))==null||Z.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function Y(){var P;return(P=B.current)==null?void 0:P.querySelector(`${aC}[aria-selected="true"]`)}function J(){var P;return Array.from(((P=B.current)==null?void 0:P.querySelectorAll(cw))||[])}function H(P){let T=J()[P];T&&$.setState("value",T.getAttribute(ms))}function ee(P){var T;let Z=Y(),W=J(),ce=W.findIndex(ge=>ge===Z),ve=W[ce+P];(T=f.current)!=null&&T.loop&&(ve=ce+P<0?W[W.length-1]:ce+P===W.length?W[0]:W[ce+P]),ve&&$.setState("value",ve.getAttribute(ms))}function be(P){let T=Y(),Z=T==null?void 0:T.closest(ru),W;for(;Z&&!W;)Z=P>0?HM(Z,ru):ZM(Z,ru),W=Z==null?void 0:Z.querySelector(cw);W?$.setState("value",W.getAttribute(ms)):ee(P)}let Ae=()=>H(J().length-1),A=P=>{P.preventDefault(),P.metaKey?Ae():P.altKey?be(1):ee(1)},L=P=>{P.preventDefault(),P.metaKey?H(0):P.altKey?be(-1):ee(-1)};return x.createElement(Oa.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:P=>{var T;(T=C.onKeyDown)==null||T.call(C,P);let Z=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||Z))switch(P.key){case"n":case"j":{E&&P.ctrlKey&&A(P);break}case"ArrowDown":{A(P);break}case"p":case"k":{E&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),H(0);break}case"End":{P.preventDefault(),Ae();break}case"Enter":{P.preventDefault();let W=Y();if(W){let ce=new Event(Cg);W.dispatchEvent(ce)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:KM},m),kf(e,P=>x.createElement(lC.Provider,{value:$},x.createElement(iC.Provider,{value:U},P))))}),IM=x.forwardRef((e,t)=>{var n,a;let l=Ta(),o=x.useRef(null),c=x.useContext(sC),f=Ku(),m=uC(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;vl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=cC(l,o,[e.value,e.children,o],e.keywords),g=Ey(),b=Ti(z=>z.value&&z.value===y.current),w=Ti(z=>h||f.filter()===!1?!0:z.search?z.filtered.items.get(l)>0:!0);x.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Cg,k),()=>z.removeEventListener(Cg,k)},[w,e.onSelect,e.disabled]);function k(){var z,$;j(),($=(z=m.current).onSelect)==null||$.call(z,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:E,value:C,onSelect:R,forceMount:O,keywords:M,...B}=e;return x.createElement(Oa.div,{ref:_i(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)}),LM=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Ta(),f=x.useRef(null),m=x.useRef(null),h=Ta(),y=Ku(),g=Ti(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);vl(()=>y.group(c),[]),cC(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Oa.div,{ref:_i(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),kf(e,w=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(sC.Provider,{value:b},w))))}),UM=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ti(c=>!c.search);return!n&&!o?null:x.createElement(Oa.div,{ref:_i(l,t),...a,"cmdk-separator":"",role:"separator"})}),PM=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=Ey(),c=Ti(h=>h.search),f=Ti(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Oa.input,{ref:t,...a,"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:c,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),BM=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ti(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Oa.div,{ref:_i(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},kf(e,h=>x.createElement("div",{ref:_i(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),$M=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Jj,{open:n,onOpenChange:a},x.createElement(Wj,{container:c},x.createElement(eC,{"cmdk-overlay":"",className:l}),x.createElement(tC,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(oC,{ref:t,...f}))))}),FM=x.forwardRef((e,t)=>Ti(n=>n.filtered.count===0)?x.createElement(Oa.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qM=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Oa.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},kf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Xn=Object.assign(oC,{List:BM,Item:IM,Input:PM,Group:LM,Separator:UM,Dialog:$M,Empty:FM,Loading:qM});function HM(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ZM(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uC(e){let t=x.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function ps(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ti(e){let t=Ey(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function cC(e,t,n,a=[]){let l=x.useRef(),o=Ku();return vl(()=>{var c;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=a.map(h=>h.trim());o.value(e,f,m),(c=t.current)==null||c.setAttribute(ms,f),l.current=f}),l}var VM=()=>{let[e,t]=x.useState(),n=ps(()=>new Map);return vl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function QM(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function kf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(QM(t),{ref:t.ref},n(t.props.children)):n(t)}var KM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ln=Jj,GM=Wj,dC=x.forwardRef(({className:e,...t},n)=>u.jsx(eC,{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}));dC.displayName="DialogOverlay";const en=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(GM,{children:[u.jsx(dC,{}),u.jsxs(tC,{ref:a,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,u.jsxs(jM,{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:[u.jsx(ku,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));en.displayName="DialogContent";function dn({className:e,...t}){return u.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Ln({className:e,...t}){return u.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const sn=x.forwardRef(({className:e,...t},n)=>u.jsx(SM,{ref:n,className:Te("text-subtitle leading-none tracking-tight",e),...t}));sn.displayName="DialogTitle";const Ny=x.forwardRef(({className:e,...t},n)=>u.jsx(kM,{ref:n,className:Te("text-body text-muted-foreground",e),...t}));Ny.displayName="DialogDescription";const fC=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));fC.displayName=Xn.displayName;function YM({open:e,onOpenChange:t,children:n}){return u.jsx(ln,{open:e,onOpenChange:t,children:u.jsx(en,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(fC,{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 hC=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(vy,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Xn.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})]}));hC.displayName=Xn.Input.displayName;const mC=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.List,{ref:n,className:Te("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));mC.displayName=Xn.List.displayName;const pC=x.forwardRef((e,t)=>u.jsx(Xn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));pC.displayName=Xn.Empty.displayName;const Hd=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.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}));Hd.displayName=Xn.Group.displayName;const Eg=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));Eg.displayName=Xn.Separator.displayName;const Zd=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.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}));Zd.displayName=Xn.Item.displayName;function Gu(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 Ee.get(hn(`/agents${n?`?${n}`:""}`))}function gC(){return Ee.get("/me/managed-agents")}function XM(e){return Ee.get(`/agents/${encodeURIComponent(e)}`)}function JM(e){return Ee.post(hn("/agents"),e)}function WM(e){return Ee.get(hn(`/agents/names/${encodeURIComponent(e)}/availability`))}function dw(e,t){return Ee.patch(`/agents/${encodeURIComponent(e)}`,t)}function eD(e,t){return Ee.patch(`/agents/${encodeURIComponent(e)}/rebind`,t)}function tD(e){return Ee.delete(`/agents/${encodeURIComponent(e)}`)}function nD(e){return Ee.post(`/agents/${encodeURIComponent(e)}/suspend`,{})}function rD(e){return Ee.post(`/agents/${encodeURIComponent(e)}/reactivate`,{})}function aD(e){return Ee.post(`/agents/${encodeURIComponent(e)}/test`,{})}function jf(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Gu({limit:100}),staleTime:3e4}),{data:t}=Ve({queryKey:["managed-agents","name-map"],queryFn:gC,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,a.displayName);if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,a.displayName);return a=>a?n.get(a)??a:"—"},[e,t])}function _y(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Gu({limit:100}),staleTime:3e4}),{data:t}=Ve({queryKey:["managed-agents","name-map"],queryFn:gC,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,{name:a.name,displayName:a.displayName});if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,{name:a.name,displayName:a.displayName});return a=>a?n.get(a)??null:null},[e,t])}const iD=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function lD({open:e,onOpenChange:t}){const n=Un(),a=jf(),{data:l}=Ve({queryKey:["activity"],queryFn:Qu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Ve({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await bj(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 u.jsxs(YM,{open:e,onOpenChange:t,children:[u.jsx(hC,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(mC,{children:[u.jsx(pC,{children:"No results"}),o.length>0&&u.jsx(Hd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(Zd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(GR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:y}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Eg,{}),u.jsx(Hd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(Zd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(yy,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:g}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),u.jsx(Eg,{}),u.jsx(Hd,{heading:"Pages",children:iD.map(h=>u.jsxs(Zd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(cz,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function sD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function oD(){var a;const{user:e}=Dt(),{data:t}=Ve({queryKey:["clients"],queryFn:Ni,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=sD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const uD=160;function cD(){const e=Un(),{rows:t,firstHostname:n}=oD();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return u.jsxs("button",{type:"button",onClick:()=>e("/settings/computers"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[u.jsx(dD,{}),a?u.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[u.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):u.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[u.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:uD,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),u.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function dD(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function Yu(e){return u.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),u.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),u.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),u.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),u.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function fw(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 Ee.get(hn(`/notifications${n?`?${n}`:""}`))}function fD(e){return Ee.post(hn(`/notifications/${e}/read`))}function hD(){return Ee.post(hn("/notifications/read-all"))}const mD={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 pD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function gD({notification:e,onClick:t,clickable:n}){const a=(mD[e.type]??e.type).toString(),l=pD(e.severity),o=n??!0;return u.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:c=>{o&&(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{c.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[u.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[u.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:ju(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function yD(){var w;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=Un(),c=fn(),{data:f}=Ve({queryKey:["notifications","bell"],queryFn:()=>fw({limit:8}),refetchInterval:1e4}),{data:m}=Ve({queryKey:["notifications","unread-count"],queryFn:()=>fw({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(fD(k.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,c]),b=x.useCallback(async()=>{a(null);try{await hD(),await c.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[c]);return u.jsxs("div",{className:"relative",children:[u.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:[u.jsx(QR,{className:"h-4 w-4"}),y&&u.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&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),u.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:[u.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&u.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&u.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}),u.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?u.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=>u.jsx(gD,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function vD(){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 bD(){const[e,t]=x.useState(vD);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?u.jsx(Tz,{className:"h-4 w-4"}):u.jsx(bz,{className:"h-4 w-4"})})}function xD(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function hw({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?u.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):u.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:u.jsx("span",{className:"text-subtitle font-semibold",children:xD(t)})})}const mw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pw=rj,wD=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return pw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,c=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=mw(y)||mw(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||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:b,...w}=y;return Object.entries(w).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return pw(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},SD=wD("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"}}),pe=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?NM:"button";return u.jsx(c,{className:Te(SD({variant:t,size:n,className:e})),ref:o,...l})});pe.displayName="Button";const At=x.forwardRef(({className:e,type:t,...n},a)=>u.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:a,...n}));At.displayName="Input";function kD({action:e,onClose:t}){const n=e!==null;return u.jsx(ln,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(en,{children:[u.jsxs(dn,{children:[u.jsx(sn,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(Ny,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&u.jsx(CD,{onDone:t}),e==="join"&&u.jsx(ED,{onDone:t})]})})}function jD(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function CD({onDone:e}){const{adoptTokens:t}=Dt(),n=Un(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const b=await Ee.post("/me/organizations",{name:jD(g),displayName:g});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){c(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(At,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(pe,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function ED({onDone:e}){const{adoptTokens:t}=Dt(),n=Un(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),b=/\/invite\/([^/?#]+)/.exec(g),w=(b==null?void 0:b[1])??g,k=await Ee.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(At,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),u.jsx(pe,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function ND(){var B,z;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:l}=Dt(),o=Un(),[c,f]=x.useState([]),[m,h]=x.useState(!1),[y,g]=x.useState(null),b=x.useRef(null);x.useEffect(()=>{(async()=>{try{const $=await Ee.get("/me/organizations");f($)}catch{}})()},[]),x.useEffect(()=>{const $=Q=>{m&&b.current&&!b.current.contains(Q.target)&&h(!1)},U=Q=>{m&&Q.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",$),window.addEventListener("keydown",U),()=>{window.removeEventListener("mousedown",$),window.removeEventListener("keydown",U)}},[m]);const w=(n==null?void 0:n.displayName)??"User",k=(n==null?void 0:n.username)??"",j=(n==null?void 0:n.avatarUrl)??null,E=c.find($=>$.id===e)??null,C=(E==null?void 0:E.role)??(t==="admin"||t==="member"?t:null),R=async $=>{if($===e){h(!1);return}try{await a($),h(!1),o("/",{replace:!0})}catch{}},O=()=>{h(!1),g("create")},M=()=>{h(!1),g("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:b,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${w}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h($=>!$),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:m?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(hw,{src:j,name:w,size:28})}),m&&u.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[u.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx(hw,{src:j,name:w,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:w}),k&&k!==w&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",k]})]})]}),c.length>0&&u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Current team"}),c.length===1?u.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:u.jsx($r,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:(B=c[0])==null?void 0:B.displayName}),u.jsx(gw,{role:((z=c[0])==null?void 0:z.role)??C})]}):u.jsx("div",{children:c.map($=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void R($.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:$.id===e?u.jsx($r,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:$.displayName}),u.jsx(gw,{role:$.role})]},$.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:O,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(Fr,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:M,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(tj,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsx("div",{className:"py-1",children:u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),l()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(gz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})})]})]}),u.jsx(kD,{action:y,onClose:()=>g(null)})]})}function gw({role:e}){return e!=="admin"&&e!=="member"?null:u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:e==="admin"?"var(--accent-dim)":"var(--fg-3)",border:"var(--hairline) solid var(--border)",background:e==="admin"?"var(--accent-bg)":"var(--bg-sunken)"},children:e})}const _D=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/context",label:"Context",end:!1,kbd:"⌘2"},{to:"/team",label:"Team",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}];function TD(){const[e,t]=x.useState(!1),n=Yn(),a=n.pathname==="/"||n.search.includes("a=");return x.useEffect(()=>{const l=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),t(c=>!c))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[u.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[u.jsx(Yu,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsx("span",{className:"text-title",style:{color:"var(--fg)"},children:"First Tree"})]}),u.jsx(cD,{})]}),u.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:_D.map(l=>u.jsx(yf,{to:l.to,end:l.end,style:{pointerEvents:"auto"},className:({isActive:o})=>Te("inline-flex items-center transition-colors",o?"":"hover:text-[var(--fg)]"),children:({isActive:o})=>u.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:o?"var(--fg)":"var(--fg-3)",background:o?"var(--bg-hover)":"transparent"},children:[l.label,o&&u.jsx("span",{className:"kbd",children:l.kbd})]})},l.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[u.jsxs("button",{type:"button",onClick:()=>t(!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:l=>{l.currentTarget.style.color="var(--fg)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(vy,{className:"h-4 w-4"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(yD,{}),u.jsx(bD,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(ND,{})]})]}),u.jsx(lD,{open:e,onOpenChange:t}),a?u.jsx(Us,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(Us,{})})})]})}function oe(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.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 c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,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(c,"name",{value:e}),c}class ws extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class yC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const vC={};function Ai(e){return vC}function bC(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,l])=>t.indexOf(+a)===-1).map(([a,l])=>l)}function Ng(e,t){return typeof t=="bigint"?t.toString():t}function Cf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ty(e){return e==null}function Ay(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function AD(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,c=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const yw=Symbol("evaluating");function pt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==yw)return a===void 0&&(a=yw,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function kl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function vw(e){return JSON.stringify(e)}function RD(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const xC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Nu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const zD=Cf(()=>{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 Ps(e){if(Nu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Nu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wC(e){return Ps(e)?{...e}:Array.isArray(e)?[...e]:e}const OD=new Set(["string","number","symbol"]);function Bs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Re(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 MD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const DD={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 ID(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return kl(this,"shape",c),c},checks:[]});return Mi(e,o)}function LD(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return kl(this,"shape",c),c},checks:[]});return Mi(e,o)}function UD(e,t){if(!Ps(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 c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Oi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return kl(this,"shape",o),o}});return Mi(e,l)}function PD(e,t){if(!Ps(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return kl(this,"shape",a),a}});return Mi(e,n)}function BD(e,t){const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return kl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Mi(e,n)}function $D(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 c=Oi(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 kl(this,"shape",m),m},checks:[]});return Mi(t,c)}function FD(e,t,n){const a=Oi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const c in n){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(o[c]=new e({type:"nonoptional",innerType:l[c]}))}else for(const c in l)o[c]=new e({type:"nonoptional",innerType:l[c]});return kl(this,"shape",o),o}});return Mi(t,a)}function ys(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function vs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Td(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ri(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Td((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.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";a.message=y}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function Ry(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _u(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const SC=(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,Ng,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kC=oe("$ZodError",SC),jC=oe("$ZodError",SC,{Parent:Error});function qD(e,t=n=>n.message){const n={},a=[];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))):a.push(t(l));return{formErrors:a,fieldErrors:n}}function HD(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>a({issues:c}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let c=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const zy=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new ws;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw xC(f,l==null?void 0:l.callee),f}return c.value},Oy=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw xC(f,l==null?void 0:l.callee),f}return c.value},Ef=e=>(t,n,a)=>{const l=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new ws;return o.issues.length?{success:!1,error:new(e??kC)(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},ZD=Ef(jC),Nf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{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(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},VD=Nf(jC),QD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return zy(e)(t,n,l)},KD=e=>(t,n,a)=>zy(e)(t,n,a),GD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Oy(e)(t,n,l)},YD=e=>async(t,n,a)=>Oy(e)(t,n,a),XD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ef(e)(t,n,l)},JD=e=>(t,n,a)=>Ef(e)(t,n,a),WD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Nf(e)(t,n,l)},e4=e=>async(t,n,a)=>Nf(e)(t,n,a),t4=/^[cC][^\s-]{8,}$/,n4=/^[0-9a-z]+$/,r4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a4=/^[0-9a-vA-V]{20}$/,i4=/^[A-Za-z0-9]{27}$/,l4=/^[a-zA-Z0-9_-]{21}$/,s4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,o4=/^([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})$/,bw=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)$/,u4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,c4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function d4(){return new RegExp(c4,"u")}const f4=/^(?:(?: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])$/,h4=/^(([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}|:))$/,m4=/^((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])$/,p4=/^(([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])$/,g4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,CC=/^[A-Za-z0-9_-]*$/,y4=/^\+[1-9]\d{6,14}$/,EC="(?:(?:\\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])))",v4=new RegExp(`^${EC}$`);function NC(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 b4(e){return new RegExp(`^${NC(e)}$`)}function x4(e){const t=NC({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${EC}T(?:${a})$`)}const w4=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}$`)},S4=/^-?\d+$/,_C=/^-?\d+(?:\.\d+)?$/,k4=/^(?:true|false)$/i,j4=/^[^A-Z]*$/,C4=/^[^a-z]*$/,Jn=oe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),TC={number:"number",bigint:"bigint",object:"date"},AC=oe("$ZodCheckLessThan",(e,t)=>{Jn.init(e,t);const n=TC[typeof t.value];e._zod.onattach.push(a=>{const l=a._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=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),RC=oe("$ZodCheckGreaterThan",(e,t)=>{Jn.init(e,t);const n=TC[typeof t.value];e._zod.onattach.push(a=>{const l=a._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=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),E4=oe("$ZodCheckMultipleOf",(e,t)=>{Jn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):AD(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})}}),N4=oe("$ZodCheckNumberFormat",(e,t)=>{var c;Jn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[l,o]=DD[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=S4)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,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:a,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:a,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})}}),_4=oe("$ZodCheckMaxLength",(e,t)=>{var n;Jn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ty(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const c=Ry(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),T4=oe("$ZodCheckMinLength",(e,t)=>{var n;Jn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ty(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const c=Ry(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),A4=oe("$ZodCheckLengthEquals",(e,t)=>{var n;Jn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ty(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const c=Ry(l),f=o>t.length;a.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),_f=oe("$ZodCheckStringFormat",(e,t)=>{var n,a;Jn.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})}):(a=e._zod).check??(a.check=()=>{})}),R4=oe("$ZodCheckRegex",(e,t)=>{_f.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})}}),z4=oe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=j4),_f.init(e,t)}),O4=oe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=C4),_f.init(e,t)}),M4=oe("$ZodCheckIncludes",(e,t)=>{Jn.init(e,t);const n=Bs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),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})}}),D4=oe("$ZodCheckStartsWith",(e,t)=>{Jn.init(e,t);const n=new RegExp(`^${Bs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),I4=oe("$ZodCheckEndsWith",(e,t)=>{Jn.init(e,t);const n=new RegExp(`.*${Bs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),L4=oe("$ZodCheckOverwrite",(e,t)=>{Jn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class U4{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
320
+ `).filter(c=>c),l=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(l)).map(c=>" ".repeat(this.indent*2)+c);for(const c of o)this.content.push(c)}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(`
321
+ `))}}const P4={major:4,minor:3,patch:6},It=oe("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=P4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(e);if(a.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=ys(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new ws;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==w&&(y||(y=ys(f,w)))});else{if(f.issues.length===w)continue;y||(y=ys(f,w))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(ys(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new ws;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=>c(g,f,m)):c(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new ws;return h.then(y=>o(y,a,m))}return o(h,a,m)}}pt(e,"~standard",()=>({validate:o=>{var c;try{const f=ZD(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return VD(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}))}),My=oe("$ZodString",(e,t)=>{var n;It.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??w4(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Mt=oe("$ZodStringFormat",(e,t)=>{_f.init(e,t),My.init(e,t)}),B4=oe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=o4),Mt.init(e,t)}),$4=oe("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bw(a))}else t.pattern??(t.pattern=bw());Mt.init(e,t)}),F4=oe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=u4),Mt.init(e,t)}),q4=oe("$ZodURL",(e,t)=>{Mt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);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=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),H4=oe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=d4()),Mt.init(e,t)}),Z4=oe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=l4),Mt.init(e,t)}),V4=oe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=t4),Mt.init(e,t)}),Q4=oe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=n4),Mt.init(e,t)}),K4=oe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=r4),Mt.init(e,t)}),G4=oe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=a4),Mt.init(e,t)}),Y4=oe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=i4),Mt.init(e,t)}),X4=oe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=x4(t)),Mt.init(e,t)}),J4=oe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=v4),Mt.init(e,t)}),W4=oe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=b4(t)),Mt.init(e,t)}),e5=oe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=s4),Mt.init(e,t)}),t5=oe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=f4),Mt.init(e,t),e._zod.bag.format="ipv4"}),n5=oe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=h4),Mt.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})}}}),r5=oe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=m4),Mt.init(e,t)}),a5=oe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=p4),Mt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const c=Number(o);if(`${c}`!==o)throw new Error;if(c<0||c>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 zC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const i5=oe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=g4),Mt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{zC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function l5(e){if(!CC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return zC(n)}const s5=oe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=CC),Mt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{l5(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),o5=oe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=y4),Mt.init(e,t)});function u5(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const c5=oe("$ZodJWT",(e,t)=>{Mt.init(e,t),e._zod.check=n=>{u5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),OC=oe("$ZodNumber",(e,t)=>{It.init(e,t),e._zod.pattern=e._zod.bag.pattern??_C,e._zod.parse=(n,a)=>{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}}),d5=oe("$ZodNumberFormat",(e,t)=>{N4.init(e,t),OC.init(e,t)}),f5=oe("$ZodBoolean",(e,t)=>{It.init(e,t),e._zod.pattern=k4,e._zod.parse=(n,a)=>{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}}),h5=oe("$ZodUnknown",(e,t)=>{It.init(e,t),e._zod.parse=n=>n}),m5=oe("$ZodNever",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function xw(e,t,n){e.issues.length&&t.issues.push(...vs(n,e.issues)),t.value[n]=e.value}const p5=oe("$ZodArray",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{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 c=0;c<l.length;c++){const f=l[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>xw(h,n,c))):xw(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function Wd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...vs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function MC(e){var a,l,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=MD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function DC(e,t,n,a,l,o){const c=[],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"){c.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(w=>Wd(w,n,g,t,y))):Wd(b,n,g,t,y)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const g5=oe("$ZodObject",(e,t)=>{It.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 a=Cf(()=>MC(t));pt(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=Nu,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=a.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=c.shape;for(const b of c.keys){const w=g[b],k=w._zod.optout==="optional",j=w._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>Wd(E,f,b,h,k))):Wd(j,f,b,h,k)}return o?DC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),y5=oe("$ZodObjectJIT",(e,t)=>{g5.init(e,t);const n=e._zod.parse,a=Cf(()=>MC(t)),l=b=>{var O;const w=new U4(["shape","payload","ctx"]),k=a.value,j=M=>{const B=vw(M);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};w.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const M of k.keys)E[M]=`key_${C++}`;w.write("const newResult = {};");for(const M of k.keys){const B=E[M],z=vw(M),$=b[M],U=((O=$==null?void 0:$._zod)==null?void 0:O.optout)==="optional";w.write(`const ${B} = ${j(M)};`),U?w.write(`
322
+ if (${B}.issues.length) {
323
+ if (${z} in input) {
324
+ payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
325
+ ...iss,
326
+ path: iss.path ? [${z}, ...iss.path] : [${z}]
327
+ })));
328
+ }
329
+ }
330
+
331
+ if (${B}.value === undefined) {
332
+ if (${z} in input) {
333
+ newResult[${z}] = undefined;
334
+ }
335
+ } else {
336
+ newResult[${z}] = ${B}.value;
337
+ }
338
+
339
+ `):w.write(`
340
+ if (${B}.issues.length) {
341
+ payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
342
+ ...iss,
343
+ path: iss.path ? [${z}, ...iss.path] : [${z}]
344
+ })));
345
+ }
346
+
347
+ if (${B}.value === undefined) {
348
+ if (${z} in input) {
349
+ newResult[${z}] = undefined;
350
+ }
351
+ } else {
352
+ newResult[${z}] = ${B}.value;
353
+ }
354
+
355
+ `)}w.write("payload.value = newResult;"),w.write("return payload;");const R=w.compile();return(M,B)=>R(b,M,B)};let o;const c=Nu,f=!vC.jitless,h=f&&zD.value,y=t.catchall;let g;e._zod.parse=(b,w)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),b=o(b,w),y?DC([],k,b,w,g,e):b):n(b,w):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function ww(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ys(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(c=>Ri(c,a,Ai())))}),t)}const IC=oe("$ZodUnion",(e,t)=>{It.init(e,t),pt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),pt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),pt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),pt(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=>Ay(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let c=!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),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>ww(m,l,e,o)):ww(f,l,e,o)}}),v5=oe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,IC.init(e,t);const n=e._zod.parse;pt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const c=o._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(c)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=Cf(()=>{var c;const l=t.options,o=new Map;for(const f of l){const m=(c=f._zod.propValues)==null?void 0:c[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 c=l.value;if(!Nu(c))return l.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),l;const f=a.value.get(c==null?void 0:c[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:c,path:[t.discriminator],inst:e}),l)}}),b5=oe("$ZodIntersection",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),c=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>Sw(n,m,h)):Sw(n,o,c)}});function _g(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(Ps(e)&&Ps(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const c=_g(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};l[o]=c.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 a=0;a<e.length;a++){const l=e[a],o=t[a],c=_g(l,o);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Sw(e,t,n){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.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)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ys(e))return e;const c=_g(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const x5=oe("$ZodRecord",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Ps(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const h of c)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:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...vs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...vs(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:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&_C.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);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=>Ri(g,a,Ai())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...vs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...vs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),w5=oe("$ZodEnum",(e,t)=>{It.init(e,t);const n=bC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>OD.has(typeof l)).map(l=>typeof l=="string"?Bs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return a.has(c)||l.issues.push({code:"invalid_value",values:n,input:c,inst:e}),l}}),S5=oe("$ZodLiteral",(e,t)=>{if(It.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Bs(a):a?Bs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),k5=oe("$ZodTransform",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new yC(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(c=>(n.value=c,n));if(l instanceof Promise)throw new ws;return n.value=l,n}});function kw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const LC=oe("$ZodOptional",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ay(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>kw(o,n.value)):kw(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),j5=oe("$ZodExactOptional",(e,t)=>{LC.init(e,t),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),C5=oe("$ZodNullable",(e,t)=>{It.init(e,t),pt(e._zod,"optin",()=>t.innerType._zod.optin),pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ay(n.source)}|null)$`):void 0}),pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),E5=oe("$ZodDefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>jw(o,t)):jw(l,t)}});function jw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const N5=oe("$ZodPrefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),_5=oe("$ZodNonOptional",(e,t)=>{It.init(e,t),pt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>Cw(o,e)):Cw(l,e)}});function Cw(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 T5=oe("$ZodCatch",(e,t)=>{It.init(e,t),pt(e._zod,"optin",()=>t.innerType._zod.optin),pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>Ri(c,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ri(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),A5=oe("$ZodPipe",(e,t)=>{It.init(e,t),pt(e._zod,"values",()=>t.in._zod.values),pt(e._zod,"optin",()=>t.in._zod.optin),pt(e._zod,"optout",()=>t.out._zod.optout),pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(c=>Ad(c,t.in,a)):Ad(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>Ad(o,t.out,a)):Ad(l,t.out,a)}});function Ad(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const R5=oe("$ZodReadonly",(e,t)=>{It.init(e,t),pt(e._zod,"propValues",()=>t.innerType._zod.propValues),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),pt(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(Ew):Ew(l)}});function Ew(e){return e.value=Object.freeze(e.value),e}const z5=oe("$ZodCustom",(e,t)=>{Jn.init(e,t),It.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>Nw(o,n,a,e));Nw(l,n,a,e)}});function Nw(e,t,n,a){if(!e){const l={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(_u(l))}}var _w;class O5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const l={...a,...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 M5(){return new O5}(_w=globalThis).__zod_globalRegistry??(_w.__zod_globalRegistry=M5());const cu=globalThis.__zod_globalRegistry;function D5(e,t){return new e({type:"string",...Re(t)})}function I5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function Tw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function L5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function U5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function P5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function B5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function $5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function F5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function q5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function H5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function Z5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function V5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function Q5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function K5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function G5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function Y5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function X5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function J5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function W5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function eI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function tI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function nI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function rI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function aI(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function iI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function lI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function sI(e,t){return new e({type:"number",checks:[],...Re(t)})}function oI(e,t){return new e({type:"number",coerce:!0,checks:[],...Re(t)})}function uI(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function cI(e,t){return new e({type:"boolean",...Re(t)})}function dI(e){return new e({type:"unknown"})}function fI(e,t){return new e({type:"never",...Re(t)})}function Aw(e,t){return new AC({check:"less_than",...Re(t),value:e,inclusive:!1})}function yp(e,t){return new AC({check:"less_than",...Re(t),value:e,inclusive:!0})}function Rw(e,t){return new RC({check:"greater_than",...Re(t),value:e,inclusive:!1})}function vp(e,t){return new RC({check:"greater_than",...Re(t),value:e,inclusive:!0})}function zw(e,t){return new E4({check:"multiple_of",...Re(t),value:e})}function UC(e,t){return new _4({check:"max_length",...Re(t),maximum:e})}function ef(e,t){return new T4({check:"min_length",...Re(t),minimum:e})}function PC(e,t){return new A4({check:"length_equals",...Re(t),length:e})}function hI(e,t){return new R4({check:"string_format",format:"regex",...Re(t),pattern:e})}function mI(e){return new z4({check:"string_format",format:"lowercase",...Re(e)})}function pI(e){return new O4({check:"string_format",format:"uppercase",...Re(e)})}function gI(e,t){return new M4({check:"string_format",format:"includes",...Re(t),includes:e})}function yI(e,t){return new D4({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function vI(e,t){return new I4({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function Xs(e){return new L4({check:"overwrite",tx:e})}function bI(e){return Xs(t=>t.normalize(e))}function xI(){return Xs(e=>e.trim())}function wI(){return Xs(e=>e.toLowerCase())}function SI(){return Xs(e=>e.toUpperCase())}function kI(){return Xs(e=>RD(e))}function jI(e,t,n){return new e({type:"array",element:t,...Re(n)})}function CI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Re(n)})}function EI(e){const t=NI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(_u(a,n.value,t._zod.def));else{const l=a;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(_u(l))}},e(n.value,n)));return t}function NI(e,t){const n=new Jn({check:"custom",...Re(t)});return n._zod.check=e,n}function BC(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)??cu,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 Wt(e,t,n={path:[],schemaPath:[]}){var y,g;var a;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 c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)c.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,b);else{const k=c.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const w=e._zod.parent;w&&(c.ref||(c.ref=w),Wt(w,t,b),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&Mn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function $C(e,t){var c,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const g=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(g){const b=a.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.`);a.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,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const R=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=R,{defId:R,ref:`${C("__shared")}#/${g}/${R}`}}if(y[1]===n)return{ref:"#"};const w=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:w+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);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>
356
+
357
+ 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 w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){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 FC(e,t){var c,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),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===w)for(const R in g)R==="$ref"||R==="allOf"||R in b||delete g[R];if(E.$ref&&j.def)for(const R in g)R==="$ref"||R==="allOf"||R in j.def&&JSON.stringify(g[R])===JSON.stringify(j.def[R])&&delete g[R]}const k=h._zod.parent;if(k&&k!==w){a(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())a(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,(c=e.external)!=null&&c.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:tf(t,"input",e.processors),output:tf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Mn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Mn(a.element,n);if(a.type==="set")return Mn(a.valueType,n);if(a.type==="lazy")return Mn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Mn(a.innerType,n);if(a.type==="intersection")return Mn(a.left,n)||Mn(a.right,n);if(a.type==="record"||a.type==="map")return Mn(a.keyType,n)||Mn(a.valueType,n);if(a.type==="pipe")return Mn(a.in,n)||Mn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(Mn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(Mn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(Mn(l,n))return!0;return!!(a.rest&&Mn(a.rest,n))}return!1}const _I=(e,t={})=>n=>{const a=BC({...n,processors:t});return Wt(e,a),$C(a,e),FC(a,e)},tf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=BC({...l??{},target:o,io:t,processors:n});return Wt(e,c),$C(c,e),FC(c,e)},TI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},AI=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof c=="number"&&(l.maxLength=c),f&&(l.format=TI[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}))])}},RI=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,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 c=="number"&&(l.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},zI=(e,t,n,a)=>{n.type="boolean"},OI=(e,t,n,a)=>{n.not={}},MI=(e,t,n,a)=>{},DI=(e,t,n,a)=>{const l=e._zod.def,o=bC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},II=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const c of l.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(c))}else o.push(c);if(o.length!==0)if(o.length===1){const c=o[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),o.every(c=>typeof c=="boolean")&&(n.type="boolean"),o.every(c=>c===null)&&(n.type="null"),n.enum=o},LI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},PI=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(l.minItems=c),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Wt(o.element,t,{...a,path:[...a.path,"items"]})},BI=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const y in c)l.properties[y]=Wt(c[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(c)),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=Wt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},$I=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>Wt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},FI=(e,t,n,a)=>{const l=e._zod.def,o=Wt(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=Wt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(c)?c.allOf:[c]];n.allOf=m},qI=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Wt(o.valueType,t,{...a,path:[...a.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=Wt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Wt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},HI=(e,t,n,a)=>{const l=e._zod.def,o=Wt(l.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},ZI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},VI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},QI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},KI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let c;try{c=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},GI=(e,t,n,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Wt(o,t,a);const c=t.seen.get(e);c.ref=o},YI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},qC=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},XI=oe("ZodISODateTime",(e,t)=>{X4.init(e,t),Ut.init(e,t)});function JI(e){return rI(XI,e)}const WI=oe("ZodISODate",(e,t)=>{J4.init(e,t),Ut.init(e,t)});function eL(e){return aI(WI,e)}const tL=oe("ZodISOTime",(e,t)=>{W4.init(e,t),Ut.init(e,t)});function nL(e){return iI(tL,e)}const rL=oe("ZodISODuration",(e,t)=>{e5.init(e,t),Ut.init(e,t)});function aL(e){return lI(rL,e)}const iL=(e,t)=>{kC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>HD(e,n)},flatten:{value:n=>qD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ng,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ng,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ar=oe("ZodError",iL,{Parent:Error}),lL=zy(Ar),sL=Oy(Ar),oL=Ef(Ar),uL=Nf(Ar),cL=QD(Ar),dL=KD(Ar),fL=GD(Ar),hL=YD(Ar),mL=XD(Ar),pL=JD(Ar),gL=WD(Ar),yL=e4(Ar),Lt=oe("ZodType",(e,t)=>(It.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tf(e,"input"),output:tf(e,"output")}}),e.toJSONSchema=_I(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Oi(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Mi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>lL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>oL(e,n,a),e.parseAsync=async(n,a)=>sL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>uL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>cL(e,n,a),e.decode=(n,a)=>dL(e,n,a),e.encodeAsync=async(n,a)=>fL(e,n,a),e.decodeAsync=async(n,a)=>hL(e,n,a),e.safeEncode=(n,a)=>mL(e,n,a),e.safeDecode=(n,a)=>pL(e,n,a),e.safeEncodeAsync=async(n,a)=>gL(e,n,a),e.safeDecodeAsync=async(n,a)=>yL(e,n,a),e.refine=(n,a)=>e.check(u6(n,a)),e.superRefine=n=>e.check(c6(n)),e.overwrite=n=>e.check(Xs(n)),e.optional=()=>Dw(e),e.exactOptional=()=>YL(e),e.nullable=()=>Iw(e),e.nullish=()=>Dw(Iw(e)),e.nonoptional=n=>n6(e,n),e.array=()=>Et(e),e.or=n=>VC([e,n]),e.and=n=>ZL(e,n),e.transform=n=>Ag(e,QC(n)),e.default=n=>WL(e,n),e.prefault=n=>t6(e,n),e.catch=n=>a6(e,n),e.pipe=n=>Ag(e,n),e.readonly=()=>s6(e),e.describe=n=>{const a=e.clone();return cu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=cu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const a=e.clone();return cu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),HC=oe("_ZodString",(e,t)=>{My.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>AI(e,a,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(hI(...a)),e.includes=(...a)=>e.check(gI(...a)),e.startsWith=(...a)=>e.check(yI(...a)),e.endsWith=(...a)=>e.check(vI(...a)),e.min=(...a)=>e.check(ef(...a)),e.max=(...a)=>e.check(UC(...a)),e.length=(...a)=>e.check(PC(...a)),e.nonempty=(...a)=>e.check(ef(1,...a)),e.lowercase=a=>e.check(mI(a)),e.uppercase=a=>e.check(pI(a)),e.trim=()=>e.check(xI()),e.normalize=(...a)=>e.check(bI(...a)),e.toLowerCase=()=>e.check(wI()),e.toUpperCase=()=>e.check(SI()),e.slugify=()=>e.check(kI())}),vL=oe("ZodString",(e,t)=>{My.init(e,t),HC.init(e,t),e.email=n=>e.check(I5(bL,n)),e.url=n=>e.check($5(xL,n)),e.jwt=n=>e.check(nI(DL,n)),e.emoji=n=>e.check(F5(wL,n)),e.guid=n=>e.check(Tw(Ow,n)),e.uuid=n=>e.check(L5(Rd,n)),e.uuidv4=n=>e.check(U5(Rd,n)),e.uuidv6=n=>e.check(P5(Rd,n)),e.uuidv7=n=>e.check(B5(Rd,n)),e.nanoid=n=>e.check(q5(SL,n)),e.guid=n=>e.check(Tw(Ow,n)),e.cuid=n=>e.check(H5(kL,n)),e.cuid2=n=>e.check(Z5(jL,n)),e.ulid=n=>e.check(V5(CL,n)),e.base64=n=>e.check(W5(zL,n)),e.base64url=n=>e.check(eI(OL,n)),e.xid=n=>e.check(Q5(EL,n)),e.ksuid=n=>e.check(K5(NL,n)),e.ipv4=n=>e.check(G5(_L,n)),e.ipv6=n=>e.check(Y5(TL,n)),e.cidrv4=n=>e.check(X5(AL,n)),e.cidrv6=n=>e.check(J5(RL,n)),e.e164=n=>e.check(tI(ML,n)),e.datetime=n=>e.check(JI(n)),e.date=n=>e.check(eL(n)),e.time=n=>e.check(nL(n)),e.duration=n=>e.check(aL(n))});function N(e){return D5(vL,e)}const Ut=oe("ZodStringFormat",(e,t)=>{Mt.init(e,t),HC.init(e,t)}),bL=oe("ZodEmail",(e,t)=>{F4.init(e,t),Ut.init(e,t)}),Ow=oe("ZodGUID",(e,t)=>{B4.init(e,t),Ut.init(e,t)}),Rd=oe("ZodUUID",(e,t)=>{$4.init(e,t),Ut.init(e,t)}),xL=oe("ZodURL",(e,t)=>{q4.init(e,t),Ut.init(e,t)}),wL=oe("ZodEmoji",(e,t)=>{H4.init(e,t),Ut.init(e,t)}),SL=oe("ZodNanoID",(e,t)=>{Z4.init(e,t),Ut.init(e,t)}),kL=oe("ZodCUID",(e,t)=>{V4.init(e,t),Ut.init(e,t)}),jL=oe("ZodCUID2",(e,t)=>{Q4.init(e,t),Ut.init(e,t)}),CL=oe("ZodULID",(e,t)=>{K4.init(e,t),Ut.init(e,t)}),EL=oe("ZodXID",(e,t)=>{G4.init(e,t),Ut.init(e,t)}),NL=oe("ZodKSUID",(e,t)=>{Y4.init(e,t),Ut.init(e,t)}),_L=oe("ZodIPv4",(e,t)=>{t5.init(e,t),Ut.init(e,t)}),TL=oe("ZodIPv6",(e,t)=>{n5.init(e,t),Ut.init(e,t)}),AL=oe("ZodCIDRv4",(e,t)=>{r5.init(e,t),Ut.init(e,t)}),RL=oe("ZodCIDRv6",(e,t)=>{a5.init(e,t),Ut.init(e,t)}),zL=oe("ZodBase64",(e,t)=>{i5.init(e,t),Ut.init(e,t)}),OL=oe("ZodBase64URL",(e,t)=>{s5.init(e,t),Ut.init(e,t)}),ML=oe("ZodE164",(e,t)=>{o5.init(e,t),Ut.init(e,t)}),DL=oe("ZodJWT",(e,t)=>{c5.init(e,t),Ut.init(e,t)}),Dy=oe("ZodNumber",(e,t)=>{OC.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>RI(e,a,l),e.gt=(a,l)=>e.check(Rw(a,l)),e.gte=(a,l)=>e.check(vp(a,l)),e.min=(a,l)=>e.check(vp(a,l)),e.lt=(a,l)=>e.check(Aw(a,l)),e.lte=(a,l)=>e.check(yp(a,l)),e.max=(a,l)=>e.check(yp(a,l)),e.int=a=>e.check(Mw(a)),e.safe=a=>e.check(Mw(a)),e.positive=a=>e.check(Rw(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(Aw(0,a)),e.nonpositive=a=>e.check(yp(0,a)),e.multipleOf=(a,l)=>e.check(zw(a,l)),e.step=(a,l)=>e.check(zw(a,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 Be(e){return sI(Dy,e)}const IL=oe("ZodNumberFormat",(e,t)=>{d5.init(e,t),Dy.init(e,t)});function Mw(e){return uI(IL,e)}const LL=oe("ZodBoolean",(e,t)=>{f5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>zI(e,n,a)});function qr(e){return cI(LL,e)}const UL=oe("ZodUnknown",(e,t)=>{h5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>MI()});function Nt(){return dI(UL)}const PL=oe("ZodNever",(e,t)=>{m5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>OI(e,n,a)});function BL(e){return fI(PL,e)}const $L=oe("ZodArray",(e,t)=>{p5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>PI(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(ef(n,a)),e.nonempty=n=>e.check(ef(1,n)),e.max=(n,a)=>e.check(UC(n,a)),e.length=(n,a)=>e.check(PC(n,a)),e.unwrap=()=>e.element});function Et(e,t){return jI($L,e,t)}const FL=oe("ZodObject",(e,t)=>{y5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>BI(e,n,a,l),pt(e,"shape",()=>t.shape),e.keyof=()=>Ue(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nt()}),e.strict=()=>e.clone({...e._zod.def,catchall:BL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>UD(e,n),e.safeExtend=n=>PD(e,n),e.merge=n=>BD(e,n),e.pick=n=>ID(e,n),e.omit=n=>LD(e,n),e.partial=(...n)=>$D(KC,e,n[0]),e.required=(...n)=>FD(GC,e,n[0])});function ae(e,t){const n={type:"object",shape:e??{},...Re(t)};return new FL(n)}const ZC=oe("ZodUnion",(e,t)=>{IC.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>$I(e,n,a,l),e.options=t.options});function VC(e,t){return new ZC({type:"union",options:e,...Re(t)})}const qL=oe("ZodDiscriminatedUnion",(e,t)=>{ZC.init(e,t),v5.init(e,t)});function Iy(e,t,n){return new qL({type:"union",options:t,discriminator:e,...Re(n)})}const HL=oe("ZodIntersection",(e,t)=>{b5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>FI(e,n,a,l)});function ZL(e,t){return new HL({type:"intersection",left:e,right:t})}const VL=oe("ZodRecord",(e,t)=>{x5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>qI(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Vt(e,t,n){return new VL({type:"record",keyType:e,valueType:t,...Re(n)})}const Tg=oe("ZodEnum",(e,t)=>{w5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>DI(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const c of a)if(n.has(c))o[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Tg({...t,checks:[],...Re(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const c of a)if(n.has(c))delete o[c];else throw new Error(`Key ${c} not found in enum`);return new Tg({...t,checks:[],...Re(l),entries:o})}});function Ue(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Tg({type:"enum",entries:n,...Re(t)})}const QL=oe("ZodLiteral",(e,t)=>{S5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>II(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Jt(e,t){return new QL({type:"literal",values:Array.isArray(e)?e:[e],...Re(t)})}const KL=oe("ZodTransform",(e,t)=>{k5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>UI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new yC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(_u(o,n.value,t));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(_u(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function QC(e){return new KL({type:"transform",transform:e})}const KC=oe("ZodOptional",(e,t)=>{LC.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>qC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function Dw(e){return new KC({type:"optional",innerType:e})}const GL=oe("ZodExactOptional",(e,t)=>{j5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>qC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function YL(e){return new GL({type:"optional",innerType:e})}const XL=oe("ZodNullable",(e,t)=>{C5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>HI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function Iw(e){return new XL({type:"nullable",innerType:e})}const JL=oe("ZodDefault",(e,t)=>{E5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>VI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function WL(e,t){return new JL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wC(t)}})}const e6=oe("ZodPrefault",(e,t)=>{N5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>QI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function t6(e,t){return new e6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wC(t)}})}const GC=oe("ZodNonOptional",(e,t)=>{_5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>ZI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function n6(e,t){return new GC({type:"nonoptional",innerType:e,...Re(t)})}const r6=oe("ZodCatch",(e,t)=>{T5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>KI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function a6(e,t){return new r6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const i6=oe("ZodPipe",(e,t)=>{A5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>GI(e,n,a,l),e.in=t.in,e.out=t.out});function Ag(e,t){return new i6({type:"pipe",in:e,out:t})}const l6=oe("ZodReadonly",(e,t)=>{R5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>YI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function s6(e){return new l6({type:"readonly",innerType:e})}const o6=oe("ZodCustom",(e,t)=>{z5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>LI(e,n)});function u6(e,t={}){return CI(o6,e,t)}function c6(e){return EI(e)}function d6(e,t){return Ag(QC(e),t)}const bp={custom:"custom"};function Xu(e){return oI(Dy,e)}const f6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function h6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function YC(e,t){const n=h6(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const l=new Set;for(const o of n.matchAll(f6)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const m6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,Lw="/";function XC(e){return!e||typeof e!="string"||e.length>256||!m6.test(e)?"/":e}const p6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},JC=Ue(["feishu","slack","kael"]),WC=Ue(["active","inactive"]);ae({platform:JC,agentId:N().min(1),credentials:Vt(N(),Nt()),status:WC.default("active")});ae({agentId:N().min(1).optional(),credentials:Vt(N(),Nt()).optional(),status:WC.optional()});ae({id:Be(),platform:N(),agentId:N(),hasCredentials:qr(),status:N(),createdAt:N(),updatedAt:N()});const g6=Ue(["code","reverse_token","oauth","manual"]);ae({appId:N().min(1),appSecret:N().min(1)});ae({platform:JC,externalUserId:N().min(1),agentId:N().min(1),boundVia:g6.default("manual"),displayName:N().max(200).optional()});ae({id:Be(),platform:N(),externalUserId:N(),agentId:N(),boundVia:N().nullable(),displayName:N().nullable(),createdAt:N()});ae({feishuUserId:N().min(1),displayName:N().max(200).optional()});ae({configId:Be(),platform:N(),agentId:N(),appId:N(),connected:qr(),lastActiveAt:N().nullable()});const eE=Ue(["online","offline"]),tE=Ue(["idle","working","blocked","error"]);Ue(["active","suspended","evicted"]);const y6=Ue(["active","suspended"]);ae({chatId:N().min(1),state:y6});ae({runtimeState:tE});ae({agentId:N().min(1),runtimeType:N().max(50),runtimeVersion:N().max(50).optional()});Ue(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);ae({agentId:N(),status:eE,connectedAt:N().nullable(),lastSeenAt:N(),clientId:N().nullable().optional(),runtimeType:N().nullable().optional(),runtimeVersion:N().nullable().optional(),runtimeState:tE.nullable().optional(),activeSessions:Be().int().nullable().optional(),totalSessions:Be().int().nullable().optional(),runtimeUpdatedAt:N().nullable().optional()});ae({total:Be().int(),running:Be().int(),byState:ae({idle:Be().int(),working:Be().int(),blocked:Be().int(),error:Be().int()}),clients:Be().int()});const nf={CLAUDE_CODE:"claude-code",CODEX:"codex"},Tf=Ue(["claude-code","codex"]),Af=Ue(["human","personal_assistant","autonomous_agent"]),Uw={PRIVATE:"private",ORGANIZATION:"organization"},Ly=Ue(["private","organization"]),v6=Ue(["admin-api","portal"]);Ue(["active","suspended"]);const Rg=/^[a-z0-9][a-z0-9_-]{0,63}$/,bs=64,b6=["admin","agent","first-tree","hub","me","null","system","undefined"],x6=new Set(b6);function zg(e){return x6.has(e)}ae({name:N().min(1).max(64).regex(Rg,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!zg(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Af,displayName:N().min(1).max(200).optional(),delegateMention:N().max(100).optional(),organizationId:N().min(1).max(100).optional(),source:v6.optional(),visibility:Ly.optional(),metadata:Vt(N(),Nt()).optional(),managerId:N().optional(),clientId:N().min(1).max(100).optional(),runtimeProvider:Tf.optional()});ae({type:Af.optional(),displayName:N().min(1).max(200).optional(),delegateMention:N().max(100).nullable().optional(),visibility:Ly.optional(),metadata:Vt(N(),Nt()).optional(),managerId:N().nullable().optional(),clientId:N().min(1).max(100).nullable().optional()});ae({clientId:N().min(1).max(100),runtimeProvider:Tf,force:qr().optional()});ae({uuid:N(),name:N().nullable(),organizationId:N(),type:Af,displayName:N(),delegateMention:N().nullable(),inboxId:N(),status:N(),source:N().nullable().optional(),visibility:Ly,metadata:Vt(N(),Nt()),managerId:N().nullable(),clientId:N().nullable(),runtimeProvider:Tf,presenceStatus:eE.optional(),createdAt:N(),updatedAt:N()});ae({repo:N().nullable(),branch:N().nullable()});ae({type:Jt("agent:pinned"),agentId:N(),name:N().nullable(),displayName:N(),agentType:Af,runtimeProvider:Tf});const w6=32e3,Uy=/^[a-z0-9][a-z0-9_-]{0,63}$/i,S6=/^[A-Z][A-Z0-9_]*$/,k6=ae({append:N().max(w6).default("")}),j6=ae({name:N().regex(Uy,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Jt("stdio"),command:N().min(1),args:Et(N()).optional()}),C6=ae({name:N().regex(Uy,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Jt("http"),url:N().url(),headers:Vt(N(),N()).optional()}),E6=ae({name:N().regex(Uy,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Jt("sse"),url:N().url(),headers:Vt(N(),N()).optional()}),N6=Iy("transport",[j6,C6,E6]),_6=ae({key:N().regex(S6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:N(),sensitive:qr().default(!1)}),T6=ae({url:N().min(1),ref:N().min(1).optional(),localPath:N().min(1).optional()}),Rf=ae({prompt:k6.default({append:""}),model:N().default("opus"),mcpServers:Et(N6).default([]),env:Et(_6).default([]),gitRepos:Et(T6).default([])}),A6=Rf.extend({kind:Jt("claude-code")}),R6=Rf.extend({kind:Jt("codex")}),z6=Iy("kind",[A6,R6]),O6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:bp.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:bp.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,c)=>{const f=o.localPath??af(o.url);f&&(l.has(f)&&t.addIssue({code:bp.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},nE=d6(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,z6).superRefine((e,t)=>{O6(e,t)}),M6=ae({agentId:N(),version:Be().int().positive(),payload:nE,updatedAt:N(),updatedBy:N()});ae({expectedVersion:Be().int().positive(),payload:Rf.partial()});ae({payload:Rf.partial()});ae({current:M6,next:nE,diff:Et(ae({path:N(),op:Ue(["add","remove","replace"]),before:Nt().optional(),after:Nt().optional()}))});const rf="***";function af(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}ae({username:N().min(1),password:N().min(1)});ae({accessToken:N(),refreshToken:N()});ae({refreshToken:N().min(1)});ae({token:N().min(1)});ae({token:N(),expiresIn:Be(),command:N()});const D6=Ue(["direct","group","thread"]);ae({type:D6,topic:N().max(500).optional(),participantIds:Et(N()).min(1),metadata:Vt(N(),Nt()).optional()});const rE=ae({agentId:N(),role:N(),mode:N(),joinedAt:N()});rE.extend({name:N().nullable(),displayName:N(),type:N()});const I6=ae({id:N(),organizationId:N(),type:N(),topic:N().nullable(),lifecyclePolicy:N().nullable().optional(),metadata:Vt(N(),Nt()),createdAt:N(),updatedAt:N()});I6.extend({participants:Et(rE),title:N(),firstMessagePreview:N().nullable()});ae({topic:N().trim().max(500).nullable()});ae({agentId:N().min(1),mode:Ue(["full","mention_only"]).default("full")});ae({agentId:N().min(1)});const L6=Ue(["connected","disconnected"]),U6=Ue(["ok","expired"]);ae({id:N(),userId:N().nullable(),status:L6,authState:U6,sdkVersion:N().max(50).nullable(),hostname:N().max(100).nullable(),os:N().max(50).nullable(),agentCount:Be().int().min(0),connectedAt:N().nullable(),lastSeenAt:N(),metadata:Vt(N(),Nt()).nullable()});const P6=ae({wsInboxDeliver:qr().default(!1)}).partial();ae({clientId:N().min(1).max(100),hostname:N().max(100).optional(),os:N().max(50).optional(),sdkVersion:N().max(50).optional(),wireCapabilities:P6.optional()});ae({clientId:N(),previousUserId:N().nullable(),unpinnedAgentCount:Be().int().nonnegative()});const B6=Ue(["ok","missing","unauthenticated","error"]),$6=Ue(["api_key","oauth","auth_json","none"]),F6=ae({state:B6,available:qr(),authenticated:qr(),sdkVersion:N().nullable().optional(),authMethod:$6,error:N().nullable().optional(),detectedAt:N()}),q6=Vt(N(),F6);ae({capabilities:q6});ae({limit:Xu().int().min(1).max(100).default(20),cursor:N().optional()});const H6=Ue(["active","stale","unavailable"]),Z6=Ue(["ok","warning","error"]),V6=ae({label:N(),detail:N().nullable(),severity:Z6}),Q6=Ue(["root","domain","subdomain","leaf"]),Py=Ue(["added","edited","removed"]),K6=Ue(["parent","soft_link","markdown_link"]),G6=Ue(["low","medium","high"]),Y6=ae({id:N(),path:N(),sourcePath:N().nullable(),title:N(),kind:Q6,owners:Et(N()),parentId:N().nullable(),preview:N().nullable(),relatedNodeIds:Et(N()),affectedContextArea:N(),changeType:Py.nullable(),changedAtCommit:N().nullable()}),X6=ae({source:N(),target:N(),kind:K6}),J6=ae({path:N(),nodeId:N().nullable(),type:Py,commit:N().nullable(),changedAt:N().nullable(),changedBy:N().nullable(),summary:N().nullable()}),W6=ae({id:N(),nodeId:N().nullable(),path:N(),title:N(),changeType:Py,affectedContextArea:N(),reason:N(),summary:N(),changedBy:N().nullable(),owners:Et(N()),relatedNodeIds:Et(N()),sourceCommit:N().nullable(),riskLevel:G6}),eU=ae({addedCount:Be().int().nonnegative(),editedCount:Be().int().nonnegative(),removedCount:Be().int().nonnegative(),changedNodeCount:Be().int().nonnegative()});ae({repo:N().nullable(),branch:N().nullable(),headCommit:N().nullable(),syncedAt:N().nullable(),snapshotStatus:H6,contextStatus:V6,summary:eU,updates:Et(W6),nodes:Et(Y6),edges:Et(X6),changes:Et(J6)});const tU=["image/png","image/jpeg","image/gif","image/webp"],By=Ue(tU);ae({data:N().min(1),mimeType:By,filename:N().min(1),size:Be().int().nonnegative().optional(),imageId:N().uuid().optional()});ae({imageId:N().uuid(),mimeType:By,filename:N().min(1),size:Be().int().nonnegative().optional()});ae({type:Jt("image_payload"),imageId:N().uuid(),chatId:N(),base64:N().min(1),mimeType:By,filename:N().min(1),size:Be().int().nonnegative().optional()});const $y=Ue(["hub_ui","cli","feishu","github","api"]),aE=Ue(["text","markdown","card","reference","file","task"]);ae({format:aE.default("text"),content:Nt(),metadata:Vt(N(),Nt()).optional(),inReplyTo:N().optional(),replyToInbox:N().optional(),replyToChat:N().optional(),source:$y.optional()});ae({format:aE.default("text"),content:Nt(),metadata:Vt(N(),Nt()).optional(),replyToInbox:N().optional(),replyToChat:N().optional(),source:$y.optional()});const nU=ae({id:N(),chatId:N(),senderId:N(),format:N(),content:Nt(),metadata:Vt(N(),Nt()),replyToInbox:N().nullable(),replyToChat:N().nullable(),inReplyTo:N().nullable(),source:$y.nullable(),createdAt:N()}),rU=ae({senderId:N(),chatId:N(),replyToChat:N().nullable()}).nullable(),aU=Ue(["full","mention_only"]),iU=ae({id:N(),senderId:N(),format:N(),content:Nt(),metadata:Vt(N(),Nt()).default({}),createdAt:N()}),iE=nU.extend({configVersion:Be().int().positive(),recipientMode:aU.default("full"),inReplyToSnapshot:rU.default(null),precedingMessages:Et(iU).default([])});Ue(["pending","delivered","acked","failed"]);const lU=ae({id:Be(),inboxId:N(),messageId:N(),chatId:N().nullable(),status:N(),retryCount:Be(),createdAt:N(),deliveredAt:N().nullable(),ackedAt:N().nullable()});lU.extend({message:iE});ae({limit:Xu().int().min(1).max(50).default(10)});ae({type:Jt("inbox:deliver"),entryId:Be().int().nonnegative(),inboxId:N().min(1),chatId:N().nullable(),message:iE}).passthrough();ae({type:Jt("inbox:ack"),entryId:Be().int().nonnegative()});const sU=7;ae({organizationId:N(),organizationName:N(),organizationDisplayName:N(),role:N(),expiresAt:N().nullable()});ae({id:N(),organizationId:N(),token:N(),inviteUrl:N(),role:N(),createdAt:N(),expiresAt:N().nullable()});ae({token:N().min(1)});ae({}).optional();const oU=["all","unread","watching"],uU=Ue(oU),lE=Ue(["participant","watching"]);ae({cursor:N().optional(),limit:Xu().int().min(1).max(200).default(50),filter:uU.default("all")});const cU=ae({agentId:N(),displayName:N(),type:N()}),dU=ae({chatId:N(),type:N(),membershipKind:lE,title:N(),topic:N().nullable(),participants:Et(cU),participantCount:Be().int(),lastMessageAt:N().nullable(),lastMessagePreview:N().nullable(),unreadMentionCount:Be().int(),canReply:qr(),taskId:N().nullable(),taskStatus:N().nullable()});ae({rows:Et(dU),nextCursor:N().nullable()});ae({participantIds:Et(N().min(1)).min(1),topic:N().trim().max(500).optional().nullable()});ae({participantIds:Et(N().min(1)).min(1)});ae({chatId:N(),lastReadAt:N(),unreadMentionCount:Be().int()});ae({chatId:N(),membershipKind:lE.nullable()});ae({type:Jt("chat:message"),chatId:N()});Ue(["connect","create_agent","completed"]);ae({id:N(),name:N(),displayName:N(),role:Ue(["admin","member"])});ae({name:N().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:N().min(1).max(200)});ae({id:N(),organizationId:N(),organizationName:N(),role:Ue(["admin","member"]),agentId:N()});const fU={ADMIN:"admin",MEMBER:"member"},Fy=Ue(["admin","member"]),hU=ae({id:N(),userId:N(),organizationId:N(),agentId:N(),role:Fy,createdAt:N()});ae({username:N().min(1).max(100),displayName:N().min(1).max(200),role:Fy.default("member")});ae({role:Fy.optional(),displayName:N().min(1).max(200).optional()});hU.extend({username:N(),displayName:N(),password:N()});const mU=Ue(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),sE=Ue(["high","medium","low"]);ae({id:N(),organizationId:N(),type:mU,severity:sE,agentId:N().nullable(),chatId:N().nullable(),message:N(),read:qr(),createdAt:N()});ae({limit:Xu().int().min(1).max(100).default(20),cursor:N().optional(),severity:sE.optional(),read:Ue(["true","false"]).transform(e=>e==="true").optional(),agentId:N().optional()});ae({next:N().max(256).optional()});ae({code:N().min(1),state:N().min(1)});ae({githubId:N().min(1),login:N().min(1),email:N().email().optional(),displayName:N().optional(),next:N().max(256).optional()});const oE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ae({name:N().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=>!oE.test(e),"Name must not be a UUID format"),displayName:N().min(1).max(200),maxAgents:Be().int().min(0).default(0),maxMessagesPerMinute:Be().int().min(0).default(0),features:Vt(N(),Nt()).default({})});ae({name:N().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=>!oE.test(e),"Name must not be a UUID format").optional(),displayName:N().min(1).max(200).optional(),maxAgents:Be().int().min(0).optional(),maxMessagesPerMinute:Be().int().min(0).optional(),features:Vt(N(),Nt()).optional()});ae({id:N(),name:N(),displayName:N(),maxAgents:Be(),maxMessagesPerMinute:Be(),features:Vt(N(),Nt()),createdAt:N(),updatedAt:N()});const pU=ae({workingCount:Be().int().nonnegative(),errorMask:qr()}),gU=ae({type:Jt("pulse:tick"),organizationId:N(),agents:Vt(N(),Et(pU).length(32))}),yU=Ue(["tool_call","error","assistant_text","thinking","turn_end"]),uE=ae({toolUseId:N(),name:N(),args:Nt(),status:Ue(["pending","ok","error"]),durationMs:Be().int().nonnegative().optional(),resultPreview:N().max(400).optional()}),cE=ae({source:Ue(["sdk","runtime","tool"]),message:N().max(2e3)}),dE=ae({text:N().max(8e3)}),fE=ae({}),hE=ae({status:Ue(["success","error"])}),vU=Iy("kind",[ae({kind:Jt("tool_call"),payload:uE}),ae({kind:Jt("error"),payload:cE}),ae({kind:Jt("assistant_text"),payload:dE}),ae({kind:Jt("thinking"),payload:fE}),ae({kind:Jt("turn_end"),payload:hE})]);ae({id:N(),agentId:N(),chatId:N(),seq:Be().int().positive(),kind:yU,payload:VC([uE,cE,dE,fE,hE]),createdAt:N()});ae({agentId:N(),chatId:N(),event:vU});ae({agentId:N(),chatId:N()});ae({type:Jt("session:reconcile"),agentId:N().min(1),chatIds:Et(N().min(1)).max(500)});ae({type:Jt("session:reconcile:result"),agentId:N().min(1),staleChatIds:Et(N().min(1))});const bU=ae({organizationId:N(),agentCount:Be(),chatCount:Be(),messageCount:Be()});ae({totalAgents:Be(),totalChats:Be(),totalMessages:Be(),byOrganization:Et(bU)});const Tu=Ue(["pending","assigned","working","completed","failed","cancelled"]),Pw=Ue(["agent","admin"]),xU=Ue(["assigned","status_changed","cancelled"]);ae({taskId:N(),event:xU,title:N(),body:N().default(""),status:Tu,fromStatus:Tu.optional(),originRef:N().nullable().optional()});const wU=ae({title:N().min(1).max(500),body:N().optional(),assigneeAgentId:N().optional(),originRef:N().max(500).optional(),metadata:Vt(N(),Nt()).optional()});wU.extend({organizationId:N().optional()});ae({status:Ue(["working","completed","failed"]),result:N().optional()});ae({assigneeAgentId:N().nullable().optional(),status:Tu.optional(),result:N().optional()});ae({chatId:N().min(1)});const SU=ae({id:N(),organizationId:N(),title:N(),body:N(),status:Tu,assigneeAgentId:N().nullable(),createdByType:Pw,createdById:N(),originRef:N().nullable(),result:N().nullable(),metadata:Vt(N(),Nt()),createdAt:N(),updatedAt:N(),cancelledAt:N().nullable(),cancelledByType:Pw.nullable(),cancelledById:N().nullable()}),kU=ae({taskId:N(),chatId:N(),linkedByAgentId:N().nullable(),linkedAt:N()});SU.extend({chats:Et(kU)});ae({status:Tu.optional(),assigneeAgentId:N().optional(),originRef:N().optional(),limit:Xu().int().min(1).max(100).default(20),cursor:N().optional()});const jU=Ue(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ae({taskId:N(),signal:jU,reason:N()});const CU=Ue(["active","suspended"]);ae({id:N(),username:N(),displayName:N(),avatarUrl:N().nullable(),status:CU,createdAt:N(),updatedAt:N()});ae({username:N().min(1).max(100),displayName:N().min(1).max(200),password:N().min(8).max(200)});ae({displayName:N().min(1).max(200).optional(),password:N().min(8).max(200).optional()});ae({type:Jt("auth"),token:N().min(1)});const EU=ae({wsInboxDeliver:qr().default(!1)}).partial();ae({type:Jt("server:welcome"),serverCommandVersion:N().min(1),serverTimeMs:Be().int().nonnegative(),capabilities:EU.optional()}).passthrough();const mE=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function NU(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let a=0;a<32&&a<n.length;a++){const l=n[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const _U=2e3,TU=3e4;let mi=null,Au=!1,lf=0,fu=null;const Og=new Set;let hi=null,ll=0;function AU(e){for(const t of Og)try{t(e)}catch{}if(hi){if(e.type==="notification")hi.invalidateQueries({queryKey:["notifications"]});else if(e.type==="session:state")hi.invalidateQueries({queryKey:["activity"]}),hi.invalidateQueries({queryKey:["sessions"]});else if(e.type==="chat:message"){const t=typeof e.chatId=="string"?e.chatId:null;hi.invalidateQueries({queryKey:["me","chats"]}),t&&(hi.invalidateQueries({queryKey:["chat-messages",t]}),hi.invalidateQueries({queryKey:["chat-detail",t]}))}}}function qy(){const e=vf();if(!(e!=null&&e.accessToken))return;let t=null;try{t=localStorage.getItem("first-tree-hub:selectedOrganizationId")}catch{t=null}if(!t)return;const a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/orgs/${encodeURIComponent(t)}/ws/?token=${e.accessToken}`,l=new WebSocket(a);mi=l,l.onmessage=o=>{if(l===mi)try{const c=JSON.parse(o.data);AU(c)}catch{}},l.onopen=()=>{l===mi&&(lf=0)},l.onclose=o=>{if(l===mi&&(mi=null,!(Au||ll===0))){if(o.code===4001){bR().then(c=>{Au||ll===0||(c?(lf=0,qy()):Bw())});return}Bw()}}}function Bw(){lf++;const e=Math.min(_U*2**(lf-1),TU);fu=setTimeout(()=>{fu=null,!Au&&ll>0&&qy()},e)}function RU(){Au=!0,fu&&(clearTimeout(fu),fu=null),mi&&(mi.close(1e3,"unmount"),mi=null)}function pE(e){const{onMessage:t,enabled:n=!0}=e??{},a=fn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{hi=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Og.add(o),ll++,ll===1&&(Au=!1,qy()),()=>{Og.delete(o),ll--,ll===0&&RU()}},[n])}const zU=x.createContext({aggregated:mE,agents:{},receivedAtMs:null,stale:!0});function OU({children:e}){const[t,n]=x.useState({aggregated:mE,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());pE({onMessage:c=>{const f=gU.safeParse(c);f.success&&n({aggregated:NU(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const c=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return u.jsx(zU.Provider,{value:o,children:e})}function MU(e){return Ee.get(`/agents/${e}/config`)}function DU(e,t){return Ee.patch(`/agents/${e}/config`,t)}function IU(e,t){return Ee.post(`/agents/${e}/config/dry-run`,{payload:t})}function LU(e){return Ee.get(`/agents/${e}/client-status`)}function UU({className:e,style:t,...n}){return u.jsx("div",{className:Te("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function PU({onClick:e,children:t}){return u.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 BU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function $U({children:e,mono:t}){return u.jsx("span",{className:Te("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const FU={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 Ur({tone:e="neutral",className:t,style:n,...a}){const l=FU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.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},...a})}function Mg({children:e,right:t,className:n,style:a,...l}){return u.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)",...a},...l,children:[u.jsx("span",{children:e}),t]})}function Hy({className:e,style:t,...n}){return u.jsx("span",{className:Te("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function hu({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:Te("shrink-0",n),style:a,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.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"?u.jsx("span",{className:Te("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:Te("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function qU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ru({state:e,className:t}){const n=e!==null&&qU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(hu,{state:n,size:7}),n]})}function zd({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function HU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?u.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[u.jsxs("span",{children:["Runs on ",u.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),u.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function ZU(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),c=t.displayName||t.name||t.uuid;return u.jsxs("section",{id:"ad-danger",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:"var(--radius-panel)"},children:[u.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[u.jsx(Ys,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),u.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),u.jsxs("div",{children:[t.status==="active"?u.jsx(xp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(pe,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(xp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(pe,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(xp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(pe,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(Su,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(VU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(QU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function xp(e){return u.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:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),u.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),u.jsx("div",{children:e.action})]})}function VU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsxs(sn,{children:['Suspend "',n,'"?']})}),u.jsx("div",{className:"space-y-3",children:u.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(pe,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function QU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,c]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return u.jsx(ln,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsxs(sn,{children:['Delete "',n,'"?']})}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),u.jsx(At,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(pe,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}var KU="Label",gE=x.forwardRef((e,t)=>u.jsx(Oa.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())}}));gE.displayName=KU;var GU=gE;const ft=x.forwardRef(({className:e,...t},n)=>u.jsx(GU,{ref:n,className:Te("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));ft.displayName="Label";const tn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));tn.displayName="Panel";const Rr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,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},...n}));Rr.displayName="PanelHeader";const zr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));zr.displayName="PanelTitle";const Tn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Tn.displayName="PanelBody";const YU={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 Zy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=YU[e],f=e==="deleted";return u.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:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),c.label&&u.jsx("span",{className:Te("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(pe,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(Oz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(pe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(bf,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(pe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(Su,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function XU(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),c=e.items.filter(f=>f.status!=="deleted").length;return u.jsxs(tn,{children:[u.jsxs(Rr,{children:[u.jsxs(zr,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Fr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Tn,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===rf,y=m&&!h&&!!f.value.value,g=a.has(f.key);let b;return m?y&&g?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs(Zy,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:f.value.key}),u.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&u.jsx(Wk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?u.jsx(az,{className:"h-3.5 w-3.5"}):u.jsx(Xk,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(JU,{open:!!t,onOpenChange:f=>!f&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:f=>{t.mode==="edit"?e.onUpdate(t.key,f):e.onAdd(f),n(null)}})]})}function JU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=x.useState((n==null?void 0:n.sensitive)??!1),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((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 w(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=rf),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"env-key",children:"Key"}),u.jsx(At,{id:"env-key",value:o,onChange:k=>c(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&u.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"env-value",children:"Value"}),u.jsx(At,{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"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-body",children:[u.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)"]}),u.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&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(pe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function WU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(tn,{children:[u.jsxs(Rr,{children:[u.jsxs(zr,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Fr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Tn,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??af(l.value.url);return u.jsxs(Zy,{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:[u.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&u.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),u.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&u.jsx(eP,{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 eP({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,y]=x.useState((n==null?void 0:n.localPath)??""),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((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 w(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||af(j);if(E&&a.has(E)){b(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(C)}return u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"git-url",children:"URL"}),u.jsx(At,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(At,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(At,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:af(o)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(pe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function tP({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return u.jsx("span",{className:Te("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:Te("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:y??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:Te("inline-flex items-baseline gap-1.5",o),style:c,title:y??void 0,children:[h&&u.jsx("span",{style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function Vy(){return Ee.get(hn("/members"))}function nP(e,t){return Ee.patch(hn(`/members/${encodeURIComponent(e)}`),t)}function rP(e){return Ee.delete(hn(`/members/${encodeURIComponent(e)}`))}function yE(){const{data:e}=Ve({queryKey:["members","name-map"],queryFn:Vy,staleTime:3e4});return x.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 aP({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=_y(),o=yE(),c=e.metadata,f=c==null?void 0:c.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 u.jsxs(tn,{children:[u.jsxs(Rr,{children:[u.jsx(zr,{children:"Profile"}),e.status==="active"&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(bf,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(Tn,{className:"text-body space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&u.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx(tP,{name:g.name,displayName:g.displayName})]})]})]}),u.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(Ur,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(Ur,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>u.jsx(Ur,{tone:"outline",children:b},b))})]})]})]}),u.jsx(iP,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function iP({agent:e,open:t,onOpenChange:n,onSave:a}){var M;const{memberId:l,role:o}=Dt(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,w]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===l,R=Ve({queryKey:["agents-for-delegate"],queryFn:async()=>(await Gu({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&E});async function O(B){B.preventDefault(),j(null);const z=c.trim();if(!z){j("Display name is required.");return}w(!0);try{const $={displayName:z,delegateMention:m||null};y!==e.visibility&&($.visibility=y),await a($),n(!1)}catch($){j($ instanceof Error?$.message:String($))}finally{w(!1)}}return u.jsx(ln,{open:t,onOpenChange:n,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:O,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Agent name"}),u.jsx(At,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"id-display",children:"Display Name"}),u.jsx(At,{id:"id-display",value:c,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.target.value),disabled:!C,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:[u.jsx("option",{value:Uw.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:Uw.ORGANIZATION,children:"Organization — all members"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:C?"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&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.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:[u.jsx("option",{value:"",children:"None"}),(M=R.data)==null?void 0:M.map(B=>u.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (@${B.name??B.uuid})`:B.name?`@${B.name}`:B.uuid},B.uuid))]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&u.jsx("p",{className:"text-body text-destructive",children:k}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(pe,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function lP(e){return e==="working"?"accent":e==="error"?"error":"outline"}function sP(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(tn,{children:[u.jsxs(Rr,{children:[u.jsxs(zr,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Fr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Tn,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return u.jsxs(Zy,{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:[u.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:l.value.name}),u.jsx(Ur,{tone:lP(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:oP(l.value)})]},l.key)})}),t&&u.jsx(uP,{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 oP(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 uP({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,y]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(c((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 C(R){if(R.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(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const M=g.trim().split(/\s+/).filter(B=>B.length>0);O={name:f,transport:"stdio",command:h.trim(),...M.length?{args:M}:{}}}else{const M=w.trim();try{new URL(M)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:M}}l(O)}return u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:R=>c(R.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:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-name",children:"Name"}),u.jsx(At,{id:"mcp-name",value:f,onChange:R=>m(R.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-command",children:"Command"}),u.jsx(At,{id:"mcp-command",value:h,onChange:R=>y(R.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(At,{id:"mcp-args",value:g,onChange:R=>b(R.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-url",children:"URL"}),u.jsx(At,{id:"mcp-url",value:w,onChange:R=>k(R.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(pe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const cP=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],dP=[{value:"gpt-5.5",label:"gpt-5.5",hint:"latest"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5.4-mini",label:"gpt-5.4-mini",hint:"fastest"},{value:"gpt-5.3-codex",label:"gpt-5.3-codex",hint:"coding-specialized"},{value:"gpt-5.2",label:"gpt-5.2"}],fP={"claude-code":cP,codex:dP},hP={"claude-code":"Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ~/.claude/settings.json model preference, then the CLI default.",codex:"Pick a Codex model. Slugs come from the Codex CLI bundled with @openai/codex-sdk; ChatGPT-account auth currently only accepts gpt-5.5, while API-key auth accepts the wider set. Applies to new sessions immediately; active sessions switch on their next message. Unset lets the codex CLI choose a model that matches the user's auth mode."},mP={value:"",label:"(unset — inherits local)"};function pP({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=fP[o],m=x.useMemo(()=>{const h=[mP,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(tn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Rr,{children:[u.jsxs(zr,{children:["Model",c&&u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),c&&u.jsx(pe,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(Tn,{className:"space-y-2",children:[u.jsx(gP,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:hP[o]})]})]})}function gP({items:e,value:t,onChange:n,disabled:a}){const[l,o]=x.useState(!1),[c,f]=x.useState(null),m=x.useRef(null),h=x.useRef(null),y=e.find(b=>b.value===t)??e[0],g=x.useCallback(()=>{const b=m.current;if(!b)return;const w=b.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var C,R;const E=j.target;(C=m.current)!=null&&C.contains(E)||(R=h.current)!=null&&R.contains(E)||o(!1)},w=j=>{var E;j.key==="Escape"&&(o(!1),(E=m.current)==null||E.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),u.jsxs("div",{className:"max-w-md",children:[u.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(b=>!b),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[u.jsx("span",{className:"truncate",style:{color:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),u.jsx(Yk,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&Sy.createPortal(u.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:c.top,left:c.left,width:c.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(b=>{const w=b.value===t;return u.jsxs("button",{type:"button",onClick:()=>{n(b.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:w?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx($r,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),u.jsx("span",{className:"flex-1 truncate",children:b.label}),b.hint&&u.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:b.hint})]},b.value||"__unset")})}),document.body)]})}function yP(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xP={};function $w(e,t){return(xP.jsx?bP:vP).test(e)}const wP=/[ \t\n\f\r]/g;function SP(e){return typeof e=="object"?e.type==="text"?Fw(e.value):!1:Fw(e)}function Fw(e){return e.replace(wP,"")===""}class Ju{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Ju.prototype.normal={};Ju.prototype.property={};Ju.prototype.space=void 0;function vE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Ju(n,a,t)}function Dg(e){return e.toLowerCase()}class Wn{constructor(t,n){this.attribute=n,this.property=t}}Wn.prototype.attribute="";Wn.prototype.booleanish=!1;Wn.prototype.boolean=!1;Wn.prototype.commaOrSpaceSeparated=!1;Wn.prototype.commaSeparated=!1;Wn.prototype.defined=!1;Wn.prototype.mustUseProperty=!1;Wn.prototype.number=!1;Wn.prototype.overloadedBoolean=!1;Wn.prototype.property="";Wn.prototype.spaceSeparated=!1;Wn.prototype.space=void 0;let kP=0;const Ze=jl(),Xt=jl(),Ig=jl(),he=jl(),jt=jl(),Ss=jl(),sr=jl();function jl(){return 2**++kP}const Lg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:Xt,commaOrSpaceSeparated:sr,commaSeparated:Ss,number:he,overloadedBoolean:Ig,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),wp=Object.keys(Lg);class Qy extends Wn{constructor(t,n,a,l){let o=-1;if(super(t,n),qw(this,"space",l),typeof a=="number")for(;++o<wp.length;){const c=wp[o];qw(this,wp[o],(a&Lg[c])===Lg[c])}}}Qy.prototype.defined=!0;function qw(e,t,n){n&&(e[t]=n)}function Js(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Qy(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Dg(a)]=a,n[Dg(o.attribute)]=a}return new Ju(t,n,e.space)}const bE=Js({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:Xt,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:Xt,ariaFlowTo:jt,ariaGrabbed:Xt,ariaHasPopup:null,ariaHidden:Xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:he,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:jt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Xt,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 xE(e,t){return t in e?e[t]:t}function wE(e,t){return xE(e,t.toLowerCase())}const jP=Js({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:jt,autoFocus:Ze,autoPlay:Ze,blocking:jt,capture:null,charSet:null,checked:Ze,cite:null,className:jt,cols:he,colSpan:null,content:null,contentEditable:Xt,controls:Ze,controlsList:jt,coords:he|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:Ig,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:jt,height:he,hidden:Ig,high:he,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ze,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,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:Ze,optimum:he,pattern:null,ping:jt,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:jt,required:Ze,reversed:Ze,rows:he,rowSpan:he,sandbox:jt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Xt,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:Ze,useMap:null,value:Xt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,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:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Xt,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:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:wE}),CP=Js({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:sr,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:jt,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:Ze,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:Ss,g2:Ss,glyphName:Ss,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:sr,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:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sr,rev:sr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sr,requiredFeatures:sr,requiredFonts:sr,requiredFormats:sr,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:sr,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:sr,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:sr,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:xE}),SE=Js({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()}}),kE=Js({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wE}),jE=Js({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),EP={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"},NP=/[A-Z]/g,Hw=/-[a-z]/g,_P=/^data[-\w.:]+$/i;function TP(e,t){const n=Dg(t);let a=t,l=Wn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_P.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Hw,RP);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Hw.test(o)){let c=o.replace(NP,AP);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Qy}return new l(a,t)}function AP(e){return"-"+e.toLowerCase()}function RP(e){return e.charAt(1).toUpperCase()}const zP=vE([bE,jP,SE,kE,jE],"html"),Ky=vE([bE,CP,SE,kE,jE],"svg");function OP(e){return e.join(" ").trim()}var fs={},Sp,Zw;function MP(){if(Zw)return Sp;Zw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
358
+ `,h="/",y="*",g="",b="comment",w="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var R=1,O=1;function M(Y){var J=Y.match(t);J&&(R+=J.length);var H=Y.lastIndexOf(m);O=~H?Y.length-H:O+Y.length}function B(){var Y={line:R,column:O};return function(J){return J.position=new z(Y),Q(),J}}function z(Y){this.start=Y,this.end={line:R,column:O},this.source=C.source}z.prototype.content=E;function $(Y){var J=new Error(C.source+":"+R+":"+O+": "+Y);if(J.reason=Y,J.filename=C.source,J.line=R,J.column=O,J.source=E,!C.silent)throw J}function U(Y){var J=Y.exec(E);if(J){var H=J[0];return M(H),E=E.slice(H.length),J}}function Q(){U(n)}function I(Y){var J;for(Y=Y||[];J=ne();)J!==!1&&Y.push(J);return Y}function ne(){var Y=B();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var J=2;g!=E.charAt(J)&&(y!=E.charAt(J)||h!=E.charAt(J+1));)++J;if(J+=2,g===E.charAt(J-1))return $("End of comment missing");var H=E.slice(2,J-2);return O+=2,M(H),E=E.slice(J),O+=2,Y({type:b,comment:H})}}function le(){var Y=B(),J=U(a);if(J){if(ne(),!U(l))return $("property missing ':'");var H=U(o),ee=Y({type:w,property:j(J[0].replace(e,g)),value:H?j(H[0].replace(e,g)):g});return U(c),ee}}function we(){var Y=[];I(Y);for(var J;J=le();)J!==!1&&(Y.push(J),I(Y));return Y}return Q(),we()}function j(E){return E?E.replace(f,g):g}return Sp=k,Sp}var Vw;function DP(){if(Vw)return fs;Vw=1;var e=fs&&fs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.default=n;const t=e(MP());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.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 fs}var au={},Qw;function IP(){if(Qw)return au;Qw=1,Object.defineProperty(au,"__esModule",{value:!0}),au.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=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(a,f),h.replace(t,c))};return au.camelCase=m,au}var iu,Kw;function LP(){if(Kw)return iu;Kw=1;var e=iu&&iu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(DP()),n=IP();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,iu=a,iu}var UP=LP();const PP=hf(UP),CE=EE("end"),Gy=EE("start");function EE(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function BP(e){const t=Gy(e),n=CE(e);if(t&&n)return{start:t,end:n}}function mu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gw(e.position):"start"in e||"end"in e?Gw(e):"line"in e||"column"in e?Ug(e):""}function Ug(e){return Yw(e&&e.line)+":"+Yw(e&&e.column)}function Gw(e){return Ug(e&&e.start)+"-"+Ug(e&&e.end)}function Yw(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!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&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.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=mu(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=c&&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}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const Yy={}.hasOwnProperty,$P=new Map,FP=/[A-Z]/g,qP=new Set(["table","tbody","thead","tfoot","tr"]),HP=new Set(["td","th"]),NE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=WP(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=JP(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ky:zP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=_E(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function _E(e,t,n){if(t.type==="element")return VP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return GP(e,t,n);if(t.type==="mdxjsEsm")return KP(e,t);if(t.type==="root")return YP(e,t,n);if(t.type==="text")return XP(e,t)}function VP(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Ky,e.schema=l),e.ancestors.push(t);const o=AE(e,t.tagName,!1),c=e9(e,t);let f=Jy(e,t);return qP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!SP(m):!0})),TE(e,c,o,t),Xy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function QP(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}zu(e,t.position)}function KP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zu(e,t.position)}function GP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Ky,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:AE(e,t.name,!0),c=t9(e,t),f=Jy(e,t);return TE(e,c,o,t),Xy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function YP(e,t,n){const a={};return Xy(a,Jy(e,t)),e.create(t,e.Fragment,a,n)}function XP(e,t){return t.value}function TE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Xy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function JP(e,t,n){return a;function a(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function WP(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=Gy(a);return t(l,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function e9(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Yy.call(t.properties,l)){const o=n9(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&HP.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function t9(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else zu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else zu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function Jy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:$P;for(;++a<t.children.length;){const o=t.children[a];let c;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;c=m+"-"+h,l.set(m,h+1)}}const f=_E(e,o,c);f!==void 0&&n.push(f)}return n}function n9(e,t,n){const a=TP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?yP(n):OP(n)),a.property==="style"){let l=typeof n=="object"?n:r9(e,String(n));return e.stylePropertyNameCase==="css"&&(l=a9(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?EP[a.property]||a.property:a.attribute,n]}}function r9(e,t){try{return PP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new An("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=NE+"#cannot-parse-style-attribute",l}}function AE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=$w(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=$w(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Yy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);zu(e)}function zu(e,t){const n=new An("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=NE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function a9(e){const t={};let n;for(n in e)Yy.call(e,n)&&(t[i9(n)]=e[n]);return t}function i9(e){let t=e.replace(FP,l9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function l9(e){return"-"+e.toLowerCase()}const kp={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"]},s9={};function Wy(e,t){const n=s9,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return RE(e,a,l)}function RE(e,t,n){if(o9(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 Xw(e.children,t,n)}return Array.isArray(e)?Xw(e,t,n):""}function Xw(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=RE(e[l],t,n);return a.join("")}function o9(e){return!!(e&&typeof e=="object")}const Jw=document.createElement("i");function ev(e){const t="&"+e+";";Jw.innerHTML=t;const n=Jw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function dr(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function Nr(e,t){return e.length>0?(dr(e,e.length,0,t),e):t}const Ww={}.hasOwnProperty;function zE(e){const t={};let n=-1;for(;++n<e.length;)u9(t,e[n]);return t}function u9(e,t){let n;for(n in t){const l=(Ww.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Ww.call(l,c)||(l[c]=[]);const f=o[c];c9(l[c],Array.isArray(f)?f:f?[f]:[])}}}function c9(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);dr(e,0,0,a)}function OE(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 Br(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=Di(/[A-Za-z]/),_n=Di(/[\dA-Za-z]/),d9=Di(/[#-'*+\--9=?A-Z^-~]/);function sf(e){return e!==null&&(e<32||e===127)}const Pg=Di(/\d/),f9=Di(/[\dA-Fa-f]/),h9=Di(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const zf=Di(new RegExp("\\p{P}|\\p{S}","u")),bl=Di(/\s/);function Di(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ws(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&_n(e.charCodeAt(n+1))&&_n(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function ot(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return et(m)?(e.enter(n),f(m)):t(m)}function f(m){return et(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const m9={tokenize:p9};function p9(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ot(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,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return De(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const g9={tokenize:y9},eS={tokenize:v9};function y9(e){const t=this,n=[];let a=0,l,o,c;return f;function f(O){if(a<n.length){const M=n[a];return t.containerState=M[1],e.attempt(M[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const M=t.events.length;let B=M,z;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){z=t.events[B][1].end;break}C(a);let $=M;for(;$<t.events.length;)t.events[$][1].end={...z},$++;return dr(t.events,B+1,0,t.events.slice(M)),t.events.length=$,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(eS,y,g)(O)}function y(O){return l&&R(),C(a),b(O)}function g(O){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(eS,w,k)(O)}function w(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&R(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return De(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,M){const B=t.sliceStream(O);if(M&&B.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(B),t.parser.lazy[O.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<c&&(!l.events[z][1].end||l.events[z][1].end.offset>c))return;const $=t.events.length;let U=$,Q,I;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(Q){I=t.events[U][1].end;break}Q=!0}for(C(a),z=$;z<t.events.length;)t.events[z][1].end={...I},z++;dr(t.events,U+1,0,t.events.slice($)),t.events.length=z}}function C(O){let M=n.length;for(;M-- >O;){const B=n[M];t.containerState=B[1],B[0].exit.call(t,e)}n.length=O}function R(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function v9(e,t,n){return ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $s(e){if(e===null||kt(e)||bl(e))return 1;if(zf(e))return 2}function Of(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Bg={name:"attention",resolveAll:b9,tokenize:x9};function b9(e,t){let n=-1,a,l,o,c,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},b={...e[n][1].start};tS(g,-m),tS(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Nr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Nr(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Nr(h,Of(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Nr(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=Nr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,dr(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function x9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=$s(a);let o;return c;function c(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=$s(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function tS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const w9={name:"autolink",tokenize:S9};function S9(e,t,n){let a=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return In(w)?(e.consume(w),c):w===64?n(w):h(w)}function c(w){return w===43||w===45||w===46||_n(w)?(a=1,f(w)):h(w)}function f(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||_n(w))&&a++<32?(e.consume(w),f):(a=0,h(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||sf(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):d9(w)?(e.consume(w),h):n(w)}function y(w){return _n(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):b(w)}function b(w){if((w===45||_n(w))&&a++<63){const k=w===45?b:g;return e.consume(w),k}return n(w)}}const Wu={partial:!0,tokenize:k9};function k9(e,t,n){return a;function a(o){return et(o)?ot(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||De(o)?t(o):n(o)}}const ME={continuation:{tokenize:C9},exit:E9,name:"blockQuote",tokenize:j9};function j9(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return et(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function C9(e,t,n){const a=this;return l;function l(c){return et(c)?ot(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(ME,t,n)(c)}}function E9(e){e.exit("blockQuote")}const DE={name:"characterEscape",tokenize:N9};function N9(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return h9(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const IE={name:"characterReference",tokenize:_9};function _9(e,t,n){const a=this;let l=0,o,c;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,c=_n,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=f9,y):(e.enter("characterReferenceValue"),o=7,c=Pg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===_n&&!ev(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const nS={partial:!0,tokenize:A9},rS={concrete:!0,name:"codeFenced",tokenize:T9};function T9(e,t,n){const a=this,l={partial:!0,tokenize:B};let o=0,c=0,f;return m;function m(z){return h(z)}function h(z){const $=a.events[a.events.length-1];return o=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(z)}function y(z){return z===f?(c++,e.consume(z),y):c<3?n(z):(e.exit("codeFencedFenceSequence"),et(z)?ot(e,g,"whitespace")(z):g(z))}function g(z){return z===null||De(z)?(e.exit("codeFencedFence"),a.interrupt?t(z):e.check(nS,j,M)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||De(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(z)):et(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ot(e,w,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function w(z){return z===null||De(z)?g(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||De(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,M,E)(z)}function E(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),C}function C(z){return o>0&&et(z)?ot(e,R,"linePrefix",o+1)(z):R(z)}function R(z){return z===null||De(z)?e.check(nS,j,M)(z):(e.enter("codeFlowValue"),O(z))}function O(z){return z===null||De(z)?(e.exit("codeFlowValue"),R(z)):(e.consume(z),O)}function M(z){return e.exit("codeFenced"),t(z)}function B(z,$,U){let Q=0;return I;function I(J){return z.enter("lineEnding"),z.consume(J),z.exit("lineEnding"),ne}function ne(J){return z.enter("codeFencedFence"),et(J)?ot(z,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):le(J)}function le(J){return J===f?(z.enter("codeFencedFenceSequence"),we(J)):U(J)}function we(J){return J===f?(Q++,z.consume(J),we):Q>=c?(z.exit("codeFencedFenceSequence"),et(J)?ot(z,Y,"whitespace")(J):Y(J)):U(J)}function Y(J){return J===null||De(J)?(z.exit("codeFencedFence"),$(J)):U(J)}}}function A9(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const jp={name:"codeIndented",tokenize:z9},R9={partial:!0,tokenize:O9};function z9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),ot(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):De(h)?e.attempt(R9,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||De(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function O9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):De(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):ot(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):De(c)?l(c):n(c)}}const M9={name:"codeText",previous:I9,resolve:D9,tokenize:L9};function D9(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function I9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function L9(e,t,n){let a=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,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)):De(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||De(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class U9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&lu(this.left,a),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),lu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lu(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);lu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lu(this.left,n.reverse())}}}function lu(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 LE(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new U9(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(m=a[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(a[0]==="enter")a[1].contentType&&(Object.assign(t,P9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return dr(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function P9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let y,g,b=-1,w=n,k=0,j=0;const E=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=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),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),R=o.pop();m.push([R,R+C.length-1]),e.splice(R,2,C)}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 B9={resolve:F9,tokenize:q9},$9={partial:!0,tokenize:H9};function F9(e){return LE(e),e}function q9(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):De(f)?e.check($9,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function H9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ot(e,o,"linePrefix")}function o(c){if(c===null||De(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function UE(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||sf(C)?n(C):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),w(C))}function w(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||De(C)?n(C):(e.consume(C),C===92?k:w)}function k(C){return C===60||C===62||C===92?(e.consume(C),w):w(C)}function j(C){return!y&&(C===null||C===41||kt(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(C)):y<h&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||sf(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function PE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):De(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||De(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!et(w)),w===92?b:g)}function b(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function BE(e,t,n,a,l,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),c=b===40?41:b,m):n(b)}function m(b){return b===c?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),m(c)):b===null?n(b):De(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ot(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||De(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===c||b===92?(e.consume(b),y):y(b)}}function pu(e,t){let n;return a;function a(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):et(l)?ot(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const Z9={name:"definition",tokenize:Q9},V9={partial:!0,tokenize:K9};function Q9(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),c(w)}function c(w){return PE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Br(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return kt(w)?pu(e,h)(w):h(w)}function h(w){return UE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(V9,g,g)(w)}function g(w){return et(w)?ot(e,b,"whitespace")(w):b(w)}function b(w){return w===null||De(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function K9(e,t,n){return a;function a(f){return kt(f)?pu(e,l)(f):n(f)}function l(f){return BE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return et(f)?ot(e,c,"whitespace")(f):c(f)}function c(f){return f===null||De(f)?t(f):n(f)}}const G9={name:"hardBreakEscape",tokenize:Y9};function Y9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return De(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const X9={name:"headingAtx",resolve:J9,tokenize:W9};function J9(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},dr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function W9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||kt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||De(y)?(e.exit("atxHeading"),t(y)):et(y)?ot(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||kt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const e8=["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"],aS=["pre","script","style","textarea"],t8={concrete:!0,name:"htmlFlow",resolveTo:a8,tokenize:i8},n8={partial:!0,tokenize:s8},r8={partial:!0,tokenize:l8};function a8(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 i8(e,t,n){const a=this;let l,o,c,f,m;return h;function h(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),b):T===47?(e.consume(T),o=!0,j):T===63?(e.consume(T),l=3,a.interrupt?t:A):In(T)?(e.consume(T),c=String.fromCharCode(T),E):n(T)}function b(T){return T===45?(e.consume(T),l=2,w):T===91?(e.consume(T),l=5,f=0,k):In(T)?(e.consume(T),l=4,a.interrupt?t:A):n(T)}function w(T){return T===45?(e.consume(T),a.interrupt?t:A):n(T)}function k(T){const Z="CDATA[";return T===Z.charCodeAt(f++)?(e.consume(T),f===Z.length?a.interrupt?t:le:k):n(T)}function j(T){return In(T)?(e.consume(T),c=String.fromCharCode(T),E):n(T)}function E(T){if(T===null||T===47||T===62||kt(T)){const Z=T===47,W=c.toLowerCase();return!Z&&!o&&aS.includes(W)?(l=1,a.interrupt?t(T):le(T)):e8.includes(c.toLowerCase())?(l=6,Z?(e.consume(T),C):a.interrupt?t(T):le(T)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):o?R(T):O(T))}return T===45||_n(T)?(e.consume(T),c+=String.fromCharCode(T),E):n(T)}function C(T){return T===62?(e.consume(T),a.interrupt?t:le):n(T)}function R(T){return et(T)?(e.consume(T),R):I(T)}function O(T){return T===47?(e.consume(T),I):T===58||T===95||In(T)?(e.consume(T),M):et(T)?(e.consume(T),O):I(T)}function M(T){return T===45||T===46||T===58||T===95||_n(T)?(e.consume(T),M):B(T)}function B(T){return T===61?(e.consume(T),z):et(T)?(e.consume(T),B):O(T)}function z(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),m=T,$):et(T)?(e.consume(T),z):U(T)}function $(T){return T===m?(e.consume(T),m=null,Q):T===null||De(T)?n(T):(e.consume(T),$)}function U(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||kt(T)?B(T):(e.consume(T),U)}function Q(T){return T===47||T===62||et(T)?O(T):n(T)}function I(T){return T===62?(e.consume(T),ne):n(T)}function ne(T){return T===null||De(T)?le(T):et(T)?(e.consume(T),ne):n(T)}function le(T){return T===45&&l===2?(e.consume(T),H):T===60&&l===1?(e.consume(T),ee):T===62&&l===4?(e.consume(T),L):T===63&&l===3?(e.consume(T),A):T===93&&l===5?(e.consume(T),Ae):De(T)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(n8,P,we)(T)):T===null||De(T)?(e.exit("htmlFlowData"),we(T)):(e.consume(T),le)}function we(T){return e.check(r8,Y,P)(T)}function Y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),J}function J(T){return T===null||De(T)?we(T):(e.enter("htmlFlowData"),le(T))}function H(T){return T===45?(e.consume(T),A):le(T)}function ee(T){return T===47?(e.consume(T),c="",be):le(T)}function be(T){if(T===62){const Z=c.toLowerCase();return aS.includes(Z)?(e.consume(T),L):le(T)}return In(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),be):le(T)}function Ae(T){return T===93?(e.consume(T),A):le(T)}function A(T){return T===62?(e.consume(T),L):T===45&&l===2?(e.consume(T),A):le(T)}function L(T){return T===null||De(T)?(e.exit("htmlFlowData"),P(T)):(e.consume(T),L)}function P(T){return e.exit("htmlFlow"),t(T)}}function l8(e,t,n){const a=this;return l;function l(c){return De(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function s8(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Wu,t,n)}}const o8={name:"htmlText",tokenize:u8};function u8(e,t,n){const a=this;let l,o,c;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),B):A===63?(e.consume(A),O):In(A)?(e.consume(A),U):n(A)}function h(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),o=0,k):In(A)?(e.consume(A),R):n(A)}function y(A){return A===45?(e.consume(A),w):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),b):De(A)?(c=g,ee(A)):(e.consume(A),g)}function b(A){return A===45?(e.consume(A),w):g(A)}function w(A){return A===62?H(A):A===45?b(A):g(A)}function k(A){const L="CDATA[";return A===L.charCodeAt(o++)?(e.consume(A),o===L.length?j:k):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):De(A)?(c=j,ee(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),C):j(A)}function C(A){return A===62?H(A):A===93?(e.consume(A),C):j(A)}function R(A){return A===null||A===62?H(A):De(A)?(c=R,ee(A)):(e.consume(A),R)}function O(A){return A===null?n(A):A===63?(e.consume(A),M):De(A)?(c=O,ee(A)):(e.consume(A),O)}function M(A){return A===62?H(A):O(A)}function B(A){return In(A)?(e.consume(A),z):n(A)}function z(A){return A===45||_n(A)?(e.consume(A),z):$(A)}function $(A){return De(A)?(c=$,ee(A)):et(A)?(e.consume(A),$):H(A)}function U(A){return A===45||_n(A)?(e.consume(A),U):A===47||A===62||kt(A)?Q(A):n(A)}function Q(A){return A===47?(e.consume(A),H):A===58||A===95||In(A)?(e.consume(A),I):De(A)?(c=Q,ee(A)):et(A)?(e.consume(A),Q):H(A)}function I(A){return A===45||A===46||A===58||A===95||_n(A)?(e.consume(A),I):ne(A)}function ne(A){return A===61?(e.consume(A),le):De(A)?(c=ne,ee(A)):et(A)?(e.consume(A),ne):Q(A)}function le(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,we):De(A)?(c=le,ee(A)):et(A)?(e.consume(A),le):(e.consume(A),Y)}function we(A){return A===l?(e.consume(A),l=void 0,J):A===null?n(A):De(A)?(c=we,ee(A)):(e.consume(A),we)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||kt(A)?Q(A):(e.consume(A),Y)}function J(A){return A===47||A===62||kt(A)?Q(A):n(A)}function H(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function ee(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),be}function be(A){return et(A)?ot(e,Ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Ae(A)}function Ae(A){return e.enter("htmlTextData"),c(A)}}const tv={name:"labelEnd",resolveAll:h8,resolveTo:m8,tokenize:p8},c8={tokenize:g8},d8={tokenize:y8},f8={tokenize:v8};function h8(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&dr(e,0,e.length,n),e}function m8(e,t){let n=e.length,a=0,l,o,c,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(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=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[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=Nr(f,e.slice(o+1,o+a+3)),f=Nr(f,[["enter",y,t]]),f=Nr(f,Of(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=Nr(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=Nr(f,e.slice(c+1)),f=Nr(f,[["exit",m,t]]),dr(e,o,e.length,f),e}function p8(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?g(b):(c=a.parser.defined.includes(Br(a.sliceSerialize({start:o.end,end:a.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(c8,y,c?y:g)(b):b===91?e.attempt(d8,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(f8,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function g8(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return kt(g)?pu(e,o)(g):o(g)}function o(g){return g===41?y(g):UE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return kt(g)?pu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?BE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return kt(g)?pu(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 y8(e,t,n){const a=this;return l;function l(f){return PE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Br(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function v8(e,t,n){return a;function a(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 b8={name:"labelStartImage",resolveAll:tv.resolveAll,tokenize:x8};function x8(e,t,n){const a=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"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const w8={name:"labelStartLink",resolveAll:tv.resolveAll,tokenize:S8};function S8(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Cp={name:"lineEnding",tokenize:k8};function k8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ot(e,t,"linePrefix")}}const Vd={name:"thematicBreak",tokenize:j8};function j8(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||De(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),et(h)?ot(e,f,"whitespace")(h):f(h))}}const Qn={continuation:{tokenize:_8},exit:A8,name:"list",tokenize:N8},C8={partial:!0,tokenize:R8},E8={partial:!0,tokenize:T8};function N8(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Pg(w)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Vd,n,h)(w):h(w);if(!a.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return n(w)}function m(w){return Pg(w)&&++c<10?(e.consume(w),m):(!a.interrupt||c<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(Wu,a.interrupt?n:y,e.attempt(C8,b,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,b(w)}function g(w){return et(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),b):n(w)}function b(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function _8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Wu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ot(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!et(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(E8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,ot(e,e.attempt(Qn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function T8(e,t,n){const a=this;return ot(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function A8(e){e.exit(this.containerState.type)}function R8(e,t,n){const a=this;return ot(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!et(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const iS={name:"setextUnderline",resolveTo:z8,tokenize:O8};function z8(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=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 c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function O8(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),et(h)?ot(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||De(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const M8={tokenize:D8};function D8(e){const t=this,n=e.attempt(Wu,a,e.attempt(this.parser.constructs.flowInitial,l,ot(e,e.attempt(this.parser.constructs.flow,l,e.attempt(B9,l)),"linePrefix")));return n;function a(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 I8={resolveAll:FE()},L8=$E("string"),U8=$E("text");function $E(e){return{resolveAll:FE(e==="text"?P8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(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 w=g[b];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function FE(e){return t;function t(n,a){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,a):n}}function P8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-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?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const B8={42:Qn,43:Qn,45:Qn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,62:ME},$8={91:Z9},F8={[-2]:jp,[-1]:jp,32:jp},q8={35:X9,42:Vd,45:[iS,Vd],60:t8,61:iS,95:Vd,96:rS,126:rS},H8={38:IE,92:DE},Z8={[-5]:Cp,[-4]:Cp,[-3]:Cp,33:b8,38:IE,42:Bg,60:[w9,o8],91:w8,92:[G9,DE],93:tv,95:Bg,96:M9},V8={null:[Bg,I8]},Q8={null:[42,95]},K8={null:[]},G8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Q8,contentInitial:$8,disable:K8,document:B8,flow:q8,flowInitial:F8,insideSpan:V8,string:H8,text:Z8},Symbol.toStringTag,{value:"Module"}));function Y8(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const m={attempt:$(B),check:$(z),consume:R,enter:O,exit:M,interrupt:$(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ne){return c=Nr(c,ne),E(),c[c.length-1]!==null?[]:(U(t,0),h.events=Of(o,h.events,h),h.events)}function b(ne,le){return J8(w(ne),le)}function w(ne){return X8(c,ne)}function k(){const{_bufferIndex:ne,_index:le,line:we,column:Y,offset:J}=a;return{_bufferIndex:ne,_index:le,line:we,column:Y,offset:J}}function j(ne){l[ne.line]=ne.column,I()}function E(){let ne;for(;a._index<c.length;){const le=c[a._index];if(typeof le=="string")for(ne=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ne&&a._bufferIndex<le.length;)C(le.charCodeAt(a._bufferIndex));else C(le)}}function C(ne){y=y(ne)}function R(ne){De(ne)?(a.line++,a.column=1,a.offset+=ne===-3?2:1,I()):ne!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ne}function O(ne,le){const we=le||{};return we.type=ne,we.start=k(),h.events.push(["enter",we,h]),f.push(we),we}function M(ne){const le=f.pop();return le.end=k(),h.events.push(["exit",le,h]),le}function B(ne,le){U(ne,le.from)}function z(ne,le){le.restore()}function $(ne,le){return we;function we(Y,J,H){let ee,be,Ae,A;return Array.isArray(Y)?P(Y):"tokenize"in Y?P([Y]):L(Y);function L(ce){return ve;function ve(ge){const fe=ge!==null&&ce[ge],Qe=ge!==null&&ce.null,Oe=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(Qe)?Qe:Qe?[Qe]:[]];return P(Oe)(ge)}}function P(ce){return ee=ce,be=0,ce.length===0?H:T(ce[be])}function T(ce){return ve;function ve(ge){return A=Q(),Ae=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?W():ce.tokenize.call(le?Object.assign(Object.create(h),le):h,m,Z,W)(ge)}}function Z(ce){return ne(Ae,A),J}function W(ce){return A.restore(),++be<ee.length?T(ee[be]):H}}}function U(ne,le){ne.resolveAll&&!o.includes(ne)&&o.push(ne),ne.resolve&&dr(h.events,le,h.events.length-le,ne.resolve(h.events.slice(le),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function Q(){const ne=k(),le=h.previous,we=h.currentConstruct,Y=h.events.length,J=Array.from(f);return{from:Y,restore:H};function H(){a=ne,h.previous=le,h.currentConstruct=we,h.events.length=Y,f=J,I()}}function I(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function X8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function J8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
359
+ `;break}case-3:{c=`\r
360
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function W8(e){const a={constructs:zE([G8,...(e||{}).extensions||[]]),content:l(m9),defined:[],document:l(g9),flow:l(M8),lazy:{},string:l(L8),text:l(U8)};return a;function l(o){return c;function c(f){return Y8(a,o,f)}}}function eB(e){for(;!LE(e););return e}const lS=/[\0\t\n\r]/g;function tB(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(lS.lastIndex=g,h=lS.exec(o),b=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(b),!h){t=o.slice(g);break}if(w===10&&g===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),w){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:a=!0,e=1}g=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const nB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rB(e){return e.replace(nB,aB)}function aB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return OE(n.slice(o?2:1),o?16:10)}return ev(n)||e}const qE={}.hasOwnProperty;function iB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),lB(n)(eB(W8(n).document().write(tB()(e,t,!0))))}function lB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Da),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:o(Me),blockQuote:o(Qe),characterEscape:Q,characterReference:Q,codeFenced:o(Oe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Oe,c),codeText:o(ut,c),codeTextData:Q,data:Q,codeFlowValue:Q,definition:o(re),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Se),hardBreakEscape:o(Ge),hardBreakTrailing:o(Ge),htmlFlow:o(Rn,c),htmlFlowData:Q,htmlText:o(Rn,c),htmlTextData:Q,image:o(zn),label:c,link:o(Da),listItem:o(ra),listItemValue:b,listOrdered:o(Ia,g),listUnordered:o(Ia),paragraph:o(ro),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Me),strong:o(ao),thematicBreak:o(io)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:fe,autolinkProtocol:ge,blockQuote:m(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ce,characterReference:ve,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:m(C),codeText:m(J),codeTextData:I,data:I,definition:m(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(le),hardBreakTrailing:m(le),htmlFlow:m(we),htmlFlowData:I,htmlText:m(Y),htmlTextData:I,image:m(ee),label:Ae,labelText:be,lineEnding:ne,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Z,resourceDestinationString:A,resourceTitleString:L,resource:P,setextHeading:m(U),setextHeadingLineSequence:$,setextHeadingText:z,strong:m(),thematicBreak:m()}};HE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(se){let ye={type:"root",children:[]};const Pe={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},$e=[];let rt=-1;for(;++rt<se.length;)if(se[rt][1].type==="listOrdered"||se[rt][1].type==="listUnordered")if(se[rt][0]==="enter")$e.push(rt);else{const pn=$e.pop();rt=l(se,pn,rt)}for(rt=-1;++rt<se.length;){const pn=t[se[rt][0]];qE.call(pn,se[rt][1].type)&&pn[se[rt][1].type].call(Object.assign({sliceSerialize:se[rt][2].sliceSerialize},Pe),se[rt][1])}if(Pe.tokenStack.length>0){const pn=Pe.tokenStack[Pe.tokenStack.length-1];(pn[1]||sS).call(Pe,void 0,pn[0])}for(ye.position={start:ci(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:ci(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)ye=t.transforms[rt](ye)||ye;return ye}function l(se,ye,Pe){let $e=ye-1,rt=-1,pn=!1,hr,nn,qt,gn;for(;++$e<=Pe;){const mt=se[$e];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?rt++:rt--,gn=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(hr&&!gn&&!rt&&!qt&&(qt=$e),gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gn=void 0}if(!rt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||rt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(hr){let Or=$e;for(nn=void 0;Or--;){const Pn=se[Or];if(Pn[1].type==="lineEnding"||Pn[1].type==="lineEndingBlank"){if(Pn[0]==="exit")continue;nn&&(se[nn][1].type="lineEndingBlank",pn=!0),Pn[1].type="lineEnding",nn=Or}else if(!(Pn[1].type==="linePrefix"||Pn[1].type==="blockQuotePrefix"||Pn[1].type==="blockQuotePrefixWhitespace"||Pn[1].type==="blockQuoteMarker"||Pn[1].type==="listItemIndent"))break}qt&&(!nn||qt<nn)&&(hr._spread=!0),hr.end=Object.assign({},nn?se[nn][1].start:mt[1].end),se.splice(nn||$e,0,["exit",hr,mt[2]]),$e++,Pe++}if(mt[1].type==="listItemPrefix"){const Or={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};hr=Or,se.splice($e,0,["enter",Or,mt[2]]),$e++,Pe++,qt=void 0,gn=!0}}}return se[ye][1]._spread=pn,Pe}function o(se,ye){return Pe;function Pe($e){f.call(this,se($e),$e),ye&&ye.call(this,$e)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(se,ye,Pe){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([ye,Pe||void 0]),se.position={start:ci(ye.start),end:void 0}}function m(se){return ye;function ye(Pe){se&&se.call(this,Pe),h.call(this,Pe)}}function h(se,ye){const Pe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==se.type&&(ye?ye.call(this,se,$e[0]):($e[1]||sS).call(this,se,$e[0]));else throw new Error("Cannot close `"+se.type+"` ("+mu({start:se.start,end:se.end})+"): it’s not open");Pe.position.end=ci(se.end)}function y(){return Wy(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(se){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function w(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=se}function k(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=se}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/(\r?\n|\r)$/g,"")}function R(se){const ye=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ye,Pe.identifier=Br(this.sliceSerialize(se)).toLowerCase()}function O(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function M(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function B(se){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Pe=this.sliceSerialize(se).length;ye.depth=Pe}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function $(se){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(se){const Pe=this.stack[this.stack.length-1].children;let $e=Pe[Pe.length-1];(!$e||$e.type!=="text")&&($e=mn(),$e.position={start:ci(se.start),end:void 0},Pe.push($e)),this.stack.push($e)}function I(se){const ye=this.stack.pop();ye.value+=this.sliceSerialize(se),ye.position.end=ci(se.end)}function ne(se){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=ye.children[ye.children.length-1];Pe.position.end=ci(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(Q.call(this,se),I.call(this,se))}function le(){this.data.atHardBreak=!0}function we(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function Y(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function J(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function H(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function ee(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function be(se){const ye=this.sliceSerialize(se),Pe=this.stack[this.stack.length-2];Pe.label=rB(ye),Pe.identifier=Br(ye).toLowerCase()}function Ae(){const se=this.stack[this.stack.length-1],ye=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const $e=se.children;Pe.children=$e}else Pe.alt=ye}function A(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function L(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function P(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function Z(se){const ye=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ye,Pe.identifier=Br(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function W(se){this.data.characterReferenceType=se.type}function ce(se){const ye=this.sliceSerialize(se),Pe=this.data.characterReferenceType;let $e;Pe?($e=OE(ye,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=ev(ye);const rt=this.stack[this.stack.length-1];rt.value+=$e}function ve(se){const ye=this.stack.pop();ye.position.end=ci(se.end)}function ge(se){I.call(this,se);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(se)}function fe(se){I.call(this,se);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(se)}function Qe(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function ut(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Se(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function Ge(){return{type:"break"}}function Rn(){return{type:"html",value:""}}function zn(){return{type:"image",title:null,url:"",alt:null}}function Da(){return{type:"link",title:null,url:"",children:[]}}function Ia(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function ra(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function ro(){return{type:"paragraph",children:[]}}function ao(){return{type:"strong",children:[]}}function mn(){return{type:"text",value:""}}function io(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function HE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?HE(e,a):sB(e,a)}}function sB(e,t){let n;for(n in t)if(qE.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function sS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mu({start:t.start,end:t.end})+") is still open")}function oB(e){const t=this;t.parser=n;function n(a){return iB(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uB(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 cB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
361
+ `}]}function dB(e,t){const n=t.value?t.value+`
362
+ `:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,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 fB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Ws(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,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(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function pB(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 gB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ZE(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function yB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return ZE(e,t);const l={src:Ws(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function vB(e,t){const n={src:Ws(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function bB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function xB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return ZE(e,t);const l={href:Ws(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function wB(e,t){const n={href:Ws(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function SB(e,t,n){const a=e.all(t),l=n?kB(n):VE(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.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<a.length;){const y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
363
+ `}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
364
+ `});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function kB(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=VE(n[a])}return t}function VE(e){const t=e.spread;return t??e.children.length>1}function jB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.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(a,!0)};return e.patch(t,o),e.applyData(t,o)}function CB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function NB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _B(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Gy(t.children[1]),m=CE(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function TB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},w=c?c[m]:void 0;w&&(b.align=w);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 AB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const oS=9,uS=32;function RB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(cS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(cS(t.slice(l),l>0,!1)),o.join("")}function cS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===oS||o===uS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===oS||o===uS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function zB(e,t){const n={type:"text",value:RB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function OB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const MB={blockquote:uB,break:cB,code:dB,delete:fB,emphasis:hB,footnoteReference:mB,heading:pB,html:gB,imageReference:yB,image:vB,inlineCode:bB,linkReference:xB,link:wB,listItem:SB,list:jB,paragraph:CB,root:EB,strong:NB,table:_B,tableCell:AB,tableRow:TB,text:zB,thematicBreak:OB,toml:Od,yaml:Od,definition:Od,footnoteDefinition:Od};function Od(){}const QE=-1,Mf=0,gu=1,of=2,nv=3,rv=4,av=5,iv=6,KE=7,GE=8,dS=typeof self=="object"?self:globalThis,DB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case Mf:case QE:return n(c,l);case gu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case of:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case nv:return n(new Date(c),l);case rv:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case av:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case iv:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case KE:{const{name:f,message:m}=c;return n(new dS[f](m),l)}case GE:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new dS[o](c),l)};return a},fS=e=>DB(new Map,e)(0),hs="",{toString:IB}={},{keys:LB}=Object,su=e=>{const t=typeof e;if(t!=="object"||!e)return[Mf,t];const n=IB.call(e).slice(8,-1);switch(n){case"Array":return[gu,hs];case"Object":return[of,hs];case"Date":return[nv,hs];case"RegExp":return[rv,hs];case"Map":return[av,hs];case"Set":return[iv,hs];case"DataView":return[gu,n]}return n.includes("Array")?[gu,n]:n.includes("Error")?[KE,n]:[of,n]},Md=([e,t])=>e===Mf&&(t==="function"||t==="symbol"),UB=(e,t,n,a)=>{const l=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=su(c);switch(f){case Mf:{let y=c;switch(m){case"bigint":f=GE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([QE],c)}return l([f,y],c)}case gu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const y=[],g=l([f,y],c);for(const b of c)y.push(o(b));return g}case of:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const y=[],g=l([f,y],c);for(const b of LB(c))(e||!Md(su(c[b])))&&y.push([o(b),o(c[b])]);return g}case nv:return l([f,c.toISOString()],c);case rv:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case av:{const y=[],g=l([f,y],c);for(const[b,w]of c)(e||!(Md(su(b))||Md(su(w))))&&y.push([o(b),o(w)]);return g}case iv:{const y=[],g=l([f,y],c);for(const b of c)(e||!Md(su(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},hS=(e,{json:t,lossy:n}={})=>{const a=[];return UB(!(t||n),!!t,new Map,a)(e),a},uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fS(hS(e,t)):structuredClone(e):(e,t)=>fS(hS(e,t));function PB(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 BB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $B(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||PB,a=e.options.footnoteBackLabel||BB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=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=Ws(g.toLowerCase());let w=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++w<=j;){k.length>0&&k.push({type:"text",value:" "});let R=typeof n=="string"?n:n(m,w);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const R=E.children[E.children.length-1];R&&R.type==="text"?R.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...uf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
365
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
366
+ `}]}}const Df=(function(e){if(e==null)return ZB;if(typeof e=="function")return If(e);if(typeof e=="object")return Array.isArray(e)?FB(e):qB(e);if(typeof e=="string")return HB(e);throw new Error("Expected function, string, or object as test")});function FB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Df(e[n]);return If(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function qB(e){const t=e;return If(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function HB(e){return If(t);function t(n){return n&&n.type===e}}function If(e){return t;function t(n,a,l){return!!(VB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function ZB(){return!0}function VB(e){return e!==null&&typeof e=="object"&&"type"in e}const YE=[],QB=!0,$g=!1,KB="skip";function XE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Df(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return b;function b(){let w=YE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=GB(n(m,y)),w[0]===$g))return w;if("children"in m&&m.children){const C=m;if(C.children&&w[0]!==KB)for(j=(a?C.children.length:-1)+c,E=y.concat(C);j>-1&&j<C.children.length;){const R=C.children[j];if(k=f(R,j,E)(),k[0]===$g)return k;j=typeof k[1]=="number"?k[1]:j+c}}return w}}}function GB(e){return Array.isArray(e)?e:typeof e=="number"?[QB,e]:e==null?YE:[e]}function lv(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),XE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const Fg={}.hasOwnProperty,YB={};function XB(e,t){const n=t||YB,a=new Map,l=new Map,o=new Map,c={...MB,...n.handlers},f={all:h,applyData:WB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:JB,wrap:t$};return lv(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,w=f.handlers[b];if(Fg.call(f.handlers,b)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,C=uf(E);return C.children=f.all(y),C}return uf(y)}return(f.options.unknownHandler||e$)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let w=-1;for(;++w<b.length;){const k=f.one(b[w],y);if(k){if(w&&b[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=mS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=mS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function JB(e,t){e.position&&(t.position=BP(e))}function WB(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,uf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function e$(e,t){const n=t.data||{},a="value"in t&&!(Fg.call(n,"hProperties")||Fg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function t$(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
367
+ `});++a<e.length;)a&&n.push({type:"text",value:`
368
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
369
+ `}),n}function mS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function pS(e,t){const n=XB(e,t),a=n.one(e,void 0),l=$B(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
370
+ `},l),o}function n$(e,t){return e&&"run"in e?async function(n,a){const l=pS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return pS(n,{file:a,...e||t})}}function gS(e){if(e)throw e}var Ep,yS;function r$(){if(yS)return Ep;yS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=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)},c=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(a)return a(h,y).value}else return;return h[y]};return Ep=function m(){var h,y,g,b,w,k,j=arguments[0],E=1,C=arguments.length,R=!1;for(typeof j=="boolean"&&(R=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(R&&b&&(o(b)||(w=l(b)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(R,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Ep}var a$=r$();const Np=hf(a$);function qg(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 i$(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){c(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?l$(y,f)(...h):c(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function l$(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}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(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Yr={basename:s$,dirname:o$,extname:u$,join:c$,sep:"/"};function s$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ec(e);let n=0,a=-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 a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function o$(e){if(ec(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function u$(e){ec(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!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===a+1?"":e.slice(l,n)}function c$(...e){let t=-1,n;for(;++t<e.length;)ec(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":d$(n)}function d$(e){ec(e);const t=e.codePointAt(0)===47;let n=f$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function f$(e,t){let n="",a=0,l=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==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="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function ec(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const h$={cwd:m$};function m$(){return"/"}function Hg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function p$(e){if(typeof e=="string")e=new URL(e);else if(!Hg(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 g$(e)}function g$(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const _p=["history","path","basename","stem","extname","dirname"];class JE{constructor(t){let n;t?Hg(t)?n={path:t}:typeof t=="string"||y$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":h$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<_p.length;){const o=_p[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)_p.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Yr.basename(this.path):void 0}set basename(t){Ap(t,"basename"),Tp(t,"basename"),this.path=Yr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yr.dirname(this.path):void 0}set dirname(t){vS(this.basename,"dirname"),this.path=Yr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yr.extname(this.path):void 0}set extname(t){if(Tp(t,"extname"),vS(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=Yr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Hg(t)&&(t=p$(t)),Ap(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yr.basename(this.path,this.extname):void 0}set stem(t){Ap(t,"stem"),Tp(t,"stem"),this.path=Yr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new An(t,n,a);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 Tp(e,t){if(e&&e.includes(Yr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yr.sep+"`")}function Ap(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function y$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v$=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),b$={}.hasOwnProperty;class sv extends v${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=i$()}copy(){const t=new sv;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Np(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Op("data",this.frozen),this.namespace[t]=n,this):b$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Op("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dd(t),a=this.parser||this.Parser;return Rp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Rp("process",this.parser||this.Parser),zp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=Dd(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const w=g,k=a.stringify(w,b);S$(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?c(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),Rp("processSync",this.parser||this.Parser),zp("processSync",this.compiler||this.Compiler),this.process(t,l),xS("processSync","process",n),a;function l(o,c){n=!0,gS(o),a=c}}run(t,n,a){bS(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const m=Dd(n);l.run(t,m,h);function h(y,g,b){const w=g||t;y?f(y):c?c(w):a(void 0,w,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),xS("runSync","run",a),l;function o(c,f){gS(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Dd(n),l=this.compiler||this.Compiler;return zp("stringify",l),bS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Op("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(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 c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(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=Np(!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<a.length;)if(a[g][0]===h){b=g;break}if(b===-1)a.push([h,...y]);else if(y.length>0){let[w,...k]=y;const j=a[b][1];qg(j)&&qg(w)&&(w=Np(!0,j,w)),a[b]=[h,w,...k]}}}}const x$=new sv().freeze();function Rp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function zp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Op(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 bS(e){if(!qg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dd(e){return w$(e)?e:new JE(e)}function w$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function S$(e){return typeof e=="string"||k$(e)}function k$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const j$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wS=[],SS={allowDangerousHtml:!0},C$=/^(https?|ircs?|mailto|xmpp)$/i,E$=[{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 N$(e){const t=_$(e),n=T$(e);return A$(t.runSync(t.parse(n),n),e)}function _$(e){const t=e.rehypePlugins||wS,n=e.remarkPlugins||wS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...SS}:SS;return x$().use(oB).use(n).use(n$,a).use(t)}function T$(e){const t=e.children||"",n=new JE;return typeof t=="string"&&(n.value=t),n}function A$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||R$;for(const y of E$)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+j$+y.id,void 0);return lv(e,h),ZP(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return c?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in kp)if(Object.hasOwn(kp,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=kp[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,b)),w&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function R$(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||C$.test(e.slice(0,t))?e:""}function z$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WE(e,t,n){const l=Df((n||{}).ignore||[]),o=O$(t);let c=-1;for(;++c<o.length;)XE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const w=y[g],k=b?b.children:void 0;if(l(w,k?k.indexOf(w):void 0,b))return;b=w}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],w=o[c][1];let k=0;const E=g.children.indexOf(h);let C=!1,R=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const M=O.index,B={index:O.index,input:O.input,stack:[...y,h]};let z=w(...O,B);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=M+1:(k!==M&&R.push({type:"text",value:h.value.slice(k,M)}),Array.isArray(z)?R.push(...z):z&&R.push(z),k=M+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&R.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...R)):R=[h],E+R.length}}function O$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([M$(l[0]),D$(l[1])])}return t}function M$(e){return typeof e=="string"?new RegExp(z$(e),"g"):e}function D$(e){return typeof e=="function"?e:function(){return e}}function I$(e){WE(e,[/\r?\n|\r/g,L$])}function L$(){return{type:"break"}}function U$(){return function(e){I$(e)}}function kS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}const Mp="phrasing",Dp=["autolink","link","image","label"];function P$(){return{transforms:[V$],enter:{literalAutolink:$$,literalAutolinkEmail:Ip,literalAutolinkHttp:Ip,literalAutolinkWww:Ip},exit:{literalAutolink:Z$,literalAutolinkEmail:H$,literalAutolinkHttp:F$,literalAutolinkWww:q$}}}function B$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Dp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Dp},{character:":",before:"[ps]",after:"\\/",inConstruct:Mp,notInConstruct:Dp}]}}function $$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ip(e){this.config.enter.autolinkProtocol.call(this,e)}function F$(e){this.config.exit.autolinkProtocol.call(this,e)}function q$(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 H$(e){this.config.exit.autolinkEmail.call(this,e)}function Z$(e){this.exit(e)}function V$(e){WE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Q$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),K$]],{ignore:["link","linkReference"]})}function Q$(e,t,n,a,l){let o="";if(!eN(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!G$(n)))return!1;const c=Y$(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function K$(e,t,n,a){return!eN(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function G$(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 Y$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=kS(e,"(");let o=kS(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function eN(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bl(n)||zf(n))&&(!t||n!==47)}tN.peek=iF;function X$(){this.buffer()}function J$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function W$(){this.buffer()}function eF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function tF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Br(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nF(e){this.exit(e)}function rF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Br(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aF(e){this.exit(e)}function iF(){return"["}function tN(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function lF(){return{enter:{gfmFootnoteCallString:X$,gfmFootnoteCall:J$,gfmFootnoteDefinitionLabelString:W$,gfmFootnoteDefinition:eF},exit:{gfmFootnoteCallString:tF,gfmFootnoteCall:nF,gfmFootnoteDefinitionLabelString:rF,gfmFootnoteDefinition:aF}}}function sF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
371
+ `:" ")+o.indentLines(o.containerFlow(a,f.current()),t?nN:oF))),h(),m}}function oF(e,t,n){return t===0?e:nN(e,t,n)}function nN(e,t,n){return(n?"":" ")+e}const uF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rN.peek=mF;function cF(){return{canContainEols:["delete"],enter:{strikethrough:fF},exit:{strikethrough:hF}}}function dF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:uF}],handlers:{delete:rN}}}function fF(e){this.enter({type:"delete",children:[]},e)}function hF(e){this.exit(e)}function rN(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function mF(){return"~"}function pF(e){return e.length}function gF(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||pF,o=[],c=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let C=-1;for(e[y].length>h&&(h=e[y].length);++C<e[y].length;){const R=yF(e[y][C]);if(n.alignDelimiters!==!1){const O=l(R);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(R)}c[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=jS(a[g]);else{const j=jS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],w=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let R=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const O=E+"-".repeat(R)+C;n.alignDelimiters!==!1&&(R=E.length+R+C.length,R>m[g]&&(m[g]=R),w[g]=R),b[g]=O}c.splice(1,0,b),f.splice(1,0,w),y=-1;const k=[];for(;++y<c.length;){const j=c[y],E=f[y];g=-1;const C=[];for(;++g<h;){const R=j[g]||"";let O="",M="";if(n.alignDelimiters!==!1){const B=m[g]-(E[g]||0),z=o[g];z===114?O=" ".repeat(B):z===99?B%2?(O=" ".repeat(B/2+.5),M=" ".repeat(B/2-.5)):(O=" ".repeat(B/2),M=O):M=" ".repeat(B)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(R),n.alignDelimiters!==!1&&C.push(M),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
372
+ `)}function yF(e){return e==null?"":String(e)}function jS(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 vF(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),bF);return l(),c}function bF(e,t,n){return">"+(n?"":" ")+e}function xF(e,t){return CS(e,t.inConstruct,!0)&&!CS(e,t.notInConstruct,!1)}function CS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function ES(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
373
+ `&&xF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
374
+ `}function wF(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function SF(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 kF(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 jF(e,t,n,a){const l=kF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(SF(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,CF);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(wF(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
375
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
376
+ `),o&&(y+=f.move(o+`
377
+ `)),y+=f.move(m),h(),y}function CF(e,t,n){return(n?"":" ")+e}function ov(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 EF(e,t,n,a){const l=ov(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);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?" ":`
378
+ `,...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()),c(),h}function NF(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 Ou(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cf(e,t,n){const a=$s(e),l=$s(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===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}}aN.peek=_F;function aN(e,t,n,a){const l=NF(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=cf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Ou(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=cf(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Ou(g));const w=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function _F(e,t,n){return n.options.emphasis||"*"}function TF(e,t){let n=!1;return lv(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,$g}),!!((!e.depth||e.depth<3)&&Wy(e)&&(t.options.setext||n))}function AF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(TF(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
379
+ `,after:`
380
+ `});return g(),y(),b+`
381
+ `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
382
+ `))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
383
+ `,...o.current()});return/^[\t ]/.test(h)&&(h=Ou(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}iN.peek=RF;function iN(e){return e.value||""}function RF(){return"<"}lN.peek=zF;function lN(e,t,n,a){const l=ov(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);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(")"),c(),h}function zF(){return"!"}sN.peek=OF;function sN(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),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 OF(){return"!"}oN.peek=MF;function oN(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function MF(){return"`"}function uN(e,t){const n=Wy(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))}cN.peek=DF;function cN(e,t,n,a){const l=ov(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(uN(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(n.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),m()),h+=c.move(")"),f(),h}function DF(e,t,n){return uN(e,n)?"<":"["}dN.peek=IF;function dN(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),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 IF(){return"["}function uv(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 LF(e){const t=uv(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 UF(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 fN(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 PF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?UF(n):uv(n);const f=e.ordered?c==="."?")":".":LF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&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),fN(n)===c&&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&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),h}function BF(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 $F(e,t,n,a){const l=BF(n);let o=n.bulletCurrent||uv(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 c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,w){return b?(w?"":" ".repeat(c))+g:(w?o:o+" ".repeat(c-o.length))+g}}function FF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const qF=Df(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function HF(e,t,n,a){return(e.children.some(function(c){return qF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function ZF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hN.peek=VF;function hN(e,t,n,a){const l=ZF(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=cf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Ou(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=cf(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Ou(g));const w=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function VF(e,t,n){return n.options.strong||"*"}function QF(e,t,n,a){return n.safe(e.value,a)}function KF(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 GF(e,t,n){const a=(fN(n)+(n.options.ruleSpaces?" ":"")).repeat(KF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const mN={blockquote:vF,break:ES,code:jF,definition:EF,emphasis:aN,hardBreak:ES,heading:AF,html:iN,image:lN,imageReference:sN,inlineCode:oN,link:cN,linkReference:dN,list:PF,listItem:$F,paragraph:FF,root:HF,strong:hN,text:QF,thematicBreak:GF};function YF(){return{enter:{table:XF,tableData:NS,tableHeader:NS,tableRow:WF},exit:{codeText:eq,table:JF,tableData:Lp,tableHeader:Lp,tableRow:Lp}}}function XF(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 JF(e){this.exit(e),this.data.inTable=void 0}function WF(e){this.enter({type:"tableRow",children:[]},e)}function Lp(e){this.exit(e)}function NS(e){this.enter({type:"tableCell",children:[]},e)}function eq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,tq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function tq(e,t){return t==="|"?t:e}function nq(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
384
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:m,tableRow:f}};function c(w,k,j,E){return h(y(w,j,E),w.align)}function f(w,k,j,E){const C=g(w,j,E),R=h([C]);return R.slice(0,R.indexOf(`
385
+ `))}function m(w,k,j,E){const C=j.enter("tableCell"),R=j.enter("phrasing"),O=j.containerPhrasing(w,{...E,before:o,after:o});return R(),C(),O}function h(w,k){return gF(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const E=w.children;let C=-1;const R=[],O=k.enter("table");for(;++C<E.length;)R[C]=g(E[C],k,j);return O(),R}function g(w,k,j){const E=w.children;let C=-1;const R=[],O=k.enter("tableRow");for(;++C<E.length;)R[C]=m(E[C],w,k,j);return O(),R}function b(w,k,j){let E=mN.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function rq(){return{exit:{taskListCheckValueChecked:_S,taskListCheckValueUnchecked:_S,paragraph:iq}}}function aq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lq}}}function _S(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function iq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function lq(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=mN.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+c}}function sq(){return[P$(),lF(),cF(),YF(),rq()]}function oq(e){return{extensions:[B$(),sF(e),dF(),nq(e),aq()]}}const uq={tokenize:pq,partial:!0},pN={tokenize:gq,partial:!0},gN={tokenize:yq,partial:!0},yN={tokenize:vq,partial:!0},cq={tokenize:bq,partial:!0},vN={name:"wwwAutolink",tokenize:hq,previous:xN},bN={name:"protocolAutolink",tokenize:mq,previous:wN},Ma={name:"emailAutolink",tokenize:fq,previous:SN},na={};function dq(){return{text:na}}let al=48;for(;al<123;)na[al]=Ma,al++,al===58?al=65:al===91&&(al=97);na[43]=Ma;na[45]=Ma;na[46]=Ma;na[95]=Ma;na[72]=[Ma,bN];na[104]=[Ma,bN];na[87]=[Ma,vN];na[119]=[Ma,vN];function fq(e,t,n){const a=this;let l,o;return c;function c(g){return!Zg(g)||!SN.call(a,a.previous)||cv(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Zg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(cq,y,h)(g):g===45||g===95||_n(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&&In(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function hq(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!xN.call(a,a.previous)||cv(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(uq,e.attempt(pN,e.attempt(gN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function mq(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&wN.call(a,a.previous)&&!cv(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(In(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||sf(g)||kt(g)||bl(g)||zf(g)?n(g):e.attempt(pN,e.attempt(gN,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function pq(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function gq(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(yN,m,f)(h):h===null||kt(h)||bl(h)||h!==45&&zf(h)?m(h):(o=!0,e.consume(h),c)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),c}function m(h){return l||a||!o?n(h):t(h)}}function yq(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(yN,t,o)(c):c===null||kt(c)||bl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function vq(e,t,n){return a;function a(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),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||kt(f)||bl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||kt(f)||bl(f)?t(f):a(f)}function o(f){return In(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):In(f)?(e.consume(f),c):n(f)}}function bq(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return _n(o)?n(o):t(o)}}function xN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kt(e)}function wN(e){return!In(e)}function SN(e){return!(e===47||Zg(e))}function Zg(e){return e===43||e===45||e===46||e===95||_n(e)}function cv(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const xq={tokenize:_q,partial:!0};function wq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Cq,continuation:{tokenize:Eq},exit:Nq}},text:{91:{name:"gfmFootnoteCall",tokenize:jq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Sq,resolveTo:kq}}}}function Sq(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=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(!c||!c._balanced)return n(m);const h=Br(a.sliceSerialize({start:c.end,end:a.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 kq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},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)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function jq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;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&&!c||g===null||g===91||kt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Br(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return kt(g)||(c=!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 Cq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=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(c>999||k===93&&!f||k===null||k===91||kt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Br(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return kt(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),ot(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function Eq(e,t,n){return e.check(Wu,t,e.attempt(xq,t,n))}function Nq(e){e.exit("gfmFootnoteDefinition")}function _q(e,t,n){const a=this;return ot(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function Tq(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&dr(b,b.length,0,Of(w,c.slice(h+1,m),f)),dr(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),dr(c,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,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):(c.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=$s(h);if(k===126)return g>1?m(k):(c.consume(k),g++,w);if(g<2&&!n)return m(k);const E=c.exit("strikethroughSequenceTemporary"),C=$s(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class Aq{constructor(){this.map=[]}add(t,n,a){Rq(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function Rq(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function zq(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function Oq(){return{flow:{null:{name:"table",tokenize:Mq,resolveAll:Dq}}}}function Mq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(I){let ne=a.events.length-1;for(;ne>-1;){const Y=a.events[ne][1].type;if(Y==="lineEnding"||Y==="linePrefix")ne--;else break}const le=ne>-1?a.events[ne][1].type:null,we=le==="tableHead"||le==="tableRow"?z:m;return we===z&&a.parser.lazy[a.now().line]?n(I):we(I)}function m(I){return e.enter("tableHead"),e.enter("tableRow"),h(I)}function h(I){return I===124||(c=!0,o+=1),y(I)}function y(I){return I===null?n(I):De(I)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):n(I):et(I)?ot(e,y,"whitespace")(I):(o+=1,c&&(c=!1,l+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(I)))}function g(I){return I===null||I===124||kt(I)?(e.exit("data"),y(I)):(e.consume(I),I===92?b:g)}function b(I){return I===92||I===124?(e.consume(I),g):g(I)}function w(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),c=!1,et(I)?ot(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?E(I):I===124?(c=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),j):B(I)}function j(I){return et(I)?ot(e,E,"whitespace")(I):E(I)}function E(I){return I===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),C):I===45?(o+=1,C(I)):I===null||De(I)?M(I):B(I)}function C(I){return I===45?(e.enter("tableDelimiterFiller"),R(I)):B(I)}function R(I){return I===45?(e.consume(I),R):I===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(I))}function O(I){return et(I)?ot(e,M,"whitespace")(I):M(I)}function M(I){return I===124?k(I):I===null||De(I)?!c||l!==o?B(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):B(I)}function B(I){return n(I)}function z(I){return e.enter("tableRow"),$(I)}function $(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),$):I===null||De(I)?(e.exit("tableRow"),t(I)):et(I)?ot(e,$,"whitespace")(I):(e.enter("data"),U(I))}function U(I){return I===null||I===124||kt(I)?(e.exit("data"),$(I)):(e.consume(I),I===92?Q:U)}function Q(I){return I===92||I===124?(e.consume(I),U):U(I)}}function Dq(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,y,g;const b=new Aq;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(TS(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"?(a=!0,g=void 0,o=[0,0,0,0],c=[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")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Id(b,t,o,l,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Id(b,t,o,l,void 0,g)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=Id(b,t,o,l,n,g)):c[1]!==0&&(g=Id(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&TS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=zq(t.events,n))}return e}function Id(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},gs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=gs(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=gs(t.events,n[2]),y=gs(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const b=t.events[n[2]],w=t.events[n[3]];if(b[1].end=Object.assign({},w[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({},gs(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function TS(e,t,n,a,l){const o=[],c=gs(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function gs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const Iq={name:"tasklistCheck",tokenize:Uq};function Lq(){return{text:{91:Iq}}}function Uq(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return kt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return De(m)?t(m):et(m)?e.check({tokenize:Pq},t,n)(m):n(m)}}function Pq(e,t,n){return ot(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function Bq(e){return zE([dq(),wq(),Tq(e),Oq(),Lq()])}const $q={};function Fq(e){const t=this,n=e||$q,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(Bq(n)),o.push(sq()),c.push(oq(n))}function dv({children:e,className:t}){return u.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:u.jsx(N$,{remarkPlugins:[Fq,U$],children:e})})}function qq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,c]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),u.jsxs(tn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Rr,{children:[u.jsxs(zr,{children:["System prompt append",m&&u.jsx(Hq,{})]}),!o&&!l&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(bf,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(Tn,{children:o?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!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}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(pe,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(pe,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),u.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."})]}):u.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?u.jsx(dv,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function Hq(){return u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const kN={"claude-code":"Claude Code",codex:"Codex"},Zq=[nf.CLAUDE_CODE,nf.CODEX];function Vq({open:e,onOpenChange:t,agent:n}){const a=fn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),w=Ve({queryKey:["clients-rebind"],queryFn:Ni,enabled:e}).data??[],k=LT({queries:w.map(U=>({queryKey:["client-capabilities",U.id],queryFn:()=>wy(U.id),enabled:e}))}),j=x.useMemo(()=>{const U=new Map;return k.forEach((Q,I)=>{const ne=w[I];if(!ne)return;const le=Q.data;le!=null&&le.capabilities&&U.set(ne.id,le.capabilities)}),U},[k,w]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const E=c?j.get(c)??null:null,C=(E==null?void 0:E[m])??null,R=!C||C.state==="missing"||C.state==="error",O=!!c&&(c!==l||m!==o)&&(!R||y),M=m!==o,B=c!==l,z=Ct({mutationFn:()=>{if(!c)throw new Error("clientId required");return eD(n.uuid,{clientId:c,runtimeProvider:m,force:R&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),$=z.error instanceof Vu||z.error instanceof Error?z.error.message:null;return u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{className:"max-w-lg",children:[u.jsx(dn,{children:u.jsx(sn,{children:"Re-bind agent"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",u.jsx("span",{className:"mono",children:Kq(l,w,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:U=>f(U.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(U=>u.jsx("option",{value:U.id,children:Qq(U)},U.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:Zq.map(U=>{const Q=(E==null?void 0:E[U])??null,I=!!Q&&Q.state!=="missing",ne=m===U;return u.jsxs("label",{className:ne?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":I?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:ne,onChange:()=>h(U),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:kN[U]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:Yq(Q,U)})]})]},U)})})]}),(B||M)&&u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),M&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),R&&u.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[u.jsx("input",{type:"checkbox",checked:y,onChange:U=>g(U.target.checked),className:"mt-0.5"}),u.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),$&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:$})]}),u.jsxs(Ln,{children:[u.jsx(pe,{variant:"outline",onClick:()=>t(!1),disabled:z.isPending,children:"Cancel"}),u.jsx(pe,{onClick:()=>z.mutate(),disabled:!O||z.isPending,children:z.isPending?"Re-binding…":"Re-bind"})]})]})})}function Qq(e){return`${e.hostname??e.id} · ${e.status}`}function Kq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${kN[n]}`}const Gq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function Yq(e,t){if(!e)return"Not reported on this computer.";switch(e.state){case"ok":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, authenticated.`;case"unauthenticated":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, not authenticated. ${Gq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const Xq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function Jq(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(hu,{state:"blocked",size:8}),u.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>u.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:Xq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&u.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[u.jsx($r,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&u.jsx(pe,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(pe,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(pe,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(hz,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function yu(e){return`agent-cfg-${e}`}function ou({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:Te("space-y-3",o),...c,children:[u.jsxs("div",{className:"flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),u.jsx("div",{className:"space-y-3",children:l})]})}function Wq(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const e7={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Re-bind via the agent's settings to switch computer or runtime."},codex:{name:"Codex",caption:"OpenAI's Codex CLI runtime. Re-bind via the agent's settings to switch computer or runtime."}};function t7(e){const t=e7[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(n7,{name:t.name,caption:t.caption,locked:!0}),u.jsx(r7,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function n7({name:e,caption:t,locked:n}){return u.jsxs(tn,{children:[u.jsx(Rr,{children:u.jsxs(zr,{children:["Where it runs",n&&u.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Wk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(Tn,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(ej,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),u.jsx("span",{className:"font-medium",children:e})]}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function r7(e){const t=!!e.computerLabel;return u.jsxs(tn,{children:[u.jsxs(Rr,{children:[u.jsx(zr,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(xg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(pe,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(xg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(Tn,{className:"text-body",children:t?u.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function a7(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 i7(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function l7(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Up(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function AS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:l7(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Pp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=i7(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:AS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:AS(f)}}),remove:a=>t(l=>{const c=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:c}}),undo:a=>t(l=>{const c=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:c}})}}function s7(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Up(e.payload.mcpServers,"mcp"),env:Up(e.payload.env,"env"),git:Up(e.payload.gitRepos,"git")}}function o7(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(s7(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",c=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],M=U=>U.reduce((Q,I)=>I.status==="unchanged"?Q:Q+1,0),B=M(a.mcp),z=M(a.env),$=M(a.git);return c&&O.push("prompt"),f&&O.push("model"),B>0&&O.push("mcp"),z>0&&O.push("env"),$>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:c?1:0,model:f?1:0,mcp:B,env:z,git:$}}},[a,c,f]),h=x.useCallback(O=>{n(M=>M&&O(M))},[]),y=x.useCallback(O=>h(M=>({...M,promptAppend:O})),[h]),g=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(M=>({...M,model:O})),[h]),w=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>Pp("mcp",h),[h]),j=x.useMemo(()=>Pp("env",h),[h]),E=x.useMemo(()=>Pp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),R=x.useCallback(()=>{if(!t||!e)return{};const O={};c&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const M=m.counts.mcp>0,B=m.counts.env>0,z=m.counts.git>0;return M&&(O.mcpServers=t.mcp.filter($=>$.status!=="deleted").map($=>$.value)),B&&(O.env=t.env.filter($=>$.status!=="deleted").map($=>{const U=$.value;return U.sensitive&&U.value===rf?{key:U.key,value:rf,sensitive:!0}:U})),z&&(O.gitRepos=t.git.filter($=>$.status!=="deleted").map($=>$.value)),O},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:w,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:C,buildPayloadPatch:R}}const En={overview:"ad-overview",setup:"ad-setup",prompt:yu("prompt"),tools:yu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function u7(e){const t=[{key:"overview",label:"Profile",anchor:En.overview}];return e||t.push({key:"setup",label:"Setup",anchor:En.setup},{key:"prompt",label:"Prompt",anchor:En.prompt},{key:"tools",label:"Tools",anchor:En.tools},{key:"advanced",label:"Advanced",anchor:En.advanced}),t.push({key:"danger",label:"Danger zone",anchor:En.danger,divider:!0,danger:!0}),t}function c7(){var gn,mt,Or,Pn,rc,Ii,Li,Ui,Zr,Pi,La,ac;const t=Mk().uuid??"",n=Un(),a=fn(),l=Ve({queryKey:["agent",t],queryFn:()=>XM(t),enabled:!!t}),o=Ve({queryKey:["agent-config",t],queryFn:()=>MU(t),enabled:!!t&&((gn=l.data)==null?void 0:gn.type)!=="human"}),c=Ve({queryKey:["agent-client-status",t],queryFn:()=>LU(t),enabled:!!t&&((mt=l.data)==null?void 0:mt.type)!=="human"}),f=Ve({queryKey:["agent-sessions-active",t],queryFn:()=>bj(t,{state:"active"}),enabled:!!t&&((Or=l.data)==null?void 0:Or.type)!=="human"}),m=Ve({queryKey:["clients"],queryFn:Ni,enabled:!!t&&((Pn=l.data)==null?void 0:Pn.type)!=="human",refetchInterval:3e4}),h=o7(o.data),[y,g]=x.useState(null),[b,w]=x.useState(null),[k,j]=x.useState(!1),E=Ct({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const xe=h.buildPayloadPatch();return DU(t,{expectedVersion:o.data.version,payload:xe})},onSuccess:xe=>{a.setQueryData(["agent-config",t],xe),g(null),w(null),j(!0)},onError:xe=>{if(j(!1),xe instanceof Vu&&xe.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(xe instanceof Error?xe.message:String(xe))}});x.useEffect(()=>{if(!k)return;const xe=setTimeout(()=>j(!1),2500);return()=>clearTimeout(xe)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),R=x.useCallback(xe=>{const Ye=document.getElementById(xe);Ye&&Ye.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=Ct({mutationFn:xe=>dw(t,xe),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),M=Ct({mutationFn:()=>nD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),B=Ct({mutationFn:()=>rD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),z=Ct({mutationFn:()=>tD(t),onSuccess:()=>n("/team")}),$=Ct({mutationFn:()=>aD(t)}),[U,Q]=x.useState(!1),[I,ne]=x.useState(""),[le,we]=x.useState(null),[Y,J]=x.useState(!1),H=Ve({queryKey:["clients"],queryFn:Ni,enabled:U}),ee=Ct({mutationFn:xe=>dw(t,{clientId:xe}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),Q(!1),ne(""),we(null)},onError:xe=>we(xe instanceof Error?xe.message:String(xe))}),[be,Ae]=x.useState(!1),[A,L]=x.useState(null),P=Ct({mutationFn:()=>IU(t,h.buildPayloadPatch()),onSuccess:xe=>{const Ye=xe.diff.length?xe.diff.map(yn=>`${yn.op} ${yn.path}`).join(`
386
+ `):"(no changes)";L(Ye)},onError:xe=>L(`Dry run failed: ${xe instanceof Error?xe.message:String(xe)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const xe=Ye=>{Ye.preventDefault(),Ye.returnValue=""};return window.addEventListener("beforeunload",xe),()=>window.removeEventListener("beforeunload",xe)},[h.summary.anyDirty]);const T=((rc=l.data)==null?void 0:rc.type)==="human",Z=x.useMemo(()=>u7(T),[T]),W=x.useRef(null),[ce,ve]=x.useState(!1);x.useEffect(()=>{if(T)return;const xe=W.current;if(!xe||typeof IntersectionObserver>"u")return;const Ye=new IntersectionObserver(yn=>{const aa=yn[0];aa&&ve(!aa.isIntersecting&&aa.boundingClientRect.top<0)},{threshold:0});return Ye.observe(xe),()=>Ye.disconnect()},[T]);const[ge,fe]=x.useState(En.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const xe=[];for(const Ye of Z){const yn=document.getElementById(Ye.anchor);if(!yn)continue;const aa=new IntersectionObserver(lo=>{for(const ic of lo)ic.isIntersecting&&fe(Ye.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});aa.observe(yn),xe.push(aa)}return()=>{for(const Ye of xe)Ye.disconnect()}},[Z]);const Qe=x.useMemo(()=>{const xe=new Set;for(const Ye of h.summary.dirtySections)Ye==="prompt"&&xe.add(En.prompt),Ye==="model"&&xe.add(En.setup),Ye==="mcp"&&xe.add(En.tools),(Ye==="env"||Ye==="git")&&xe.add(En.advanced);return xe},[h.summary.dirtySections]);if(l.isLoading)return u.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:u.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return u.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 Oe=l.data;if(!Oe)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const ut=Oe.type==="human",re=c.data,Se=((Ii=f.data)==null?void 0:Ii.length)??0,Me=!ut&&!(re!=null&&re.clientId),Ge=!ut&&re?!re.online&&!!re.clientId:!1,Rn=Oe,zn=Rn.runtimeState??null,Da=Rn.runtimeType??null,Ia=Rn.totalSessions??null,ra=Oe.uuid.slice(0,8),ro=a7({activeSessions:Se,isUnclaimed:Me,isOffline:Ge}),ao=h.draft.mcp.filter(xe=>xe.status!=="deleted"),mn=h.draft.env.filter(xe=>xe.status!=="deleted"),io=h.draft.git.filter(xe=>xe.status!=="deleted"),se=xe=>new Set(ao.filter(Ye=>Ye.key!==xe).map(Ye=>Ye.value.name.toLowerCase())),ye=xe=>new Set(mn.filter(Ye=>Ye.key!==xe).map(Ye=>Ye.value.key)),Pe=xe=>new Set(io.filter(Ye=>Ye.key!==xe).map(Ye=>{const{value:yn}=Ye;return yn.localPath?yn.localPath:((yn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),$e={sessions:Ia??"—",active:Se,runtime:Da??(ut?"human":"—"),model:((Ui=(Li=o.data)==null?void 0:Li.payload.model)==null?void 0:Ui.trim())||"—"},rt=(re==null?void 0:re.clientId)??null,pn=rt?((Zr=m.data)==null?void 0:Zr.find(xe=>xe.id===rt))??null:null,hr=rt?(pn==null?void 0:pn.hostname)??rt:null,nn=Oe.runtimeProvider??"claude-code",qt=nn==="codex"?"Codex":"Claude Code";return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("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:[u.jsx(Hy,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),Z.map(xe=>u.jsxs("div",{children:[xe.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(d7,{label:xe.label,active:ge===xe.anchor,danger:xe.danger??!1,dirty:Qe.has(xe.anchor),onClick:()=>R(xe.anchor)})]},xe.key))]}),u.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[u.jsxs(UU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(PU,{onClick:()=>n("/team"),children:"Agents"}),u.jsx(BU,{}),u.jsx($U,{mono:!0,children:Oe.name??ra})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.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:u.jsx(Yu,{width:18,height:20,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-title",title:`agt_${ra}`,children:Oe.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",Oe.name??ra]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(Ur,{tone:Oe.type==="autonomous_agent"?"accent":"neutral",children:Oe.type}),Oe.visibility&&u.jsx(Ur,{tone:Oe.visibility==="organization"?"accent":"outline",children:Oe.visibility}),(re==null?void 0:re.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",ju(re.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Ru,{state:zn}),u.jsxs(pe,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${Oe.uuid}`),children:[u.jsx(yy,{className:"h-3 w-3"})," Open chat"]}),!ut&&Oe.status==="active"&&u.jsxs(pe,{variant:"outline",size:"xs",onClick:()=>{$.reset(),$.mutate()},disabled:$.isPending,children:[u.jsx(ej,{className:"h-3 w-3"}),$.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(zd,{label:"sessions",value:$e.sessions}),u.jsx(zd,{label:"active",value:$e.active,accent:typeof $e.active=="number"&&$e.active>0?"var(--accent)":void 0}),u.jsx(zd,{label:"runtime",value:$e.runtime}),u.jsx(zd,{label:"model",value:$e.model})]})]}),u.jsx("div",{ref:W,"aria-hidden":!0,style:{height:0}}),!ut&&u.jsx(HU,{runtimeLabel:qt,computerLabel:hr,visible:ce}),u.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[($.data||$.error)&&u.jsx(y7,{result:$.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>$.reset()}),u.jsx(ou,{anchorId:En.overview,title:"Profile",right:u.jsxs(pe,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${Oe.uuid}`),title:"Manage platform bindings in Integrations",children:[u.jsx(xg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(aP,{agent:Oe,onSave:async xe=>{await O.mutateAsync(xe)}})}),!ut&&u.jsxs(u.Fragment,{children:[u.jsxs(ou,{anchorId:En.setup,title:"Setup",caption:((Pi=o.data)==null?void 0:Pi.version)!=null?u.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&u.jsx(t7,{runtimeProvider:nn,computerLabel:hr,canBindComputer:Me&&Oe.status==="active",bindComputerPending:ee.isPending,onBindComputer:()=>Q(!0),onRebind:Oe.clientId?()=>J(!0):void 0,modelSlot:u.jsx(pP,{value:h.draft.model,baseline:((La=o.data)==null?void 0:La.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:Oe.status!=="active",provider:nn})})]}),u.jsx(ou,{anchorId:En.prompt,title:"Prompt",children:o.data?u.jsx(qq,{value:h.draft.promptAppend,baseline:((ac=o.data)==null?void 0:ac.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:Oe.status!=="active"}):null}),u.jsx(ou,{anchorId:En.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(sP,{items:h.draft.mcp,otherNames:se,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:Oe.status!=="active"}):null}),u.jsx(ou,{anchorId:En.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{id:yu("env"),children:u.jsx(XU,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:Oe.status!=="active"})}),u.jsx("div",{id:yu("git"),children:u.jsx(WU,{items:h.draft.git,otherPaths:Pe,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:Oe.status!=="active"})}),A&&u.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:A}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.jsx("button",{type:"button",onClick:()=>P.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:P.isPending,children:P.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),u.jsx(Wq,{}),u.jsx(ZU,{agent:Oe,suspendPending:M.isPending,reactivatePending:B.isPending,deletePending:z.isPending,onSuspend:()=>M.mutate(),onReactivate:()=>B.mutate(),onDelete:()=>z.mutate()})]}),!ut&&u.jsx(Jq,{summary:h.summary,saveHint:ro,conflictMessage:b,errorMessage:y,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&Ae(!0)},onReloadRemote:C,onJumpTo:xe=>R(yu(xe))})]}),u.jsx(f7,{open:be,onOpenChange:Ae,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),g(null),w(null),Ae(!1)}}),u.jsx(ln,{open:U,onOpenChange:xe=>{Q(xe),xe||(ne(""),we(null),ee.reset())},children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.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."}),H.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):H.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",H.error instanceof Error?H.error.message:"Unknown"]}):u.jsx(h7,{clients:H.data??[],selected:I,onSelect:ne}),le&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:le})]}),u.jsxs(Ln,{children:[u.jsx(pe,{variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),u.jsx(pe,{disabled:!I||ee.isPending,onClick:()=>{we(null),ee.mutate(I)},children:ee.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Vq,{open:Y,onOpenChange:J,agent:Oe})]})}function d7({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:Te("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex-1 truncate",children:e}),a&&u.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&u.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function f7(e){return u.jsx(ln,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(pe,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function h7({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?u.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"," ",u.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."]}):u.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:a.map(l=>{const o=l.id===t,c=l.status==="online"||l.status==="active";return u.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:u.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:[u.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),u.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}`:""]})]}),u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const m7={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},p7={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},g7={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function y7({result:e,onDismiss:t}){const n=p7[e.status],a=g7[e.status],l=e.connection;return u.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:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ur,{tone:a,children:m7[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[u.jsx("div",{children:l.runtimeState&&u.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?u.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):u.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&u.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.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})]}),u.jsx(pe,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function v7(e){var t=0,n=e.children,a=n&&n.length;if(!a)t=1;else for(;--a>=0;)t+=n[a].value;e.value=t}function b7(){return this.eachAfter(v7)}function x7(e,t){let n=-1;for(const a of this)e.call(t,a,++n,this);return this}function w7(e,t){for(var n=this,a=[n],l,o,c=-1;n=a.pop();)if(e.call(t,n,++c,this),l=n.children)for(o=l.length-1;o>=0;--o)a.push(l[o]);return this}function S7(e,t){for(var n=this,a=[n],l=[],o,c,f,m=-1;n=a.pop();)if(l.push(n),o=n.children)for(c=0,f=o.length;c<f;++c)a.push(o[c]);for(;n=l.pop();)e.call(t,n,++m,this);return this}function k7(e,t){let n=-1;for(const a of this)if(e.call(t,a,++n,this))return a}function j7(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,a=t.children,l=a&&a.length;--l>=0;)n+=a[l].value;t.value=n})}function C7(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function E7(e){for(var t=this,n=N7(t,e),a=[t];t!==n;)t=t.parent,a.push(t);for(var l=a.length;e!==n;)a.splice(l,0,e),e=e.parent;return a}function N7(e,t){if(e===t)return e;var n=e.ancestors(),a=t.ancestors(),l=null;for(e=n.pop(),t=a.pop();e===t;)l=e,e=n.pop(),t=a.pop();return l}function _7(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function T7(){return Array.from(this)}function A7(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function R7(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*z7(){var e=this,t,n=[e],a,l,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,a=e.children)for(l=0,o=a.length;l<o;++l)n.push(a[l]);while(n.length)}function jN(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=D7)):t===void 0&&(t=M7);for(var n=new Fs(e),a,l=[n],o,c,f,m;a=l.pop();)if((c=t(a.data))&&(m=(c=Array.from(c)).length))for(a.children=c,f=m-1;f>=0;--f)l.push(o=c[f]=new Fs(c[f])),o.parent=a,o.depth=a.depth+1;return n.eachBefore(CN)}function O7(){return jN(this).eachBefore(I7)}function M7(e){return e.children}function D7(e){return Array.isArray(e)?e[1]:null}function I7(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function CN(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Fs(e){this.data=e,this.depth=this.height=0,this.parent=null}Fs.prototype=jN.prototype={constructor:Fs,count:b7,each:x7,eachAfter:S7,eachBefore:w7,find:k7,sum:j7,sort:C7,path:E7,ancestors:_7,descendants:T7,leaves:A7,links:R7,copy:O7,[Symbol.iterator]:z7};function Bp(e){return e==null?null:L7(e)}function L7(e){if(typeof e!="function")throw new Error;return e}var U7={depth:-1},RS={},$p={};function P7(e){return e.id}function B7(e){return e.parentId}function $7(){var e=P7,t=B7,n;function a(l){var o=Array.from(l),c=e,f=t,m,h,y,g,b,w,k,j,E=new Map;if(n!=null){const C=o.map((M,B)=>F7(n(M,B,l))),R=C.map(zS),O=new Set(C).add("");for(const M of R)O.has(M)||(O.add(M),C.push(M),R.push(zS(M)),o.push($p));c=(M,B)=>C[B],f=(M,B)=>R[B]}for(y=0,m=o.length;y<m;++y)h=o[y],w=o[y]=new Fs(h),(k=c(h,y,l))!=null&&(k+="")&&(j=w.id=k,E.set(j,E.has(j)?RS:w)),(k=f(h,y,l))!=null&&(k+="")&&(w.parent=k);for(y=0;y<m;++y)if(w=o[y],k=w.parent){if(b=E.get(k),!b)throw new Error("missing: "+k);if(b===RS)throw new Error("ambiguous: "+k);b.children?b.children.push(w):b.children=[w],w.parent=b}else{if(g)throw new Error("multiple roots");g=w}if(!g)throw new Error("no root");if(n!=null){for(;g.data===$p&&g.children.length===1;)g=g.children[0],--m;for(let C=o.length-1;C>=0&&(w=o[C],w.data===$p);--C)w.data=null}if(g.parent=U7,g.eachBefore(function(C){C.depth=C.parent.depth+1,--m}).eachBefore(CN),g.parent=null,m>0)throw new Error("cycle");return g}return a.id=function(l){return arguments.length?(e=Bp(l),a):e},a.parentId=function(l){return arguments.length?(t=Bp(l),a):t},a.path=function(l){return arguments.length?(n=Bp(l),a):n},a}function F7(e){e=`${e}`;let t=e.length;return Vg(e,t-1)&&!Vg(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function zS(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Vg(e,t););return e.slice(0,t)}function Vg(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function q7(e,t){return e.parent===t.parent?1:2}function Fp(e){var t=e.children;return t?t[0]:e.t}function qp(e){var t=e.children;return t?t[t.length-1]:e.t}function H7(e,t,n){var a=n/(t.i-e.i);t.c-=a,t.s+=n,e.c+=a,t.z+=n,t.m+=n}function Z7(e){for(var t=0,n=0,a=e.children,l=a.length,o;--l>=0;)o=a[l],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function V7(e,t,n){return e.a.parent===t.parent?e.a:n}function Qd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Qd.prototype=Object.create(Fs.prototype);function Q7(e){for(var t=new Qd(e,0),n,a=[t],l,o,c,f;n=a.pop();)if(o=n._.children)for(n.children=new Array(f=o.length),c=f-1;c>=0;--c)a.push(l=n.children[c]=new Qd(o[c],c)),l.parent=n;return(t.parent=new Qd(null,0)).children=[t],t}function K7(){var e=q7,t=1,n=1,a=null;function l(h){var y=Q7(h);if(y.eachAfter(o),y.parent.m=-y.z,y.eachBefore(c),a)h.eachBefore(m);else{var g=h,b=h,w=h;h.eachBefore(function(R){R.x<g.x&&(g=R),R.x>b.x&&(b=R),R.depth>w.depth&&(w=R)});var k=g===b?1:e(g,b)/2,j=k-g.x,E=t/(b.x+k+j),C=n/(w.depth||1);h.eachBefore(function(R){R.x=(R.x+j)*E,R.y=R.depth*C})}return h}function o(h){var y=h.children,g=h.parent.children,b=h.i?g[h.i-1]:null;if(y){Z7(h);var w=(y[0].z+y[y.length-1].z)/2;b?(h.z=b.z+e(h._,b._),h.m=h.z-w):h.z=w}else b&&(h.z=b.z+e(h._,b._));h.parent.A=f(h,b,h.parent.A||g[0])}function c(h){h._.x=h.z+h.parent.m,h.m+=h.parent.m}function f(h,y,g){if(y){for(var b=h,w=h,k=y,j=b.parent.children[0],E=b.m,C=w.m,R=k.m,O=j.m,M;k=qp(k),b=Fp(b),k&&b;)j=Fp(j),w=qp(w),w.a=h,M=k.z+R-b.z-E+e(k._,b._),M>0&&(H7(V7(k,h,g),h,M),E+=M,C+=M),R+=k.m,E+=b.m,O+=j.m,C+=w.m;k&&!qp(w)&&(w.t=k,w.m+=R-C),b&&!Fp(j)&&(j.t=b,j.m+=E-O,g=h)}return g}function m(h){h.x*=t,h.y=h.depth*n}return l.separation=function(h){return arguments.length?(e=h,l):e},l.size=function(h){return arguments.length?(a=!1,t=+h[0],n=+h[1],l):a?null:[t,n]},l.nodeSize=function(h){return arguments.length?(a=!0,t=+h[0],n=+h[1],l):a?[t,n]:null},l}function G7(e){const t=`?window=${encodeURIComponent(e)}`;return Ee.get(`/context-tree/snapshot${t}`)}function tc({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-4) var(--sp-5) var(--sp-3)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),u.jsx("div",{style:{flex:1}}),n]})}const EN=[{value:"1d",label:"1 day",summary:"last 1 day"},{value:"7d",label:"7 days",summary:"last 7 days"},{value:"30d",label:"30 days",summary:"last 30 days"}];function Y7(){const[e,t]=x.useState("7d"),[n,a]=x.useState(null),[l,o]=x.useState(null),c=Ve({queryKey:["context-tree-snapshot",e],queryFn:()=>G7(e)}),f=c.data,m=x.useMemo(()=>f?f.updates.find(g=>g.id===n)??f.updates[0]??null:null,[n,f]),h=x.useMemo(()=>f&&m!=null&&m.nodeId?f.nodes.find(g=>g.id===m.nodeId)??null:null,[m,f]),y=l??(m==null?void 0:m.nodeId)??(h==null?void 0:h.id)??null;return x.useEffect(()=>{var g;f&&(n&&f.updates.some(b=>b.id===n)||a(((g=f.updates[0])==null?void 0:g.id)??null))},[n,f]),u.jsxs("div",{className:"-m-6",children:[u.jsx(tc,{title:"Context",subtitle:"Team context available to agents, and how it is changing"}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[c.isLoading?u.jsx(nH,{}):null,c.error?u.jsx(rH,{message:c.error instanceof Error?c.error.message:"Failed to load"}):null,f&&!c.isLoading?u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[u.jsx(X7,{snapshot:f,window:e,onWindowChange:t}),f.snapshotStatus==="unavailable"?u.jsx(_N,{snapshot:f}):u.jsx(J7,{snapshot:f,selectedUpdate:m,selectedUpdateNode:h,selectedOverviewNodeId:y,onSelectUpdate:g=>{a(g.id),o(g.nodeId)},onSelectOverviewNode:o})]}):null]})]})}function X7({snapshot:e,window:t,onWindowChange:n}){const a=e.contextStatus.severity==="ok"?u.jsx(tz,{size:18}):u.jsx(Ys,{size:18}),l=lH(t);return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-3)"},children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between",style:{gap:"var(--sp-3)"},children:[u.jsxs("div",{className:"flex items-start",style:{gap:"var(--sp-2)"},children:[u.jsx("span",{style:{color:sH(e.contextStatus.severity),paddingTop:"var(--sp-0_5)"},children:a}),u.jsxs("div",{children:[u.jsx("div",{className:"text-title font-semibold",style:{color:"var(--fg)"},children:e.contextStatus.label}),u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)",marginTop:"var(--sp-1)"},children:[e.contextStatus.detail??"Agents have a synced team context snapshot available.",e.branch||e.headCommit?u.jsxs(u.Fragment,{children:[" ",u.jsx("span",{style:{color:"var(--fg-3)"},children:"·"})," ",u.jsx("span",{className:"font-medium",children:e.branch??"unknown"}),e.headCommit?`@${e.headCommit.slice(0,7)}`:""]}):null]})]})]}),u.jsxs("fieldset",{className:"flex flex-wrap",style:{gap:"var(--sp-1)"},children:[u.jsx("legend",{className:"sr-only",children:"Context update window"}),EN.map(o=>u.jsx(pe,{variant:o.value===t?"default":"outline",size:"sm",onClick:()=>n(o.value),children:o.label},o.value))]})]}),u.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[u.jsx(du,{label:`${e.summary.changedNodeCount} context updates in the ${l}`,strong:!0}),u.jsx(du,{label:`Added ${e.summary.addedCount}`,tone:"added"}),u.jsx(du,{label:`Edited ${e.summary.editedCount}`,tone:"edited"}),u.jsx(du,{label:`Removed ${e.summary.removedCount}`,tone:"removed"})]})]})})})}function J7({snapshot:e,selectedUpdate:t,selectedUpdateNode:n,selectedOverviewNodeId:a,onSelectUpdate:l,onSelectOverviewNode:o}){const c=f=>{o(f);const m=e.updates.find(h=>h.nodeId===f);m&&l(m)};return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[u.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[minmax(22rem,0.78fr)_minmax(0,1.22fr)]",style:{gap:"var(--sp-4)",alignItems:"start"},children:[u.jsxs(tn,{children:[u.jsx(Rr,{children:u.jsxs("div",{className:"flex flex-col",children:[u.jsx(zr,{children:"Context Updates"}),u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:[e.updates.length," team context changes agents may use"]})]})}),u.jsx(Tn,{children:e.updates.length===0?u.jsx(TN,{}):u.jsx("div",{className:"flex flex-col",style:{gap:"var(--sp-2)",maxHeight:"min(64vh, 38rem)",overflow:"auto",paddingRight:"var(--sp-0_5)"},children:e.updates.map(f=>u.jsx(W7,{update:f,selected:f.id===(t==null?void 0:t.id),onClick:()=>l(f)},f.id))})})]}),u.jsx(eH,{update:t,node:n,snapshot:e},(t==null?void 0:t.id)??"empty")]}),u.jsx(tH,{snapshot:e,selectedNodeId:a,onSelectNode:c})]})}function W7({update:e,selected:t,onClick:n}){return u.jsxs("button",{type:"button",onClick:n,className:"w-full text-left transition-colors",style:{border:"var(--hairline) solid var(--border)",borderColor:t?"var(--accent)":"var(--border)",borderRadius:"var(--radius-panel)",background:t?"var(--bg-sunken)":"var(--bg)",padding:"var(--sp-3)"},children:[u.jsx("div",{className:"flex items-start justify-between",style:{gap:"var(--sp-2)"},children:u.jsxs("div",{style:{minWidth:0},children:[u.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[u.jsx(NN,{type:e.changeType}),u.jsx("span",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:dH(e)})]}),u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["In ",Qg(e.path)]})]})}),u.jsxs("div",{className:"flex flex-wrap text-label",style:{color:"var(--fg-3)",gap:"var(--sp-2)",marginTop:"var(--sp-2)"},children:[u.jsx("span",{children:gH(e.owners)}),e.relatedNodeIds.length>0?u.jsx("span",{children:yH(e.relatedNodeIds.length)}):null]})]})}function eH({update:e,node:t,snapshot:n}){const[a,l]=x.useState(!1),o=t==null?void 0:t.relatedNodeIds.map(h=>n.nodes.find(y=>y.id===h)).filter(h=>!!h),c=(t==null?void 0:t.sourcePath)??(e==null?void 0:e.path)??null,f=e!=null&&e.sourceCommit?e.sourceCommit.slice(0,7):"no commit",m=e?pH(e.owners):"No owner";return u.jsxs(tn,{children:[u.jsxs(Rr,{children:[u.jsxs("div",{children:[u.jsx(zr,{children:"Selected Change"}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"What changed, and what agents can use from it"})]}),e?u.jsx(NN,{type:e.changeType}):null]}),u.jsx(Tn,{children:e?u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-title font-semibold",style:{color:"var(--fg)"},children:e.title}),u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:["In ",Qg(e.path)]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2",style:{gap:"var(--sp-3)"},children:[u.jsx(OS,{label:"What changed",value:fH(e)}),u.jsx(OS,{label:"What agents can use",value:cH(e)})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3",style:{gap:"var(--sp-3)"},children:[u.jsx(Hp,{label:"Change",value:uH(e.changeType)}),u.jsx(Hp,{label:"Context area",value:vH(e.path)||Qg(e.path)}),u.jsx(Hp,{label:e.owners.length>1?"Owners":"Owner",value:m})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_minmax(16rem,0.7fr)]",style:{gap:"var(--sp-4)"},children:[u.jsx(MS,{title:"Linked context",items:o&&o.length>0?o.map(h=>h.title||h.path||"root"):["none"]}),u.jsxs("div",{children:[u.jsx(MS,{title:"Source",items:[c??e.path,f]}),c?u.jsxs("div",{className:"flex flex-wrap",style:{gap:"var(--sp-1)",marginTop:"var(--sp-2)"},children:[u.jsx(pe,{variant:"outline",size:"xs",onClick:()=>{l(h=>!h)},children:"Preview source"}),u.jsxs(pe,{variant:"ghost",size:"xs",onClick:()=>void navigator.clipboard.writeText(c),children:[u.jsx(gy,{size:14}),"Copy path"]})]}):null]})]}),a?u.jsx("div",{style:{borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:"var(--sp-3)"},children:t!=null&&t.preview?u.jsx(dv,{children:t.preview}):u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No source preview available."})}):null]}):u.jsx(TN,{})})]})}function tH({snapshot:e,selectedNodeId:t,onSelectNode:n}){const a=x.useMemo(()=>aH(e.nodes),[e.nodes]),l=x.useMemo(()=>iH(e.nodes),[e.nodes]),o=Math.max(920,...a.map(f=>f.x+300)),c=Math.max(340,a.length*34);return u.jsxs(tn,{children:[u.jsx(Rr,{children:u.jsxs("div",{children:[u.jsxs(zr,{children:[u.jsx(sz,{size:17}),"Context Tree Overview"]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"Shows where recent context updates are concentrated across the team tree"})]})}),u.jsx(Tn,{children:a.length===0?u.jsx(_N,{snapshot:e}):u.jsx("div",{style:{overflow:"auto",maxHeight:"min(72vh, 52rem)"},children:u.jsxs("svg",{viewBox:`0 0 ${o} ${c}`,role:"img","aria-label":"Context Tree overview",style:{width:"100%",minWidth:"44rem"},children:[a.map(f=>f.parent?u.jsx("line",{x1:f.parent.x,y1:f.parent.y,x2:f.x,y2:f.y,stroke:"var(--border)",strokeWidth:1},`edge:${f.id}`):null),a.map(f=>{const m=f.id===t,h=l.get(f.id)??0;return u.jsx("foreignObject",{x:f.x-8,y:f.y-12,width:o-f.x+8,height:24,children:u.jsxs("button",{type:"button",onClick:()=>n(f.id),className:"flex w-full items-center text-left text-label",style:{color:"var(--fg)",gap:"var(--sp-2)"},children:[u.jsx("span",{"aria-hidden":"true",style:{width:m?"var(--sp-4)":"var(--sp-3)",height:m?"var(--sp-4)":"var(--sp-3)",borderRadius:"50%",background:xH(f.changeType,m),border:`${m?"var(--hairline-bold)":"var(--hairline)"} solid ${m?"var(--accent)":"var(--border-strong)"}`,flex:"0 0 auto"}}),u.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.title}),h>0?u.jsx("span",{style:{color:"var(--fg-3)",marginLeft:"auto",paddingRight:"var(--sp-2)"},children:h}):null]})},f.id)})]})})})]})}function du({label:e,tone:t,strong:n}){return u.jsx("span",{className:`text-label ${n?"font-semibold":"font-medium"}`,style:{color:t?bH(t):"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)",padding:"var(--sp-1) var(--sp-2)"},children:e})}function NN({type:e}){return u.jsx(du,{label:oH(e),tone:e})}function Hp({label:e,value:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:e}),u.jsx("div",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:t})]})}function OS({label:e,value:t}){return u.jsxs("div",{style:{color:"var(--fg-2)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:"var(--sp-3)"},children:[u.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:e}),u.jsx("div",{className:"text-body",children:t})]})}function MS({title:e,items:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:e}),u.jsx("div",{className:"flex flex-wrap",style:{gap:"var(--sp-1)"},children:t.map(n=>u.jsx("span",{className:"text-label",style:{color:"var(--fg-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-chip)",padding:"var(--sp-1) var(--sp-2)"},children:n},n))})]})}function nH(){return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[u.jsx(Ez,{size:17}),"Loading team context..."]})})})}function rH({message:e}){return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--danger)",gap:"var(--sp-2)"},children:[u.jsx(Ys,{size:17}),e]})})})}function _N({snapshot:e}){return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex items-start text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[u.jsx(Ys,{size:18,style:{color:"var(--warn)"}}),u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold",style:{color:"var(--fg)"},children:e.contextStatus.label}),u.jsx("div",{style:{marginTop:"var(--sp-1)"},children:e.contextStatus.detail})]})]})})})}function TN(){return u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No context updates in this time window."})}function aH(e){const t=new Map(e.map(m=>[m.id,m])),n=e.filter(m=>!m.parentId||t.has(m.parentId)).sort((m,h)=>m.path.localeCompare(h.path));if(n.length===0)return[];const a=$7().id(m=>m.id).parentId(m=>m.parentId)(n).sort((m,h)=>m.data.path.localeCompare(h.data.path)),o=K7().nodeSize([34,96])(a).descendants(),c=Math.min(...o.map(m=>m.x));return o.map(m=>({...m.data,x:24+m.y,y:24+m.x-c,parent:null})).map((m,h,y)=>({...m,parent:m.parentId?y.find(g=>g.id===m.parentId)??null:null}))}function iH(e){const t=new Map(e.map(a=>[a.id,a])),n=new Map;for(const a of e){if(!a.changeType)continue;let l=a;for(;l;)n.set(l.id,(n.get(l.id)??0)+1),l=l.parentId?t.get(l.parentId):void 0}return n}function lH(e){var t;return((t=EN.find(n=>n.value===e))==null?void 0:t.summary)??"last 7 days"}function sH(e){return e==="ok"?"var(--ok)":e==="warning"?"var(--warn)":"var(--danger)"}function oH(e){return e==="added"?"New":e==="removed"?"Removed":"Updated"}function uH(e){return e==="added"?"New knowledge":e==="removed"?"Removed knowledge":"Updated knowledge"}function cH(e){return e.changeType==="added"?`Agents can use new team knowledge when working on ${e.affectedContextArea}.`:e.changeType==="removed"?`Agents should stop using the old team knowledge for ${e.affectedContextArea}.`:`Agents can use updated team knowledge when working on ${e.affectedContextArea}.`}function dH(e){const t=e.changedBy??"Someone",n=e.changeType==="added"?"added":e.changeType==="removed"?"removed":"updated";return`${t} ${n} ${e.title}`}function fH(e){const t=e.changedBy??"Someone",n=e.changeType==="added"?"added":e.changeType==="removed"?"removed":"updated",a=mH(e);return a?`${t} ${n} ${e.title}: ${a}`:`${t} ${n} ${e.title}.`}function hH(e){return e.summary.replace(/^updated:\s*/i,"")}function mH(e){const t=hH(e);return new Set(["updated this team knowledge","added this team knowledge","removed this team knowledge"]).has(t.toLowerCase())||t.length<12||/[,;:]$/.test(t)?null:t}function pH(e){return e.length===0?"No owner":e.length===1?e[0]??"No owner":e.join(", ")}function gH(e){return e.length===0?"Owner not set":e.length===1?`Owner: ${e[0]??"Unknown"}`:`Owners: ${e.join(", ")}`}function yH(e){return`${e} linked context${e===1?"":"s"}`}function vH(e){const t=e.split("/").filter(Boolean);return t.length<=1?null:t.slice(0,-1).map(AN).join(" / ")}function Qg(e){return e.split("/").filter(Boolean).map(AN).join(" / ")||"root"}function AN(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function bH(e){return e==="added"?"var(--ok)":e==="edited"?"var(--warn)":"var(--danger)"}function xH(e,t){return t?"var(--accent)":e==="added"?"var(--ok)":e==="edited"?"var(--warn)":e==="removed"?"var(--danger)":"var(--bg-raised)"}const eo=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));eo.displayName="Card";const to=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));to.displayName="CardHeader";const nc=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("text-subtitle leading-none",e),...t}));nc.displayName="CardTitle";const RN=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("text-body text-muted-foreground",e),...t}));RN.displayName="CardDescription";const no=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));no.displayName="CardContent";const wH=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));wH.displayName="CardFooter";function SH(){const{token:e}=Mk(),t=Un(),{isAuthenticated:n,adoptTokens:a}=Dt(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1),[y,g]=x.useState(null);if(x.useEffect(()=>{e&&(async()=>{try{const E=await fetch(`/api/v1/invitations/${encodeURIComponent(e)}/preview`);if(!E.ok){f("This invitation is no longer valid");return}o(await E.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const E=await Ee.get("/me/organizations"),C=await Ee.get("/me"),R=E.find(O=>O.id===C.member.organizationId);g((R==null?void 0:R.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(DS,{message:"Bad invitation URL"});if(c)return u.jsx(DS,{message:"This invitation is no longer valid"});if(!l)return u.jsx(kH,{});const b=async()=>{h(!0);try{const E=await Ee.post("/me/organizations/join",{token:e});await a(E.tokens),Vk("invite"),t("/",{replace:!0})}catch(E){f(E instanceof Error?E.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=jH(l.expiresAt);return u.jsx(fv,{children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsx(to,{className:"text-center",children:u.jsxs(nc,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(no,{className:"space-y-4",children:[k&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[u.jsx(Ys,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("span",{children:["You'll switch from ",u.jsx("span",{className:"font-medium",children:y})," to"," ",u.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?u.jsx(pe,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(pe,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:w,children:[u.jsx(Jk,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&u.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function fv({children:e}){return u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Zu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(py,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function kH(){return u.jsx(fv,{children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsxs(to,{className:"text-center",children:[u.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),u.jsxs(no,{className:"space-y-4",children:[u.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function DS({message:e}){return u.jsx(fv,{children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsxs(to,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(Ys,{className:"h-6 w-6"})}),u.jsx(nc,{className:"text-title",children:e})]}),u.jsxs(no,{className:"space-y-4",children:[u.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),u.jsx(pe,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Zu,{to:"/",children:[u.jsx(py,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function jH(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const n=t-Date.now();if(n<=0)return null;const a=Math.floor(n/6e4),l=Math.floor(a/60),o=Math.floor(l/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:l>=1?{text:`Expires in ${l} ${l===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function CH(e){if(typeof e!="object"||e===null||!("from"in e))return null;const t=e.from;if(typeof t!="object"||t===null||!("pathname"in t)||typeof t.pathname!="string"||t.pathname==="/login")return null;const n="search"in t&&typeof t.search=="string"?t.search:"",a="hash"in t&&typeof t.hash=="string"?t.hash:"",l=`${t.pathname}${n}${a}`,o=XC(l);return o===Lw&&l!==Lw?null:o}function EH(){const{isAuthenticated:e}=Dt(),t=Yn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=CH(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?u.jsx(ur,{to:a,replace:!0}):u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Zu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(py,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsxs(to,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(Yu,{width:28,height:32})}),u.jsxs(nc,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(no,{className:"space-y-4",children:[u.jsx(pe,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Jk,{className:"h-4 w-4"}),"Continue with GitHub"]})}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[u.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),u.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),u.jsx(pe,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(Lz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function NH(){const e=Un(),{adoptTokens:t}=Dt(),[n,a]=x.useState(null);return x.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),c=o.get("access"),f=o.get("refresh"),m=XC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Vk(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}const qs=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("table",{ref:a,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0,...t},...n}));qs.displayName="DenseTable";const Hs=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));Hs.displayName="DenseTableHeader";const Zs=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));Zs.displayName="DenseTableBody";const Pr=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.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,...a},...l}));Pr.displayName="DenseTableRow";const lt=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:Te("text-left text-label whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3_5)",color:"var(--fg-3)",fontWeight:500,borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));lt.displayName="DenseTableHead";const We=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:Te("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));We.displayName="DenseTableCell";const _H=1500;function TH({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=x.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),_H))},b=t!==void 0?Math.max(1,Math.round(t/60)):null,w=u.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?u.jsxs(u.Fragment,{children:[e,b!==null&&u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",b,"m"]})]}):"Generating token…"}),k=u.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?u.jsx($r,{className:"h-3.5 w-3.5"}):u.jsx(gy,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):u.jsxs(u.Fragment,{children:[w,k]}),f&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[u.jsx(AH,{}),l]}),n==="success"&&o&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[u.jsx($r,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),u.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:c})]})}function AH(){return u.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const RH=3e3,zH=1200;function OH({open:e,onOpenChange:t}){const n=fn(),{user:a}=Dt(),[l,o]=x.useState("loading"),[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),b=x.useRef(new Set);return x.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),b.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return b.current=new Set(k),(async()=>{try{const j=await TO();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),x.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ni}),E=b.current,C=j.find(R=>!E.has(R.id)&&R.status==="connected"&&R.userId===a.id);C&&(g(C.hostname??null),o("success"))}catch{}},RH);return()=>clearInterval(k)},[e,l,n,a]),x.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},zH);return()=>clearTimeout(w)},[l,t,n]),u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsxs(dn,{children:[u.jsx(sn,{children:"Connect computer"}),u.jsx(Ny,{children:"Run this command on the machine you want to pair with this Hub."})]}),u.jsx(TH,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:l,successContent:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),u.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:u.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function MH({embedded:e=!1}={}){const t=fn(),n=jf(),[a,l]=x.useState(()=>new Set),[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(!1),{data:w}=Ve({queryKey:["clients"],queryFn:Ni,refetchInterval:1e4}),{data:k}=Ve({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),j=Ct({mutationFn:_O,onSuccess:()=>{c(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),E=Ct({mutationFn:NO,onSuccess:()=>{m(null),y(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:z=>{z instanceof Vu?y(z.message):y(z instanceof Error?z.message:String(z))}}),C=x.useMemo(()=>{const z=new Map;for(const $ of(k==null?void 0:k.agents)??[]){if(!$.clientId)continue;const U=z.get($.clientId)??[];U.push($),z.set($.clientId,U)}return z},[k==null?void 0:k.agents]),R=z=>C.get(z)??[],O=(w??[]).filter(z=>z.status==="connected").length,M=(w??[]).reduce((z,$)=>z+$.agentCount,0),B=(w??[]).filter(z=>z.authState!=="ok").length;return u.jsxs("div",{className:e?"":"-m-6",children:[u.jsx(tc,{title:"Computers",subtitle:w&&w.length>0?u.jsxs(u.Fragment,{children:[w.length," total · ",O," connected · ",M," agents bound",B>0&&u.jsxs(u.Fragment,{children:[" · ",u.jsxs("span",{style:{color:"var(--state-error)"},children:[B," need re-auth"]})]})]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(pe,{size:"xs",onClick:()=>b(!0),children:[u.jsx(Fr,{className:"h-3 w-3"}),"Connect computer"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(OH,{open:g,onOpenChange:b}),f&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.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:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.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)."]}),R(f.id).length>0&&u.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:[u.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-body space-y-0.5",children:R(f.id).map(z=>u.jsx("li",{className:"font-medium",children:n(z.agentId)},z.agentId))})]}),h&&u.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:h}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(pe,{variant:"outline",size:"sm",onClick:()=>{m(null),y(null)},children:"Cancel"}),u.jsx(pe,{variant:"destructive",size:"sm",onClick:()=>E.mutate(f.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),o&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.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:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:o.hostname??o.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:R(o.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):R(o.id).map(z=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:n(z.agentId)}),u.jsx(Ru,{state:z.runtimeState})]},z.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(pe,{variant:"outline",size:"sm",onClick:()=>c(null),children:"Cancel"}),u.jsx(pe,{variant:"destructive",size:"sm",onClick:()=>j.mutate(o.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!w||w.length===0?u.jsx(tn,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers connected. Use the button above to generate a connect command."})}):u.jsxs(tn,{children:[u.jsxs(Mg,{children:["Registered · ",w.length]}),u.jsxs(qs,{children:[u.jsx(Hs,{children:u.jsxs(Pr,{children:[u.jsx(lt,{style:{width:16}}),u.jsx(lt,{children:"Hostname"}),u.jsx(lt,{children:"OS"}),u.jsx(lt,{children:"SDK"}),u.jsx(lt,{children:"Agents"}),u.jsx(lt,{children:"Connected"}),u.jsx(lt,{children:"Status"}),u.jsx(lt,{"aria-hidden":!0})]})}),u.jsx(Zs,{children:w.map(z=>{const $=!a.has(z.id),U=R(z.id);return u.jsx($H,{client:z,boundAgents:U,isExpanded:$,agentName:n,onToggle:()=>l(Q=>{const I=new Set(Q);return I.has(z.id)?I.delete(z.id):I.add(z.id),I}),onDisconnect:()=>c(z),onRetire:()=>{y(null),m(z)},onReconnect:()=>b(!0)},z.id)})})]})]})]})]})}const DH={"claude-code":"Claude Code",codex:"Codex"},IH=[nf.CLAUDE_CODE,nf.CODEX],IS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},LH={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function UH({clientId:e,enabled:t}){const{data:n,isLoading:a}=Ve({queryKey:["client-capabilities",e],queryFn:()=>wy(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Hy,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):u.jsx("div",{className:"flex flex-col gap-1",children:IH.map(o=>u.jsx(PH,{provider:o,entry:l?l[o]??null:null},o))})]})}function PH({provider:e,entry:t}){const n=DH[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",IS[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",LH[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",IS[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function BH(){return u.jsxs("span",{className:"mono inline-flex items-center gap-1.5 uppercase text-caption",style:{color:"var(--state-error)"},children:[u.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--state-error)",display:"inline-block"}}),"AUTH EXPIRED"]})}function $H({client:e,boundAgents:t,isExpanded:n,agentName:a,onToggle:l,onDisconnect:o,onRetire:c,onReconnect:f}){const h=e.status!=="connected",y=e.authState!=="ok",g=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(Pr,{interactive:!0,selected:n,onClick:l,children:[u.jsx(We,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Yk,{className:"h-3.5 w-3.5"}):u.jsx(WR,{className:"h-3.5 w-3.5"})})}),u.jsx(We,{className:"font-medium",children:e.hostname??"—"}),u.jsx(We,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(We,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(We,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?ju(e.connectedAt):"—"}),u.jsx(We,{children:y?u.jsx(BH,{}):u.jsx(Ru,{state:g})}),u.jsx(We,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex items-center justify-end text-label",style:{gap:"var(--sp-3_5)"},children:[h&&u.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:y?"var(--state-error)":"var(--fg-2)"},onClick:b=>{b.stopPropagation(),f()},children:"Reconnect"}),u.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:"var(--fg-2)"},onClick:b=>{b.stopPropagation(),o()},children:"Disconnect"}),u.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:"var(--fg-4)"},onClick:b=>{b.stopPropagation(),c()},children:"Retire"})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(We,{}),u.jsxs(We,{colSpan:7,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(UH,{clientId:e.id,enabled:n}),t.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs(Hy,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),u.jsx("div",{className:"flex flex-col gap-1",children:t.map(b=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:a(b.agentId)}),u.jsx(Ru,{state:b.runtimeState}),b.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[b.activeSessions," / ",b.totalSessions??0," sessions"]})]},b.agentId))})]})]})]})]})}function FH(){return u.jsx(MH,{embedded:!0})}function qH(){return Ee.get(hn("/adapter-mappings"))}function HH(e){return Ee.post(hn("/adapter-mappings"),e)}function ZH(e){return Ee.delete(`/adapter-mappings/${e}`)}function VH(){return Ee.get(hn("/adapters/status"))}function QH(){return Ee.get(hn("/adapters"))}function KH(e){return Ee.post(hn("/adapters"),e)}function GH(e,t){return Ee.patch(`/adapters/${e}`,t)}function YH(e){return Ee.delete(`/adapters/${e}`)}const XH=Object.values(p6),LS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function US(e){const[t,n]=x.useState(LS),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...LS,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),l(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.preventDefault(),l(""),e.kind==="user"){if(!t.externalUserId)return;e.onSubmit({kind:"user-create",draft:{platform:t.platform,externalUserId:t.externalUserId,displayName:t.displayName||null}});return}if(t.platform==="feishu"){if(!e.editingId&&(!t.feishuAppId||!t.feishuAppSecret)){l("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){l("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){l("Credentials are required");return}if(h)try{JSON.parse(h)}catch{l("Invalid JSON");return}}const m=JH(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const c=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return u.jsx(ln,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,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:XH.map(f=>u.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(At,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(At,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):u.jsxs(u.Fragment,{children:[t.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.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": "..."}'})]}),a&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.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:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(pe,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function JH(e){if(e.platform==="feishu")return!e.feishuAppId&&!e.feishuAppSecret||!e.feishuAppId||!e.feishuAppSecret?null:{app_id:e.feishuAppId,app_secret:e.feishuAppSecret};if(e.platform==="kael")return!e.kaelUserId&&!e.kaelProjectId||!e.kaelUserId||!e.kaelProjectId?null:{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId};const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function WH(){var T;const e=Un(),t=fn(),[n,a]=Fk(),l=n.get("agent"),o=jf(),c=Ve({queryKey:["adapters"],queryFn:QH}),f=Ve({queryKey:["adapter-mappings"],queryFn:qH}),m=Ve({queryKey:["adapter-statuses"],queryFn:VH,refetchInterval:15e3}),y=((T=Ve({queryKey:["agents","name-map"],queryFn:()=>Gu({limit:100}),staleTime:3e4}).data)==null?void 0:T.items)??[],g=x.useMemo(()=>{const Z=new Map;for(const W of m.data??[])Z.set(W.configId,W);return Z},[m.data]),b=x.useMemo(()=>{const Z=c.data??[];return l?Z.filter(W=>W.agentId===l):Z},[c.data,l]),w=x.useMemo(()=>{const Z=f.data??[];return l?Z.filter(W=>W.agentId===l):Z},[f.data,l]),k=b.reduce((Z,W)=>{var ce;return Z+((ce=g.get(W.id))!=null&&ce.connected?1:0)},0),j=b.length-k,E=c.isLoading||f.isLoading,[C,R]=x.useState(null),[O,M]=x.useState(""),[B,z]=x.useState(null),[$,U]=x.useState(null),[Q,I]=x.useState(null),[ne,le]=x.useState(null),we=Ct({mutationFn:Z=>KH({platform:Z.platform,agentId:Z.agentId,credentials:Z.credentials,status:Z.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),Y=Ct({mutationFn:Z=>{const W={status:Z.status};return Z.credentials&&(W.credentials=Z.credentials),GH(Z.id,W)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),J=Ct({mutationFn:YH,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),H=Ct({mutationFn:Z=>HH({platform:Z.platform,externalUserId:Z.externalUserId,agentId:Z.agentId,boundVia:"manual",displayName:Z.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),U(null)}}),ee=Ct({mutationFn:ZH,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function be(Z){if(l){Z==="bot"?z({agentId:l,editingId:null}):U({agentId:l});return}M(""),R({kind:Z})}function Ae(){!C||!O||(C.kind==="bot"?z({agentId:O,editingId:null}):U({agentId:O}),R(null))}function A(Z){if(B){if(Z.kind==="bot-create")we.mutate({agentId:B.agentId,platform:Z.draft.platform,status:Z.draft.status,credentials:Z.draft.credentials});else if(Z.kind==="bot-update"){if(!B.editingId)return;Y.mutate({id:B.editingId,status:Z.status,credentials:Z.credentials})}}}function L(Z){!$||Z.kind!=="user-create"||H.mutate({agentId:$.agentId,platform:Z.draft.platform,externalUserId:Z.draft.externalUserId,displayName:Z.draft.displayName})}const P=l?y.find(Z=>Z.uuid===l):null;return u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&u.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[u.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),u.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(P==null?void 0:P.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const Z=new URLSearchParams(n);Z.delete("agent"),a(Z,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:u.jsx(ku,{className:"h-3 w-3"})})]})]}),u.jsxs(tn,{className:"mb-3.5",children:[u.jsxs(Mg,{right:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[u.jsx(hu,{state:"idle",size:6})," ",k," online"]}),u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(hu,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>be("bot"),children:[u.jsx(Fr,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?u.jsx(Ld,{children:"Loading…"}):b.length?u.jsxs(qs,{children:[u.jsx(Hs,{children:u.jsxs(Pr,{children:[u.jsx(lt,{children:"Agent"}),u.jsx(lt,{children:"Platform"}),u.jsx(lt,{children:"Status"}),u.jsx(lt,{children:"Connection"}),u.jsx(lt,{children:"Created"}),u.jsx(lt,{style:{width:96,textAlign:"right"}})]})}),u.jsx(Zs,{children:b.map(Z=>{var ce;const W=((ce=g.get(Z.id))==null?void 0:ce.connected)??!1;return u.jsxs(Pr,{interactive:!0,onClick:()=>e(`/agents/${Z.agentId}`),children:[u.jsx(We,{children:u.jsx("span",{className:"mono font-medium",children:o(Z.agentId)})}),u.jsx(We,{children:u.jsx(Ur,{children:Z.platform})}),u.jsx(We,{children:u.jsx(Ur,{tone:Z.status==="active"?"accent":"outline",children:Z.status})}),u.jsx(We,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(hu,{state:W?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:W?"Online":"Offline"})]})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:ju(Z.createdAt)}),u.jsxs(We,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:ve=>ve.stopPropagation(),children:[u.jsx(pe,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>z({agentId:Z.agentId,editingId:Z.id,initialPlatform:eZ(Z.platform),initialStatus:tZ(Z.status)}),children:"Edit"}),u.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>I(Z.id),disabled:J.isPending,title:"Delete",children:u.jsx(Su,{className:"h-3.5 w-3.5"})})]})]},Z.id)})})]}):u.jsx(Ld,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(tn,{children:[u.jsxs(Mg,{right:u.jsxs(pe,{size:"xs",variant:"outline",onClick:()=>be("user"),children:[u.jsx(Fr,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),E?u.jsx(Ld,{children:"Loading…"}):w.length?u.jsxs(qs,{children:[u.jsx(Hs,{children:u.jsxs(Pr,{children:[u.jsx(lt,{children:"Agent"}),u.jsx(lt,{children:"Platform"}),u.jsx(lt,{children:"External user ID"}),u.jsx(lt,{children:"Display name"}),u.jsx(lt,{children:"Bound via"}),u.jsx(lt,{children:"Created"}),u.jsx(lt,{style:{width:32}})]})}),u.jsx(Zs,{children:w.map(Z=>u.jsxs(Pr,{interactive:!0,onClick:()=>e(`/agents/${Z.agentId}`),children:[u.jsx(We,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(Z.agentId)})}),u.jsx(We,{children:u.jsx(Ur,{children:Z.platform})}),u.jsx(We,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:Z.externalUserId})}),u.jsx(We,{style:{color:"var(--fg-2)"},children:Z.displayName??"—"}),u.jsx(We,{children:u.jsx(Ur,{tone:"outline",children:Z.boundVia??"—"})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:ju(Z.createdAt)}),u.jsx(We,{onClick:W=>W.stopPropagation(),children:u.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>le(Z.id),disabled:ee.isPending,title:"Delete",children:u.jsx(Su,{className:"h-3.5 w-3.5"})})})]},Z.id))})]}):u.jsx(Ld,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(nZ,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:y,agentId:O,onAgentChange:M,onCancel:()=>R(null),onConfirm:Ae}),u.jsx(US,{open:B!=null,kind:"bot",editingId:(B==null?void 0:B.editingId)??null,initialPlatform:B==null?void 0:B.initialPlatform,initialStatus:B==null?void 0:B.initialStatus,agentLabel:B?o(B.agentId):"",pending:we.isPending||Y.isPending,errorMessage:(we.error??Y.error)instanceof Error?(we.error??Y.error).message:null,onOpenChange:Z=>{Z||(z(null),we.reset(),Y.reset())},onSubmit:A}),u.jsx(US,{open:$!=null,kind:"user",editingId:null,agentLabel:$?o($.agentId):"",pending:H.isPending,errorMessage:H.error instanceof Error?H.error.message:null,onOpenChange:Z=>{Z||(U(null),H.reset())},onSubmit:L}),u.jsx(PS,{open:Q!=null,onOpenChange:Z=>!Z&&I(null),title:"Remove this bot binding?",description:"The bot will stop routing to this agent and any platform credentials stored here will be dropped.",confirmLabel:"Remove binding",pending:J.isPending,onConfirm:()=>{Q!=null&&(J.mutate(Q),I(null))}}),u.jsx(PS,{open:ne!=null,onOpenChange:Z=>!Z&&le(null),title:"Remove this binding?",description:"The external user will stop routing to this agent. You can add the mapping again later.",confirmLabel:"Remove binding",pending:ee.isPending,onConfirm:()=>{ne!=null&&(ee.mutate(ne),le(null))}})]})}function eZ(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function tZ(e){return e==="inactive"?"inactive":"active"}function Ld({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function nZ(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return u.jsx(ln,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),u.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.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:[u.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>u.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),u.jsxs(Ln,{children:[u.jsx(pe,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(pe,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function PS(e){return u.jsx(ln,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(pe,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function rZ({embedded:e=!1}={}){return u.jsxs("div",{className:e?"":"-m-6",children:[u.jsx(tc,{title:"Integrations",subtitle:"External platform bindings"}),u.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:u.jsx(WH,{})})]})}function aZ(){return u.jsx(rZ,{embedded:!0})}function iZ(){return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[u.jsx(BS,{to:"/settings/computers",label:"Computers"}),u.jsx(BS,{to:"/settings/integrations",label:"Integrations"})]}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:u.jsx(Us,{})})]})}function BS({to:e,label:t}){return u.jsx(yf,{to:e,className:({isActive:n})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!n&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:n})=>u.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:n?"var(--bg-active)":"transparent",color:n?"var(--fg)":"var(--fg-3)",fontWeight:n?500:400,borderRadius:"var(--radius-input)"},children:u.jsx("span",{className:"flex-1 truncate",children:t})})})}function Kg(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,bs)}const Zp=200;function lZ(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const a of e){const l=a.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function sZ(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,bs)}function oZ(e){switch(e){case"taken":return"That agent name is already in use in this organization. Pick a different one.";case"reserved":return"That agent name is reserved — pick a different one.";case"invalid":return"Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_)."}}function uZ({open:e,onOpenChange:t,onCreated:n}){const a=fn(),{refreshMe:l,organizationId:o}=Dt(),[c,f]=x.useState(""),[m,h]=x.useState(""),[y,g]=x.useState(!1),[b,w]=x.useState("claude-code"),[k,j]=x.useState("form"),[E,C]=x.useState([]),[R,O]=x.useState(null),[M,B]=x.useState(!1),[z,$]=x.useState({}),[U,Q]=x.useState({status:"idle"});x.useEffect(()=>{e&&(f(""),h(""),g(!1),w("claude-code"),j("form"),C([]),O(null),B(!1),$({}),Q({status:"idle"}))},[e]),x.useEffect(()=>{y||h(Kg(c))},[c,y]);const I=x.useRef(0);x.useEffect(()=>{if(!e||!m){Q({status:"idle"});return}if(!Rg.test(m)){Q({status:"bad",reason:"invalid"});return}if(zg(m)){Q({status:"bad",reason:"reserved"});return}const A=++I.current;Q({status:"checking"});const L=window.setTimeout(()=>{WM(m).then(P=>{A===I.current&&(P.available?Q({status:"ok"}):Q({status:"bad",reason:P.reason}))}).catch(()=>{A===I.current&&Q({status:"idle"})})},300);return()=>window.clearTimeout(L)},[m,e]);const ne=Ct({mutationFn:async A=>{const L=c.trim()||m.trim()||"Untitled assistant";return JM({name:m||void 0,type:"personal_assistant",displayName:L,clientId:A.clientId,runtimeProvider:b,...o?{organizationId:o}:{}})},onSuccess:A=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(A,b)}}),le=x.useMemo(()=>{const A=ne.error;if(!A)return{};if(A instanceof Vu){const L=lZ(A.issues);return Object.keys(L).length>0?L:A.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:A.message}}return A instanceof Error?{_root:A.message}:{}},[ne.error]),we=U.status==="bad"?oZ(U.reason):void 0,Y={...we?{name:we}:{},...le,...z};function J(){const A={};return m?m.length>bs?A.name=`Agent name must be at most ${bs} characters (got ${m.length}).`:Rg.test(m)?zg(m)&&(A.name="That agent name is reserved — pick a different one."):A.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":c.trim().length>0&&(A.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),c.length>Zp&&(A.displayName=`Display name must be at most ${Zp} characters (got ${c.length}).`),A}async function H(A){var P,T;A.preventDefault();const L=J();if($(L),!(Object.keys(L).length>0)&&U.status!=="bad"){B(!0);try{const W=(await Ni()).filter(ve=>ve.status==="connected");if(W.length===0){ne.mutate({clientId:void 0});return}if(W.length===1){ne.mutate({clientId:(P=W[0])==null?void 0:P.id});return}const ce=[...W].sort((ve,ge)=>ge.lastSeenAt.localeCompare(ve.lastSeenAt));C(ce),O(((T=ce[0])==null?void 0:T.id)??null),j("pick-computer")}catch{ne.mutate({clientId:void 0})}finally{B(!1)}}}function ee(){R&&ne.mutate({clientId:R})}const be=U.status==="bad",Ae=c.trim().length>0&&!be&&!ne.isPending&&!M;return k==="pick-computer"?u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{className:"max-w-lg",children:[u.jsx(dn,{children:u.jsx(sn,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:c||m})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:E.map(A=>{const L=R===A.id;return u.jsxs("label",{className:L?"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:[u.jsx("input",{type:"radio",name:"target-computer",checked:L,onChange:()=>O(A.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:A.hostname??A.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[A.os??"unknown OS"," · last seen ",new Date(A.lastSeenAt).toLocaleString()]})]})]},A.id)})}),Y.clientId&&u.jsx("p",{className:"text-body text-destructive",children:Y.clientId}),Y._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:Y._root})]}),u.jsxs(Ln,{children:[u.jsx(pe,{variant:"outline",onClick:()=>j("form"),disabled:ne.isPending,children:"Back"}),u.jsx(pe,{onClick:ee,disabled:!R||ne.isPending,children:ne.isPending?"Creating…":"Create"})]})]})}):u.jsx(ln,{open:e,onOpenChange:t,children:u.jsxs(en,{className:"max-w-lg",children:[u.jsx(dn,{children:u.jsx(sn,{children:"New Agent"})}),u.jsxs("form",{onSubmit:H,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(At,{id:"new-agent-display-name",value:c,onChange:A=>{f(A.target.value),z.displayName&&$(L=>({...L,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Zp,"aria-invalid":Y.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),u.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),Y.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:Y.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"new-agent-name",children:"Agent name"}),u.jsxs("div",{className:"flex items-stretch",children:[u.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),u.jsx(At,{id:"new-agent-name",value:m,onChange:A=>{const L=sZ(A.target.value);h(L),g(!0),z.name&&$(P=>({...P,name:void 0}))},onBlur:A=>{const L=Kg(A.target.value);L!==m&&h(L)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:bs,"aria-invalid":Y.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),u.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",bs," characters. Permanent after creation."]}),m&&!Y.name&&U.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:U.status==="ok"?"var(--state-idle)":U.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[U.status==="checking"&&"Checking availability…",U.status==="ok"&&"Available."]}),Y.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:Y.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.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:[u.jsx("input",{type:"radio",name:"runtime",checked:b==="claude-code",onChange:()=>w("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),u.jsxs("label",{className:b==="codex"?"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:[u.jsx("input",{type:"radio",name:"runtime",checked:b==="codex",onChange:()=>w("codex"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Codex"}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",u.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),Y._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:Y._root}),u.jsx(Ln,{children:u.jsx(pe,{type:"submit",disabled:!Ae,children:M?"Checking computers…":ne.isPending?"Creating…":"Create"})})]})]})})}function hv({children:e,count:t,right:n}){return u.jsxs("div",{className:"flex items-baseline justify-between",style:{padding:"var(--sp-1) var(--sp-1) var(--sp-2)"},children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[u.jsx("h2",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t!==void 0&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:t})]}),n]})}function cZ(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const l=Math.ceil(a/(1440*60*1e3));return`expires ${l===1?"in less than a day":`in ${l} days`} · ${t.toLocaleDateString()}`}function dZ(){const{organizationId:e}=Dt(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,c]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const y=await Ee.get(U1(e,"/invitations"));n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const y=await Ee.post(U1(e,"/invitations/rotate"));n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(eo,{children:[u.jsxs(to,{children:[u.jsx(nc,{children:"Invite link"}),u.jsxs(RN,{children:["Anyone with this link can join your team as a member. Links expire after ",sU," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(no,{className:"space-y-3",children:[a&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),u.jsx(pe,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(pe,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),u.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${cZ(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const fZ=Object.values(fU);function hZ(){const e=fn(),{memberId:t,role:n}=Dt(),a=n==="admin",[l,o]=x.useState(null),{data:c,isLoading:f,error:m}=Ve({queryKey:["members"],queryFn:Vy}),h=Ct({mutationFn:rP,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function y(g){window.confirm("Delete this member? Their human agent will also be deactivated.")&&h.mutate(g)}return u.jsxs(u.Fragment,{children:[u.jsx("section",{children:f?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):m?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",m instanceof Error?m.message:"Unknown error"]}):(c==null?void 0:c.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:a?"No members yet — share the Invite link to add teammates.":"No members yet."}):u.jsxs(qs,{className:"table-fixed",children:[u.jsx(Hs,{children:u.jsxs(Pr,{children:[u.jsx(lt,{style:{width:160},children:"Display name"}),u.jsx(lt,{style:{width:140},children:"Username"}),u.jsx(lt,{style:{width:120},children:"Role"}),u.jsx(lt,{style:{width:150},children:"Created"}),u.jsx(lt,{"aria-hidden":!0}),a&&u.jsx(lt,{style:{width:80,textAlign:"right"}})]})}),u.jsx(Zs,{children:c==null?void 0:c.map(g=>{const b=t===g.id;return u.jsxs(Pr,{children:[u.jsxs(We,{children:[u.jsx("span",{className:"font-medium",children:g.displayName}),b&&u.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),u.jsx(We,{children:u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",g.username]})}),u.jsx(We,{className:"text-label",style:{color:"var(--fg-3)"},children:g.role==="admin"?"Admin":"Member"}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:vj(g.createdAt)}),u.jsx(We,{"aria-hidden":!0}),a&&u.jsx(We,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({id:g.id,username:g.username,displayName:g.displayName,role:g.role}),title:"Edit",children:u.jsx(bf,{className:"h-3.5 w-3.5"})}),!b&&u.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(g.id),disabled:h.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Su,{className:"h-3.5 w-3.5"})})]})})]},g.id)})})]})}),u.jsx(mZ,{target:l,onClose:()=>o(null),onSaved:()=>{o(null),e.invalidateQueries({queryKey:["members"]})}})]})}function mZ({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,c]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),c(e.role),m(null))},[e]);const h=Ct({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return a.trim()&&a!==e.displayName&&(b.displayName=a.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:nP(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 u.jsx(ln,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Username"}),u.jsx(At,{value:e.username,disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(At,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"edit-member-role",children:"Role"}),u.jsx("select",{id:"edit-member-role",value:o,onChange:b=>c(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:fZ.map(b=>u.jsx("option",{value:b,children:b},b))}),u.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&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),u.jsxs(Ln,{children:[u.jsx(pe,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(pe,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function pZ(){var m;const{role:e}=Dt(),t=e==="admin",[n,a]=x.useState(!1),{data:l}=Ve({queryKey:["members"],queryFn:Vy}),o=Ve({queryKey:["agents","team-page"],queryFn:()=>Gu({limit:100})}),c=(l==null?void 0:l.length)??0,f=(((m=o.data)==null?void 0:m.items)??[]).filter(h=>h.type!=="human").length;return u.jsxs(u.Fragment,{children:[u.jsx(tc,{title:"Team",subtitle:`${c} ${c===1?"human":"humans"} and ${f} ${f===1?"agent":"agents"} working together`,right:t&&u.jsxs(pe,{size:"xs",variant:"ghost",onClick:()=>a(!0),children:[u.jsx(tj,{className:"h-3 w-3"}),"Invite link"]})}),u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)",display:"flex",flexDirection:"column",gap:"var(--sp-5)"},children:[u.jsx(gZ,{}),u.jsx(yZ,{data:o.data,isLoading:o.isLoading,error:o.error})]}),u.jsx(ln,{open:n,onOpenChange:a,children:u.jsxs(en,{children:[u.jsx(dn,{children:u.jsx(sn,{children:"Invite link"})}),u.jsx(dZ,{})]})})]})}function gZ(){return u.jsxs("section",{children:[u.jsx(hv,{children:"Humans"}),u.jsx(hZ,{})]})}function yZ({data:e,isLoading:t,error:n}){const a=Un(),l=fn(),o=yE(),{memberId:c}=Dt(),[f,m]=x.useState(!1),{data:h}=Ve({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),y=x.useMemo(()=>{const w=new Map;for(const k of(h==null?void 0:h.agents)??[])w.set(k.agentId,k);return w},[h==null?void 0:h.agents]),g=x.useMemo(()=>{const w=((e==null?void 0:e.items)??[]).filter(E=>E.type!=="human");if(!c)return w;const k=[],j=[];for(const E of w)(E.managerId===c?k:j).push(E);return[...k,...j]},[e==null?void 0:e.items,c]);function b(w,k){m(!1),l.invalidateQueries({queryKey:["agents"]}),l.invalidateQueries({queryKey:["activity"]})}return u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsx(hv,{right:u.jsxs(pe,{size:"xs",variant:"ghost",className:"normal-case tracking-normal",onClick:()=>m(!0),children:[u.jsx(Fr,{className:"h-3 w-3"}),"New agent"]}),children:"Agents"}),t?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",n instanceof Error?n.message:"Unknown error"]}):g.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents yet — create one with “New agent”."}):u.jsxs(qs,{className:"table-fixed",children:[u.jsx(Hs,{children:u.jsxs(Pr,{children:[u.jsx(lt,{style:{width:160},children:"Display name"}),u.jsx(lt,{style:{width:140},children:"Agent name"}),u.jsx(lt,{style:{width:150},children:"Type"}),u.jsx(lt,{style:{width:160},children:"Managed by"}),u.jsx(lt,{style:{width:100},children:"Visibility"}),u.jsx(lt,{style:{width:110},children:"Status"}),u.jsx(lt,{style:{width:150},children:"Created"})]})}),u.jsx(Zs,{children:g.map(w=>{const k=y.get(w.uuid);return u.jsxs(Pr,{interactive:!0,onClick:()=>a(`/agents/${encodeURIComponent(w.uuid)}`),children:[u.jsx(We,{children:u.jsx("span",{className:"font-medium",children:w.displayName})}),u.jsx(We,{children:w.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",w.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(We,{className:"text-label",style:{color:"var(--fg-3)"},children:vZ(w.type)}),u.jsxs(We,{className:"text-label",style:{color:"var(--fg-2)"},children:[w.managerId?o(w.managerId):"—",w.managerId&&w.managerId===c&&u.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),u.jsx(We,{className:"text-label",style:{color:"var(--fg-3)"},children:bZ(w.visibility)}),u.jsx(We,{children:u.jsx(Ru,{state:(k==null?void 0:k.runtimeState)??null})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:vj(w.createdAt)})]},w.uuid)})})]})]}),u.jsx(uZ,{open:f,onOpenChange:m,onCreated:b})]})}function vZ(e){return e==="autonomous_agent"?"Autonomous agent":e==="personal_assistant"?"Personal assistant":e}function bZ(e){return e==="organization"?"Shared":e==="private"?"Private":e}function xZ(e){return Ee.get(`/orgs/${encodeURIComponent(e)}`)}function wZ(e,t){return Ee.patch(`/orgs/${encodeURIComponent(e)}`,t)}function SZ(){const{organizationId:e}=Dt(),t=fn(),n=Ve({queryKey:["organization",e],queryFn:()=>e?xZ(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(""),[f,m]=x.useState(!1);x.useEffect(()=>{n.data&&(l(n.data.displayName),c(n.data.name))},[n.data]);const h=Ct({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},b=a.trim(),w=o.trim();return b&&b!==n.data.displayName&&(g.displayName=b),w&&w!==n.data.name&&(g.name=w),Object.keys(g).length===0?Promise.resolve(n.data):wZ(e,g)},onSuccess:g=>{t.setQueryData(["organization",e],g),t.invalidateQueries({queryKey:["me-organizations"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return u.jsxs("section",{children:[u.jsx(hv,{right:u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(pe,{type:"submit",form:"team-identity-form",size:"xs",variant:"outline",disabled:h.isPending||!n.data,children:[u.jsx($r,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]}),children:"Team identity"}),n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx($S,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),u.jsx($S,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>c(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})]})}function $S({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,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)"}})]})}function kZ(){return u.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:u.jsx(SZ,{})})}function jZ(){const{role:e}=Dt();return e===null?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?u.jsx(ur,{to:"/team",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx(tc,{title:"Team settings",subtitle:"Organization name, slug, and metadata"}),u.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:u.jsx(kZ,{})})]})}function CZ(){const{role:e}=Dt();return e!=="admin"?u.jsx(Us,{}):u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[u.jsx(FS,{to:"/team",end:!0,label:"Members"}),u.jsx(FS,{to:"/team/settings",label:"Team settings"})]}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:u.jsx(Us,{})})]})}function FS({to:e,label:t,end:n}){return u.jsx(yf,{to:e,end:n,className:({isActive:a})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!a&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:a})=>u.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:a?"var(--bg-active)":"transparent",color:a?"var(--fg)":"var(--fg-3)",fontWeight:a?500:400,borderRadius:"var(--radius-input)"},children:u.jsx("span",{className:"flex-1 truncate",children:t})})})}function df(e){const t=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.filter&&t.set("filter",e.filter);const n=t.toString();return Ee.get(hn(`/chats${n?`?${n}`:""}`))}function EZ(e){return Ee.post(hn("/chats"),e)}function NZ(e){return Ee.post(`/chats/${encodeURIComponent(e)}/read`)}function zN(e,t){return Ee.post(`/chats/${encodeURIComponent(e)}/participants`,t)}function _Z(e){return Ee.post(`/chats/${encodeURIComponent(e)}/workspace-join`)}function TZ({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:Te("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),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},...c,children:[l,t!==void 0&&u.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const ff="draft";function AZ(e){if(!e)return"";const t=new Date(e),a=Date.now()-t.getTime();if(a<6e4)return"now";if(a<60*6e4)return`${Math.round(a/6e4)}m`;if(a<1440*6e4)return`${Math.round(a/36e5)}h`;const l=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),o=c=>{var f;return((f=l.find(m=>m.type===c))==null?void 0:f.value)??""};return`${o("month")}/${o("day")} ${o("hour")}:${o("minute")}`}function RZ(e){return e.membershipKind==="watching"?e.lastMessagePreview?`Watching · ${e.lastMessagePreview}`:"Watching":e.lastMessagePreview??""}function zZ({selectedChatId:e,onSelectChat:t,onNewChat:n}){const[a,l]=x.useState("all"),[o,c]=x.useState(""),[f,m]=x.useState([]),[h,y]=x.useState(!1),[g,b]=x.useState(null),{data:w,isLoading:k}=Ve({queryKey:["me","chats",a],queryFn:()=>df({filter:a}),refetchInterval:15e3}),j=()=>{f.length>0&&m([]),b(null)},E=(w==null?void 0:w.rows)??[],C=x.useMemo(()=>[...E,...f],[E,f]),R=x.useMemo(()=>{const U=o.trim().toLowerCase();return U?C.filter(Q=>Q.title.toLowerCase().includes(U)||(Q.lastMessagePreview??"").toLowerCase().includes(U)?!0:Q.participants.map(we=>we.displayName.toLowerCase()).join(" ").includes(U)):C},[C,o]),O=async()=>{if(h)return;const U=w==null?void 0:w.nextCursor;if(U){y(!0),b(null);try{const Q=await df({filter:a,cursor:U});m(I=>[...I,...Q.rows]),B(Q.nextCursor)}catch(Q){b(Q instanceof Error?Q.message:"Failed to load more")}finally{y(!1)}}},[M,B]=x.useState(null),z=(w==null?void 0:w.nextCursor)??null;x.useEffect(()=>{B(z)},[z]);const $=x.useMemo(()=>C.reduce((U,Q)=>U+(Q.unreadMentionCount>0?1:0),0),[C]);return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:320,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0 flex flex-col",style:{gap:6,padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:n,className:"w-full inline-flex items-center transition-colors text-body hover:bg-[var(--bg-hover)]",style:{gap:6,padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:e===ff?"var(--bg-active)":"transparent",color:e===ff?"var(--accent)":"var(--fg)",cursor:"pointer",fontWeight:500},title:"New chat",children:[u.jsx(Fr,{className:"h-3.5 w-3.5",strokeWidth:2}),"New chat"]}),u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx("div",{className:"flex gap-1 shrink-0",children:$>0&&u.jsx(TZ,{active:a==="unread",count:$,onClick:()=>{l(a==="unread"?"all":"unread"),j()},children:"unread"})}),u.jsxs("div",{className:"relative",style:{flex:1,minWidth:0},children:[u.jsx(vy,{className:"h-3 w-3 absolute pointer-events-none",style:{left:4,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:o,onChange:U=>c(U.target.value),placeholder:"Search…",className:"w-full outline-none text-caption",style:{padding:"var(--sp-0_5) var(--sp-1) var(--sp-0_5) var(--sp-5)",background:"transparent",border:"none",color:"var(--fg-2)"}})]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[k&&R.length===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:"Loading…"}),!k&&R.length===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:o?"No matches":u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{margin:0},children:"No conversations yet."}),u.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Start with New chat."})]})}),R.map(U=>{const Q=e===U.chatId,I=RZ(U),ne=I&&I!==U.title?I:"",le=U.unreadMentionCount>0;return u.jsx("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("button",{type:"button",onClick:()=>t(U.chatId),className:Te("w-full text-left transition-colors flex flex-col","hover:bg-[var(--bg-hover)]"),style:{padding:"var(--sp-2) var(--sp-3)",background:Q?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${Q?"var(--accent)":"transparent"}`},children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:6},children:[le&&u.jsx("span",{"aria-label":`${U.unreadMentionCount} unread mentions`,role:"status",style:{width:6,height:6,borderRadius:"50%",background:"var(--state-error)",flexShrink:0,alignSelf:"center"}}),u.jsx("span",{className:"truncate text-subtitle",style:{color:le?"var(--fg)":"var(--fg-2)",fontWeight:le?700:500,flex:1,minWidth:0},children:U.title}),U.lastMessageAt&&u.jsx("span",{className:"mono text-caption shrink-0",style:{color:"var(--fg-4)"},children:AZ(U.lastMessageAt)})]}),u.jsx("div",{className:"truncate text-body",style:{color:le?"var(--fg-2)":"var(--fg-3)",marginTop:2},children:ne||"—"})]})},U.chatId)}),M&&R.length>0&&u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)"},children:[u.jsx("button",{type:"button",onClick:O,disabled:h,className:"w-full text-body mono",style:{padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",color:"var(--fg-2)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"Loading…":"Load more"}),g&&u.jsx("p",{className:"mono text-caption",style:{color:"var(--state-error)",marginTop:4},children:g})]})]})]})}function ON(e){return Ee.get(`/chats/${encodeURIComponent(e)}`)}function OZ(e,t){return Ee.patch(`/chats/${encodeURIComponent(e)}`,{topic:t})}function Gg(e,t){return Ee.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function MZ(e,t){return Ee.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function DZ(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const l=a.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},a.onerror=()=>n(a.error??new Error("FileReader error")),a.readAsDataURL(e)})}function IZ(e){return Ee.post(`/agents/${encodeURIComponent(e)}/chats`,{})}function LZ(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const a=n.toString();return Ee.get(`/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function mv(e){const t=new Map;for(const a of e)a.displayName&&t.set(a.displayName,(t.get(a.displayName)??0)+1);const n=new Set;for(const[a,l]of t)l>1&&n.add(a);return n}function UZ(e,t){return!e.name||!e.displayName?!1:e.displayName!==e.name?!0:t.has(e.displayName)}function pv({candidate:e,ambiguous:t}){const n=e.name?`@${e.name}`:"—";return u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-medium",children:e.displayName??n}),UZ(e,t)&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",e.name]})]})}function PZ(e,t){if(t<=0||t>e.length)return null;let n=t-1;for(;n>=0;){const l=e[n];if(l===void 0)return null;if(l==="@")break;if(!/[A-Za-z0-9_-]/.test(l))return null;n--}if(n<0||e[n]!=="@")return null;if(n>0){const l=e[n-1];if(l!==void 0&&/[A-Za-z0-9_.@-]/.test(l))return null}const a=e.slice(n+1,t).toLowerCase();return{triggerIndex:n,query:a}}function BZ(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let c=1/0;l.startsWith(t)?c=0:o.startsWith(t)?c=1:o.includes(t)&&(c=2),c!==1/0&&n.push({c:a,score:c})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function $Z(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${c}${m}`,y=l.length+c.length+(f?1:0);return{text:h,cursor:y}}function MN({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,c]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:PZ(e,t),[e,t,l]),y=x.useMemo(()=>h?BZ(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const R=$Z(e,h,t,C);R&&a(R)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:C=>{if(!w||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),c(R=>y.length===0?0:(R+1)%y.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),c(R=>y.length===0?0:(R-1+y.length)%y.length),!0;if(C.key==="Enter"||C.key==="Tab"){const R=y[o]??y[0];return R?(C.preventDefault(),j(R),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function DN({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=x.useRef(null);return x.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:u.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Te("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,minWidth:240,maxWidth:360,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const f=mv(t);return t.map((m,h)=>{const y=h===n;return u.jsx("button",{type:"button",role:"option","aria-selected":y,"data-mention-index":h,title:m.name?`@${m.name}`:void 0,onMouseDown:g=>{g.preventDefault(),a(m)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:y?"var(--bg-hover)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:u.jsx(pv,{candidate:m,ambiguous:f})},m.agentId)})})()})}function FZ({onCreated:e}){const t=fn(),{agentId:n}=Dt(),a=_y(),[l,o]=x.useState([]),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState(null),[b,w]=x.useState(!1),[k,j]=x.useState(!1),E=x.useRef(null),C=x.useRef(!1),R=x.useRef(null),{data:O}=Ve({queryKey:["activity"],queryFn:Qu,refetchInterval:15e3}),M=x.useMemo(()=>{const Y=(O==null?void 0:O.agents)??[],J=[];for(const H of Y){if(n&&H.agentId===n)continue;const ee=a(H.agentId);!ee||!ee.name||J.push({agentId:H.agentId,name:ee.name,displayName:ee.displayName})}return J},[O,a,n]);x.useEffect(()=>{if(C.current||l.length>0||M.length===0)return;const Y=HZ(M,(O==null?void 0:O.agents)??[]);Y&&(o([Y]),C.current=!0)},[M,O,l.length]);const B=x.useMemo(()=>{const Y=M.map(J=>({agentId:J.agentId,name:J.name}));return YC(c,Y)},[c,M]),z=MN({value:c,cursor:m,candidates:M,disabled:b,onSelect:Y=>{f(Y.text),h(Y.cursor),requestAnimationFrame(()=>{const J=E.current;J&&(J.focus(),J.setSelectionRange(Y.cursor,Y.cursor))})}});x.useEffect(()=>{B.length!==0&&o(Y=>{const J=new Set(Y);let H=!1;for(const ee of B)J.has(ee)||(J.add(ee),H=!0);return H?[...J]:Y})},[B]),x.useEffect(()=>{if(!k)return;const Y=J=>{R.current&&(R.current.contains(J.target)||j(!1))};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[k]);const $=Ct({mutationFn:async({participantIds:Y,text:J})=>{const H=await EZ({participantIds:Y}),ee=J.trim();return ee.length>0&&await Gg(H.chatId,ee),H.chatId},onSuccess:Y=>{f(""),o([]),C.current=!1,t.invalidateQueries({queryKey:["me","chats"]}),e(Y)},onError:Y=>{g(Y instanceof Error?Y.message:"Failed to create chat")}}),U=x.useMemo(()=>!(b||$.isPending||l.length===0||c.trim().length===0||l.length>=2&&B.length===0),[b,$.isPending,l.length,c,B.length]),Q=x.useMemo(()=>l.length===0?"Add at least one participant":c.trim().length===0?null:l.length>=2&&B.length===0?"Group chats need an @ to wake at least one participant":null,[l.length,c,B.length]),I=async()=>{if(!U)return;const Y=Array.from(new Set([...l,...B]));g(null),w(!0);try{await $.mutateAsync({participantIds:Y,text:c})}finally{w(!1)}},ne=Y=>{o(J=>J.filter(H=>H!==Y))},le=Y=>{o(J=>J.includes(Y)?J:[...J,Y]),j(!1)},we=x.useMemo(()=>M.filter(Y=>!l.includes(Y.agentId)),[M,l]);return u.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"var(--bg-base)"},children:u.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",style:{padding:"var(--sp-6)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:"clamp(55rem, 75%, 70rem)"},children:[u.jsx("p",{className:"text-title",style:{color:"var(--fg)",textAlign:"center",marginBottom:"var(--sp-5)"},children:"What's the task?"}),u.jsxs("div",{style:{borderRadius:10,background:"var(--bg-raised)",boxShadow:"var(--shadow-md)",overflow:"visible"},children:[u.jsx(qZ,{chips:l,candidates:M,chipCandidates:we,pickerOpen:k,setPickerOpen:j,pickerContainerRef:R,onAdd:le,onRemove:ne}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(DN,{trigger:z.trigger,results:z.results,highlightIndex:z.highlightIndex,anchorRef:E,onPick:z.pick}),u.jsx("textarea",{ref:E,value:c,onChange:Y=>{f(Y.target.value),h(Y.target.selectionStart??Y.target.value.length)},onSelect:Y=>{h(Y.currentTarget.selectionStart??c.length)},placeholder:l.length>=2?"Describe the task. Use @ to address one or more.":"Describe the task…",rows:1,onKeyDown:Y=>{z.handleKey(Y)||Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),I())},disabled:b||$.isPending,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2) var(--sp-3)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}}),l.length>=2&&B.length===0&&c.trim().length>0&&u.jsxs("div",{"aria-hidden":"true",className:"text-subtitle font-normal",style:{position:"absolute",inset:0,padding:"var(--sp-2) var(--sp-3)",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",pointerEvents:"none",color:"transparent",overflow:"hidden"},children:[c,u.jsx("span",{style:{color:"var(--fg-4)"},children:" ← @ a group member to send"})]})]}),u.jsx("div",{className:"flex items-center justify-end",style:{padding:"var(--sp-1_5) var(--sp-2_5)"},children:u.jsx("button",{type:"button",onClick:()=>void I(),disabled:!U,title:Q??"Send (Enter)","aria-label":"Send",className:Te("inline-flex items-center justify-center transition-opacity",!U&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:u.jsx(Gk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})})]}),y&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:8},children:y})]})})})}function qZ({chips:e,candidates:t,chipCandidates:n,pickerOpen:a,setPickerOpen:l,pickerContainerRef:o,onAdd:c,onRemove:f}){return u.jsxs("div",{className:"flex items-center flex-wrap",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) var(--sp-1)"},children:[e.map(m=>{const h=t.find(g=>g.agentId===m),y=(h==null?void 0:h.displayName)??(h==null?void 0:h.name)??m;return u.jsxs("span",{className:"group inline-flex items-center text-label",style:{gap:2,padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg)"},children:[u.jsx("span",{children:y}),u.jsx("button",{type:"button",onClick:()=>f(m),title:"Remove participant",className:"opacity-0 group-hover:opacity-100 transition-opacity",style:{background:"none",border:"none",padding:0,marginLeft:2,cursor:"pointer",color:"var(--fg-3)",display:"inline-flex",alignItems:"center"},children:u.jsx(ku,{className:"h-3 w-3"})})]},m)}),u.jsxs("div",{ref:o,style:{position:"relative"},children:[u.jsx("button",{type:"button",onClick:()=>l(!a),title:"Add participant","aria-label":"Add participant",disabled:n.length===0,className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:n.length===0?"var(--fg-4)":"var(--fg-3)",cursor:n.length===0?"not-allowed":"pointer"},children:u.jsx(Fr,{className:"h-3 w-3"})}),a&&n.length>0&&u.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",left:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const m=mv(n);return n.map(h=>u.jsx("button",{type:"button",role:"option","aria-selected":"false",title:h.name?`@${h.name}`:void 0,onClick:()=>c(h.agentId),className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:u.jsx(pv,{candidate:h,ambiguous:m})},h.agentId))})()})]})]})}function HZ(e,t){var o;const n=new Set(e.map(c=>c.agentId)),a=[...t].filter(c=>n.has(c.agentId)&&c.runtimeUpdatedAt).sort((c,f)=>(f.runtimeUpdatedAt??"").localeCompare(c.runtimeUpdatedAt??""))[0];if(a)return a.agentId;const l=t.find(c=>n.has(c.agentId)&&c.type==="personal_assistant");return l?l.agentId:((o=e[0])==null?void 0:o.agentId)??null}const ZZ="first-tree-hub-images",VZ=1,Vs="images";let Ud=null;function IN(){return Ud||(Ud=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(ZZ,VZ);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Vs)||n.createObjectStore(Vs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Ud)}async function QZ(e){const t=await IN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Vs,"readwrite"),o=l.objectStore(Vs),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function KZ(e){const t=await IN();return t?new Promise(n=>{const o=t.transaction(Vs,"readonly").objectStore(Vs).get(e);o.onsuccess=()=>{const c=o.result;if(!c){n(null);return}n({base64:c.base64,mimeType:c.mimeType})},o.onerror=()=>n(null)}):null}function GZ(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),a=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=qS(l.payload);if(!o)continue;const c=a.get(o)??-1;l.seq>c&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=qS(l.payload);return o?a.get(o)===l.seq:!0})}function qS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Lf(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),a=l=>{var o;return((o=n.find(c=>c.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function YZ(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function HS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function XZ({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function JZ({event:e}){const t=AO(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return u.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:[a?u.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}}):u.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),u.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?HS(t.args):void 0,children:[u.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?u.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",HS(t.args),")"]}):null,t.durationMs!==void 0&&!a?u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",YZ(t.durationMs)]}):null]})]})}function WZ({event:e,agentNameFn:t,agentId:n}){const a=zO(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[u.jsx(LN,{name:l,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Lf(e.createdAt)}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function eV({event:e}){return u.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:[u.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}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Lf(e.createdAt)})]})}function tV({event:e}){const t=RO(e.payload),n=Lf(e.createdAt);return u.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:[u.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),u.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 LN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return u.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:u.jsx(Yu,{width:9,height:10,style:{color:"var(--accent)"}})})}function nV({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[u.jsx(LN,{name:a,isSelf:l}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Lf(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(XZ,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&rV(e.content)?u.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"&&aV(e.content)?u.jsx(iV,{content:e.content}):e.format==="text"?u.jsx(dv,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):u.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 rV(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 aV(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 iV({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return KZ(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?u.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function ZS({agentId:e,chatId:t,readOnly:n=!1,titleFallback:a,joinAction:l}){var ut;const o=fn(),c=jf(),f=_y(),{agentId:m}=Dt(),[h,y]=x.useState(""),[g,b]=x.useState(0),[w,k]=x.useState([]),[j,E]=x.useState(!1),[C,R]=x.useState(null),O=x.useRef(null),M=x.useRef(null),B=x.useRef(null),z=x.useRef(!1),$=x.useRef(new Set);x.useEffect(()=>{z.current=!1},[t]);const{data:U}=Ve({queryKey:["chat-messages",t],queryFn:()=>LZ(t,{limit:50}),refetchInterval:5e3}),{data:Q}=Ve({queryKey:["session-events",e,t],queryFn:()=>OO(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:I}=Ve({queryKey:["chat-detail",t],queryFn:()=>ON(t),enabled:!!t}),{data:ne}=Ve({queryKey:["activity"],queryFn:Qu,refetchInterval:15e3}),le=Ct({mutationFn:re=>Gg(t,re),onSuccess:()=>{y(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:K1(e)})}}),we=x.useCallback(re=>{const Me=re.filter(zn=>zn.type.startsWith("image/"));if(Me.length===0)return;const Ge=Me.find(zn=>zn.size>5242880);if(Ge){R(`Image too large (${(Ge.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Rn=Me.map(zn=>({id:crypto.randomUUID(),file:zn,previewUrl:URL.createObjectURL(zn)}));k(zn=>[...zn,...Rn]),R(null)},[]),Y=x.useCallback(re=>{k(Se=>{const Me=Se.find(Ge=>Ge.id===re);return Me&&URL.revokeObjectURL(Me.previewUrl),Se.filter(Ge=>Ge.id!==re)})},[]),J=async()=>{const re=h.trim(),Se=w;if(!(!re&&Se.length===0)&&!j&&!(ge&&fe.length===0)){if(Qe.length>0)try{await zN(t,{participantIds:Qe}),await o.invalidateQueries({queryKey:["chat-detail",t]})}catch(Me){R(Me instanceof Error?Me.message:"Failed to add participants");return}if(Se.length>0){E(!0),R(null);try{for(const Me of Se){const Ge=await DZ(Me.file),Rn=crypto.randomUUID();await QZ({imageId:Rn,base64:Ge,mimeType:Me.file.type}),await MZ(t,{data:Ge,mimeType:Me.file.type,filename:Me.file.name,size:Me.file.size,imageId:Rn}),URL.revokeObjectURL(Me.previewUrl)}k([]),re&&await Gg(t,re),y(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:K1(e)})}catch(Me){R(Me instanceof Error?Me.message:"Failed to send image")}finally{E(!1)}return}le.mutate(re)}},[H,ee]=x.useState(!1),[be,Ae]=x.useState(""),A=x.useRef(null);x.useEffect(()=>{var re;H&&((re=A.current)==null||re.focus())},[H]);const L=Ct({mutationFn:re=>OZ(t,re),onSuccess:()=>{ee(!1),o.invalidateQueries({queryKey:["chat-detail",t]}),o.invalidateQueries({queryKey:["agent-sessions",e]}),o.invalidateQueries({queryKey:["session",e,t]})}}),P=()=>{const re=be.trim();L.mutate(re.length>0?re:null)},T=x.useMemo(()=>{const re=(U==null?void 0:U.items)??[],Se=GZ((Q==null?void 0:Q.items)??[]),Me=[...re.map(Ge=>({kind:"message",at:Ge.createdAt,key:`m-${Ge.id}`,data:Ge})),...Se.map(Ge=>({kind:"event",at:Ge.createdAt,key:`e-${Ge.id}`,data:Ge}))];return Me.sort((Ge,Rn)=>Ge.at.localeCompare(Rn.at)),Me},[U,Q]),Z=T.length;x.useEffect(()=>{var re;Z>0&&((re=B.current)==null||re.scrollIntoView({behavior:"smooth"}))},[Z]);const W=c(e),ce=x.useMemo(()=>{var re;return new Set(((re=I==null?void 0:I.participants)==null?void 0:re.map(Se=>Se.agentId))??[])},[I==null?void 0:I.participants]),ve=x.useMemo(()=>{const re=new Set;for(const Me of(I==null?void 0:I.participants)??[])re.add(Me.agentId);for(const Me of(ne==null?void 0:ne.agents)??[])re.add(Me.agentId);re.size===0&&re.add(e);const Se=[];for(const Me of re){if(Me===m)continue;const Ge=f(Me);!Ge||!Ge.name||Se.push({agentId:Me,name:Ge.name,displayName:Ge.displayName})}return Se},[I==null?void 0:I.participants,ne==null?void 0:ne.agents,e,f,m]),ge=x.useMemo(()=>{if(!I)return!1;if(I.type==="group")return!0;const re=I.participants.some(Se=>Se.agentId===m);return I.type==="direct"&&!re&&I.participants.length>=2},[I,m]);x.useEffect(()=>{if(n||$.current.has(t)||!U||!Q||!I||T.length>0||h.length>0||ge||W===e)return;const re=`Hi ${W}! What can you help with?`;y(re),b(re.length),$.current.add(t),requestAnimationFrame(()=>{const Se=M.current;Se&&(Se.focus(),Se.setSelectionRange(re.length,re.length))})},[t,e,U,Q,I,T.length,h.length,W,ge,n]);const fe=x.useMemo(()=>{const re=ve.map(Se=>({agentId:Se.agentId,name:Se.name}));return YC(h,re)},[h,ve]),Qe=x.useMemo(()=>ce.size===0?[]:fe.filter(re=>!ce.has(re)),[fe,ce]),Oe=MN({value:h,cursor:g,candidates:ve,disabled:le.isPending||j,onSelect:re=>{y(re.text),b(re.cursor),requestAnimationFrame(()=>{const Se=M.current;Se&&(Se.focus(),Se.setSelectionRange(re.cursor,re.cursor))})}});return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6)",borderBottom:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex items-center",style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%",gap:10},children:[u.jsx("div",{className:"flex items-center min-w-0",style:{gap:8,flex:1},children:n?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle min-w-0",style:{color:"var(--fg)"},children:(I==null?void 0:I.title)??a??"…"}),u.jsx("span",{className:"mono uppercase text-eyebrow shrink-0",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--fg-3)",background:"var(--bg-sunken)"},children:"watching"})]}):H?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:A,value:be,onChange:re=>Ae(re.target.value),onKeyDown:re=>{re.key==="Enter"?(re.preventDefault(),P()):re.key==="Escape"&&(re.preventDefault(),ee(!1))},disabled:L.isPending,maxLength:500,placeholder:(I==null?void 0:I.title)??"Chat name",className:"outline-none text-subtitle",style:{fieldSizing:"content",minWidth:200,maxWidth:480,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)"}}),u.jsx("button",{type:"button",onClick:P,disabled:L.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx($r,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>ee(!1),disabled:L.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(ku,{className:"h-3.5 w-3.5"})})]}):u.jsx("button",{type:"button",onClick:()=>{Ae((I==null?void 0:I.topic)??""),ee(!0)},title:"Click to rename",className:"truncate text-subtitle text-left min-w-0",style:{color:"var(--fg)",background:"transparent",border:"none",padding:0,cursor:"pointer"},children:(I==null?void 0:I.title)??"…"})}),u.jsx(lV,{chatId:t,participantIds:((ut=I==null?void 0:I.participants)==null?void 0:ut.map(re=>re.agentId))??[e],candidates:ve,agentIdentity:f,onAdded:()=>o.invalidateQueries({queryKey:["chat-detail",t]}),readOnly:n})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-6)"},children:u.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[Z===0&&u.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[u.jsx(yy,{className:"h-8 w-8",style:{opacity:.3}}),n?"No messages yet":"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:T.map(re=>{if(re.kind==="event"){const Se=re.data;switch(Se.kind){case"tool_call":return u.jsx(JZ,{event:Se},re.key);case"assistant_text":return u.jsx(WZ,{event:Se,agentId:e,agentNameFn:c},re.key);case"thinking":return u.jsx(eV,{event:Se},re.key);case"error":return u.jsx(tV,{event:Se},re.key);default:return null}}return u.jsx(nV,{msg:re.data,myAgentId:m,agentNameFn:c},re.key)})}),u.jsx("div",{ref:B})]})}),u.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6) var(--sp-3)"},children:u.jsx("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:n?u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-3)",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[u.jsx(Xk,{className:"h-4 w-4 shrink-0",style:{color:"var(--fg-3)"}}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)"},children:"You're watching this chat — read-only."}),(l==null?void 0:l.error)&&u.jsx("div",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:2},children:l.error})]}),l&&u.jsx(pe,{type:"button",variant:"secondary",size:"sm",className:"shrink-0",onClick:l.onJoin,disabled:l.joining,children:l.joining?"Joining…":"Join to reply"})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:re=>re.preventDefault(),onDrop:re=>{re.preventDefault(),we(Array.from(re.dataTransfer.files))},children:[w.length>0&&u.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:w.map(re=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:re.previewUrl,alt:re.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>Y(re.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:u.jsx(ku,{className:"h-2 w-2"})})]},re.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(DN,{trigger:Oe.trigger,results:Oe.results,highlightIndex:Oe.highlightIndex,anchorRef:M,onPick:Oe.pick}),u.jsx("textarea",{ref:M,value:h,onChange:re=>{y(re.target.value),b(re.target.selectionStart??re.target.value.length)},onSelect:re=>{b(re.currentTarget.selectionStart??h.length)},onFocus:()=>{ge&&(z.current||h.length>0||ve.length===0||(z.current=!0,y("@"),b(1),requestAnimationFrame(()=>{const re=M.current;re&&re.setSelectionRange(1,1)})))},onPaste:re=>{const Se=Array.from(re.clipboardData.files);Se.length>0&&(re.preventDefault(),we(Se))},placeholder:ge?"Type @ to pick a recipient, then your message":`Message @${W} · / for commands · @ to mention`,rows:2,onKeyDown:re=>{Oe.handleKey(re)||re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),J())},disabled:le.isPending||j,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)"}})]}),u.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex items-center",style:{gap:10},children:[u.jsx("button",{type:"button",onClick:()=>{const re=M.current;if(!re)return;const Se=re.selectionStart??h.length,Me=re.selectionEnd??Se,Ge=`${h.slice(0,Se)}@${h.slice(Me)}`;y(Ge),b(Se+1),requestAnimationFrame(()=>{re.focus(),re.setSelectionRange(Se+1,Se+1)})},title:"Mention an agent (or type @)",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(ZR,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>{var re;return(re=O.current)==null?void 0:re.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(wz,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:re=>{re.target.files&&(we(Array.from(re.target.files)),re.target.value="")}})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[j&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsx("button",{type:"button",onClick:J,disabled:le.isPending||j||!h.trim()&&w.length===0||ge&&fe.length===0,title:ge&&fe.length===0?"Pick at least one recipient with @ before sending in a group chat":"Send (Enter)","aria-label":"Send",className:Te("inline-flex items-center justify-center transition-opacity",(le.isPending||j||!h.trim()&&w.length===0||ge&&fe.length===0)&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:u.jsx(Gk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})]}),(le.isError||C)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:C??(le.error instanceof Error?le.error.message:"Failed to send")})]})})})]})}function lV({chatId:e,participantIds:t,candidates:n,agentIdentity:a,onAdded:l,readOnly:o=!1}){const[c,f]=x.useState(!1),m=x.useRef(null);x.useEffect(()=>{if(!c)return;const g=b=>{m.current&&(m.current.contains(b.target)||f(!1))};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[c]);const h=Ct({mutationFn:g=>zN(e,{participantIds:[g]}),onSuccess:()=>{f(!1),l()}}),y=x.useMemo(()=>n.filter(g=>!t.includes(g.agentId)),[n,t]);return u.jsxs("div",{className:"inline-flex items-center flex-wrap",style:{gap:4},children:[t.map(g=>{const b=a(g),w=(b==null?void 0:b.displayName)??(b==null?void 0:b.name)??g.slice(0,8);return u.jsx("span",{className:"inline-flex items-center text-label",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg-2)"},children:w},g)}),!o&&u.jsxs("div",{ref:m,style:{position:"relative"},children:[u.jsx("button",{type:"button",onClick:()=>f(!c),disabled:y.length===0||h.isPending,title:y.length===0?"All available agents are already in this chat":"Add participant","aria-label":"Add participant",className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:y.length===0?"var(--fg-4)":"var(--fg-3)",cursor:y.length===0?"not-allowed":"pointer"},children:u.jsx(Fr,{className:"h-3 w-3"})}),c&&y.length>0&&u.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",right:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const g=mv(y);return y.map(b=>u.jsx("button",{type:"button",role:"option","aria-selected":"false",title:b.name?`@${b.name}`:void 0,onClick:()=>h.mutate(b.agentId),disabled:h.isPending,className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:u.jsx(pv,{candidate:b,ambiguous:g})},b.agentId))})()})]})]})}function VS(e,t){return e?e.find(n=>n.chatId===t)??null:null}function sV(e,t){var l;const n=e.filter(o=>o.agentId!==t),a=n.find(o=>o.type!==void 0&&o.type!=="human");return a?a.agentId:((l=n[0])==null?void 0:l.agentId)??null}function oV({chatId:e}){const t=fn(),{agentId:n}=Dt(),a=x.useRef(new Map),{data:l}=Ve({queryKey:["chat-detail",e],queryFn:()=>ON(e),enabled:!!e}),{data:o}=Ve({queryKey:["me","chats","all"],queryFn:()=>df({filter:"all"}),refetchInterval:3e4}),{data:c}=Ve({queryKey:["me","chats","watching"],queryFn:()=>df({filter:"watching"}),refetchInterval:3e4}),f=x.useMemo(()=>VS(o==null?void 0:o.rows,e)??VS(c==null?void 0:c.rows,e)??null,[o,c,e]),m=x.useMemo(()=>f?f.participants.map(j=>({agentId:j.agentId,type:j.type})):l?l.participants.map(j=>({agentId:j.agentId,type:void 0})):[],[f,l]),h=x.useMemo(()=>sV(m,n),[m,n]),g=Ct({mutationFn:()=>NZ(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]})}}).mutate,b=(f==null?void 0:f.lastMessageAt)??"";x.useEffect(()=>{!f||a.current.get(e)===b||(a.current.set(e,b),g())},[e,f,b,g]);const w=Ct({mutationFn:()=>_Z(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]}),t.invalidateQueries({queryKey:["chat-detail",e]})}}),k=(f==null?void 0:f.membershipKind)==="watching";return h?k?u.jsx(ZS,{agentId:h,chatId:e,readOnly:!0,titleFallback:(f==null?void 0:f.title)??null,joinAction:{onJoin:()=>w.mutate(),joining:w.isPending,error:w.isError?w.error instanceof Error?w.error.message:"Failed to join":null}}):u.jsx(ZS,{agentId:h,chatId:e}):u.jsx("div",{className:"flex-1 flex items-center justify-center",style:{padding:"var(--sp-8)"},children:u.jsxs("div",{className:"text-center",style:{color:"var(--fg-3)"},children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg-2)",marginBottom:6},children:"Loading chat…"}),u.jsx("div",{className:"text-body",children:"Resolving participants."})]})})}function uV(){return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(Yu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),u.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."})]})})}const cV=3e4,dV=1e3,fV=3e3;function hV(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function mV(){var ve;const{refreshMe:e,organizationId:t,memberId:n}=Dt(),a=Un(),l=kR(t,n),o=CR(l),c=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=c?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=x.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=x.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[b,w]=x.useState(null),[k,j]=x.useState(null),[E,C]=x.useState(null),[R,O]=x.useState(()=>c),[M,B]=x.useState(()=>f),[z,$]=x.useState([]),[U,Q]=x.useState("form"),[I,ne]=x.useState(null),[le]=x.useState(()=>wR()),we=x.useRef(null),Y=x.useRef(null),J=x.useRef(null),H=x.useRef(0);x.useEffect(()=>()=>{Y.current&&(Y.current.cancelled=!0)},[]),x.useEffect(()=>{ER(l,{displayName:m,selectedRuntime:y,connectToken:R,connectTokenExpiresAt:M})},[l,m,y,R,M]),x.useEffect(()=>{(async()=>{try{const ge=await Ee.get("/me/organizations");$(ge)}catch{}})()},[]),x.useEffect(()=>{if(U!=="form")return;let ge=!1;const fe=async()=>{const Oe=++H.current;try{const ut=await Ni();if(ge||Oe!==H.current)return;const Se=ut.filter(Me=>Me.status==="connected").sort((Me,Ge)=>Ge.lastSeenAt.localeCompare(Me.lastSeenAt))[0]??null;if(w(Me=>(Me==null?void 0:Me.id)===(Se==null?void 0:Se.id)?Me:Se),Se){J.current!==Se.id&&(J.current=null,C(null),j(null));try{const Me=await wy(Se.id);if(ge||Oe!==H.current)return;J.current=Se.id,C(Se.id),j(Me.capabilities)}catch{}}else J.current=null,C(null),j(null)}catch{}};fe();const Qe=setInterval(fe,fV);return()=>{ge=!0,clearInterval(Qe)}},[U]),x.useEffect(()=>{if(b)return;if(R&&M&&M>Date.now()){const fe=Math.max(M-Date.now(),0),Qe=window.setTimeout(()=>{O(null),B(null)},fe);return()=>window.clearTimeout(Qe)}R&&(O(null),B(null));let ge=!1;return(async()=>{try{const fe=await Ee.post("/me/connect-tokens",{});ge||(O(fe.token),B(Date.now()+fe.expiresIn*1e3))}catch(fe){ge||ne(fe instanceof Error?fe.message:"Failed to generate connect token")}})(),()=>{ge=!0}},[b,R,M]);const ee=b&&E===b.id?k:null;x.useEffect(()=>{g(ge=>{if(!ee)return ge;const fe=Object.entries(ee).filter(([,Qe])=>Qe.state==="ok").map(([Qe])=>Qe);return ge&&fe.includes(ge)?ge:fe[0]??null})},[ee]);const be=ee?Object.entries(ee).filter(([,ge])=>ge.state==="ok").map(([ge])=>ge):[],Ae=((ve=z.find(ge=>ge.id===t))==null?void 0:ve.displayName)??"",A=m.trim(),L=A||"your agent",P=R?`npm install -g @agent-team-foundation/first-tree-hub
387
+ first-tree-hub connect ${R}`:null,T=x.useCallback(async ge=>{Y.current&&(Y.current.cancelled=!0);const fe={cancelled:!1};Y.current=fe;const Qe=Date.now();for(;!fe.cancelled;){let Oe=!1;try{const ut=await Ee.get(`/agents/${encodeURIComponent(ge)}/client-status`);if(fe.cancelled)return;Oe=ut.online===!0}catch{if(fe.cancelled)return}if(Oe){try{const ut=await IZ(ge);if(fe.cancelled||(NR(l),await e(),fe.cancelled))return;a(`/?a=${encodeURIComponent(ge)}&c=${encodeURIComponent(ut.id)}`,{replace:!0})}catch(ut){if(fe.cancelled)return;ne(ut instanceof Error?ut.message:"Failed to open chat"),Q("timeout")}return}if(Date.now()-Qe>cV){fe.cancelled||Q("timeout");return}await new Promise(ut=>setTimeout(ut,dV))}},[l,e,a]),Z=!!(A&&b&&y&&be.includes(y)&&U==="form"),W=x.useCallback(async()=>{if(!b||!y||!A)return;ne(null),Q("creating");const ge=Kg(A);let fe;try{fe=(await Ee.post(hn("/agents"),{type:"personal_assistant",displayName:A,...ge?{name:ge}:{},clientId:b.id,runtimeProvider:y,...t?{organizationId:t}:{}})).uuid,we.current=fe}catch(Qe){ne(Qe instanceof Error?Qe.message:"Failed to create agent"),Q("form");return}await T(fe)},[A,b,y,T,t]),ce=x.useCallback(async()=>{const ge=we.current;ge&&(ne(null),Q("creating"),await T(ge))},[T]);return u.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:560},children:[U==="form"&&u.jsx(pV,{joinPath:le,teamName:Ae,displayName:m,setDisplayName:h,trimmedName:A,connectedClient:b,cliCommand:P,okRuntimes:be,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:ee!==null,error:I,canCreate:Z,onCreate:W}),U==="creating"&&u.jsx(SV,{nameOrFallback:L}),U==="timeout"&&u.jsx(kV,{nameOrFallback:L,hostname:(b==null?void 0:b.hostname)??null,error:I,onRetry:ce})]})})}function pV({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:c,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:b,onCreate:w}){const k=x.useRef(null),E=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",C=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return x.useEffect(()=>{var R;l||(R=k.current)==null||R.focus()},[l]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[u.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[u.jsx("span",{style:{color:"var(--fg-2)"},children:E}),u.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),u.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),u.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[u.jsx(gV,{}),u.jsx(QS,{number:"01",state:l?"complete":"active",children:u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[u.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),u.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:R=>a(R.target.value),placeholder:"e.g. Code Reviewer",maxLength:200,className:"onboarding-name-input text-body font-medium",style:{flex:"0 1 28ch",minWidth:"22ch",maxWidth:"30ch",padding:"var(--sp-0_5) 0",background:"transparent",border:0,borderBottom:"var(--hairline) solid var(--border-faint)",borderRadius:0,boxShadow:"none",color:"var(--fg)",outline:"none",caretColor:"var(--accent)",transition:"border-color 160ms ease, color 160ms ease"},onFocus:R=>{R.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:R=>{R.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),u.jsx(QS,{number:"02",state:b?"complete":l?"active":"idle",children:u.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[u.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?u.jsx(bV,{hostname:o.hostname??o.id}):u.jsxs(u.Fragment,{children:[u.jsx(yV,{command:c}),u.jsx(vV,{})]}),o&&u.jsx(xV,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&u.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&u.jsxs("div",{style:{marginTop:b?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!b&&u.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:C}),b&&u.jsxs(pe,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter:R=>{R.currentTarget.style.transform="scale(1.01)",R.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:R=>{R.currentTarget.style.transform="scale(1)",R.currentTarget.style.boxShadow="var(--shadow-md)"},children:[u.jsxs("span",{children:["Create ",l]}),u.jsx(FR,{className:"h-4 w-4"})]}),u.jsx("p",{className:"text-caption",style:{margin:b?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function gV(){return u.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function QS({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return u.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[u.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?u.jsx($r,{className:"h-3 w-3"}):e}),u.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function yV({command:e}){const[t,n]=x.useState(!1),l=(e?e.split(`
388
+ `):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",c=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return u.jsx("div",{style:{marginTop:"var(--sp-2)"},children:u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[u.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:c||"Generating token…"}),u.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?u.jsx($r,{className:"h-3.5 w-3.5"}):u.jsx(gy,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function vV(){return u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[u.jsx(wV,{}),u.jsx("span",{children:"Waiting for your computer…"})]})}function bV({hostname:e}){return u.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[u.jsx($r,{className:"h-3.5 w-3.5"}),u.jsxs("span",{children:[u.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function xV({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?u.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):u.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),u.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[u.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const c=t===l;return u.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:c?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:c?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[u.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:c,onChange:()=>n(l),className:"sr-only"}),u.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:c?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:c?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:c?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:c&&u.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),hV(l)]},l)})]})]})}function wV(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function SV({nameOrFallback:e}){return u.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),u.jsx(jV,{}),u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function kV({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return u.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[u.jsx("p",{children:"This usually means:"}),u.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[u.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),u.jsxs("li",{children:["The connection to ",l," dropped"]})]}),u.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",u.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),u.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:u.jsx(pe,{onClick:a,children:"Try again"})})]})}function jV(){return u.jsxs("span",{className:"flex items-center",style:{gap:6},children:[u.jsx(Vp,{delayMs:0}),u.jsx(Vp,{delayMs:160}),u.jsx(Vp,{delayMs:320})]})}function Vp({delayMs:e}){return u.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function CV({selectedChatId:e,onSelectChat:t}){const{wizardStep:n}=Dt();return e===ff?u.jsx(FZ,{onCreated:t}):e?u.jsx(oV,{chatId:e}):n!==null&&n!=="completed"?u.jsx(mV,{}):u.jsx(uV,{})}function EV(){const[e,t]=Fk(),n=e.get("c"),a=e.get("a");pE(),x.useEffect(()=>{if(a&&n){t({c:n},{replace:!0});return}a&&!n&&t({},{replace:!0})},[a,n,t]);const l=x.useCallback(c=>{t({c})},[t]),o=x.useCallback(()=>{t({c:ff})},[t]);return u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(zZ,{selectedChatId:n,onSelectChat:l,onNewChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(CV,{selectedChatId:n,onSelectChat:l})})]})}const NV=new zT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function _V(){return u.jsx(OT,{client:NV,children:u.jsx(TR,{children:u.jsx(oR,{children:u.jsxs(LA,{children:[u.jsx(zt,{path:"/login",element:u.jsx(EH,{})}),u.jsx(zt,{path:"/signup",element:u.jsx(ur,{to:"/login",replace:!0})}),u.jsx(zt,{path:"/auth/github/complete",element:u.jsx(NH,{})}),u.jsx(zt,{path:"/invite/:token",element:u.jsx(SH,{})}),u.jsx(zt,{element:u.jsx(MR,{}),children:u.jsxs(zt,{element:u.jsx(OU,{children:u.jsx(TD,{})}),children:[u.jsx(zt,{index:!0,element:u.jsx(EV,{})}),u.jsx(zt,{path:"context",element:u.jsx(Y7,{})}),u.jsx(zt,{path:"agents/:uuid",element:u.jsx(c7,{})}),u.jsxs(zt,{path:"team",element:u.jsx(CZ,{}),children:[u.jsx(zt,{index:!0,element:u.jsx(pZ,{})}),u.jsx(zt,{path:"settings",element:u.jsx(jZ,{})})]}),u.jsxs(zt,{path:"settings",element:u.jsx(iZ,{}),children:[u.jsx(zt,{index:!0,element:u.jsx(ur,{to:"computers",replace:!0})}),u.jsx(zt,{path:"computers",element:u.jsx(FH,{})}),u.jsx(zt,{path:"integrations",element:u.jsx(aZ,{})})]}),u.jsx(zt,{path:"agents",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(zt,{path:"clients",element:u.jsx(ur,{to:"/settings/computers",replace:!0})}),u.jsx(zt,{path:"integrations",element:u.jsx(ur,{to:"/settings/integrations",replace:!0})}),u.jsx(zt,{path:"team/members",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(zt,{path:"team/agents",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(zt,{path:"team/invite",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(zt,{path:"admin",element:u.jsx(TV,{})})]})})]})})})})}function TV(){const e=Yn();return e.hash==="#bindings"?u.jsx(ur,{to:`/settings/integrations${e.search}`,replace:!0}):u.jsx(ur,{to:`/team${e.hash}`,replace:!0})}const UN=document.getElementById("root");if(!UN)throw new Error("Root element not found");lT.createRoot(UN).render(u.jsx(x.StrictMode,{children:u.jsx(_V,{})}));export{FR as A,Yu as F,Zu as L,st as c,u as j,x as r};