@agent-team-foundation/first-tree-hub 0.10.3 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-CBAVWQUT.mjs → bootstrap-jx5nN1qZ.mjs} +1 -0
- package/dist/cli/index.mjs +7 -7
- package/dist/{dist-DUCelK3Z.mjs → dist-CbX9mUVH.mjs} +52 -4
- package/dist/{feishu-Boy3n8CT.mjs → feishu-DvjRZMdZ.mjs} +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{invitation-C_zAhB8x-8Khychlu.mjs → invitation-BljIolbO-DLeHfURd.mjs} +3 -2
- package/dist/{invitation-BTlGMy0o-Coj07kYi.mjs → invitation-D3feYxet-366MNOor.mjs} +2 -2
- package/dist/{saas-connect-3p-vBkuY.mjs → saas-connect-2puW1r3r.mjs} +582 -84
- package/dist/web/assets/index-5SNLeFZA.js +392 -0
- package/dist/web/assets/{index-CHoaSIzI.js → index-BxQQDavm.js} +1 -1
- package/dist/web/assets/index-DKZFiOjh.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CP8uLPyO.css +0 -1
- package/dist/web/assets/index-D7OzKrI2.js +0 -387
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
var Q0=e=>{throw TypeError(e)};var Km=(e,t,n)=>t.has(e)||Q0("Cannot "+n);var M=(e,t,n)=>(Km(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Q0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,a)=>(Km(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),De=(e,t,n)=>(Km(e,t,"access private method"),n);var yd=(e,t,n,a)=>({set _(l){ge(e,t,l,n)},get _(){return M(e,t,a)}});function D2(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 df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},nu={};/**
|
|
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 G0;function M2(){if(G0)return nu;G0=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 nu.Fragment=t,nu.jsx=n,nu.jsxs=n,nu}var K0;function L2(){return K0||(K0=1,Ym.exports=M2()),Ym.exports}var u=L2(),Xm={exports:{}},Be={};/**
|
|
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 Y0;function I2(){if(Y0)return Be;Y0=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 S(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function E(P,B,_){this.props=P,this.context=B,this.refs=C,this.updater=_||k}E.prototype.isReactComponent={},E.prototype.setState=function(P,B){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,B,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function A(){}A.prototype=E.prototype;function O(P,B,_){this.props=P,this.context=B,this.refs=C,this.updater=_||k}var L=O.prototype=new A;L.constructor=O,j(L,E.prototype),L.isPureReactComponent=!0;var D=Array.isArray;function z(){}var I={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function Y(P,B,_){var q=_.ref;return{$$typeof:e,type:P,key:B,ref:q!==void 0?q:null,props:_}}function $(P,B){return Y(P.type,B,P.props)}function te(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function J(P){var B={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(_){return B[_]})}var be=/\/+/g;function fe(P,B){return typeof P=="object"&&P!==null&&P.key!=null?J(""+P.key):B.toString(36)}function ie(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(z,z):(P.status="pending",P.then(function(B){P.status==="pending"&&(P.status="fulfilled",P.value=B)},function(B){P.status==="pending"&&(P.status="rejected",P.reason=B)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Z(P,B,_,q,W){var ue=typeof P;(ue==="undefined"||ue==="boolean")&&(P=null);var xe=!1;if(P===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(P.$$typeof){case e:case t:xe=!0;break;case y:return xe=P._init,Z(xe(P._payload),B,_,q,W)}}if(xe)return W=W(P),xe=q===""?"."+fe(P,0):q,D(W)?(_="",xe!=null&&(_=xe.replace(be,"$&/")+"/"),Z(W,B,_,"",function(Ct){return Ct})):W!=null&&(te(W)&&(W=$(W,_+(W.key==null||P&&P.key===W.key?"":(""+W.key).replace(be,"$&/")+"/")+xe)),B.push(W)),1;xe=0;var Le=q===""?".":q+":";if(D(P))for(var Se=0;Se<P.length;Se++)q=P[Se],ue=Le+fe(q,Se),xe+=Z(q,B,_,ue,W);else if(Se=S(P),typeof Se=="function")for(P=Se.call(P),Se=0;!(q=P.next()).done;)q=q.value,ue=Le+fe(q,Se++),xe+=Z(q,B,_,ue,W);else if(ue==="object"){if(typeof P.then=="function")return Z(ie(P),B,_,q,W);throw B=String(P),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ae(P,B,_){if(P==null)return P;var q=[],W=0;return Z(P,q,"","",function(ue){return B.call(_,ue,W++)}),q}function K(P){if(P._status===-1){var B=P._result;B=B(),B.then(function(_){(P._status===0||P._status===-1)&&(P._status=1,P._result=_)},function(_){(P._status===0||P._status===-1)&&(P._status=2,P._result=_)}),P._status===-1&&(P._status=0,P._result=B)}if(P._status===1)return P._result.default;throw P._result}var he=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},T={map:ae,forEach:function(P,B,_){ae(P,function(){B.apply(this,arguments)},_)},count:function(P){var B=0;return ae(P,function(){B++}),B},toArray:function(P){return ae(P,function(B){return B})||[]},only:function(P){if(!te(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Be.Activity=g,Be.Children=T,Be.Component=E,Be.Fragment=n,Be.Profiler=l,Be.PureComponent=O,Be.StrictMode=a,Be.Suspense=m,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Be.__COMPILER_RUNTIME={__proto__:null,c:function(P){return I.H.useMemoCache(P)}},Be.cache=function(P){return function(){return P.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(P,B,_){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var q=j({},P.props),W=P.key;if(B!=null)for(ue in B.key!==void 0&&(W=""+B.key),B)!F.call(B,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&B.ref===void 0||(q[ue]=B[ue]);var ue=arguments.length-2;if(ue===1)q.children=_;else if(1<ue){for(var xe=Array(ue),Le=0;Le<ue;Le++)xe[Le]=arguments[Le+2];q.children=xe}return Y(P.type,W,q)},Be.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},Be.createElement=function(P,B,_){var q,W={},ue=null;if(B!=null)for(q in B.key!==void 0&&(ue=""+B.key),B)F.call(B,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(W[q]=B[q]);var xe=arguments.length-2;if(xe===1)W.children=_;else if(1<xe){for(var Le=Array(xe),Se=0;Se<xe;Se++)Le[Se]=arguments[Se+2];W.children=Le}if(P&&P.defaultProps)for(q in xe=P.defaultProps,xe)W[q]===void 0&&(W[q]=xe[q]);return Y(P,ue,W)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(P){return{$$typeof:f,render:P}},Be.isValidElement=te,Be.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:K}},Be.memo=function(P,B){return{$$typeof:h,type:P,compare:B===void 0?null:B}},Be.startTransition=function(P){var B=I.T,_={};I.T=_;try{var q=P(),W=I.S;W!==null&&W(_,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(z,he)}catch(ue){he(ue)}finally{B!==null&&_.types!==null&&(B.types=_.types),I.T=B}},Be.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Be.use=function(P){return I.H.use(P)},Be.useActionState=function(P,B,_){return I.H.useActionState(P,B,_)},Be.useCallback=function(P,B){return I.H.useCallback(P,B)},Be.useContext=function(P){return I.H.useContext(P)},Be.useDebugValue=function(){},Be.useDeferredValue=function(P,B){return I.H.useDeferredValue(P,B)},Be.useEffect=function(P,B){return I.H.useEffect(P,B)},Be.useEffectEvent=function(P){return I.H.useEffectEvent(P)},Be.useId=function(){return I.H.useId()},Be.useImperativeHandle=function(P,B,_){return I.H.useImperativeHandle(P,B,_)},Be.useInsertionEffect=function(P,B){return I.H.useInsertionEffect(P,B)},Be.useLayoutEffect=function(P,B){return I.H.useLayoutEffect(P,B)},Be.useMemo=function(P,B){return I.H.useMemo(P,B)},Be.useOptimistic=function(P,B){return I.H.useOptimistic(P,B)},Be.useReducer=function(P,B,_){return I.H.useReducer(P,B,_)},Be.useRef=function(P){return I.H.useRef(P)},Be.useState=function(P){return I.H.useState(P)},Be.useSyncExternalStore=function(P,B,_){return I.H.useSyncExternalStore(P,B,_)},Be.useTransition=function(){return I.H.useTransition()},Be.version="19.2.4",Be}var X0;function qg(){return X0||(X0=1,Xm.exports=I2()),Xm.exports}var x=qg();const U2=df(x),Hg=D2({__proto__:null,default:U2},[x]);var Jm={exports:{}},ru={},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 J0;function P2(){return J0||(J0=1,(function(e){function t(Z,ae){var K=Z.length;Z.push(ae);e:for(;0<K;){var he=K-1>>>1,T=Z[he];if(0<l(T,ae))Z[he]=ae,Z[K]=T,K=he;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var ae=Z[0],K=Z.pop();if(K!==ae){Z[0]=K;e:for(var he=0,T=Z.length,P=T>>>1;he<P;){var B=2*(he+1)-1,_=Z[B],q=B+1,W=Z[q];if(0>l(_,K))q<T&&0>l(W,_)?(Z[he]=W,Z[q]=K,he=q):(Z[he]=_,Z[B]=K,he=B);else if(q<T&&0>l(W,K))Z[he]=W,Z[q]=K,he=q;else break e}}return ae}function l(Z,ae){var K=Z.sortIndex-ae.sortIndex;return K!==0?K:Z.id-ae.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,S=!1,k=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function L(Z){for(var ae=n(h);ae!==null;){if(ae.callback===null)a(h);else if(ae.startTime<=Z)a(h),ae.sortIndex=ae.expirationTime,t(m,ae);else break;ae=n(h)}}function D(Z){if(j=!1,L(Z),!k)if(n(m)!==null)k=!0,z||(z=!0,J());else{var ae=n(h);ae!==null&&ie(D,ae.startTime-Z)}}var z=!1,I=-1,F=5,Y=-1;function $(){return C?!0:!(e.unstable_now()-Y<F)}function te(){if(C=!1,z){var Z=e.unstable_now();Y=Z;var ae=!0;try{e:{k=!1,j&&(j=!1,A(I),I=-1),S=!0;var K=b;try{t:{for(L(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&$());){var he=g.callback;if(typeof he=="function"){g.callback=null,b=g.priorityLevel;var T=he(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof T=="function"){g.callback=T,L(Z),ae=!0;break t}g===n(m)&&a(m),L(Z)}else a(m);g=n(m)}if(g!==null)ae=!0;else{var P=n(h);P!==null&&ie(D,P.startTime-Z),ae=!1}}break e}finally{g=null,b=K,S=!1}ae=void 0}}finally{ae?J():z=!1}}}var J;if(typeof O=="function")J=function(){O(te)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,fe=be.port2;be.port1.onmessage=te,J=function(){fe.postMessage(null)}}else J=function(){E(te,0)};function ie(Z,ae){I=E(function(){Z(e.unstable_now())},ae)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var ae=3;break;default:ae=b}var K=b;b=ae;try{return Z()}finally{b=K}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Z,ae){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var K=b;b=Z;try{return ae()}finally{b=K}},e.unstable_scheduleCallback=function(Z,ae,K){var he=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?he+K:he):K=he,Z){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=K+T,Z={id:y++,callback:ae,priorityLevel:Z,startTime:K,expirationTime:T,sortIndex:-1},K>he?(Z.sortIndex=K,t(h,Z),n(m)===null&&Z===n(h)&&(j?(A(I),I=-1):j=!0,ie(D,K-he))):(Z.sortIndex=T,t(m,Z),k||S||(k=!0,z||(z=!0,J()))),Z},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(Z){var ae=b;return function(){var K=b;b=ae;try{return Z.apply(this,arguments)}finally{b=K}}}})(ep)),ep}var W0;function B2(){return W0||(W0=1,Wm.exports=P2()),Wm.exports}var tp={exports:{}},kn={};/**
|
|
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 e1;function $2(){if(e1)return kn;e1=1;var e=qg();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 kn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,kn.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)},kn.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()}},kn.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))},kn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},kn.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,S=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:S}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},kn.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)},kn.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})}},kn.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)},kn.requestFormReset=function(m){a.d.r(m)},kn.unstable_batchedUpdates=function(m,h){return m(h)},kn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},kn.useFormStatus=function(){return c.H.useHostTransitionStatus()},kn.version="19.2.4",kn}var t1;function Fw(){if(t1)return tp.exports;t1=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=$2(),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 n1;function F2(){if(n1)return ru;n1=1;var e=B2(),t=qg(),n=Fw();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 w=!1,N=p.child;N;){if(N===s){w=!0,s=p,d=v;break}if(N===d){w=!0,d=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,d=p;break}if(N===d){w=!0,d=v,s=p;break}N=N.sibling}if(!w)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"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function J(r){return r===null||typeof r!="object"?null:(r=te&&r[te]||r["@@iterator"],typeof r=="function"?r:null)}var be=Symbol.for("react.client.reference");function fe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===be?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList";case Y:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case L:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case I:return i=r.displayName||null,i!==null?i:fe(r.type)||"Memo";case F:i=r._payload,r=r._init;try{return fe(r(i))}catch{}}return null}var ie=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],T=-1;function P(r){return{current:r}}function B(r){0>T||(r.current=he[T],he[T]=null,T--)}function _(r,i){T++,he[T]=r.current,r.current=i}var q=P(null),W=P(null),ue=P(null),xe=P(null);function Le(r,i){switch(_(ue,i),_(W,r),_(q,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?g0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=g0(i),r=y0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(q),_(q,r)}function Se(){B(q),B(W),B(ue)}function Ct(r){r.memoizedState!==null&&_(xe,r);var i=q.current,s=y0(i,r.type);i!==s&&(_(W,r),_(q,s))}function ne(r){W.current===r&&(B(q),B(W)),xe.current===r&&(B(xe),Jo._currentValue=K)}var Te,Ue;function Fe(r){if(Te===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Te=i&&i[1]||"",Ue=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Te+r+Ue}var Ft=!1;function cn(r,i){if(!r||Ft)return"";Ft=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ee){var X=ee}Reflect.construct(r,[],ce)}else{try{ce.call()}catch(ee){X=ee}r.call(ce.prototype)}}else{try{throw Error()}catch(ee){X=ee}(ce=r())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ee){if(ee&&X&&typeof ee.stack=="string")return[ee.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(),w=v[0],N=v[1];if(w&&N){var U=w.split(`
|
|
44
|
+
`),G=N.split(`
|
|
45
|
+
`);for(p=d=0;d<U.length&&!U[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===U.length||p===G.length)for(d=U.length-1,p=G.length-1;1<=d&&0<=p&&U[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if(U[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||U[d]!==G[p]){var re=`
|
|
46
|
+
`+U[d].replace(" at new "," at ");return r.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",r.displayName)),re}while(1<=d&&0<=p);break}}}finally{Ft=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Fe(s):""}function Oa(r,i){switch(r.tag){case 26:case 27:case 5:return Fe(r.type);case 16:return Fe("Lazy");case 13:return r.child!==i&&i!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return cn(r.type,!1);case 11:return cn(r.type.render,!1);case 1:return cn(r.type,!0);case 31:return Fe("Activity");default:return""}}function _l(r){try{var i="",s=null;do i+=Oa(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,Ma=e.unstable_scheduleCallback,Wr=e.unstable_cancelCallback,oo=e.unstable_shouldYield,uo=e.unstable_requestPaint,dn=e.unstable_now,co=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,at=e.unstable_IdlePriority,fn=e.log,cr=e.unstable_setDisableYieldValue,en=null,qt=null;function hn(r){if(typeof fn=="function"&&cr(r),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(en,r)}catch{}}var dt=Math.clz32?Math.clz32:nc,Tr=Math.log,Mn=Math.LN2;function nc(r){return r>>>=0,r===0?32:31-(Tr(r)/Mn|0)|0}var Mi=256,Li=262144,Ii=4194304;function Ir(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 Ui(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Ir(d):(w&=N,w!==0?p=Ir(w):s||(s=N&~r,s!==0&&(p=Ir(s))))):(N=d&~v,N!==0?p=Ir(N):w!==0?p=Ir(w):s||(s=d&~r,s!==0&&(p=Ir(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 rc(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 ve(){var r=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),r}function Ye(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function mn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ea(r,i,s,d,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,U=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var re=31-dt(s),ce=1<<re;N[re]=0,U[re]=-1;var X=G[re];if(X!==null)for(G[re]=null,re=0;re<X.length;re++){var ee=X[re];ee!==null&&(ee.lane&=-536870913)}s&=~ce}d!==0&&fo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function fo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-dt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function ac(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-dt(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function ev(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 tv(){var r=ae.p;return r!==0?r:(r=window.event,r===void 0?32:B0(r.type))}function nv(r,i){var s=ae.p;try{return ae.p=r,i()}finally{ae.p=s}}var Ia=Math.random().toString(36).slice(2),pn="__reactFiber$"+Ia,Ln="__reactProps$"+Ia,Al="__reactContainer$"+Ia,Bf="__reactEvents$"+Ia,kN="__reactListeners$"+Ia,jN="__reactHandles$"+Ia,rv="__reactResources$"+Ia,ho="__reactMarker$"+Ia;function $f(r){delete r[pn],delete r[Ln],delete r[Bf],delete r[kN],delete r[jN]}function Tl(r){var i=r[pn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Al]||s[pn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=j0(r);r!==null;){if(s=r[pn])return s;r=j0(r)}return i}r=s,s=r.parentNode}return null}function Rl(r){if(r=r[pn]||r[Al]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function mo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function zl(r){var i=r[rv];return i||(i=r[rv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function sn(r){r[ho]=!0}var av=new Set,iv={};function Pi(r,i){Ol(r,i),Ol(r+"Capture",i)}function Ol(r,i){for(iv[r]=i,r=0;r<i.length;r++)av.add(i[r])}var CN=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]*$"),lv={},sv={};function EN(r){return Da.call(sv,r)?!0:Da.call(lv,r)?!1:CN.test(r)?sv[r]=!0:(lv[r]=!0,!1)}function ic(r,i,s){if(EN(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 lc(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 ta(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 dr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ov(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function NN(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(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ff(r){if(!r._valueTracker){var i=ov(r)?"checked":"value";r._valueTracker=NN(r,i,""+r[i])}}function uv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=ov(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function sc(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 _N=/[\n"\\]/g;function fr(r){return r.replace(_N,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function qf(r,i,s,d,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+dr(i)):r.value!==""+dr(i)&&(r.value=""+dr(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Hf(r,w,dr(i)):s!=null?Hf(r,w,dr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+dr(N):r.removeAttribute("name")}function cv(r,i,s,d,p,v,w,N){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?""+dr(s):"",i=i!=null?""+dr(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=N?r.checked:!!d,r.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Ff(r)}function Hf(r,i,s){i==="number"&&sc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Dl(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=""+dr(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 dv(r,i,s){if(i!=null&&(i=""+dr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+dr(s):""}function fv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(ie(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=dr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Ff(r)}function Ml(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var AN=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 hv(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||AN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function mv(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&&hv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&hv(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 TN=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"]]),RN=/^[\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 oc(r){return RN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function na(){}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 Ll=null,Il=null;function pv(r){var i=Rl(r);if(i&&(r=i.stateNode)){var s=r[Ln]||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="'+fr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Ln]||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&&uv(d)}break e;case"textarea":dv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Dl(r,!!s.multiple,i,!1)}}}var Gf=!1;function gv(r,i,s){if(Gf)return r(i,s);Gf=!0;try{var d=r(i);return d}finally{if(Gf=!1,(Ll!==null||Il!==null)&&(Kc(),Ll&&(i=Ll,r=Il,Il=Ll=null,pv(i),r)))for(i=0;i<r.length;i++)pv(r[i])}}function po(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Ln]||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 ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kf=!1;if(ra)try{var go={};Object.defineProperty(go,"passive",{get:function(){Kf=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Kf=!1}var Ua=null,Yf=null,uc=null;function yv(){if(uc)return uc;var r,i=Yf,s=i.length,d,p="value"in Ua?Ua.value:Ua.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(d=1;d<=w&&i[s-d]===p[v-d];d++);return uc=p.slice(r,1<d?1-d:void 0)}function cc(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 dc(){return!0}function vv(){return!1}function In(r){function i(s,d,p,v,w){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?dc:vv,this.isPropagationStopped=vv,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=dc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),i}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=In(Bi),yo=g({},Bi,{view:0,detail:0}),zN=In(yo),Xf,Jf,vo,hc=g({},yo,{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!==vo&&(vo&&r.type==="mousemove"?(Xf=r.screenX-vo.screenX,Jf=r.screenY-vo.screenY):Jf=Xf=0,vo=r),Xf)},movementY:function(r){return"movementY"in r?r.movementY:Jf}}),bv=In(hc),ON=g({},hc,{dataTransfer:0}),DN=In(ON),MN=g({},yo,{relatedTarget:0}),Wf=In(MN),LN=g({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),IN=In(LN),UN=g({},Bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),PN=In(UN),BN=g({},Bi,{data:0}),xv=In(BN),$N={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FN={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"},qN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=qN[r])?!!i[r]:!1}function eh(){return HN}var ZN=g({},yo,{key:function(r){if(r.key){var i=$N[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=cc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?FN[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"?cc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?cc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),VN=In(ZN),QN=g({},hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=In(QN),GN=g({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eh}),KN=In(GN),YN=g({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),XN=In(YN),JN=g({},hc,{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}),WN=In(JN),e_=g({},Bi,{newState:0,oldState:0}),t_=In(e_),n_=[9,13,27,32],th=ra&&"CompositionEvent"in window,bo=null;ra&&"documentMode"in document&&(bo=document.documentMode);var r_=ra&&"TextEvent"in window&&!bo,wv=ra&&(!th||bo&&8<bo&&11>=bo),kv=" ",jv=!1;function Cv(r,i){switch(r){case"keyup":return n_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ev(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ul=!1;function a_(r,i){switch(r){case"compositionend":return Ev(i);case"keypress":return i.which!==32?null:(jv=!0,kv);case"textInput":return r=i.data,r===kv&&jv?null:r;default:return null}}function i_(r,i){if(Ul)return r==="compositionend"||!th&&Cv(r,i)?(r=yv(),uc=Yf=Ua=null,Ul=!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 wv&&i.locale!=="ko"?null:i.data;default:return null}}var l_={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 Nv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!l_[r.type]:i==="textarea"}function _v(r,i,s,d){Ll?Il?Il.push(d):Il=[d]:Ll=d,i=nd(i,"onChange"),0<i.length&&(s=new fc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var xo=null,So=null;function s_(r){c0(r,0)}function mc(r){var i=mo(r);if(uv(i))return r}function Av(r,i){if(r==="change")return i}var Tv=!1;if(ra){var nh;if(ra){var rh="oninput"in document;if(!rh){var Rv=document.createElement("div");Rv.setAttribute("oninput","return;"),rh=typeof Rv.oninput=="function"}nh=rh}else nh=!1;Tv=nh&&(!document.documentMode||9<document.documentMode)}function zv(){xo&&(xo.detachEvent("onpropertychange",Ov),So=xo=null)}function Ov(r){if(r.propertyName==="value"&&mc(So)){var i=[];_v(i,So,r,Qf(r)),gv(s_,i)}}function o_(r,i,s){r==="focusin"?(zv(),xo=i,So=s,xo.attachEvent("onpropertychange",Ov)):r==="focusout"&&zv()}function u_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return mc(So)}function c_(r,i){if(r==="click")return mc(i)}function d_(r,i){if(r==="input"||r==="change")return mc(i)}function f_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:f_;function wo(r,i){if(Yn(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)||!Yn(r[p],i[p]))return!1}return!0}function Dv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Mv(r,i){var s=Dv(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=Dv(s)}}function Lv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Lv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Iv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=sc(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=sc(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 h_=ra&&"documentMode"in document&&11>=document.documentMode,Pl=null,ih=null,ko=null,lh=!1;function Uv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;lh||Pl==null||Pl!==sc(d)||(d=Pl,"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}),ko&&wo(ko,d)||(ko=d,d=nd(ih,"onSelect"),0<d.length&&(i=new fc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Pl)))}function $i(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Bl={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},sh={},Pv={};ra&&(Pv=document.createElement("div").style,"AnimationEvent"in window||(delete Bl.animationend.animation,delete Bl.animationiteration.animation,delete Bl.animationstart.animation),"TransitionEvent"in window||delete Bl.transitionend.transition);function Fi(r){if(sh[r])return sh[r];if(!Bl[r])return r;var i=Bl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Pv)return sh[r]=i[s];return r}var Bv=Fi("animationend"),$v=Fi("animationiteration"),Fv=Fi("animationstart"),m_=Fi("transitionrun"),p_=Fi("transitionstart"),g_=Fi("transitioncancel"),qv=Fi("transitionend"),Hv=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 Rr(r,i){Hv.set(r,i),Pi(i,[r])}var pc=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)},hr=[],$l=0,uh=0;function gc(){for(var r=$l,i=uh=$l=0;i<r;){var s=hr[i];hr[i++]=null;var d=hr[i];hr[i++]=null;var p=hr[i];hr[i++]=null;var v=hr[i];if(hr[i++]=null,d!==null&&p!==null){var w=d.pending;w===null?p.next=p:(p.next=w.next,w.next=p),d.pending=p}v!==0&&Zv(s,p,v)}}function yc(r,i,s,d){hr[$l++]=r,hr[$l++]=i,hr[$l++]=s,hr[$l++]=d,uh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function ch(r,i,s,d){return yc(r,i,s,d),vc(r)}function qi(r,i){return yc(r,null,null,i),vc(r)}function Zv(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-dt(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function vc(r){if(50<Zo)throw Zo=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 Fl={};function y_(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 Xn(r,i,s,d){return new y_(r,i,s,d)}function dh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function aa(r,i){var s=r.alternate;return s===null?(s=Xn(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 Vv(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 bc(r,i,s,d,p,v){var w=0;if(d=r,typeof r=="function")dh(r)&&(w=1);else if(typeof r=="string")w=w2(r,s,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Y:return r=Xn(31,s,i,p),r.elementType=Y,r.lanes=v,r;case j:return Hi(s.children,p,v,i);case C:w=8,p|=24;break;case E:return r=Xn(12,s,i,p|2),r.elementType=E,r.lanes=v,r;case D:return r=Xn(13,s,i,p),r.elementType=D,r.lanes=v,r;case z:return r=Xn(19,s,i,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case A:w=9;break e;case L:w=11;break e;case I:w=14;break e;case F:w=16,d=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Xn(w,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Hi(r,i,s,d){return r=Xn(7,r,d,i),r.lanes=s,r}function fh(r,i,s){return r=Xn(6,r,null,i),r.lanes=s,r}function Qv(r){var i=Xn(18,null,null,0);return i.stateNode=r,i}function hh(r,i,s){return i=Xn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Gv=new WeakMap;function mr(r,i){if(typeof r=="object"&&r!==null){var s=Gv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:_l(i)},Gv.set(r,i),i)}return{value:r,source:i,stack:_l(i)}}var ql=[],Hl=0,xc=null,jo=0,pr=[],gr=0,Pa=null,Ur=1,Pr="";function ia(r,i){ql[Hl++]=jo,ql[Hl++]=xc,xc=r,jo=i}function Kv(r,i,s){pr[gr++]=Ur,pr[gr++]=Pr,pr[gr++]=Pa,Pa=r;var d=Ur;r=Pr;var p=32-dt(d)-1;d&=~(1<<p),s+=1;var v=32-dt(i)+p;if(30<v){var w=p-p%5;v=(d&(1<<w)-1).toString(32),d>>=w,p-=w,Ur=1<<32-dt(i)+p|s<<p|d,Pr=v+r}else Ur=1<<v|s<<p|d,Pr=r}function mh(r){r.return!==null&&(ia(r,1),Kv(r,1,0))}function ph(r){for(;r===xc;)xc=ql[--Hl],ql[Hl]=null,jo=ql[--Hl],ql[Hl]=null;for(;r===Pa;)Pa=pr[--gr],pr[gr]=null,Pr=pr[--gr],pr[gr]=null,Ur=pr[--gr],pr[gr]=null}function Yv(r,i){pr[gr++]=Ur,pr[gr++]=Pr,pr[gr++]=Pa,Ur=i.id,Pr=i.overflow,Pa=r}var gn=null,Et=null,it=!1,Ba=null,yr=!1,gh=Error(a(519));function $a(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(mr(i,r)),gh}function Xv(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[pn]=r,i[Ln]=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<Qo.length;s++)Je(Qo[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),cv(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),fv(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||m0(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=na),i=!0):i=!1,i||$a(r,!0)}function Jv(r){for(gn=r.return;gn;)switch(gn.tag){case 5:case 31:case 13:yr=!1;return;case 27:case 3:yr=!0;return;default:gn=gn.return}}function Zl(r){if(r!==gn)return!1;if(!it)return Jv(r),it=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Dm(r.type,r.memoizedProps)),s=!s),s&&Et&&$a(r),Jv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=k0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=k0(r)}else i===27?(i=Et,ti(r.type)?(r=Pm,Pm=null,Et=r):Et=i):Et=gn?br(r.stateNode.nextSibling):null;return!0}function Zi(){Et=gn=null,it=!1}function yh(){var r=Ba;return r!==null&&($n===null?$n=r:$n.push.apply($n,r),Ba=null),r}function Co(r){Ba===null?Ba=[r]:Ba.push(r)}var vh=P(null),Vi=null,la=null;function Fa(r,i,s){_(vh,i._currentValue),i._currentValue=s}function sa(r){r._currentValue=vh.current,B(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 w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var U=0;U<i.length;U++)if(N.context===i[U]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),bh(v.return,s,r),d||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),bh(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Vl(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 w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;Yn(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&xh(i,r,s,d),i.flags|=262144}function Sc(r){for(r=r.firstContext;r!==null;){if(!Yn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Qi(r){Vi=r,la=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function yn(r){return Wv(Vi,r)}function wc(r,i){return Vi===null&&Qi(r),Wv(r,i)}function Wv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},la===null){if(r===null)throw Error(a(308));la=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else la=la.next=i;return s}var v_=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()})}},b_=e.unstable_scheduleCallback,x_=e.unstable_NormalPriority,Qt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sh(){return{controller:new v_,data:new Map,refCount:0}}function Eo(r){r.refCount--,r.refCount===0&&b_(x_,function(){r.controller.abort()})}var No=null,wh=0,Ql=0,Gl=null;function S_(r,i){if(No===null){var s=No=[];wh=0,Ql=Cm(),Gl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return wh++,i.then(eb,eb),i}function eb(){if(--wh===0&&No!==null){Gl!==null&&(Gl.status="fulfilled");var r=No;No=null,Ql=0,Gl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function w_(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 tb=Z.S;Z.S=function(r,i){Ux=dn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&S_(r,i),tb!==null&&tb(r,i)};var Gi=P(null);function kh(){var r=Gi.current;return r!==null?r:wt.pooledCache}function kc(r,i){i===null?_(Gi,Gi.current):_(Gi,i.pool)}function nb(){var r=kh();return r===null?null:{parent:Qt._currentValue,pool:r}}var Kl=Error(a(460)),jh=Error(a(474)),jc=Error(a(542)),Cc={then:function(){}};function rb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ab(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(na,na),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,lb(r),r;default:if(typeof i.status=="string")i.then(na,na);else{if(r=wt,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,lb(r),r}throw Yi=i,Kl}}function Ki(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Yi=s,Kl):s}}var Yi=null;function ib(){if(Yi===null)throw Error(a(459));var r=Yi;return Yi=null,r}function lb(r){if(r===Kl||r===jc)throw Error(a(483))}var Yl=null,_o=0;function Ec(r){var i=_o;return _o+=1,Yl===null&&(Yl=[]),ab(Yl,r,i)}function Ao(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Nc(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 sb(r){function i(V,H){if(r){var Q=V.deletions;Q===null?(V.deletions=[H],V.flags|=16):Q.push(H)}}function s(V,H){if(!r)return null;for(;H!==null;)i(V,H),H=H.sibling;return null}function d(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function p(V,H){return V=aa(V,H),V.index=0,V.sibling=null,V}function v(V,H,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<H?(V.flags|=67108866,H):Q):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function w(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function N(V,H,Q,oe){return H===null||H.tag!==6?(H=fh(Q,V.mode,oe),H.return=V,H):(H=p(H,Q),H.return=V,H)}function U(V,H,Q,oe){var Re=Q.type;return Re===j?re(V,H,Q.props.children,oe,Q.key):H!==null&&(H.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===F&&Ki(Re)===H.type)?(H=p(H,Q.props),Ao(H,Q),H.return=V,H):(H=bc(Q.type,Q.key,Q.props,null,V.mode,oe),Ao(H,Q),H.return=V,H)}function G(V,H,Q,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=hh(Q,V.mode,oe),H.return=V,H):(H=p(H,Q.children||[]),H.return=V,H)}function re(V,H,Q,oe,Re){return H===null||H.tag!==7?(H=Hi(Q,V.mode,oe,Re),H.return=V,H):(H=p(H,Q),H.return=V,H)}function ce(V,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=fh(""+H,V.mode,Q),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return Q=bc(H.type,H.key,H.props,null,V.mode,Q),Ao(Q,H),Q.return=V,Q;case k:return H=hh(H,V.mode,Q),H.return=V,H;case F:return H=Ki(H),ce(V,H,Q)}if(ie(H)||J(H))return H=Hi(H,V.mode,Q,null),H.return=V,H;if(typeof H.then=="function")return ce(V,Ec(H),Q);if(H.$$typeof===O)return ce(V,wc(V,H),Q);Nc(V,H)}return null}function X(V,H,Q,oe){var Re=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:N(V,H,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Re?U(V,H,Q,oe):null;case k:return Q.key===Re?G(V,H,Q,oe):null;case F:return Q=Ki(Q),X(V,H,Q,oe)}if(ie(Q)||J(Q))return Re!==null?null:re(V,H,Q,oe,null);if(typeof Q.then=="function")return X(V,H,Ec(Q),oe);if(Q.$$typeof===O)return X(V,H,wc(V,Q),oe);Nc(V,Q)}return null}function ee(V,H,Q,oe,Re){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Q)||null,N(H,V,""+oe,Re);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return V=V.get(oe.key===null?Q:oe.key)||null,U(H,V,oe,Re);case k:return V=V.get(oe.key===null?Q:oe.key)||null,G(H,V,oe,Re);case F:return oe=Ki(oe),ee(V,H,Q,oe,Re)}if(ie(oe)||J(oe))return V=V.get(Q)||null,re(H,V,oe,Re,null);if(typeof oe.then=="function")return ee(V,H,Q,Ec(oe),Re);if(oe.$$typeof===O)return ee(V,H,Q,wc(H,oe),Re);Nc(H,oe)}return null}function je(V,H,Q,oe){for(var Re=null,ot=null,Ne=H,Ze=H=0,tt=null;Ne!==null&&Ze<Q.length;Ze++){Ne.index>Ze?(tt=Ne,Ne=null):tt=Ne.sibling;var ut=X(V,Ne,Q[Ze],oe);if(ut===null){Ne===null&&(Ne=tt);break}r&&Ne&&ut.alternate===null&&i(V,Ne),H=v(ut,H,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut,Ne=tt}if(Ze===Q.length)return s(V,Ne),it&&ia(V,Ze),Re;if(Ne===null){for(;Ze<Q.length;Ze++)Ne=ce(V,Q[Ze],oe),Ne!==null&&(H=v(Ne,H,Ze),ot===null?Re=Ne:ot.sibling=Ne,ot=Ne);return it&&ia(V,Ze),Re}for(Ne=d(Ne);Ze<Q.length;Ze++)tt=ee(Ne,V,Ze,Q[Ze],oe),tt!==null&&(r&&tt.alternate!==null&&Ne.delete(tt.key===null?Ze:tt.key),H=v(tt,H,Ze),ot===null?Re=tt:ot.sibling=tt,ot=tt);return r&&Ne.forEach(function(li){return i(V,li)}),it&&ia(V,Ze),Re}function Oe(V,H,Q,oe){if(Q==null)throw Error(a(151));for(var Re=null,ot=null,Ne=H,Ze=H=0,tt=null,ut=Q.next();Ne!==null&&!ut.done;Ze++,ut=Q.next()){Ne.index>Ze?(tt=Ne,Ne=null):tt=Ne.sibling;var li=X(V,Ne,ut.value,oe);if(li===null){Ne===null&&(Ne=tt);break}r&&Ne&&li.alternate===null&&i(V,Ne),H=v(li,H,Ze),ot===null?Re=li:ot.sibling=li,ot=li,Ne=tt}if(ut.done)return s(V,Ne),it&&ia(V,Ze),Re;if(Ne===null){for(;!ut.done;Ze++,ut=Q.next())ut=ce(V,ut.value,oe),ut!==null&&(H=v(ut,H,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut);return it&&ia(V,Ze),Re}for(Ne=d(Ne);!ut.done;Ze++,ut=Q.next())ut=ee(Ne,V,Ze,ut.value,oe),ut!==null&&(r&&ut.alternate!==null&&Ne.delete(ut.key===null?Ze:ut.key),H=v(ut,H,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut);return r&&Ne.forEach(function(O2){return i(V,O2)}),it&&ia(V,Ze),Re}function bt(V,H,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Re=Q.key;H!==null;){if(H.key===Re){if(Re=Q.type,Re===j){if(H.tag===7){s(V,H.sibling),oe=p(H,Q.props.children),oe.return=V,V=oe;break e}}else if(H.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===F&&Ki(Re)===H.type){s(V,H.sibling),oe=p(H,Q.props),Ao(oe,Q),oe.return=V,V=oe;break e}s(V,H);break}else i(V,H);H=H.sibling}Q.type===j?(oe=Hi(Q.props.children,V.mode,oe,Q.key),oe.return=V,V=oe):(oe=bc(Q.type,Q.key,Q.props,null,V.mode,oe),Ao(oe,Q),oe.return=V,V=oe)}return w(V);case k:e:{for(Re=Q.key;H!==null;){if(H.key===Re)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(V,H.sibling),oe=p(H,Q.children||[]),oe.return=V,V=oe;break e}else{s(V,H);break}else i(V,H);H=H.sibling}oe=hh(Q,V.mode,oe),oe.return=V,V=oe}return w(V);case F:return Q=Ki(Q),bt(V,H,Q,oe)}if(ie(Q))return je(V,H,Q,oe);if(J(Q)){if(Re=J(Q),typeof Re!="function")throw Error(a(150));return Q=Re.call(Q),Oe(V,H,Q,oe)}if(typeof Q.then=="function")return bt(V,H,Ec(Q),oe);if(Q.$$typeof===O)return bt(V,H,wc(V,Q),oe);Nc(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(V,H.sibling),oe=p(H,Q),oe.return=V,V=oe):(s(V,H),oe=fh(Q,V.mode,oe),oe.return=V,V=oe),w(V)):s(V,H)}return function(V,H,Q,oe){try{_o=0;var Re=bt(V,H,Q,oe);return Yl=null,Re}catch(Ne){if(Ne===Kl||Ne===jc)throw Ne;var ot=Xn(29,Ne,null,V.mode);return ot.lanes=oe,ot.return=V,ot}finally{}}}var Xi=sb(!0),ob=sb(!1),qa=!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 Ha(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Za(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ct&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=vc(r),Zv(r,null,s),i}return yc(r,d,i,s),vc(r)}function To(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,ac(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 w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=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 Ro(){if(_h){var r=Gl;if(r!==null)throw r}}function zo(r,i,s,d){_h=!1;var p=r.updateQueue;qa=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var U=N,G=U.next;U.next=null,w===null?v=G:w.next=G,w=U;var re=r.alternate;re!==null&&(re=re.updateQueue,N=re.lastBaseUpdate,N!==w&&(N===null?re.firstBaseUpdate=G:N.next=G,re.lastBaseUpdate=U))}if(v!==null){var ce=p.baseState;w=0,re=G=U=null,N=v;do{var X=N.lane&-536870913,ee=X!==N.lane;if(ee?(et&X)===X:(d&X)===X){X!==0&&X===Ql&&(_h=!0),re!==null&&(re=re.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var je=r,Oe=N;X=i;var bt=s;switch(Oe.tag){case 1:if(je=Oe.payload,typeof je=="function"){ce=je.call(bt,ce,X);break e}ce=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Oe.payload,X=typeof je=="function"?je.call(bt,ce,X):je,X==null)break e;ce=g({},ce,X);break e;case 2:qa=!0}}X=N.callback,X!==null&&(r.flags|=64,ee&&(r.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:N.tag,payload:N.payload,callback:N.callback,next:null},re===null?(G=re=ee,U=ce):re=re.next=ee,w|=X;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;ee=N,N=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);re===null&&(U=ce),p.baseState=U,p.firstBaseUpdate=G,p.lastBaseUpdate=re,v===null&&(p.shared.lanes=0),Ya|=w,r.lanes=w,r.memoizedState=ce}}function ub(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function cb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)ub(s[r],i)}var Xl=P(null),_c=P(0);function db(r,i){r=ga,_(_c,r),_(Xl,i),ga=r|i.baseLanes}function Ah(){_(_c,ga),_(Xl,Xl.current)}function Th(){ga=_c.current,B(Xl),B(_c)}var Jn=P(null),vr=null;function Va(r){var i=r.alternate;_(Ht,Ht.current&1),_(Jn,r),vr===null&&(i===null||Xl.current!==null||i.memoizedState!==null)&&(vr=r)}function Rh(r){_(Ht,Ht.current),_(Jn,r),vr===null&&(vr=r)}function fb(r){r.tag===22?(_(Ht,Ht.current),_(Jn,r),vr===null&&(vr=r)):Qa()}function Qa(){_(Ht,Ht.current),_(Jn,Jn.current)}function Wn(r){B(Jn),vr===r&&(vr=null),B(Ht)}var Ht=P(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||Im(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 oa=0,qe=null,yt=null,Gt=null,Tc=!1,Jl=!1,Ji=!1,Rc=0,Oo=0,Wl=null,k_=0;function Mt(){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(!Yn(r[s],i[s]))return!1;return!0}function Oh(r,i,s,d,p,v){return oa=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Kb:Gh,Ji=!1,v=s(d,p),Ji=!1,Jl&&(v=mb(i,s,d,p)),hb(r),v}function hb(r){Z.H=Lo;var i=yt!==null&&yt.next!==null;if(oa=0,Gt=yt=qe=null,Tc=!1,Oo=0,Wl=null,i)throw Error(a(300));r===null||Kt||(r=r.dependencies,r!==null&&Sc(r)&&(Kt=!0))}function mb(r,i,s,d){qe=r;var p=0;do{if(Jl&&(Wl=null),Oo=0,Jl=!1,25<=p)throw Error(a(301));if(p+=1,Gt=yt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=Yb,v=i(s,d)}while(Jl);return v}function j_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Do(i):i,r=r.useState()[0],(yt!==null?yt.memoizedState:null)!==r&&(qe.flags|=1024),i}function Dh(){var r=Rc!==0;return Rc=0,r}function Mh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Lh(r){if(Tc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Tc=!1}oa=0,Gt=yt=qe=null,Jl=!1,Oo=Rc=0,Wl=null}function Tn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?qe.memoizedState=Gt=r:Gt=Gt.next=r,Gt}function Zt(){if(yt===null){var r=qe.alternate;r=r!==null?r.memoizedState:null}else r=yt.next;var i=Gt===null?qe.memoizedState:Gt.next;if(i!==null)Gt=i,yt=r;else{if(r===null)throw qe.alternate===null?Error(a(467)):Error(a(310));yt=r,r={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},Gt===null?qe.memoizedState=Gt=r:Gt=Gt.next=r}return Gt}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(r){var i=Oo;return Oo+=1,Wl===null&&(Wl=[]),r=ab(Wl,r,i),i=qe,(Gt===null?i.memoizedState:Gt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Kb:Gh),r}function Oc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Do(r);if(r.$$typeof===O)return yn(r)}throw Error(a(438,String(r)))}function Ih(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=zc(),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]=$;return i.index++,s}function ua(r,i){return typeof i=="function"?i(r):i}function Dc(r){var i=Zt();return Uh(i,yt,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 w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,U=null,G=i,re=!1;do{var ce=G.lane&-536870913;if(ce!==G.lane?(et&ce)===ce:(oa&ce)===ce){var X=G.revertLane;if(X===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ce===Ql&&(re=!0);else if((oa&X)===X){G=G.next,X===Ql&&(re=!0);continue}else ce={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},U===null?(N=U=ce,w=v):U=U.next=ce,qe.lanes|=X,Ya|=X;ce=G.action,Ji&&s(v,ce),v=G.hasEagerState?G.eagerState:s(v,ce)}else X={lane:ce,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},U===null?(N=U=X,w=v):U=U.next=X,qe.lanes|=ce,Ya|=ce;G=G.next}while(G!==null&&G!==i);if(U===null?w=v:U.next=N,!Yn(v,r.memoizedState)&&(Kt=!0,re&&(s=Gl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=U,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 w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);Yn(v,i.memoizedState)||(Kt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function pb(r,i,s){var d=qe,p=Zt(),v=it;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Yn((yt||p).memoizedState,s);if(w&&(p.memoizedState=s,Kt=!0),p=p.queue,Fh(vb.bind(null,d,p,r),[r]),p.getSnapshot!==i||w||Gt!==null&&Gt.memoizedState.tag&1){if(d.flags|=2048,es(9,{destroy:void 0},yb.bind(null,d,p,s,i),null),wt===null)throw Error(a(349));v||(oa&127)!==0||gb(d,i,s)}return s}function gb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=zc(),qe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function yb(r,i,s,d){i.value=s,i.getSnapshot=d,bb(i)&&xb(r)}function vb(r,i,s){return s(function(){bb(i)&&xb(r)})}function bb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Yn(r,s)}catch{return!0}}function xb(r){var i=qi(r,2);i!==null&&Fn(i,r,2)}function Bh(r){var i=Tn();if(typeof r=="function"){var s=r;if(r=s(),Ji){hn(!0);try{s()}finally{hn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:r},i}function Sb(r,i,s,d){return r.baseState=s,Uh(r,yt,typeof d=="function"?d:ua)}function C_(r,i,s,d,p){if(Ic(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(w){v.listeners.push(w)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,wb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function wb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,w={};Z.T=w;try{var N=s(p,d),U=Z.S;U!==null&&U(w,N),kb(r,i,N)}catch(G){$h(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),Z.T=v}}else try{v=s(p,d),kb(r,i,v)}catch(G){$h(r,i,G)}}function kb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){jb(r,i,d)},function(d){return $h(r,i,d)}):jb(r,i,s)}function jb(r,i,s){i.status="fulfilled",i.value=s,Cb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,wb(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,Cb(i),i=i.next;while(i!==d)}r.action=null}function Cb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Eb(r,i){return i}function Nb(r,i){if(it){var s=wt.formState;if(s!==null){e:{var d=qe;if(it){if(Et){t:{for(var p=Et,v=yr;p.nodeType!==8;){if(!v){p=null;break t}if(p=br(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=br(p.nextSibling),d=p.data==="F!";break e}}$a(d)}d=!1}d&&(i=s[0])}}return s=Tn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eb,lastRenderedState:i},s.queue=d,s=Vb.bind(null,qe,d),d.dispatch=s,d=Bh(!1),v=Qh.bind(null,qe,!1,d.queue),d=Tn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=C_.bind(null,qe,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function _b(r){var i=Zt();return Ab(i,yt,r)}function Ab(r,i,s){if(i=Uh(r,i,Eb)[0],r=Dc(ua)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Do(i)}catch(w){throw w===Kl?jc:w}else d=i;i=Zt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,es(9,{destroy:void 0},E_.bind(null,p,s),null)),[d,v,r]}function E_(r,i){r.action=i}function Tb(r){var i=Zt(),s=yt;if(s!==null)return Ab(i,s,r);Zt(),i=i.memoizedState,s=Zt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function es(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=qe.updateQueue,i===null&&(i=zc(),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 Rb(){return Zt().memoizedState}function Mc(r,i,s,d){var p=Tn();qe.flags|=r,p.memoizedState=es(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;yt!==null&&d!==null&&zh(d,yt.memoizedState.deps)?p.memoizedState=es(i,v,s,d):(qe.flags|=r,p.memoizedState=es(1|i,v,s,d))}function zb(r,i){Mc(8390656,8,r,i)}function Fh(r,i){Lc(2048,8,r,i)}function N_(r){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=zc(),qe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Ob(r){var i=Zt().memoizedState;return N_({ref:i,nextImpl:r}),function(){if((ct&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Db(r,i){return Lc(4,2,r,i)}function Mb(r,i){return Lc(4,4,r,i)}function Lb(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 Ib(r,i,s){s=s!=null?s.concat([r]):null,Lc(4,4,Lb.bind(null,i,r),s)}function qh(){}function Ub(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 Pb(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(),Ji){hn(!0);try{r()}finally{hn(!1)}}return s.memoizedState=[d,i],d}function Hh(r,i,s){return s===void 0||(oa&1073741824)!==0&&(et&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Bx(),qe.lanes|=r,Ya|=r,s)}function Bb(r,i,s,d){return Yn(s,i)?s:Xl.current!==null?(r=Hh(r,s,d),Yn(r,i)||(Kt=!0),r):(oa&42)===0||(oa&1073741824)!==0&&(et&261930)===0?(Kt=!0,r.memoizedState=s):(r=Bx(),qe.lanes|=r,Ya|=r,i)}function $b(r,i,s,d,p){var v=ae.p;ae.p=v!==0&&8>v?v:8;var w=Z.T,N={};Z.T=N,Qh(r,!1,i,s);try{var U=p(),G=Z.S;if(G!==null&&G(N,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=w_(U,d);Mo(r,i,re,nr(r))}else Mo(r,i,d,nr(r))}catch(ce){Mo(r,i,{then:function(){},status:"rejected",reason:ce},nr())}finally{ae.p=v,w!==null&&N.types!==null&&(w.types=N.types),Z.T=w}}function __(){}function Zh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=Fb(r).queue;$b(r,p,i,K,s===null?__:function(){return qb(r),s(d)})}function Fb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function qb(r){var i=Fb(r);i.next===null&&(i=r.alternate.memoizedState),Mo(r,i.next.queue,{},nr())}function Vh(){return yn(Jo)}function Hb(){return Zt().memoizedState}function Zb(){return Zt().memoizedState}function A_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=nr();r=Ha(s);var d=Za(i,r,s);d!==null&&(Fn(d,i,s),To(d,i,s)),i={cache:Sh()},r.payload=i;return}i=i.return}}function T_(r,i,s){var d=nr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ic(r)?Qb(i,s):(s=ch(r,i,s,d),s!==null&&(Fn(s,r,d),Gb(s,i,d)))}function Vb(r,i,s){var d=nr();Mo(r,i,s,d)}function Mo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ic(r))Qb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,Yn(N,w))return yc(r,i,p,0),wt===null&&gc(),!1}catch{}finally{}if(s=ch(r,i,p,d),s!==null)return Fn(s,r,d),Gb(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},Ic(r)){if(i)throw Error(a(479))}else i=ch(r,s,d,2),i!==null&&Fn(i,r,2)}function Ic(r){var i=r.alternate;return r===qe||i!==null&&i===qe}function Qb(r,i){Jl=Tc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Gb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ac(r,s)}}var Lo={readContext:yn,use:Oc,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};Lo.useEffectEvent=Mt;var Kb={readContext:yn,use:Oc,useCallback:function(r,i){return Tn().memoizedState=[r,i===void 0?null:i],r},useContext:yn,useEffect:zb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Mc(4194308,4,Lb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Mc(4194308,4,r,i)},useInsertionEffect:function(r,i){Mc(4,2,r,i)},useMemo:function(r,i){var s=Tn();i=i===void 0?null:i;var d=r();if(Ji){hn(!0);try{r()}finally{hn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Tn();if(s!==void 0){var p=s(i);if(Ji){hn(!0);try{s(i)}finally{hn(!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=T_.bind(null,qe,r),[d.memoizedState,r]},useRef:function(r){var i=Tn();return r={current:r},i.memoizedState=r},useState:function(r){r=Bh(r);var i=r.queue,s=Vb.bind(null,qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:qh,useDeferredValue:function(r,i){var s=Tn();return Hh(s,r,i)},useTransition:function(){var r=Bh(!1);return r=$b.bind(null,qe,r.queue,!0,!1),Tn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=qe,p=Tn();if(it){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),wt===null)throw Error(a(349));(et&127)!==0||gb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,zb(vb.bind(null,d,v,r),[r]),d.flags|=2048,es(9,{destroy:void 0},yb.bind(null,d,v,s,i),null),s},useId:function(){var r=Tn(),i=wt.identifierPrefix;if(it){var s=Pr,d=Ur;s=(d&~(1<<32-dt(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Rc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=k_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Vh,useFormState:Nb,useActionState:Nb,useOptimistic:function(r){var i=Tn();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:Ih,useCacheRefresh:function(){return Tn().memoizedState=A_.bind(null,qe)},useEffectEvent:function(r){var i=Tn(),s={impl:r};return i.memoizedState=s,function(){if((ct&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Gh={readContext:yn,use:Oc,useCallback:Ub,useContext:yn,useEffect:Fh,useImperativeHandle:Ib,useInsertionEffect:Db,useLayoutEffect:Mb,useMemo:Pb,useReducer:Dc,useRef:Rb,useState:function(){return Dc(ua)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return Bb(s,yt.memoizedState,r,i)},useTransition:function(){var r=Dc(ua)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:pb,useId:Hb,useHostTransitionStatus:Vh,useFormState:_b,useActionState:_b,useOptimistic:function(r,i){var s=Zt();return Sb(s,yt,r,i)},useMemoCache:Ih,useCacheRefresh:Zb};Gh.useEffectEvent=Ob;var Yb={readContext:yn,use:Oc,useCallback:Ub,useContext:yn,useEffect:Fh,useImperativeHandle:Ib,useInsertionEffect:Db,useLayoutEffect:Mb,useMemo:Pb,useReducer:Ph,useRef:Rb,useState:function(){return Ph(ua)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return yt===null?Hh(s,r,i):Bb(s,yt.memoizedState,r,i)},useTransition:function(){var r=Ph(ua)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:pb,useId:Hb,useHostTransitionStatus:Vh,useFormState:Tb,useActionState:Tb,useOptimistic:function(r,i){var s=Zt();return yt!==null?Sb(s,yt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Ih,useCacheRefresh:Zb};Yb.useEffectEvent=Ob;function Kh(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=nr(),p=Ha(d);p.payload=i,s!=null&&(p.callback=s),i=Za(r,p,d),i!==null&&(Fn(i,r,d),To(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=nr(),p=Ha(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Za(r,p,d),i!==null&&(Fn(i,r,d),To(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=nr(),d=Ha(s);d.tag=2,i!=null&&(d.callback=i),i=Za(r,d,s),i!==null&&(Fn(i,r,s),To(i,r,s))}};function Xb(r,i,s,d,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,w):i.prototype&&i.prototype.isPureReactComponent?!wo(s,d)||!wo(p,v):!0}function Jb(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 Wi(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 Wb(r){pc(r)}function ex(r){console.error(r)}function tx(r){pc(r)}function Uc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function nx(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=Ha(s),s.tag=3,s.payload={element:null},s.callback=function(){Uc(r,i)},s}function rx(r){return r=Ha(r),r.tag=3,r}function ax(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(){nx(i,s,d)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){nx(i,s,d),typeof p!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function R_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Vl(i,s,p,!0),s=Jn.current,s!==null){switch(s.tag){case 31:case 13:return vr===null?Yc():s.alternate===null&&Lt===0&&(Lt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===Cc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),wm(r,d,p)),!1;case 22:return s.flags|=65536,d===Cc?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)),wm(r,d,p)),!1}throw Error(a(435,s.tag))}return wm(r,d,p),Yc(),!1}if(it)return i=Jn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==gh&&(r=Error(a(422),{cause:d}),Co(mr(r,s)))):(d!==gh&&(i=Error(a(423),{cause:d}),Co(mr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=mr(d,s),p=Xh(r.stateNode,d,p),Nh(r,p),Lt!==4&&(Lt=2)),!1;var v=Error(a(520),{cause:d});if(v=mr(v,s),Ho===null?Ho=[v]:Ho.push(v),Lt!==4&&(Lt=2),i===null)return!0;d=mr(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"&&(Xa===null||!Xa.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=rx(p),ax(p,r,s,d),Nh(s,p),!1}s=s.return}while(s!==null);return!1}var Jh=Error(a(461)),Kt=!1;function vn(r,i,s,d){i.child=r===null?ob(i,null,s,d):Xi(i,r.child,s,d)}function ix(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var w={};for(var N in d)N!=="ref"&&(w[N]=d[N])}else w=d;return Qi(i),d=Oh(r,i,s,w,v,p),N=Dh(),r!==null&&!Kt?(Mh(r,i,p),ca(r,i,p)):(it&&N&&mh(i),i.flags|=1,vn(r,i,d,p),i.child)}function lx(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,sx(r,i,v,d,p)):(r=bc(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 w=v.memoizedProps;if(s=s.compare,s=s!==null?s:wo,s(w,d)&&r.ref===i.ref)return ca(r,i,p)}return i.flags|=1,r=aa(v,d),r.ref=i.ref,r.return=i,i.child=r}function sx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(wo(v,d)&&r.ref===i.ref)if(Kt=!1,i.pendingProps=d=v,lm(r,p))(r.flags&131072)!==0&&(Kt=!0);else return i.lanes=r.lanes,ca(r,i,p)}return Wh(r,i,s,d,p)}function ox(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 ux(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&kc(i,v!==null?v.cachePool:null),v!==null?db(i,v):Ah(),fb(i);else return d=i.lanes=536870912,ux(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(kc(i,v.cachePool),db(i,v),Qa(),i.memoizedState=null):(r!==null&&kc(i,null),Ah(),Qa());return vn(r,i,p,s),i.child}function Io(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ux(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&&kc(i,null),Ah(),fb(i),r!==null&&Vl(r,i,d,!0),i.childLanes=p,null}function Pc(r,i){return i=$c({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function cx(r,i,s){return Xi(i,r.child,null,s),r=Pc(i,i.pendingProps),r.flags|=2,Wn(i),i.memoizedState=null,r}function z_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(it){if(d.mode==="hidden")return r=Pc(i,d),i.lanes=536870912,Io(null,r);if(Rh(i),(r=Et)?(r=w0(r,yr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},s=Qv(r),s.return=i,i.child=s,gn=i,Et=null)):r=null,r===null)throw $a(i);return i.lanes=536870912,null}return Pc(i,d)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(Rh(i),p)if(i.flags&256)i.flags&=-257,i=cx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Kt||Vl(r,i,s,!1),p=(s&r.childLanes)!==0,Kt||p){if(d=wt,d!==null&&(w=ev(d,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,qi(r,w),Fn(d,r,w),Jh;Yc(),i=cx(r,i,s)}else r=v.treeContext,Et=br(w.nextSibling),gn=i,it=!0,Ba=null,yr=!1,r!==null&&Yv(i,r),i=Pc(i,d),i.flags|=4096;return i}return r=aa(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Bc(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 Qi(i),s=Oh(r,i,s,d,void 0,p),d=Dh(),r!==null&&!Kt?(Mh(r,i,p),ca(r,i,p)):(it&&d&&mh(i),i.flags|=1,vn(r,i,s,p),i.child)}function dx(r,i,s,d,p,v){return Qi(i),i.updateQueue=null,s=mb(i,d,s,p),hb(r),d=Dh(),r!==null&&!Kt?(Mh(r,i,v),ca(r,i,v)):(it&&d&&mh(i),i.flags|=1,vn(r,i,s,v),i.child)}function fx(r,i,s,d,p){if(Qi(i),i.stateNode===null){var v=Fl,w=s.contextType;typeof w=="object"&&w!==null&&(v=yn(w)),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),w=s.contextType,v.context=typeof w=="object"&&w!==null?yn(w):Fl,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Kh(i,s,w,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Yh.enqueueReplaceState(v,v.state,null),zo(i,d,v,p),Ro(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,U=Wi(s,N);v.props=U;var G=v.context,re=s.contextType;w=Fl,typeof re=="object"&&re!==null&&(w=yn(re));var ce=s.getDerivedStateFromProps;re=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&Jb(i,v,d,w),qa=!1;var X=i.memoizedState;v.state=X,zo(i,d,v,p),Ro(),G=i.memoizedState,N||X!==G||qa?(typeof ce=="function"&&(Kh(i,s,ce,d),G=i.memoizedState),(U=qa||Xb(i,s,U,d,X,G,w))?(re||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=w,d=U):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Eh(r,i),w=i.memoizedProps,re=Wi(s,w),v.props=re,ce=i.pendingProps,X=v.context,G=s.contextType,U=Fl,typeof G=="object"&&G!==null&&(U=yn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||X!==U)&&Jb(i,v,d,U),qa=!1,X=i.memoizedState,v.state=X,zo(i,d,v,p),Ro();var ee=i.memoizedState;w!==ce||X!==ee||qa||r!==null&&r.dependencies!==null&&Sc(r.dependencies)?(typeof N=="function"&&(Kh(i,s,N,d),ee=i.memoizedState),(re=qa||Xb(i,s,re,d,X,ee,U)||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,ee,U),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,ee,U)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ee),v.props=d,v.state=ee,v.context=U,d=re):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Bc(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=Xi(i,r.child,null,p),i.child=Xi(i,null,s,p)):vn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ca(r,i,p),r}function hx(r,i,s,d){return Zi(),i.flags|=256,vn(r,i,s,d),i.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(r){return{baseLanes:r,cachePool:nb()}}function nm(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=tr),r}function mx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Ht.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(it){if(p?Va(i):Qa(),(r=Et)?(r=w0(r,yr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},s=Qv(r),s.return=i,i.child=s,gn=i,Et=null)):r=null,r===null)throw $a(i);return Um(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(Qa(),p=i.mode,N=$c({mode:"hidden",children:N},p),d=Hi(d,p,s,null),N.return=i,d.return=i,N.sibling=d,i.child=N,d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,w,s),i.memoizedState=em,Io(null,d)):(Va(i),rm(i,N))}var U=r.memoizedState;if(U!==null&&(N=U.dehydrated,N!==null)){if(v)i.flags&256?(Va(i),i.flags&=-257,i=am(r,i,s)):i.memoizedState!==null?(Qa(),i.child=r.child,i.flags|=128,i=null):(Qa(),N=d.fallback,p=i.mode,d=$c({mode:"visible",children:d.children},p),N=Hi(N,p,s,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Xi(i,r.child,null,s),d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,w,s),i.memoizedState=em,i=Io(null,d));else if(Va(i),Um(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,d=Error(a(419)),d.stack="",d.digest=w,Co({value:d,source:null,stack:null}),i=am(r,i,s)}else if(Kt||Vl(r,i,s,!1),w=(s&r.childLanes)!==0,Kt||w){if(w=wt,w!==null&&(d=ev(w,s),d!==0&&d!==U.retryLane))throw U.retryLane=d,qi(r,d),Fn(w,r,d),Jh;Im(N)||Yc(),i=am(r,i,s)}else Im(N)?(i.flags|=192,i.child=r.child,i=null):(r=U.treeContext,Et=br(N.nextSibling),gn=i,it=!0,Ba=null,yr=!1,r!==null&&Yv(i,r),i=rm(i,d.children),i.flags|=4096);return i}return p?(Qa(),N=d.fallback,p=i.mode,U=r.child,G=U.sibling,d=aa(U,{mode:"hidden",children:d.children}),d.subtreeFlags=U.subtreeFlags&65011712,G!==null?N=aa(G,N):(N=Hi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,Io(null,d),d=i.child,N=r.child.memoizedState,N===null?N=tm(s):(p=N.cachePool,p!==null?(U=Qt._currentValue,p=p.parent!==U?{parent:U,pool:U}:p):p=nb(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=nm(r,w,s),i.memoizedState=em,Io(r.child,d)):(Va(i),s=r.child,r=s.sibling,s=aa(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function rm(r,i){return i=$c({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function $c(r,i){return r=Xn(22,r,null,i),r.lanes=0,r}function am(r,i,s){return Xi(i,r.child,null,s),r=rm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function px(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 w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function gx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var w=Ht.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Ht,w),vn(r,i,d,s),d=it?jo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&px(r,s,i);else if(r.tag===19)px(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 ca(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Ya|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Vl(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=aa(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=aa(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 O_(r,i,s){switch(i.tag){case 3:Le(i,i.stateNode.containerInfo),Fa(i,Qt,r.memoizedState.cache),Zi();break;case 27:case 5:Ct(i);break;case 4:Le(i,i.stateNode.containerInfo);break;case 10:Fa(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?(Va(i),i.flags|=128,null):(s&i.child.childLanes)!==0?mx(r,i,s):(Va(i),r=ca(r,i,s),r!==null?r.sibling:null);Va(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Vl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return gx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Ht,Ht.current),d)break;return null;case 22:return i.lanes=0,ox(r,i,s,i.pendingProps);case 24:Fa(i,Qt,r.memoizedState.cache)}return ca(r,i,s)}function yx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Kt=!0;else{if(!lm(r,s)&&(i.flags&128)===0)return Kt=!1,O_(r,i,s);Kt=(r.flags&131072)!==0}else Kt=!1,it&&(i.flags&1048576)!==0&&Kv(i,jo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Ki(i.elementType),i.type=r,typeof r=="function")dh(r)?(d=Wi(r,d),i.tag=1,i=fx(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===L){i.tag=11,i=ix(null,i,r,d,s);break e}else if(p===I){i.tag=14,i=lx(null,i,r,d,s);break e}}throw i=fe(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=Wi(d,i.pendingProps),fx(r,i,d,p,s);case 3:e:{if(Le(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Eh(r,i),zo(i,d,null,s);var w=i.memoizedState;if(d=w.cache,Fa(i,Qt,d),d!==v.cache&&xh(i,[Qt],s,!0),Ro(),d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=hx(r,i,d,s);break e}else if(d!==p){p=mr(Error(a(424)),i),Co(p),i=hx(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(Et=br(r.firstChild),gn=i,it=!0,Ba=null,yr=!0,s=ob(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Zi(),d===p){i=ca(r,i,s);break e}vn(r,i,d,s)}i=i.child}return i;case 26:return Bc(r,i),r===null?(s=_0(i.type,null,i.pendingProps,null))?i.memoizedState=s:it||(s=i.type,r=i.pendingProps,d=rd(ue.current).createElement(s),d[pn]=i,d[Ln]=r,bn(d,s,r),sn(d),i.stateNode=d):i.memoizedState=_0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ct(i),r===null&&it&&(d=i.stateNode=C0(i.type,i.pendingProps,ue.current),gn=i,yr=!0,p=Et,ti(i.type)?(Pm=p,Et=br(d.firstChild)):Et=p),vn(r,i,i.pendingProps.children,s),Bc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&it&&((p=d=Et)&&(d=u2(d,i.type,i.pendingProps,yr),d!==null?(i.stateNode=d,gn=i,Et=br(d.firstChild),yr=!1,p=!0):p=!1),p||$a(i)),Ct(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,d=v.children,Dm(p,v)?d=null:w!==null&&Dm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=Oh(r,i,j_,null,null,s),Jo._currentValue=p),Bc(r,i),vn(r,i,d,s),i.child;case 6:return r===null&&it&&((r=s=Et)&&(s=c2(s,i.pendingProps,yr),s!==null?(i.stateNode=s,gn=i,Et=null,r=!0):r=!1),r||$a(i)),null;case 13:return mx(r,i,s);case 4:return Le(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Xi(i,null,d,s):vn(r,i,d,s),i.child;case 11:return ix(r,i,i.type,i.pendingProps,s);case 7:return vn(r,i,i.pendingProps,s),i.child;case 8:return vn(r,i,i.pendingProps.children,s),i.child;case 12:return vn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,Fa(i,i.type,d.value),vn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Qi(i),p=yn(p),d=d(p),i.flags|=1,vn(r,i,d,s),i.child;case 14:return lx(r,i,i.type,i.pendingProps,s);case 15:return sx(r,i,i.type,i.pendingProps,s);case 19:return gx(r,i,s);case 31:return z_(r,i,s);case 22:return ox(r,i,s,i.pendingProps);case 24:return Qi(i),d=yn(Qt),r===null?(p=kh(),p===null&&(p=wt,v=Sh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Ch(i),Fa(i,Qt,p)):((r.lanes&s)!==0&&(Eh(r,i),zo(i,null,null,s),Ro()),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),Fa(i,Qt,d)):(d=v.cache,Fa(i,Qt,d),d!==p.cache&&xh(i,[Qt],s,!0))),vn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function da(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(Hx())r.flags|=8192;else throw Yi=Cc,jh}else r.flags&=-16777217}function vx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!O0(i))if(Hx())r.flags|=8192;else throw Yi=Cc,jh}function Fc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ve():536870912,r.lanes|=i,as|=i)}function Uo(r,i){if(!it)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 Nt(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 D_(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 Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),sa(Qt),Se(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Zl(i)?da(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,yh())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(da(i),v!==null?(Nt(i),vx(i,v)):(Nt(i),sm(i,p,null,d,s))):v?v!==r.memoizedState?(da(i),Nt(i),vx(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&da(i),Nt(i),sm(i,p,r,d,s)),null;case 27:if(ne(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&da(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=q.current,Zl(i)?Xv(i):(r=C0(p,d,s),i.stateNode=r,da(i))}return Nt(i),null;case 5:if(ne(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&da(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=q.current,Zl(i))Xv(i);else{var w=rd(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?w.createElement(p,{is:d.is}):w.createElement(p)}}v[pn]=i,v[Ln]=d;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(bn(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&&da(i)}}return Nt(i),sm(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&da(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Zl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=gn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[pn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||m0(r.nodeValue,s)),r||$a(i,!0)}else r=rd(r).createTextNode(d),r[pn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Zl(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[pn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Wn(i),i):(Wn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Zl(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[pn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Wn(i),i):(Wn(i),null)}return Wn(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),Fc(i,i.updateQueue),Nt(i),null);case 4:return Se(),r===null&&Am(i.stateNode.containerInfo),Nt(i),null;case 10:return sa(i.type),Nt(i),null;case 19:if(B(Ht),d=i.memoizedState,d===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Uo(d,!1);else{if(Lt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Ac(r),v!==null){for(i.flags|=128,Uo(d,!1),r=v.updateQueue,i.updateQueue=r,Fc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Vv(s,r),s=s.sibling;return _(Ht,Ht.current&1|2),it&&ia(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&dn()>Qc&&(i.flags|=128,p=!0,Uo(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,Fc(i,r),Uo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!it)return Nt(i),null}else 2*dn()-d.renderingStartTime>Qc&&s!==536870912&&(i.flags|=128,p=!0,Uo(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=dn(),r.sibling=null,s=Ht.current,_(Ht,p?s&1|2:s&1),it&&ia(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return Wn(i),Th(),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&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&Fc(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&&B(Gi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),sa(Qt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function M_(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 sa(Qt),Se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ne(i),null;case 31:if(i.memoizedState!==null){if(Wn(i),i.alternate===null)throw Error(a(340));Zi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Wn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Zi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(Ht),null;case 4:return Se(),null;case 10:return sa(i.type),null;case 22:case 23:return Wn(i),Th(),r!==null&&B(Gi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return sa(Qt),null;case 25:return null;default:return null}}function bx(r,i){switch(ph(i),i.tag){case 3:sa(Qt),Se();break;case 26:case 27:case 5:ne(i);break;case 4:Se();break;case 31:i.memoizedState!==null&&Wn(i);break;case 13:Wn(i);break;case 19:B(Ht);break;case 10:sa(i.type);break;case 22:case 23:Wn(i),Th(),r!==null&&B(Gi);break;case 24:sa(Qt)}}function Po(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,w=s.inst;d=v(),w.destroy=d}s=s.next}while(s!==p)}}catch(N){pt(i,i.return,N)}}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 w=d.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var U=s,G=N;try{G()}catch(re){pt(p,U,re)}}}d=d.next}while(d!==v)}}catch(re){pt(i,i.return,re)}}function xx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{cb(i,s)}catch(d){pt(r,r.return,d)}}}function Sx(r,i,s){s.props=Wi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){pt(r,i,d)}}function Bo(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){pt(r,i,p)}}function Br(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){pt(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){pt(r,i,p)}else s.current=null}function wx(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){pt(r,r.return,p)}}function om(r,i,s){try{var d=r.stateNode;r2(d,r.type,s,i),d[Ln]=i}catch(p){pt(r,r.return,p)}}function kx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ti(r.type)||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||kx(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&&ti(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=na));else if(d!==4&&(d===27&&ti(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 qc(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&&ti(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(qc(r,i,s),r=r.sibling;r!==null;)qc(r,i,s),r=r.sibling}function jx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);bn(i,d,s),i[pn]=r,i[Ln]=s}catch(v){pt(r,r.return,v)}}var fa=!1,Yt=!1,dm=!1,Cx=typeof WeakSet=="function"?WeakSet:Set,on=null;function L_(r,i){if(r=r.containerInfo,zm=cd,r=Iv(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 w=0,N=-1,U=-1,G=0,re=0,ce=r,X=null;t:for(;;){for(var ee;ce!==s||p!==0&&ce.nodeType!==3||(N=w+p),ce!==v||d!==0&&ce.nodeType!==3||(U=w+d),ce.nodeType===3&&(w+=ce.nodeValue.length),(ee=ce.firstChild)!==null;)X=ce,ce=ee;for(;;){if(ce===r)break t;if(X===s&&++G===p&&(N=w),X===v&&++re===d&&(U=w),(ee=ce.nextSibling)!==null)break;ce=X,X=ce.parentNode}ce=ee}s=N===-1||U===-1?null:{start:N,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Om={focusedElem:r,selectionRange:s},cd=!1,on=i;on!==null;)if(i=on,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,on=r;else for(;on!==null;){switch(i=on,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=Wi(s.type,p);r=d.getSnapshotBeforeUpdate(je,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Oe){pt(s,s.return,Oe)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Lm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Lm(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,on=r;break}on=i.return}}function Ex(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ma(r,s),d&4&&Po(5,s);break;case 1:if(ma(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){pt(s,s.return,w)}else{var p=Wi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){pt(s,s.return,w)}}d&64&&xx(s),d&512&&Bo(s,s.return);break;case 3:if(ma(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{cb(r,i)}catch(w){pt(s,s.return,w)}}break;case 27:i===null&&d&4&&jx(s);case 26:case 5:ma(r,s),i===null&&d&4&&wx(s),d&512&&Bo(s,s.return);break;case 12:ma(r,s);break;case 31:ma(r,s),d&4&&Ax(r,s);break;case 13:ma(r,s),d&4&&Tx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=Z_.bind(null,s),d2(r,s))));break;case 22:if(d=s.memoizedState!==null||fa,!d){i=i!==null&&i.memoizedState!==null||Yt,p=fa;var v=Yt;fa=d,(Yt=i)&&!v?pa(r,s,(s.subtreeFlags&8772)!==0):ma(r,s),fa=p,Yt=v}break;case 30:break;default:ma(r,s)}}function Nx(r){var i=r.alternate;i!==null&&(r.alternate=null,Nx(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 _t=null,Un=!1;function ha(r,i,s){for(s=s.child;s!==null;)_x(r,i,s),s=s.sibling}function _x(r,i,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(en,s)}catch{}switch(s.tag){case 26:Yt||Br(s,i),ha(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Yt||Br(s,i);var d=_t,p=Un;ti(s.type)&&(_t=s.stateNode,Un=!1),ha(r,i,s),Ko(s.stateNode),_t=d,Un=p;break;case 5:Yt||Br(s,i);case 6:if(d=_t,p=Un,_t=null,ha(r,i,s),_t=d,Un=p,_t!==null)if(Un)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(v){pt(s,i,v)}else try{_t.removeChild(s.stateNode)}catch(v){pt(s,i,v)}break;case 18:_t!==null&&(Un?(r=_t,x0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),fs(r)):x0(_t,s.stateNode));break;case 4:d=_t,p=Un,_t=s.stateNode.containerInfo,Un=!0,ha(r,i,s),_t=d,Un=p;break;case 0:case 11:case 14:case 15:Ga(2,s,i),Yt||Ga(4,s,i),ha(r,i,s);break;case 1:Yt||(Br(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Sx(s,i,d)),ha(r,i,s);break;case 21:ha(r,i,s);break;case 22:Yt=(d=Yt)||s.memoizedState!==null,ha(r,i,s),Yt=d;break;default:ha(r,i,s)}}function Ax(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{fs(r)}catch(s){pt(i,i.return,s)}}}function Tx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{fs(r)}catch(s){pt(i,i.return,s)}}function I_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Cx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Cx),i;default:throw Error(a(435,r.tag))}}function Hc(r,i){var s=I_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=V_.bind(null,r,d);d.then(p,p)}})}function Pn(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ti(N.type)){_t=N.stateNode,Un=!1;break e}break;case 5:_t=N.stateNode,Un=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Un=!0;break e}N=N.return}if(_t===null)throw Error(a(160));_x(v,w,p),_t=null,Un=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Rx(i,r),i=i.sibling}var zr=null;function Rx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Pn(i,r),Bn(r),d&4&&(Ga(3,r,r.return),Po(3,r),Ga(5,r,r.return));break;case 1:Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),d&64&&fa&&(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=zr;if(Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(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[ho]||v[pn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),bn(v,d,s),v[pn]=r,sn(v),d=v;break e;case"link":var w=R0("link","href",p).get(d+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(d),bn(v,d,s),p.head.appendChild(v);break;case"meta":if(w=R0("meta","content",p).get(d+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(d),bn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[pn]=r,sn(v),d=v}r.stateNode=d}else z0(p,r.type,r.stateNode);else r.stateNode=T0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?z0(p,r.type,r.stateNode):T0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&om(r,r.memoizedProps,s.memoizedProps)}break;case 27:Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),s!==null&&d&4&&om(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),r.flags&32){p=r.stateNode;try{Ml(p,"")}catch(je){pt(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(Pn(i,r),Bn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(je){pt(r,r.return,je)}}break;case 3:if(ld=null,p=zr,zr=ad(i.containerInfo),Pn(i,r),zr=p,Bn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{fs(i.containerInfo)}catch(je){pt(r,r.return,je)}dm&&(dm=!1,zx(r));break;case 4:d=zr,zr=ad(r.stateNode.containerInfo),Pn(i,r),Bn(r),zr=d;break;case 12:Pn(i,r),Bn(r);break;case 31:Pn(i,r),Bn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Hc(r,d)));break;case 13:Pn(i,r),Bn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Vc=dn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Hc(r,d)));break;case 22:p=r.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,G=fa,re=Yt;if(fa=G||p,Yt=re||U,Pn(i,r),Yt=re,fa=G,Bn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||U||fa||Yt||el(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){U=s=i;try{if(v=U.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=U.stateNode;var ce=U.memoizedProps.style,X=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(je){pt(U,U.return,je)}}}else if(i.tag===6){if(s===null){U=i;try{U.stateNode.nodeValue=p?"":U.memoizedProps}catch(je){pt(U,U.return,je)}}}else if(i.tag===18){if(s===null){U=i;try{var ee=U.stateNode;p?S0(ee,!0):S0(U.stateNode,!1)}catch(je){pt(U,U.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,Hc(r,s))));break;case 19:Pn(i,r),Bn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Hc(r,d)));break;case 30:break;case 21:break;default:Pn(i,r),Bn(r)}}function Bn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(kx(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);qc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Ml(w,""),s.flags&=-33);var N=um(r);qc(r,N,w);break;case 3:case 4:var U=s.stateNode.containerInfo,G=um(r);cm(r,G,U);break;default:throw Error(a(161))}}catch(re){pt(r,r.return,re)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function zx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;zx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ma(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ex(r,i.alternate,i),i=i.sibling}function el(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),el(i);break;case 1:Br(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Sx(i,i.return,s),el(i);break;case 27:Ko(i.stateNode);case 26:case 5:Br(i,i.return),el(i);break;case 22:i.memoizedState===null&&el(i);break;case 30:el(i);break;default:el(i)}r=r.sibling}}function pa(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:pa(p,v,s),Po(4,v);break;case 1:if(pa(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){pt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var N=d.stateNode;try{var U=p.shared.hiddenCallbacks;if(U!==null)for(p.shared.hiddenCallbacks=null,p=0;p<U.length;p++)ub(U[p],N)}catch(G){pt(d,d.return,G)}}s&&w&64&&xx(v),Bo(v,v.return);break;case 27:jx(v);case 26:case 5:pa(p,v,s),s&&d===null&&w&4&&wx(v),Bo(v,v.return);break;case 12:pa(p,v,s);break;case 31:pa(p,v,s),s&&w&4&&Ax(p,v);break;case 13:pa(p,v,s),s&&w&4&&Tx(p,v);break;case 22:v.memoizedState===null&&pa(p,v,s),Bo(v,v.return);break;case 30:break;default:pa(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&&Eo(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&&Eo(r))}function Or(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ox(r,i,s,d),i=i.sibling}function Ox(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Or(r,i,s,d),p&2048&&Po(9,i);break;case 1:Or(r,i,s,d);break;case 3:Or(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&&Eo(r)));break;case 12:if(p&2048){Or(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(U){pt(i,i.return,U)}}else Or(r,i,s,d);break;case 31:Or(r,i,s,d);break;case 13:Or(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?Or(r,i,s,d):$o(r,i):v._visibility&2?Or(r,i,s,d):(v._visibility|=2,ts(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&fm(w,i);break;case 24:Or(r,i,s,d),p&2048&&hm(i.alternate,i);break;default:Or(r,i,s,d)}}function ts(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,U=d,G=w.flags;switch(w.tag){case 0:case 11:case 15:ts(v,w,N,U,p),Po(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?ts(v,w,N,U,p):$o(v,w):(re._visibility|=2,ts(v,w,N,U,p)),p&&G&2048&&fm(w.alternate,w);break;case 24:ts(v,w,N,U,p),p&&G&2048&&hm(w.alternate,w);break;default:ts(v,w,N,U,p)}i=i.sibling}}function $o(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:$o(s,d),p&2048&&fm(d.alternate,d);break;case 24:$o(s,d),p&2048&&hm(d.alternate,d);break;default:$o(s,d)}i=i.sibling}}var Fo=8192;function ns(r,i,s){if(r.subtreeFlags&Fo)for(r=r.child;r!==null;)Dx(r,i,s),r=r.sibling}function Dx(r,i,s){switch(r.tag){case 26:ns(r,i,s),r.flags&Fo&&r.memoizedState!==null&&k2(s,zr,r.memoizedState,r.memoizedProps);break;case 5:ns(r,i,s);break;case 3:case 4:var d=zr;zr=ad(r.stateNode.containerInfo),ns(r,i,s),zr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Fo,Fo=16777216,ns(r,i,s),Fo=d):ns(r,i,s));break;default:ns(r,i,s)}}function Mx(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function qo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];on=d,Ix(d,r)}Mx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Lx(r),r=r.sibling}function Lx(r){switch(r.tag){case 0:case 11:case 15:qo(r),r.flags&2048&&Ga(9,r,r.return);break;case 3:qo(r);break;case 12:qo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Zc(r)):qo(r);break;default:qo(r)}}function Zc(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];on=d,Ix(d,r)}Mx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ga(8,i,i.return),Zc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Zc(i));break;default:Zc(i)}r=r.sibling}}function Ix(r,i){for(;on!==null;){var s=on;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:Eo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,on=d;else e:for(s=r;on!==null;){d=on;var p=d.sibling,v=d.return;if(Nx(d),d===s){on=null;break e}if(p!==null){p.return=v,on=p;break e}on=v}}}var U_={getCacheForType:function(r){var i=yn(Qt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return yn(Qt).controller.signal}},P_=typeof WeakMap=="function"?WeakMap:Map,ct=0,wt=null,Xe=null,et=0,mt=0,er=null,Ka=!1,rs=!1,mm=!1,ga=0,Lt=0,Ya=0,tl=0,pm=0,tr=0,as=0,Ho=null,$n=null,gm=!1,Vc=0,Ux=0,Qc=1/0,Gc=null,Xa=null,tn=0,Ja=null,is=null,ya=0,ym=0,vm=null,Px=null,Zo=0,bm=null;function nr(){return(ct&2)!==0&&et!==0?et&-et:Z.T!==null?Cm():tv()}function Bx(){if(tr===0)if((et&536870912)===0||it){var r=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),tr=r}else tr=536870912;return r=Jn.current,r!==null&&(r.flags|=32),tr}function Fn(r,i,s){(r===wt&&(mt===2||mt===9)||r.cancelPendingCommit!==null)&&(ls(r,0),Wa(r,et,tr,!1)),mn(r,s),((ct&2)===0||r!==wt)&&(r===wt&&((ct&2)===0&&(tl|=s),Lt===4&&Wa(r,et,tr,!1)),$r(r))}function $x(r,i,s){if((ct&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||La(r,i),p=d?F_(r,i):Sm(r,i,!0),v=d;do{if(p===0){rs&&!d&&Wa(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!B_(s)){p=Sm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=Ho;var U=N.current.memoizedState.isDehydrated;if(U&&(ls(N,w).flags|=256),w=Sm(N,w,!1),w!==2){if(mm&&!U){N.errorRecoveryDisabledLanes|=v,tl|=v,p=4;break e}v=$n,$n=p,v!==null&&($n===null?$n=v:$n.push.apply($n,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){ls(r,0),Wa(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:Wa(d,i,tr,!Ka);break e;case 2:$n=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Vc+300-dn(),10<p)){if(Wa(d,i,tr,!Ka),Ui(d,0,!0)!==0)break e;ya=i,d.timeoutHandle=v0(Fx.bind(null,d,s,$n,Gc,gm,i,tr,tl,as,Ka,v,"Throttled",-0,0),p);break e}Fx(d,s,$n,Gc,gm,i,tr,tl,as,Ka,v,null,-0,0)}}break}while(!0);$r(r)}function Fx(r,i,s,d,p,v,w,N,U,G,re,ce,X,ee){if(r.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},Dx(i,v,ce);var je=(v&62914560)===v?Vc-dn():(v&4194048)===v?Ux-dn():0;if(je=j2(ce,je),je!==null){ya=v,r.cancelPendingCommit=je(Yx.bind(null,r,i,v,s,d,p,w,N,U,re,ce,null,X,ee)),Wa(r,v,w,!G);return}}Yx(r,i,v,s,d,p,w,N,U)}function B_(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(!Yn(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 Wa(r,i,s,d){i&=~pm,i&=~tl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-dt(p),w=1<<v;d[v]=-1,p&=~w}s!==0&&fo(r,s,i)}function Kc(){return(ct&6)===0?(Vo(0),!1):!0}function xm(){if(Xe!==null){if(mt===0)var r=Xe.return;else r=Xe,la=Vi=null,Lh(r),Yl=null,_o=0,r=Xe;for(;r!==null;)bx(r.alternate,r),r=r.return;Xe=null}}function ls(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,l2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ya=0,xm(),wt=r,Xe=s=aa(r.current,null),et=i,mt=0,er=null,Ka=!1,rs=La(r,i),mm=!1,as=tr=pm=tl=Ya=Lt=0,$n=Ho=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-dt(d),v=1<<p;i|=r[p],d&=~v}return ga=i,gc(),s}function qx(r,i){qe=null,Z.H=Lo,i===Kl||i===jc?(i=ib(),mt=3):i===jh?(i=ib(),mt=4):mt=i===Jh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,er=i,Xe===null&&(Lt=1,Uc(r,mr(i,r.current)))}function Hx(){var r=Jn.current;return r===null?!0:(et&4194048)===et?vr===null:(et&62914560)===et||(et&536870912)!==0?r===vr:!1}function Zx(){var r=Z.H;return Z.H=Lo,r===null?Lo:r}function Vx(){var r=Z.A;return Z.A=U_,r}function Yc(){Lt=4,Ka||(et&4194048)!==et&&Jn.current!==null||(rs=!0),(Ya&134217727)===0&&(tl&134217727)===0||wt===null||Wa(wt,et,tr,!1)}function Sm(r,i,s){var d=ct;ct|=2;var p=Zx(),v=Vx();(wt!==r||et!==i)&&(Gc=null,ls(r,i)),i=!1;var w=Lt;e:do try{if(mt!==0&&Xe!==null){var N=Xe,U=er;switch(mt){case 8:xm(),w=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(i=!0);var G=mt;if(mt=0,er=null,ss(r,N,U,G),s&&rs){w=0;break e}break;default:G=mt,mt=0,er=null,ss(r,N,U,G)}}$_(),w=Lt;break}catch(re){qx(r,re)}while(!0);return i&&r.shellSuspendCounter++,la=Vi=null,ct=d,Z.H=p,Z.A=v,Xe===null&&(wt=null,et=0,gc()),w}function $_(){for(;Xe!==null;)Qx(Xe)}function F_(r,i){var s=ct;ct|=2;var d=Zx(),p=Vx();wt!==r||et!==i?(Gc=null,Qc=dn()+500,ls(r,i)):rs=La(r,i);e:do try{if(mt!==0&&Xe!==null){i=Xe;var v=er;t:switch(mt){case 1:mt=0,er=null,ss(r,i,v,1);break;case 2:case 9:if(rb(v)){mt=0,er=null,Gx(i);break}i=function(){mt!==2&&mt!==9||wt!==r||(mt=7),$r(r)},v.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:rb(v)?(mt=0,er=null,Gx(i)):(mt=0,er=null,ss(r,i,v,7));break;case 5:var w=null;switch(Xe.tag){case 26:w=Xe.memoizedState;case 5:case 27:var N=Xe;if(w?O0(w):N.stateNode.complete){mt=0,er=null;var U=N.sibling;if(U!==null)Xe=U;else{var G=N.return;G!==null?(Xe=G,Xc(G)):Xe=null}break t}}mt=0,er=null,ss(r,i,v,5);break;case 6:mt=0,er=null,ss(r,i,v,6);break;case 8:xm(),Lt=6;break e;default:throw Error(a(462))}}q_();break}catch(re){qx(r,re)}while(!0);return la=Vi=null,Z.H=d,Z.A=p,ct=s,Xe!==null?0:(wt=null,et=0,gc(),Lt)}function q_(){for(;Xe!==null&&!oo();)Qx(Xe)}function Qx(r){var i=yx(r.alternate,r,ga);r.memoizedProps=r.pendingProps,i===null?Xc(r):Xe=i}function Gx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=dx(s,i,i.pendingProps,i.type,void 0,et);break;case 11:i=dx(s,i,i.pendingProps,i.type.render,i.ref,et);break;case 5:Lh(i);default:bx(s,i),i=Xe=Vv(i,ga),i=yx(s,i,ga)}r.memoizedProps=r.pendingProps,i===null?Xc(r):Xe=i}function ss(r,i,s,d){la=Vi=null,Lh(i),Yl=null,_o=0;var p=i.return;try{if(R_(r,p,i,s,et)){Lt=1,Uc(r,mr(s,r.current)),Xe=null;return}}catch(v){if(p!==null)throw Xe=p,v;Lt=1,Uc(r,mr(s,r.current)),Xe=null;return}i.flags&32768?(it||d===1?r=!0:rs||(et&536870912)!==0?r=!1:(Ka=r=!0,(d===2||d===9||d===3||d===6)&&(d=Jn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Kx(i,r)):Xc(i)}function Xc(r){var i=r;do{if((i.flags&32768)!==0){Kx(i,Ka);return}r=i.return;var s=D_(i.alternate,i,ga);if(s!==null){Xe=s;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=r}while(i!==null);Lt===0&&(Lt=5)}function Kx(r,i){do{var s=M_(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);Lt=6,Xe=null}function Yx(r,i,s,d,p,v,w,N,U){r.cancelPendingCommit=null;do Jc();while(tn!==0);if((ct&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,ea(r,s,v,w,N,U),r===wt&&(Xe=wt=null,et=0),is=i,Ja=r,ya=s,ym=v,vm=p,Px=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Q_(Me,function(){return t0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=ae.p,ae.p=2,w=ct,ct|=4;try{L_(r,i,s)}finally{ct=w,ae.p=p,Z.T=d}}tn=1,Xx(),Jx(),Wx()}}function Xx(){if(tn===1){tn=0;var r=Ja,i=is,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=ae.p;ae.p=2;var p=ct;ct|=4;try{Rx(i,r);var v=Om,w=Iv(r.containerInfo),N=v.focusedElem,U=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&Lv(N.ownerDocument.documentElement,N)){if(U!==null&&ah(N)){var G=U.start,re=U.end;if(re===void 0&&(re=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(re,N.value.length);else{var ce=N.ownerDocument||document,X=ce&&ce.defaultView||window;if(X.getSelection){var ee=X.getSelection(),je=N.textContent.length,Oe=Math.min(U.start,je),bt=U.end===void 0?Oe:Math.min(U.end,je);!ee.extend&&Oe>bt&&(w=bt,bt=Oe,Oe=w);var V=Mv(N,Oe),H=Mv(N,bt);if(V&&H&&(ee.rangeCount!==1||ee.anchorNode!==V.node||ee.anchorOffset!==V.offset||ee.focusNode!==H.node||ee.focusOffset!==H.offset)){var Q=ce.createRange();Q.setStart(V.node,V.offset),ee.removeAllRanges(),Oe>bt?(ee.addRange(Q),ee.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),ee.addRange(Q))}}}}for(ce=[],ee=N;ee=ee.parentNode;)ee.nodeType===1&&ce.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var oe=ce[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}cd=!!zm,Om=zm=null}finally{ct=p,ae.p=d,Z.T=s}}r.current=i,tn=2}}function Jx(){if(tn===2){tn=0;var r=Ja,i=is,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=ae.p;ae.p=2;var p=ct;ct|=4;try{Ex(r,i.alternate,i)}finally{ct=p,ae.p=d,Z.T=s}}tn=3}}function Wx(){if(tn===4||tn===3){tn=0,uo();var r=Ja,i=is,s=ya,d=Px;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?tn=5:(tn=0,is=Ja=null,e0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Xa=null),Pf(s),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(en,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=ae.p,ae.p=2,Z.T=null;try{for(var v=r.onRecoverableError,w=0;w<d.length;w++){var N=d[w];v(N.value,{componentStack:N.stack})}}finally{Z.T=i,ae.p=p}}(ya&3)!==0&&Jc(),$r(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===bm?Zo++:(Zo=0,bm=r):Zo=0,Vo(0)}}function e0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Eo(i)))}function Jc(){return Xx(),Jx(),Wx(),t0()}function t0(){if(tn!==5)return!1;var r=Ja,i=ym;ym=0;var s=Pf(ya),d=Z.T,p=ae.p;try{ae.p=32>s?32:s,Z.T=null,s=vm,vm=null;var v=Ja,w=ya;if(tn=0,is=Ja=null,ya=0,(ct&6)!==0)throw Error(a(331));var N=ct;if(ct|=4,Lx(v.current),Ox(v,v.current,w,s),ct=N,Vo(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(en,v)}catch{}return!0}finally{ae.p=p,Z.T=d,e0(r,i)}}function n0(r,i,s){i=mr(s,i),i=Xh(r.stateNode,i,2),r=Za(r,i,2),r!==null&&(mn(r,2),$r(r))}function pt(r,i,s){if(r.tag===3)n0(r,r,s);else for(;i!==null;){if(i.tag===3){n0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Xa===null||!Xa.has(d))){r=mr(s,r),s=rx(2),d=Za(i,s,2),d!==null&&(ax(s,d,i,r),mn(d,2),$r(d));break}}i=i.return}}function wm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new P_;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=H_.bind(null,r,i,s),i.then(r,r))}function H_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,wt===r&&(et&s)===s&&(Lt===4||Lt===3&&(et&62914560)===et&&300>dn()-Vc?(ct&2)===0&&ls(r,0):pm|=s,as===et&&(as=0)),$r(r)}function r0(r,i){i===0&&(i=ve()),r=qi(r,i),r!==null&&(mn(r,i),$r(r))}function Z_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),r0(r,s)}function V_(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),r0(r,s)}function Q_(r,i){return Ma(r,i)}var Wc=null,os=null,km=!1,ed=!1,jm=!1,ei=0;function $r(r){r!==os&&r.next===null&&(os===null?Wc=os=r:os=os.next=r),ed=!0,km||(km=!0,K_())}function Vo(r,i){if(!jm&&ed){jm=!0;do for(var s=!1,d=Wc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var w=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-dt(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,s0(d,v))}else v=et,v=Ui(d,d===wt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||La(d,v)||(s=!0,s0(d,v));d=d.next}while(s);jm=!1}}function G_(){a0()}function a0(){ed=km=!1;var r=0;ei!==0&&i2()&&(r=ei);for(var i=dn(),s=null,d=Wc;d!==null;){var p=d.next,v=i0(d,i);v===0?(d.next=null,s===null?Wc=p:s.next=p,p===null&&(os=s)):(s=d,(r!==0||(v&3)!==0)&&(ed=!0)),d=p}tn!==0&&tn!==5||Vo(r),ei!==0&&(ei=0)}function i0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-dt(v),N=1<<w,U=p[w];U===-1?((N&s)===0||(N&d)!==0)&&(p[w]=rc(N,i)):U<=i&&(r.expiredLanes|=N),v&=~N}if(i=wt,s=et,s=Ui(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(mt===2||mt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Wr(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&&Wr(d),Pf(s)){case 2:case 8:s=ye;break;case 32:s=Me;break;case 268435456:s=at;break;default:s=Me}return d=l0.bind(null,r),s=Ma(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Wr(d),r.callbackPriority=2,r.callbackNode=null,2}function l0(r,i){if(tn!==0&&tn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Jc()&&r.callbackNode!==s)return null;var d=et;return d=Ui(r,r===wt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:($x(r,d,i),i0(r,dn()),r.callbackNode!=null&&r.callbackNode===s?l0.bind(null,r):null)}function s0(r,i){if(Jc())return null;$x(r,i,!0)}function K_(){s2(function(){(ct&6)!==0?Ma(le,G_):a0()})}function Cm(){if(ei===0){var r=Ql;r===0&&(r=Mi,Mi<<=1,(Mi&261888)===0&&(Mi=256)),ei=r}return ei}function o0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:oc(""+r)}function u0(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 Y_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=o0((p[Ln]||null).action),w=d.submitter;w&&(i=(i=w[Ln]||null)?o0(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new fc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ei!==0){var U=w?u0(p,w):new FormData(p);Zh(s,{pending:!0,data:U,method:p.method,action:v},null,U)}}else typeof v=="function"&&(N.preventDefault(),U=w?u0(p,w):new FormData(p),Zh(s,{pending:!0,data:U,method:p.method,action:v},v,U))},currentTarget:p}]})}}for(var Em=0;Em<oh.length;Em++){var Nm=oh[Em],X_=Nm.toLowerCase(),J_=Nm[0].toUpperCase()+Nm.slice(1);Rr(X_,"on"+J_)}Rr(Bv,"onAnimationEnd"),Rr($v,"onAnimationIteration"),Rr(Fv,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(m_,"onTransitionRun"),Rr(p_,"onTransitionStart"),Rr(g_,"onTransitionCancel"),Rr(qv,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),W_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function c0(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 w=d.length-1;0<=w;w--){var N=d[w],U=N.instance,G=N.currentTarget;if(N=N.listener,U!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(re){pc(re)}p.currentTarget=null,v=U}else for(w=0;w<d.length;w++){if(N=d[w],U=N.instance,G=N.currentTarget,N=N.listener,U!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(re){pc(re)}p.currentTarget=null,v=U}}}}function Je(r,i){var s=i[Bf];s===void 0&&(s=i[Bf]=new Set);var d=r+"__bubble";s.has(d)||(d0(i,r,2,!1),s.add(d))}function _m(r,i,s){var d=0;i&&(d|=4),d0(s,r,d,i)}var td="_reactListening"+Math.random().toString(36).slice(2);function Am(r){if(!r[td]){r[td]=!0,av.forEach(function(s){s!=="selectionchange"&&(W_.has(s)||_m(s,!1,r),_m(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[td]||(i[td]=!0,_m("selectionchange",!1,i))}}function d0(r,i,s,d){switch(B0(i)){case 2:var p=N2;break;case 8:p=_2;break;default:p=Hm}s=p.bind(null,i,s,r),p=void 0,!Kf||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 Tm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var N=d.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=d.return;w!==null;){var U=w.tag;if((U===3||U===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=Tl(N),w===null)return;if(U=w.tag,U===5||U===6||U===26||U===27){d=v=w;continue e}N=N.parentNode}}d=d.return}gv(function(){var G=v,re=Qf(s),ce=[];e:{var X=Hv.get(r);if(X!==void 0){var ee=fc,je=r;switch(r){case"keypress":if(cc(s)===0)break e;case"keydown":case"keyup":ee=VN;break;case"focusin":je="focus",ee=Wf;break;case"focusout":je="blur",ee=Wf;break;case"beforeblur":case"afterblur":ee=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":ee=bv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=DN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=KN;break;case Bv:case $v:case Fv:ee=IN;break;case qv:ee=XN;break;case"scroll":case"scrollend":ee=zN;break;case"wheel":ee=WN;break;case"copy":case"cut":case"paste":ee=PN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Sv;break;case"toggle":case"beforetoggle":ee=t_}var Oe=(i&4)!==0,bt=!Oe&&(r==="scroll"||r==="scrollend"),V=Oe?X!==null?X+"Capture":null:X;Oe=[];for(var H=G,Q;H!==null;){var oe=H;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||V===null||(oe=po(H,V),oe!=null&&Oe.push(Go(H,oe,Q))),bt)break;H=H.return}0<Oe.length&&(X=new ee(X,je,null,s,re),ce.push({event:X,listeners:Oe}))}}if((i&7)===0){e:{if(X=r==="mouseover"||r==="pointerover",ee=r==="mouseout"||r==="pointerout",X&&s!==Vf&&(je=s.relatedTarget||s.fromElement)&&(Tl(je)||je[Al]))break e;if((ee||X)&&(X=re.window===re?re:(X=re.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(je=s.relatedTarget||s.toElement,ee=G,je=je?Tl(je):null,je!==null&&(bt=o(je),Oe=je.tag,je!==bt||Oe!==5&&Oe!==27&&Oe!==6)&&(je=null)):(ee=null,je=G),ee!==je)){if(Oe=bv,oe="onMouseLeave",V="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(Oe=Sv,oe="onPointerLeave",V="onPointerEnter",H="pointer"),bt=ee==null?X:mo(ee),Q=je==null?X:mo(je),X=new Oe(oe,H+"leave",ee,s,re),X.target=bt,X.relatedTarget=Q,oe=null,Tl(re)===G&&(Oe=new Oe(V,H+"enter",je,s,re),Oe.target=Q,Oe.relatedTarget=bt,oe=Oe),bt=oe,ee&&je)t:{for(Oe=e2,V=ee,H=je,Q=0,oe=V;oe;oe=Oe(oe))Q++;oe=0;for(var Re=H;Re;Re=Oe(Re))oe++;for(;0<Q-oe;)V=Oe(V),Q--;for(;0<oe-Q;)H=Oe(H),oe--;for(;Q--;){if(V===H||H!==null&&V===H.alternate){Oe=V;break t}V=Oe(V),H=Oe(H)}Oe=null}else Oe=null;ee!==null&&f0(ce,X,ee,Oe,!1),je!==null&&bt!==null&&f0(ce,bt,je,Oe,!0)}}e:{if(X=G?mo(G):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var ot=Av;else if(Nv(X))if(Tv)ot=d_;else{ot=u_;var Ne=o_}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?G&&Zf(G.elementType)&&(ot=Av):ot=c_;if(ot&&(ot=ot(r,G))){_v(ce,ot,s,re);break e}Ne&&Ne(r,X,G),r==="focusout"&&G&&X.type==="number"&&G.memoizedProps.value!=null&&Hf(X,"number",X.value)}switch(Ne=G?mo(G):window,r){case"focusin":(Nv(Ne)||Ne.contentEditable==="true")&&(Pl=Ne,ih=G,ko=null);break;case"focusout":ko=ih=Pl=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,Uv(ce,s,re);break;case"selectionchange":if(h_)break;case"keydown":case"keyup":Uv(ce,s,re)}var Ze;if(th)e:{switch(r){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Ul?Cv(r,s)&&(tt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(tt="onCompositionStart");tt&&(wv&&s.locale!=="ko"&&(Ul||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ul&&(Ze=yv()):(Ua=re,Yf="value"in Ua?Ua.value:Ua.textContent,Ul=!0)),Ne=nd(G,tt),0<Ne.length&&(tt=new xv(tt,r,null,s,re),ce.push({event:tt,listeners:Ne}),Ze?tt.data=Ze:(Ze=Ev(s),Ze!==null&&(tt.data=Ze)))),(Ze=r_?a_(r,s):i_(r,s))&&(tt=nd(G,"onBeforeInput"),0<tt.length&&(Ne=new xv("onBeforeInput","beforeinput",null,s,re),ce.push({event:Ne,listeners:tt}),Ne.data=Ze)),Y_(ce,r,G,s,re)}c0(ce,i)})}function Go(r,i,s){return{instance:r,listener:i,currentTarget:s}}function nd(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=po(r,s),p!=null&&d.unshift(Go(r,p,v)),p=po(r,i),p!=null&&d.push(Go(r,p,v))),r.tag===3)return d;r=r.return}return[]}function e2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function f0(r,i,s,d,p){for(var v=i._reactName,w=[];s!==null&&s!==d;){var N=s,U=N.alternate,G=N.stateNode;if(N=N.tag,U!==null&&U===d)break;N!==5&&N!==26&&N!==27||G===null||(U=G,p?(G=po(s,v),G!=null&&w.unshift(Go(s,G,U))):p||(G=po(s,v),G!=null&&w.push(Go(s,G,U)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var t2=/\r\n?/g,n2=/\u0000|\uFFFD/g;function h0(r){return(typeof r=="string"?r:""+r).replace(t2,`
|
|
49
|
+
`).replace(n2,"")}function m0(r,i){return i=h0(i),h0(r)===i}function vt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ml(r,""+d);break;case"className":lc(r,"class",d);break;case"tabIndex":lc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":lc(r,s,d);break;case"style":mv(r,d,v);break;case"data":if(i!=="object"){lc(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=oc(""+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"&&vt(r,i,"name",p.name,p,null),vt(r,i,"formEncType",p.formEncType,p,null),vt(r,i,"formMethod",p.formMethod,p,null),vt(r,i,"formTarget",p.formTarget,p,null)):(vt(r,i,"encType",p.encType,p,null),vt(r,i,"method",p.method,p,null),vt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=oc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=na);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=oc(""+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),ic(r,"popover",d);break;case"xlinkActuate":ta(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ta(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ta(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ta(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ta(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ta(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ta(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ta(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ta(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ic(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=TN.get(s)||s,ic(r,s,d))}}function Rm(r,i,s,d,p,v){switch(s){case"style":mv(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"?Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&Ml(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=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!iv.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[Ln]||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,""):ic(r,s,d)}}}function bn(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 w=s[v];if(w!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:vt(r,i,v,w,s,null)}}p&&vt(r,i,"srcSet",s.srcSet,s,null),d&&vt(r,i,"src",s.src,s,null);return;case"input":Je("invalid",r);var N=v=w=p=null,U=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var re=s[d];if(re!=null)switch(d){case"name":p=re;break;case"type":w=re;break;case"checked":U=re;break;case"defaultChecked":G=re;break;case"value":v=re;break;case"defaultValue":N=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:vt(r,i,d,re,s,null)}}cv(r,v,N,U,G,w,p,!1);return;case"select":Je("invalid",r),d=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":d=N;default:vt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!d,i!=null?Dl(r,!!d,i,!1):s!=null&&Dl(r,!!d,s,!0);return;case"textarea":Je("invalid",r),v=p=d=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":d=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:vt(r,i,w,N,s,null)}fv(r,d,p,v);return;case"option":for(U in s)if(s.hasOwnProperty(U)&&(d=s[U],d!=null))switch(U){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:vt(r,i,U,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<Qo.length;d++)Je(Qo[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:vt(r,i,G,d,s,null)}return;default:if(Zf(i)){for(re in s)s.hasOwnProperty(re)&&(d=s[re],d!==void 0&&Rm(r,i,re,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&vt(r,i,N,d,s,null))}function r2(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,w=null,N=null,U=null,G=null,re=null;for(ee in s){var ce=s[ee];if(s.hasOwnProperty(ee)&&ce!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":U=ce;default:d.hasOwnProperty(ee)||vt(r,i,ee,null,d,ce)}}for(var X in d){var ee=d[X];if(ce=s[X],d.hasOwnProperty(X)&&(ee!=null||ce!=null))switch(X){case"type":v=ee;break;case"name":p=ee;break;case"checked":G=ee;break;case"defaultChecked":re=ee;break;case"value":w=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,i));break;default:ee!==ce&&vt(r,i,X,ee,d,ce)}}qf(r,w,N,U,G,re,v,p);return;case"select":ee=w=N=X=null;for(v in s)if(U=s[v],s.hasOwnProperty(v)&&U!=null)switch(v){case"value":break;case"multiple":ee=U;default:d.hasOwnProperty(v)||vt(r,i,v,null,d,U)}for(p in d)if(v=d[p],U=s[p],d.hasOwnProperty(p)&&(v!=null||U!=null))switch(p){case"value":X=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==U&&vt(r,i,p,v,d,U)}i=N,s=w,d=ee,X!=null?Dl(r,!!s,X,!1):!!d!=!!s&&(i!=null?Dl(r,!!s,i,!0):Dl(r,!!s,s?[]:"",!1));return;case"textarea":ee=X=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:vt(r,i,N,null,d,p)}for(w in d)if(p=d[w],v=s[w],d.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":X=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&vt(r,i,w,p,d,v)}dv(r,X,ee);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:vt(r,i,je,null,d,X)}for(U in d)if(X=d[U],ee=s[U],d.hasOwnProperty(U)&&X!==ee&&(X!=null||ee!=null))switch(U){case"selected":r.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:vt(r,i,U,X,d,ee)}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 Oe in s)X=s[Oe],s.hasOwnProperty(Oe)&&X!=null&&!d.hasOwnProperty(Oe)&&vt(r,i,Oe,null,d,X);for(G in d)if(X=d[G],ee=s[G],d.hasOwnProperty(G)&&X!==ee&&(X!=null||ee!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:vt(r,i,G,X,d,ee)}return;default:if(Zf(i)){for(var bt in s)X=s[bt],s.hasOwnProperty(bt)&&X!==void 0&&!d.hasOwnProperty(bt)&&Rm(r,i,bt,void 0,d,X);for(re in d)X=d[re],ee=s[re],!d.hasOwnProperty(re)||X===ee||X===void 0&&ee===void 0||Rm(r,i,re,X,d,ee);return}}for(var V in s)X=s[V],s.hasOwnProperty(V)&&X!=null&&!d.hasOwnProperty(V)&&vt(r,i,V,null,d,X);for(ce in d)X=d[ce],ee=s[ce],!d.hasOwnProperty(ce)||X===ee||X==null&&ee==null||vt(r,i,ce,X,d,ee)}function p0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function a2(){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,w=p.initiatorType,N=p.duration;if(v&&N&&p0(w)){for(w=0,N=p.responseEnd,d+=1;d<s.length;d++){var U=s[d],G=U.startTime;if(G>N)break;var re=U.transferSize,ce=U.initiatorType;re&&p0(ce)&&(U=U.responseEnd,w+=re*(U<N?1:(N-G)/(U-G)))}if(--d,i+=8*(v+w)/(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 rd(r){return r.nodeType===9?r:r.ownerDocument}function g0(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 y0(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 Dm(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 Mm=null;function i2(){var r=window.event;return r&&r.type==="popstate"?r===Mm?!1:(Mm=r,!0):(Mm=null,!1)}var v0=typeof setTimeout=="function"?setTimeout:void 0,l2=typeof clearTimeout=="function"?clearTimeout:void 0,b0=typeof Promise=="function"?Promise:void 0,s2=typeof queueMicrotask=="function"?queueMicrotask:typeof b0<"u"?function(r){return b0.resolve(null).then(r).catch(o2)}:v0;function o2(r){setTimeout(function(){throw r})}function ti(r){return r==="head"}function x0(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),fs(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Ko(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ko(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[ho]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Ko(r.ownerDocument.body);s=p}while(s);fs(i)}function S0(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 Lm(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":Lm(s),$f(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function u2(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[ho])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=br(r.nextSibling),r===null)break}return null}function c2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=br(r.nextSibling),r===null))return null;return r}function w0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=br(r.nextSibling),r===null))return null;return r}function Im(r){return r.data==="$?"||r.data==="$~"}function Um(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function d2(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 br(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 k0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return br(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function j0(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 C0(r,i,s){switch(i=rd(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 Ko(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);$f(r)}var xr=new Map,E0=new Set;function ad(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var va=ae.d;ae.d={f:f2,r:h2,D:m2,C:p2,L:g2,m:y2,X:b2,S:v2,M:x2};function f2(){var r=va.f(),i=Kc();return r||i}function h2(r){var i=Rl(r);i!==null&&i.tag===5&&i.type==="form"?qb(i):va.r(r)}var us=typeof document>"u"?null:document;function N0(r,i,s){var d=us;if(d&&typeof i=="string"&&i){var p=fr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),E0.has(p)||(E0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),bn(i,"link",r),sn(i),d.head.appendChild(i)))}}function m2(r){va.D(r),N0("dns-prefetch",r,null)}function p2(r,i){va.C(r,i),N0("preconnect",r,i)}function g2(r,i,s){va.L(r,i,s);var d=us;if(d&&r&&i){var p='link[rel="preload"][as="'+fr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+fr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+fr(s.imageSizes)+'"]')):p+='[href="'+fr(r)+'"]';var v=p;switch(i){case"style":v=cs(r);break;case"script":v=ds(r)}xr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),xr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Yo(v))||i==="script"&&d.querySelector(Xo(v))||(i=d.createElement("link"),bn(i,"link",r),sn(i),d.head.appendChild(i)))}}function y2(r,i){va.m(r,i);var s=us;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+fr(d)+'"][href="'+fr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ds(r)}if(!xr.has(v)&&(r=g({rel:"modulepreload",href:r},i),xr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Xo(v)))return}d=s.createElement("link"),bn(d,"link",r),sn(d),s.head.appendChild(d)}}}function v2(r,i,s){va.S(r,i,s);var d=us;if(d&&r){var p=zl(d).hoistableStyles,v=cs(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=d.querySelector(Yo(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=xr.get(v))&&Bm(r,s);var U=w=d.createElement("link");sn(U),bn(U,"link",r),U._p=new Promise(function(G,re){U.onload=G,U.onerror=re}),U.addEventListener("load",function(){N.loading|=1}),U.addEventListener("error",function(){N.loading|=2}),N.loading|=4,id(w,i,d)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function b2(r,i){va.X(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),sn(v),bn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function x2(r,i){va.M(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),sn(v),bn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function _0(r,i,s,d){var p=(p=ue.current)?ad(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=cs(s.href),s=zl(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=cs(s.href);var v=zl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Yo(r)))&&!v._p&&(w.instance=v,w.state.loading=5),xr.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},xr.set(r,s),v||S2(p,r,s,w.state))),i&&d===null)throw Error(a(528,""));return w}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=ds(s),s=zl(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 cs(r){return'href="'+fr(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function A0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function S2(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}),bn(i,"link",s),sn(i),r.head.appendChild(i))}function ds(r){return'[src="'+fr(r)+'"]'}function Xo(r){return"script[async]"+r}function T0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+fr(s.href)+'"]');if(d)return i.instance=d,sn(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"),sn(d),bn(d,"style",p),id(d,s.precedence,r),i.instance=d;case"stylesheet":p=cs(s.href);var v=r.querySelector(Yo(p));if(v)return i.state.loading|=4,i.instance=v,sn(v),v;d=A0(s),(p=xr.get(p))&&Bm(d,p),v=(r.ownerDocument||r).createElement("link"),sn(v);var w=v;return w._p=new Promise(function(N,U){w.onload=N,w.onerror=U}),bn(v,"link",d),i.state.loading|=4,id(v,s.precedence,r),i.instance=v;case"script":return v=ds(s.src),(p=r.querySelector(Xo(v)))?(i.instance=p,sn(p),p):(d=s,(p=xr.get(v))&&(d=g({},s),$m(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),sn(p),bn(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,id(d,s.precedence,r));return i.instance}function id(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,w=0;w<d.length;w++){var N=d[w];if(N.dataset.precedence===i)v=N;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 ld=null;function R0(r,i,s){if(ld===null){var d=new Map,p=ld=new Map;p.set(s,d)}else p=ld,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[ho]||v[pn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=d.get(w);N?N.push(v):d.set(w,[v])}}return d}function z0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function w2(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 O0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function k2(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=cs(d.href),v=i.querySelector(Yo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=sd.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,sn(v);return}v=i.ownerDocument||i,d=A0(d),(p=xr.get(p))&&Bm(d,p),v=v.createElement("link"),sn(v);var w=v;w._p=new Promise(function(N,U){w.onload=N,w.onerror=U}),bn(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=sd.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Fm=0;function j2(r,i){return r.stylesheets&&r.count===0&&ud(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&ud(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Fm===0&&(Fm=62500*a2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ud(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 sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ud(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var od=null;function ud(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,od=new Map,i.forEach(C2,r),od=null,sd.call(r))}function C2(r,i){if(!(i.state.loading&4)){var s=od.get(r);if(s)var d=s.get(null);else{s=new Map,od.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),d=w)}d&&s.set(null,d)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||d,v===d&&s.set(null,p),s.set(w,p),this.count++,d=sd.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 Jo={$$typeof:O,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function E2(r,i,s,d,p,v,w,N,U){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=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function D0(r,i,s,d,p,v,w,N,U,G,re,ce){return r=new E2(r,i,s,w,U,G,re,ce,N),i=1,v===!0&&(i|=24),v=Xn(3,null,null,i),r.current=v,v.stateNode=r,i=Sh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Ch(v),r}function M0(r){return r?(r=Fl,r):Fl}function L0(r,i,s,d,p,v){p=M0(p),d.context===null?d.context=p:d.pendingContext=p,d=Ha(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Za(r,d,i),s!==null&&(Fn(s,r,i),To(s,r,i))}function I0(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){I0(r,i),(r=r.alternate)&&I0(r,i)}function U0(r){if(r.tag===13||r.tag===31){var i=qi(r,67108864);i!==null&&Fn(i,r,67108864),qm(r,67108864)}}function P0(r){if(r.tag===13||r.tag===31){var i=nr();i=Uf(i);var s=qi(r,i);s!==null&&Fn(s,r,i),qm(r,i)}}var cd=!0;function N2(r,i,s,d){var p=Z.T;Z.T=null;var v=ae.p;try{ae.p=2,Hm(r,i,s,d)}finally{ae.p=v,Z.T=p}}function _2(r,i,s,d){var p=Z.T;Z.T=null;var v=ae.p;try{ae.p=8,Hm(r,i,s,d)}finally{ae.p=v,Z.T=p}}function Hm(r,i,s,d){if(cd){var p=Zm(d);if(p===null)Tm(r,i,d,dd,s),$0(r,d);else if(T2(p,r,i,s,d))d.stopPropagation();else if($0(r,d),i&4&&-1<A2.indexOf(r)){for(;p!==null;){var v=Rl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ir(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var U=1<<31-dt(w);N.entanglements[1]|=U,w&=~U}$r(v),(ct&6)===0&&(Qc=dn()+500,Vo(0))}}break;case 31:case 13:N=qi(v,2),N!==null&&Fn(N,v,2),Kc(),qm(v,2)}if(v=Zm(d),v===null&&Tm(r,i,d,dd,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Tm(r,i,d,null,s)}}function Zm(r){return r=Qf(r),Vm(r)}var dd=null;function Vm(r){if(dd=null,r=Tl(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 dd=r,null}function B0(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(co()){case le:return 2;case ye:return 8;case Me:case Pe:return 32;case at:return 268435456;default:return 32}default:return 32}}var Qm=!1,ni=null,ri=null,ai=null,Wo=new Map,eu=new Map,ii=[],A2="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 $0(r,i){switch(r){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Wo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":eu.delete(i.pointerId)}}function tu(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=Rl(i),i!==null&&U0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function T2(r,i,s,d,p){switch(i){case"focusin":return ni=tu(ni,r,i,s,d,p),!0;case"dragenter":return ri=tu(ri,r,i,s,d,p),!0;case"mouseover":return ai=tu(ai,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Wo.set(v,tu(Wo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,eu.set(v,tu(eu.get(v)||null,r,i,s,d,p)),!0}return!1}function F0(r){var i=Tl(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,nv(r.priority,function(){P0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,nv(r.priority,function(){P0(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 fd(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=Rl(s),i!==null&&U0(i),r.blockedOn=s,!1;i.shift()}return!0}function q0(r,i,s){fd(r)&&s.delete(i)}function R2(){Qm=!1,ni!==null&&fd(ni)&&(ni=null),ri!==null&&fd(ri)&&(ri=null),ai!==null&&fd(ai)&&(ai=null),Wo.forEach(q0),eu.forEach(q0)}function hd(r,i){r.blockedOn===i&&(r.blockedOn=null,Qm||(Qm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R2)))}var md=null;function H0(r){md!==r&&(md=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){md===r&&(md=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=Rl(s);v!==null&&(r.splice(i,3),i-=3,Zh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function fs(r){function i(U){return hd(U,r)}ni!==null&&hd(ni,r),ri!==null&&hd(ri,r),ai!==null&&hd(ai,r),Wo.forEach(i),eu.forEach(i);for(var s=0;s<ii.length;s++){var d=ii[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ii.length&&(s=ii[0],s.blockedOn===null);)F0(s),s.blockedOn===null&&ii.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],w=p[Ln]||null;if(typeof v=="function")w||H0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[Ln]||null)N=w.formAction;else if(Vm(p)!==null)continue}else N=w.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),H0(s)}}}function Z0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function 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 Gm(r){this._internalRoot=r}pd.prototype.render=Gm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=nr();L0(s,d,r,i,null,null)},pd.prototype.unmount=Gm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;L0(r.current,2,null,r,null,null),Kc(),i[Al]=null}};function pd(r){this._internalRoot=r}pd.prototype.unstable_scheduleHydration=function(r){if(r){var i=tv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<ii.length&&i!==0&&i<ii[s].priority;s++);ii.splice(s,0,r),s===0&&F0(r)}};var V0=t.version;if(V0!=="19.2.4")throw Error(a(527,V0,"19.2.4"));ae.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 z2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gd.isDisabled&&gd.supportsFiber)try{en=gd.inject(z2),qt=gd}catch{}}return ru.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=Wb,v=ex,w=tx;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&&(w=i.onRecoverableError)),i=D0(r,1,!1,null,null,s,d,null,p,v,w,Z0),r[Al]=i.current,Am(r),new Gm(i)},ru.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=Wb,w=ex,N=tx,U=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&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),i=D0(r,1,!0,i,s??null,d,p,U,v,w,N,Z0),i.context=M0(null),s=i.current,d=nr(),d=Uf(d),p=Ha(d),p.callback=null,Za(s,p,d),s=d,i.current.lanes=s,mn(i,s),$r(i),r[Al]=i.current,Am(r),new pd(i)},ru.version="19.2.4",ru}var r1;function q2(){if(r1)return Jm.exports;r1=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=F2(),Jm.exports}var H2=q2(),wl=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(){}},il,hi,As,Tw,Z2=(Tw=class extends wl{constructor(){super();we(this,il);we(this,hi);we(this,As);ge(this,As,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,hi)||this.setEventListener(M(this,As))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,hi))==null||t.call(this),ge(this,hi,void 0))}setEventListener(t){var n;ge(this,As,t),(n=M(this,hi))==null||n.call(this),ge(this,hi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){M(this,il)!==t&&(ge(this,il,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,il)=="boolean"?M(this,il):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},il=new WeakMap,hi=new WeakMap,As=new WeakMap,Tw),Zg=new Z2,V2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mi,Fg,Rw,Q2=(Rw=class{constructor(){we(this,mi,V2);we(this,Fg,!1)}setTimeoutProvider(e){ge(this,mi,e)}setTimeout(e,t){return M(this,mi).setTimeout(e,t)}clearTimeout(e){M(this,mi).clearTimeout(e)}setInterval(e,t){return M(this,mi).setInterval(e,t)}clearInterval(e){M(this,mi).clearInterval(e)}},mi=new WeakMap,Fg=new WeakMap,Rw),al=new Q2;function G2(e){setTimeout(e,0)}var K2=typeof window>"u"||"Deno"in globalThis;function En(){}function Y2(e,t){return typeof e=="function"?e(t):e}function qp(e){return typeof e=="number"&&e>=0&&e!==1/0}function qw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function a1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Vg(c,t.options))return!1}else if(!wu(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 i1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ml(t.options.mutationKey)!==ml(o))return!1}else if(!wu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Vg(e,t){return((t==null?void 0:t.queryKeyHashFn)||ml)(e)}function ml(e){return JSON.stringify(e,(t,n)=>Hp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function wu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>wu(e[n],t[n])):!1}var X2=Object.prototype.hasOwnProperty;function Qg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=l1(e)&&l1(t);if(!a&&!(Hp(e)&&Hp(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],S=t[g];if(b===S){m[g]=b,(a?y<o:X2.call(e,g))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[g]=S;continue}const k=Qg(b,S,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function ku(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 l1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hp(e){if(!s1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!s1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function s1(e){return Object.prototype.toString.call(e)==="[object Object]"}function J2(e){return new Promise(t=>{al.setTimeout(t,e)})}function Zp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qg(e,t):t}function W2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function eA(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Gg=Symbol();function Hw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Gg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Kg(e,t){return typeof e=="function"?e(...t):!!e}function tA(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 ju=(()=>{let e=()=>K2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Vp(){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 nA=G2;function rA(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=nA;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 Ut=rA(),Ts,pi,Rs,zw,aA=(zw=class extends wl{constructor(){super();we(this,Ts,!0);we(this,pi);we(this,Rs);ge(this,Rs,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(){M(this,pi)||this.setEventListener(M(this,Rs))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,pi))==null||t.call(this),ge(this,pi,void 0))}setEventListener(t){var n;ge(this,Rs,t),(n=M(this,pi))==null||n.call(this),ge(this,pi,t(this.setOnline.bind(this)))}setOnline(t){M(this,Ts)!==t&&(ge(this,Ts,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return M(this,Ts)}},Ts=new WeakMap,pi=new WeakMap,Rs=new WeakMap,zw),Qd=new aA;function iA(e){return Math.min(1e3*2**e,3e4)}function Zw(e){return(e??"online")==="online"?Qd.isOnline():!0}var Qp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vw(e){let t=!1,n=0,a;const l=Vp(),o=()=>l.status!=="pending",c=j=>{var C;if(!o()){const E=new Qp(j);b(E),(C=e.onCancel)==null||C.call(e,E)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Zg.isFocused()&&(e.networkMode==="always"||Qd.isOnline())&&e.canRun(),y=()=>Zw(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},S=()=>new Promise(j=>{var C;a=E=>{(o()||h())&&j(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const C=n===0?e.initialPromise:void 0;try{j=C??e.fn()}catch(E){j=Promise.reject(E)}Promise.resolve(j).then(g).catch(E=>{var z;if(o())return;const A=e.retry??(ju.isServer()?0:3),O=e.retryDelay??iA,L=typeof O=="function"?O(n,E):O,D=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,E);if(t||!D){b(E);return}n++,(z=e.onFail)==null||z.call(e,n,E),J2(L).then(()=>h()?void 0:S()).then(()=>{t?b(E):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():S().then(k),l)}}var ll,Ow,Qw=(Ow=class{constructor(){we(this,ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qp(this.gcTime)&&ge(this,ll,al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ju.isServer()?1/0:300*1e3))}clearGcTimeout(){M(this,ll)&&(al.clearTimeout(M(this,ll)),ge(this,ll,void 0))}},ll=new WeakMap,Ow),sl,zs,Sr,ol,un,Du,ul,lr,Gw,xa,Dw,lA=(Dw=class extends Qw{constructor(t){super();we(this,lr);we(this,sl);we(this,zs);we(this,Sr);we(this,ol);we(this,un);we(this,Du);we(this,ul);ge(this,ul,!1),ge(this,Du,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,ol,t.client),ge(this,Sr,M(this,ol).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,sl,u1(this.options)),this.state=t.state??M(this,sl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,un))==null?void 0:t.promise}setOptions(t){if(this.options={...M(this,Du),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=u1(this.options);n.data!==void 0&&(this.setState(o1(n.data,n.dataUpdatedAt)),ge(this,sl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,Sr).remove(this)}setData(t,n){const a=Zp(this.state.data,t,this.options);return De(this,lr,xa).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){De(this,lr,xa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=M(this,un))==null?void 0:a.promise;return(l=M(this,un))==null||l.cancel(t),n?n.then(En).catch(En):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return M(this,sl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ji(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:!qw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,un))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,un))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,Sr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,un)&&(M(this,ul)||De(this,lr,Gw).call(this)?M(this,un).cancel({revert:!0}):M(this,un).cancelRetry()),this.scheduleGc()),M(this,Sr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,lr,xa).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,S,k,j,C,E,A,O;if(this.state.fetchStatus!=="idle"&&((m=M(this,un))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,un))return M(this,un).continueRetry(),M(this,un).promise}if(t&&this.setOptions(t),!this.options.queryFn){const L=this.observers.find(D=>D.options.queryFn);L&&this.setOptions(L.options)}const a=new AbortController,l=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(ge(this,ul,!0),a.signal)})},o=()=>{const L=Hw(this.options,n),z=(()=>{const I={client:M(this,ol),queryKey:this.queryKey,meta:this.meta};return l(I),I})();return ge(this,ul,!1),this.options.persister?this.options.persister(L,z,this):L(z)},f=(()=>{const L={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,ol),state:this.state,fetchFn:o};return l(L),L})();(h=this.options.behavior)==null||h.onFetch(f,this),ge(this,zs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&De(this,lr,xa).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ge(this,un,Vw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:L=>{L instanceof Qp&&L.revert&&this.setState({...M(this,zs),fetchStatus:"idle"}),a.abort()},onFail:(L,D)=>{De(this,lr,xa).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{De(this,lr,xa).call(this,{type:"pause"})},onContinue:()=>{De(this,lr,xa).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const L=await M(this,un).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(S=(b=M(this,Sr).config).onSuccess)==null||S.call(b,L,this),(j=(k=M(this,Sr).config).onSettled)==null||j.call(k,L,this.state.error,this),L}catch(L){if(L instanceof Qp){if(L.silent)return M(this,un).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw De(this,lr,xa).call(this,{type:"error",error:L}),(E=(C=M(this,Sr).config).onError)==null||E.call(C,L,this),(O=(A=M(this,Sr).config).onSettled)==null||O.call(A,this.state.data,L,this),L}finally{this.scheduleGc()}}},sl=new WeakMap,zs=new WeakMap,Sr=new WeakMap,ol=new WeakMap,un=new WeakMap,Du=new WeakMap,ul=new WeakMap,lr=new WeakSet,Gw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},xa=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,...Kw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...o1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,zs,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),Ut.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),M(this,Sr).notify({query:this,type:"updated",action:t})})},Dw);function Kw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function o1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u1(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 Hn,lt,Mu,zn,cl,Os,Sa,gi,Lu,Ds,Ms,dl,fl,yi,Ls,ht,hu,Gp,Kp,Yp,Xp,Jp,Wp,eg,Yw,Mw,Yg=(Mw=class extends wl{constructor(t,n){super();we(this,ht);we(this,Hn);we(this,lt);we(this,Mu);we(this,zn);we(this,cl);we(this,Os);we(this,Sa);we(this,gi);we(this,Lu);we(this,Ds);we(this,Ms);we(this,dl);we(this,fl);we(this,yi);we(this,Ls,new Set);this.options=n,ge(this,Hn,t),ge(this,gi,null),ge(this,Sa,Vp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,lt).addObserver(this),c1(M(this,lt),this.options)?De(this,ht,hu).call(this):this.updateResult(),De(this,ht,Xp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tg(M(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tg(M(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,ht,Jp).call(this),De(this,ht,Wp).call(this),M(this,lt).removeObserver(this)}setOptions(t){const n=this.options,a=M(this,lt);if(this.options=M(this,Hn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,M(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,ht,eg).call(this),M(this,lt).setOptions(this.options),n._defaulted&&!ku(this.options,n)&&M(this,Hn).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,lt),observer:this});const l=this.hasListeners();l&&d1(M(this,lt),a,this.options,n)&&De(this,ht,hu).call(this),this.updateResult(),l&&(M(this,lt)!==a||kr(this.options.enabled,M(this,lt))!==kr(n.enabled,M(this,lt))||ji(this.options.staleTime,M(this,lt))!==ji(n.staleTime,M(this,lt)))&&De(this,ht,Gp).call(this);const o=De(this,ht,Kp).call(this);l&&(M(this,lt)!==a||kr(this.options.enabled,M(this,lt))!==kr(n.enabled,M(this,lt))||o!==M(this,yi))&&De(this,ht,Yp).call(this,o)}getOptimisticResult(t){const n=M(this,Hn).getQueryCache().build(M(this,Hn),t),a=this.createResult(n,t);return oA(this,a)&&(ge(this,zn,a),ge(this,Os,this.options),ge(this,cl,M(this,lt).state)),a}getCurrentResult(){return M(this,zn)}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&&M(this,Sa).status==="pending"&&M(this,Sa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){M(this,Ls).add(t)}getCurrentQuery(){return M(this,lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=M(this,Hn).defaultQueryOptions(t),a=M(this,Hn).getQueryCache().build(M(this,Hn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return De(this,ht,hu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,zn)))}createResult(t,n){var Y;const a=M(this,lt),l=this.options,o=M(this,zn),c=M(this,cl),f=M(this,Os),h=t!==a?t.state:M(this,Mu),{state:y}=t;let g={...y},b=!1,S;if(n._optimisticResults){const $=this.hasListeners(),te=!$&&c1(t,n),J=$&&d1(t,a,n,l);(te||J)&&(g={...g,...Kw(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:C}=g;S=g.data;let E=!1;if(n.placeholderData!==void 0&&S===void 0&&C==="pending"){let $;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?($=o.data,E=!0):$=typeof n.placeholderData=="function"?n.placeholderData((Y=M(this,Ms))==null?void 0:Y.state.data,M(this,Ms)):n.placeholderData,$!==void 0&&(C="success",S=Zp(o==null?void 0:o.data,$,n),b=!0)}if(n.select&&S!==void 0&&!E)if(o&&S===(c==null?void 0:c.data)&&n.select===M(this,Lu))S=M(this,Ds);else try{ge(this,Lu,n.select),S=n.select(S),S=Zp(o==null?void 0:o.data,S,n),ge(this,Ds,S),ge(this,gi,null)}catch($){ge(this,gi,$)}M(this,gi)&&(k=M(this,gi),S=M(this,Ds),j=Date.now(),C="error");const A=g.fetchStatus==="fetching",O=C==="pending",L=C==="error",D=O&&A,z=S!==void 0,F={status:C,fetchStatus:g.fetchStatus,isPending:O,isSuccess:C==="success",isError:L,isInitialLoading:D,isLoading:D,data:S,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:A,isRefetching:A&&!O,isLoadingError:L&&!z,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:L&&z,isStale:Xg(t,n),refetch:this.refetch,promise:M(this,Sa),isEnabled:kr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=F.data!==void 0,te=F.status==="error"&&!$,J=ie=>{te?ie.reject(F.error):$&&ie.resolve(F.data)},be=()=>{const ie=ge(this,Sa,F.promise=Vp());J(ie)},fe=M(this,Sa);switch(fe.status){case"pending":t.queryHash===a.queryHash&&J(fe);break;case"fulfilled":(te||F.data!==fe.value)&&be();break;case"rejected":(!te||F.error!==fe.reason)&&be();break}}return F}updateResult(){const t=M(this,zn),n=this.createResult(M(this,lt),this.options);if(ge(this,cl,M(this,lt).state),ge(this,Os,this.options),M(this,cl).data!==void 0&&ge(this,Ms,M(this,lt)),ku(n,t))return;ge(this,zn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!M(this,Ls).size)return!0;const c=new Set(o??M(this,Ls));return this.options.throwOnError&&c.add("error"),Object.keys(M(this,zn)).some(f=>{const m=f;return M(this,zn)[m]!==t[m]&&c.has(m)})};De(this,ht,Yw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,ht,Xp).call(this)}},Hn=new WeakMap,lt=new WeakMap,Mu=new WeakMap,zn=new WeakMap,cl=new WeakMap,Os=new WeakMap,Sa=new WeakMap,gi=new WeakMap,Lu=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,dl=new WeakMap,fl=new WeakMap,yi=new WeakMap,Ls=new WeakMap,ht=new WeakSet,hu=function(t){De(this,ht,eg).call(this);let n=M(this,lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(En)),n},Gp=function(){De(this,ht,Jp).call(this);const t=ji(this.options.staleTime,M(this,lt));if(ju.isServer()||M(this,zn).isStale||!qp(t))return;const a=qw(M(this,zn).dataUpdatedAt,t)+1;ge(this,dl,al.setTimeout(()=>{M(this,zn).isStale||this.updateResult()},a))},Kp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,lt)):this.options.refetchInterval)??!1},Yp=function(t){De(this,ht,Wp).call(this),ge(this,yi,t),!(ju.isServer()||kr(this.options.enabled,M(this,lt))===!1||!qp(M(this,yi))||M(this,yi)===0)&&ge(this,fl,al.setInterval(()=>{(this.options.refetchIntervalInBackground||Zg.isFocused())&&De(this,ht,hu).call(this)},M(this,yi)))},Xp=function(){De(this,ht,Gp).call(this),De(this,ht,Yp).call(this,De(this,ht,Kp).call(this))},Jp=function(){M(this,dl)&&(al.clearTimeout(M(this,dl)),ge(this,dl,void 0))},Wp=function(){M(this,fl)&&(al.clearInterval(M(this,fl)),ge(this,fl,void 0))},eg=function(){const t=M(this,Hn).getQueryCache().build(M(this,Hn),this.options);if(t===M(this,lt))return;const n=M(this,lt);ge(this,lt,t),ge(this,Mu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Yw=function(t){Ut.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(M(this,zn))}),M(this,Hn).getQueryCache().notify({query:M(this,lt),type:"observerResultsUpdated"})})},Mw);function sA(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function c1(e,t){return sA(e,t)||e.state.data!==void 0&&tg(e,t,t.refetchOnMount)}function tg(e,t,n){if(kr(t.enabled,e)!==!1&&ji(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Xg(e,t)}return!1}function d1(e,t,n,a){return(e!==t||kr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Xg(e,n)}function Xg(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function oA(e,t){return!ku(e.getCurrentResult(),t)}function f1(e){return{onFetch:(t,n)=>{var y,g,b,S,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=((S=t.state.data)==null?void 0:S.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const C=O=>{tA(O,()=>t.signal,()=>j=!0)},E=Hw(t.options,t.fetchOptions),A=async(O,L,D)=>{if(j)return Promise.reject();if(L==null&&O.pages.length)return Promise.resolve(O);const I=(()=>{const te={client:t.client,queryKey:t.queryKey,pageParam:L,direction:D?"backward":"forward",meta:t.options.meta};return C(te),te})(),F=await E(I),{maxPages:Y}=t.options,$=D?eA:W2;return{pages:$(O.pages,F,Y),pageParams:$(O.pageParams,L,Y)}};if(l&&o.length){const O=l==="backward",L=O?uA:h1,D={pages:o,pageParams:c},z=L(a,D);f=await A(D,z,O)}else{const O=e??o.length;do{const L=m===0?c[0]??a.initialPageParam:h1(a,f);if(m>0&&L==null)break;f=await A(f,L),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,C;return(C=(j=t.options).persister)==null?void 0:C.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function h1(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 uA(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 Iu,qr,jn,hl,Hr,ci,Lw,cA=(Lw=class extends Qw{constructor(t){super();we(this,Hr);we(this,Iu);we(this,qr);we(this,jn);we(this,hl);ge(this,Iu,t.client),this.mutationId=t.mutationId,ge(this,jn,t.mutationCache),ge(this,qr,[]),this.state=t.state||Xw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,qr).includes(t)||(M(this,qr).push(t),this.clearGcTimeout(),M(this,jn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,qr,M(this,qr).filter(n=>n!==t)),this.scheduleGc(),M(this,jn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,qr).length||(this.state.status==="pending"?this.scheduleGc():M(this,jn).remove(this))}continue(){var t;return((t=M(this,hl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,S,k,j,C,E,A,O,L,D,z,I;const n=()=>{De(this,Hr,ci).call(this,{type:"continue"})},a={client:M(this,Iu),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,hl,Vw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(F,Y)=>{De(this,Hr,ci).call(this,{type:"failed",failureCount:F,error:Y})},onPause:()=>{De(this,Hr,ci).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,jn).canRun(this)}));const l=this.state.status==="pending",o=!M(this,hl).canStart();try{if(l)n();else{De(this,Hr,ci).call(this,{type:"pending",variables:t,isPaused:o}),M(this,jn).config.onMutate&&await M(this,jn).config.onMutate(t,this,a);const Y=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));Y!==this.state.context&&De(this,Hr,ci).call(this,{type:"pending",context:Y,variables:t,isPaused:o})}const F=await M(this,hl).start();return await((h=(m=M(this,jn).config).onSuccess)==null?void 0:h.call(m,F,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,F,t,this.state.context,a)),await((S=(b=M(this,jn).config).onSettled)==null?void 0:S.call(b,F,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,F,null,t,this.state.context,a)),De(this,Hr,ci).call(this,{type:"success",data:F}),F}catch(F){try{await((E=(C=M(this,jn).config).onError)==null?void 0:E.call(C,F,t,this.state.context,this,a))}catch(Y){Promise.reject(Y)}try{await((O=(A=this.options).onError)==null?void 0:O.call(A,F,t,this.state.context,a))}catch(Y){Promise.reject(Y)}try{await((D=(L=M(this,jn).config).onSettled)==null?void 0:D.call(L,void 0,F,this.state.variables,this.state.context,this,a))}catch(Y){Promise.reject(Y)}try{await((I=(z=this.options).onSettled)==null?void 0:I.call(z,void 0,F,t,this.state.context,a))}catch(Y){Promise.reject(Y)}throw De(this,Hr,ci).call(this,{type:"error",error:F}),F}finally{M(this,jn).runNext(this)}}},Iu=new WeakMap,qr=new WeakMap,jn=new WeakMap,hl=new WeakMap,Hr=new WeakSet,ci=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),Ut.batch(()=>{M(this,qr).forEach(a=>{a.onMutationUpdate(t)}),M(this,jn).notify({mutation:this,type:"updated",action:t})})},Lw);function Xw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wa,Dr,Uu,Iw,dA=(Iw=class extends wl{constructor(t={}){super();we(this,wa);we(this,Dr);we(this,Uu);this.config=t,ge(this,wa,new Set),ge(this,Dr,new Map),ge(this,Uu,0)}build(t,n,a){const l=new cA({client:t,mutationCache:this,mutationId:++yd(this,Uu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){M(this,wa).add(t);const n=vd(t);if(typeof n=="string"){const a=M(this,Dr).get(n);a?a.push(t):M(this,Dr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,wa).delete(t)){const n=vd(t);if(typeof n=="string"){const a=M(this,Dr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&M(this,Dr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vd(t);if(typeof n=="string"){const a=M(this,Dr).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=vd(t);if(typeof n=="string"){const l=(a=M(this,Dr).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(){Ut.batch(()=>{M(this,wa).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,wa).clear(),M(this,Dr).clear()})}getAll(){return Array.from(M(this,wa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>i1(n,a))}findAll(t={}){return this.getAll().filter(n=>i1(t,n))}notify(t){Ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ut.batch(()=>Promise.all(t.map(n=>n.continue().catch(En))))}},wa=new WeakMap,Dr=new WeakMap,Uu=new WeakMap,Iw);function vd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ka,vi,Zn,ja,Ea,Ud,ng,Uw,fA=(Uw=class extends wl{constructor(n,a){super();we(this,Ea);we(this,ka);we(this,vi);we(this,Zn);we(this,ja);ge(this,ka,n),this.setOptions(a),this.bindMethods(),De(this,Ea,Ud).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=M(this,ka).defaultMutationOptions(n),ku(this.options,a)||M(this,ka).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,Zn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ml(a.mutationKey)!==ml(this.options.mutationKey)?this.reset():((l=M(this,Zn))==null?void 0:l.state.status)==="pending"&&M(this,Zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=M(this,Zn))==null||n.removeObserver(this)}onMutationUpdate(n){De(this,Ea,Ud).call(this),De(this,Ea,ng).call(this,n)}getCurrentResult(){return M(this,vi)}reset(){var n;(n=M(this,Zn))==null||n.removeObserver(this),ge(this,Zn,void 0),De(this,Ea,Ud).call(this),De(this,Ea,ng).call(this)}mutate(n,a){var l;return ge(this,ja,a),(l=M(this,Zn))==null||l.removeObserver(this),ge(this,Zn,M(this,ka).getMutationCache().build(M(this,ka),this.options)),M(this,Zn).addObserver(this),M(this,Zn).execute(n)}},ka=new WeakMap,vi=new WeakMap,Zn=new WeakMap,ja=new WeakMap,Ea=new WeakSet,Ud=function(){var a;const n=((a=M(this,Zn))==null?void 0:a.state)??Xw();ge(this,vi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ng=function(n){Ut.batch(()=>{var a,l,o,c,f,m,h,y;if(M(this,ja)&&this.hasListeners()){const g=M(this,vi).variables,b=M(this,vi).context,S={client:M(this,ka),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=M(this,ja)).onSuccess)==null||l.call(a,n.data,g,b,S)}catch(k){Promise.reject(k)}try{(c=(o=M(this,ja)).onSettled)==null||c.call(o,n.data,null,g,b,S)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=M(this,ja)).onError)==null||m.call(f,n.error,g,b,S)}catch(k){Promise.reject(k)}try{(y=(h=M(this,ja)).onSettled)==null||y.call(h,void 0,n.error,g,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(M(this,vi))})})},Uw);function m1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function hA(e,t,n){const a=e.slice(0);return a[t]=n,a}var Is,ir,Us,Ps,wr,bi,Pu,Bu,$u,Fu,Sn,rg,ag,ig,lg,sg,Pw,mA=(Pw=class extends wl{constructor(t,n,a){super();we(this,Sn);we(this,Is);we(this,ir);we(this,Us);we(this,Ps);we(this,wr);we(this,bi);we(this,Pu);we(this,Bu);we(this,$u);we(this,Fu,[]);ge(this,Is,t),ge(this,Ps,a),ge(this,Us,[]),ge(this,wr,[]),ge(this,ir,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&M(this,wr).forEach(t=>{t.subscribe(n=>{De(this,Sn,lg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,M(this,wr).forEach(t=>{t.destroy()})}setQueries(t,n){ge(this,Us,t),ge(this,Ps,n),Ut.batch(()=>{const a=M(this,wr),l=De(this,Sn,ig).call(this,M(this,Us));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 S=M(this,ir)[b];return!S||!ku(g,S)});!h&&!y||(h&&(ge(this,Fu,l),ge(this,wr,o)),ge(this,ir,c),this.hasListeners()&&(h&&(m1(a,o).forEach(g=>{g.destroy()}),m1(o,a).forEach(g=>{g.subscribe(b=>{De(this,Sn,lg).call(this,g,b)})})),De(this,Sn,sg).call(this)))})}getCurrentResult(){return M(this,ir)}getQueries(){return M(this,wr).map(t=>t.getCurrentQuery())}getObservers(){return M(this,wr)}getOptimisticResult(t,n){const a=De(this,Sn,ig).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>De(this,Sn,ag).call(this,c??l,n,o),()=>De(this,Sn,rg).call(this,l,a)]}},Is=new WeakMap,ir=new WeakMap,Us=new WeakMap,Ps=new WeakMap,wr=new WeakMap,bi=new WeakMap,Pu=new WeakMap,Bu=new WeakMap,$u=new WeakMap,Fu=new WeakMap,Sn=new WeakSet,rg=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)})})})},ag=function(t,n,a){if(n){const l=M(this,$u),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!M(this,bi)||M(this,ir)!==M(this,Bu)||o||n!==M(this,Pu))&&(ge(this,Pu,n),ge(this,Bu,M(this,ir)),a!==void 0&&ge(this,$u,a),ge(this,bi,Qg(M(this,bi),n(t)))),M(this,bi)}return t},ig=function(t){const n=new Map;M(this,wr).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=M(this,Is).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new Yg(M(this,Is),o);a.push({defaultedQueryOptions:o,observer:f})}),a},lg=function(t,n){const a=M(this,wr).indexOf(t);a!==-1&&(ge(this,ir,hA(M(this,ir),a,n)),De(this,Sn,sg).call(this))},sg=function(){var t;if(this.hasListeners()){const n=M(this,bi),a=De(this,Sn,rg).call(this,M(this,ir),M(this,Fu)),l=De(this,Sn,ag).call(this,a,(t=M(this,Ps))==null?void 0:t.combine);n!==l&&Ut.batch(()=>{this.listeners.forEach(o=>{o(M(this,ir))})})}},Pw),Zr,Bw,pA=(Bw=class extends wl{constructor(t={}){super();we(this,Zr);this.config=t,ge(this,Zr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Vg(l,n);let c=this.get(o);return c||(c=new lA({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){M(this,Zr).has(t.queryHash)||(M(this,Zr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,Zr).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,Zr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,Zr).get(t)}getAll(){return[...M(this,Zr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>a1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>a1(t,a)):n}notify(t){Ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zr=new WeakMap,Bw),It,xi,Si,Bs,$s,wi,Fs,qs,$w,gA=($w=class{constructor(e={}){we(this,It);we(this,xi);we(this,Si);we(this,Bs);we(this,$s);we(this,wi);we(this,Fs);we(this,qs);ge(this,It,e.queryCache||new pA),ge(this,xi,e.mutationCache||new dA),ge(this,Si,e.defaultOptions||{}),ge(this,Bs,new Map),ge(this,$s,new Map),ge(this,wi,0)}mount(){yd(this,wi)._++,M(this,wi)===1&&(ge(this,Fs,Zg.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,It).onFocus())})),ge(this,qs,Qd.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,It).onOnline())})))}unmount(){var e,t;yd(this,wi)._--,M(this,wi)===0&&((e=M(this,Fs))==null||e.call(this),ge(this,Fs,void 0),(t=M(this,qs))==null||t.call(this),ge(this,qs,void 0))}isFetching(e){return M(this,It).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,xi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,It).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,It).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ji(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return M(this,It).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=M(this,It).get(a.queryHash),o=l==null?void 0:l.state.data,c=Y2(t,o);if(c!==void 0)return M(this,It).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Ut.batch(()=>M(this,It).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,It).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,It);Ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,It);return Ut.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Ut.batch(()=>M(this,It).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(En).catch(En)}invalidateQueries(e,t={}){return Ut.batch(()=>(M(this,It).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=Ut.batch(()=>M(this,It).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(En)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(En)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,It).build(this,t);return n.isStaleByTime(ji(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(En).catch(En)}fetchInfiniteQuery(e){return e.behavior=f1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(En).catch(En)}ensureInfiniteQueryData(e){return e.behavior=f1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qd.isOnline()?M(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,It)}getMutationCache(){return M(this,xi)}getDefaultOptions(){return M(this,Si)}setDefaultOptions(e){ge(this,Si,e)}setQueryDefaults(e,t){M(this,Bs).set(ml(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Bs).values()],n={};return t.forEach(a=>{wu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){M(this,$s).set(ml(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,$s).values()],n={};return t.forEach(a=>{wu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vg(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===Gg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,It).clear(),M(this,xi).clear()}},It=new WeakMap,xi=new WeakMap,Si=new WeakMap,Bs=new WeakMap,$s=new WeakMap,wi=new WeakMap,Fs=new WeakMap,qs=new WeakMap,$w),Jw=x.createContext(void 0),_n=e=>{const t=x.useContext(Jw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yA=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Jw.Provider,{value:e,children:t})),Ww=x.createContext(!1),ek=()=>x.useContext(Ww);Ww.Provider;function vA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bA=x.createContext(vA()),tk=()=>x.useContext(bA),nk=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Kg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},rk=e=>{x.useEffect(()=>{e.clearReset()},[e])},ak=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Kg(n,[e.error,a])),ik=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))}},xA=(e,t)=>e.isLoading&&e.isFetching&&!t,og=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ug=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function SA({queries:e,...t},n){const a=_n(),l=ek(),o=tk(),c=x.useMemo(()=>e.map(j=>{const C=a.defaultQueryOptions(j);return C._optimisticResults=l?"isRestoring":"optimistic",C}),[e,a,l]);c.forEach(j=>{ik(j);const C=a.getQueryCache().get(j.queryHash);nk(j,o,C)}),rk(o);const[f]=x.useState(()=>new mA(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Ut.batchCalls(j)):En,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const S=m.some((j,C)=>og(c[C],j))?m.flatMap((j,C)=>{const E=c[C];if(E&&og(E,j)){const A=new Yg(a,E);return ug(E,A,o)}return[]}):[];if(S.length>0)throw Promise.all(S);const k=m.find((j,C)=>{const E=c[C];return E&&ak({result:j,errorResetBoundary:o,throwOnError:E.throwOnError,query:a.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function wA(e,t,n){var b,S,k,j;const a=ek(),l=tk(),o=_n(),c=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",ik(c),nk(c,l,f),rk(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(C=>{const E=g?h.subscribe(Ut.batchCalls(C)):En;return h.updateResult(),E},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),og(c,y))throw ug(c,h,l);if(ak({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&&!ju.isServer()&&xA(y,a)){const C=m?ug(c,h,l):f==null?void 0:f.promise;C==null||C.catch(En).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function He(e,t){return wA(e,Yg)}function gt(e,t){const n=_n(),[a]=x.useState(()=>new fA(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Ut.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(En)},[a]);if(l.error&&Kg(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 p1="popstate";function g1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function kA(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 cg("",{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:Cu(l)}return CA(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jA(){return Math.random().toString(36).substring(2,10)}function y1(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 cg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Js(t):t,state:n,key:t&&t.key||a||jA(),unstable_mask:l}}function Cu({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 Js(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 CA(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 C=y(),E=C==null?null:C-h;h=C,m&&m({action:f,location:j.location,delta:E})}function b(C,E){f="PUSH";let A=g1(C)?C:cg(j.location,C,E);h=y()+1;let O=y1(A,h),L=j.createHref(A.unstable_mask||A);try{c.pushState(O,"",L)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(L)}o&&m&&m({action:f,location:j.location,delta:1})}function S(C,E){f="REPLACE";let A=g1(C)?C:cg(j.location,C,E);h=y();let O=y1(A,h),L=j.createHref(A.unstable_mask||A);c.replaceState(O,"",L),o&&m&&m({action:f,location:j.location,delta:0})}function k(C){return EA(C)}let j={get action(){return f},get location(){return e(l,c)},listen(C){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(p1,g),m=C,()=>{l.removeEventListener(p1,g),m=null}},createHref(C){return t(l,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:S,go(C){return c.go(C)}};return j}function EA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Cu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function lk(e,t,n="/"){return NA(e,t,n,!1)}function NA(e,t,n,a){let l=typeof t=="string"?Js(t):t,o=Na(l.pathname||"/",n);if(o==null)return null;let c=sk(e);_A(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=PA(o);f=IA(c[m],h,a)}return f}function sk(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;At(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=Gr([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(At(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),sk(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:MA(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 ok(c.path))o(c,f,!0,h)}),t}function ok(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=ok(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 _A(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LA(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var AA=/^:[\w-]+$/,TA=3,RA=2,zA=1,OA=10,DA=-2,v1=e=>e==="*";function MA(e,t){let n=e.split("/"),a=n.length;return n.some(v1)&&(a+=DA),t&&(a+=RA),n.filter(l=>!v1(l)).reduce((l,o)=>l+(AA.test(o)?TA:o===""?zA:OA),a)}function LA(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 IA(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:Gr([o,g.pathname]),pathnameBase:qA(Gr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=Gr([o,g.pathnameBase]))}return c}function Gd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=UA(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 S=f[b];return g&&!S?h[y]=void 0:h[y]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function UA(e,t=!1,n=!0){Cr(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 PA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cr(!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 Na(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 BA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $A(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Js(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=b1(n.substring(1),"/"):o=b1(n,t)):o=t,{pathname:o,search:HA(a),hash:ZA(l)}}function b1(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 FA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jg(e){let t=FA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function ff(e,t,n,a=!1){let l;typeof e=="string"?l=Js(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),np("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),np("#","pathname","hash",l)),At(!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=$A(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Gr=e=>e.join("/").replace(/\/\/+/g,"/"),qA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),HA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,VA=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 QA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function GA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var uk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ck(e,t){let n=e;if(typeof n!="string"||!BA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(uk)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Na(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{Cr(!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 dk=["POST","PUT","PATCH","DELETE"];new Set(dk);var KA=["GET",...dk];new Set(KA);var Ws=x.createContext(null);Ws.displayName="DataRouter";var hf=x.createContext(null);hf.displayName="DataRouterState";var YA=x.createContext(!1),fk=x.createContext({isTransitioning:!1});fk.displayName="ViewTransition";var XA=x.createContext(new Map);XA.displayName="Fetchers";var JA=x.createContext(null);JA.displayName="Await";var ur=x.createContext(null);ur.displayName="Navigation";var qu=x.createContext(null);qu.displayName="Location";var Er=x.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var Wg=x.createContext(null);Wg.displayName="RouteError";var hk="REACT_ROUTER_ERROR",WA="REDIRECT",eT="ROUTE_ERROR_RESPONSE";function tT(e){if(e.startsWith(`${hk}:${WA}:{`))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 nT(e){if(e.startsWith(`${hk}:${eT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new VA(t.status,t.statusText,t.data)}catch{}}function rT(e,{relative:t}={}){At(eo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(ur),{hash:l,pathname:o,search:c}=Hu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Gr([n,o])),a.createHref({pathname:f,search:c,hash:l})}function eo(){return x.useContext(qu)!=null}function Dn(){return At(eo(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(qu).location}var mk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pk(e){x.useContext(ur).static||x.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=x.useContext(Er);return e?vT():aT()}function aT(){At(eo(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ws),{basename:t,navigator:n}=x.useContext(ur),{matches:a}=x.useContext(Er),{pathname:l}=Dn(),o=JSON.stringify(Jg(a)),c=x.useRef(!1);return pk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Cr(c.current,mk),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=ff(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Gr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var iT=x.createContext(null);function lT(e){let t=x.useContext(Er).outlet;return x.useMemo(()=>t&&x.createElement(iT.Provider,{value:e},t),[t,e])}function gk(){let{matches:e}=x.useContext(Er),t=e[e.length-1];return t?t.params:{}}function Hu(e,{relative:t}={}){let{matches:n}=x.useContext(Er),{pathname:a}=Dn(),l=JSON.stringify(Jg(n));return x.useMemo(()=>ff(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function sT(e,t){return yk(e,t)}function yk(e,t,n){var C;At(eo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(ur),{matches:l}=x.useContext(Er),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";bk(f,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Dn(),g;if(t){let E=typeof t=="string"?Js(t):t;At(m==="/"||((C=E.pathname)==null?void 0:C.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 "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=y;let b=g.pathname||"/",S=b;if(m!=="/"){let E=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=lk(e,{pathname:S});Cr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Cr(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=fT(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:Gr([m,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Gr([m,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.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 oT(){let e=yT(),t=QA(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 uT=x.createElement(oT,null),vk=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=nT(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Er.Provider,{value:this.props.routeContext},x.createElement(Wg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(cT,{error:e},t):t}};vk.contextType=YA;var rp=new WeakMap;function cT({children:e,error:t}){let{basename:n}=x.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=tT(t.digest);if(a){let l=rp.get(t);if(l)throw l;let o=ck(a.location,n);if(uk&&!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 dT({routeContext:e,match:t,children:n}){let a=x.useContext(Ws);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Er.Provider,{value:e},n)}function fT(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);At(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:S}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!S||S[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,S;m(y,{location:a.location,params:((S=(b=a.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:GA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let S,k=!1,j=null,C=null;a&&(S=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||uT,c&&(f<0&&b===0?(bk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,C=null):f===b&&(k=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,b+1)),A=()=>{let O;return S?O=j:k?O=C:g.route.Component?O=x.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,x.createElement(dT,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(vk,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):A()},null)}function ey(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hT(e){let t=x.useContext(Ws);return At(t,ey(e)),t}function mT(e){let t=x.useContext(hf);return At(t,ey(e)),t}function pT(e){let t=x.useContext(Er);return At(t,ey(e)),t}function ty(e){let t=pT(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function gT(){return ty("useRouteId")}function yT(){var a;let e=x.useContext(Wg),t=mT("useRouteError"),n=ty("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function vT(){let{router:e}=hT("useNavigate"),t=ty("useNavigate"),n=x.useRef(!1);return pk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Cr(n.current,mk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var x1={};function bk(e,t,n){!t&&!x1[e]&&(x1[e]=!0,Cr(!1,n))}x.memo(bT);function bT({routes:e,future:t,state:n,isStatic:a,onError:l}){return yk(e,void 0,{state:n,isStatic:a,onError:l})}function mf({to:e,replace:t,state:n,relative:a}){At(eo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(ur);Cr(!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(Er),{pathname:c}=Dn(),f=wn(),m=ff(e,Jg(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 dg(e){return lT(e.context)}function rr(e){At(!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 xT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){At(!eo(),"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=Js(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let C=Na(h,f);return C==null?null:{location:{pathname:C,search:y,hash:g,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,y,g,b,S,a,k]);return Cr(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(ur.Provider,{value:m},x.createElement(qu.Provider,{children:t,value:j}))}function ST({children:e,location:t}){return sT(fg(e),t)}function fg(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,fg(a.props.children,o));return}At(a.type===rr,`[${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>`),At(!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=fg(a.props.children,o)),n.push(c)}),n}var Pd="get",Bd="application/x-www-form-urlencoded";function pf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wT(e){return pf(e)&&e.tagName.toLowerCase()==="button"}function kT(e){return pf(e)&&e.tagName.toLowerCase()==="form"}function jT(e){return pf(e)&&e.tagName.toLowerCase()==="input"}function CT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ET(e,t){return e.button===0&&(!t||t==="_self")&&!CT(e)}function hg(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 NT(e,t){let n=hg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var bd=null;function _T(){if(bd===null)try{new FormData(document.createElement("form"),0),bd=!1}catch{bd=!0}return bd}var AT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ap(e){return e!=null&&!AT.has(e)?(Cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bd}"`),null):e}function TT(e,t){let n,a,l,o,c;if(kT(e)){let f=e.getAttribute("action");a=f?Na(f,t):null,n=e.getAttribute("method")||Pd,l=ap(e.getAttribute("enctype"))||Bd,o=new FormData(e)}else if(wT(e)||jT(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?Na(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Pd,l=ap(e.getAttribute("formenctype"))||ap(f.getAttribute("enctype"))||Bd,o=new FormData(f,e),!_T()){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(pf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Pd,a=null,l=Bd,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 ny(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RT(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&&Na(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function zT(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 OT(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 DT(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await zT(o,n);return c.links?c.links():[]}return[]}));return UT(a.flat(1).filter(OT).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function S1(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 MT(e,t,{includeHydrateFallback:n}={}){return LT(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 LT(e){return[...new Set(e)]}function IT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function UT(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(IT(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function xk(){let e=x.useContext(Ws);return ny(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function PT(){let e=x.useContext(hf);return ny(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ry=x.createContext(void 0);ry.displayName="FrameworkContext";function Sk(){let e=x.useContext(ry);return ny(e,"You must render this element inside a <HydratedRouter> element"),e}function BT(e,t){let n=x.useContext(ry),[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=E=>{E.forEach(A=>{c(A.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:au(f,S),onBlur:au(m,k),onMouseEnter:au(h,S),onMouseLeave:au(y,k),onTouchStart:au(g,S)}]:[!1,b,{}]}function au(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function $T({page:e,...t}){let{router:n}=xk(),a=x.useMemo(()=>lk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(qT,{page:e,matches:a,...t}):null}function FT(e){let{manifest:t,routeModules:n}=Sk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return DT(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function qT({page:e,matches:t,...n}){let a=Dn(),{future:l,manifest:o,routeModules:c}=Sk(),{basename:f}=xk(),{loaderData:m,matches:h}=PT(),y=x.useMemo(()=>S1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>S1(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,C=!1;if(t.forEach(A=>{var L;let O=o.routes[A.route.id];!O||!O.hasLoader||(!y.some(D=>D.route.id===A.route.id)&&A.route.id in m&&((L=c[A.route.id])!=null&&L.shouldRevalidate)||O.hasClientLoader?C=!0:j.add(A.route.id))}),j.size===0)return[];let E=RT(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&E.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[E.pathname+E.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),S=x.useMemo(()=>MT(g,o),[g,o]),k=FT(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:C})=>x.createElement("link",{key:j,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function HT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ZT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ZT&&(window.__reactRouterVersion="7.13.1")}catch{}function VT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=kA({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(xT,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var wk=/^(?:[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:S,...k},j){let{basename:C,navigator:E,unstable_useTransitions:A}=x.useContext(ur),O=typeof y=="string"&&wk.test(y),L=ck(y,C);y=L.to;let D=rT(y,{relative:l}),z=Dn(),I=null;if(f){let ie=ff(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);C!=="/"&&(ie.pathname=ie.pathname==="/"?C:Gr([C,ie.pathname])),I=E.createHref(ie)}let[F,Y,$]=BT(a,k),te=KT(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function J(ie){t&&t(ie),ie.defaultPrevented||te(ie)}let be=!(L.isExternal||o),fe=x.createElement("a",{...k,...$,href:(be?I:void 0)||L.absoluteURL||D,onClick:be?J:t,ref:HT(j,Y),target:h,"data-discover":!O&&n==="render"?"true":void 0});return F&&!O?x.createElement(x.Fragment,null,fe,x.createElement($T,{page:D})):fe});Zu.displayName="Link";var kk=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=Dn(),S=x.useContext(hf),{navigator:k,basename:j}=x.useContext(ur),C=S!=null&&eR(g)&&f===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,A=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(A=A.toLowerCase(),O=O?O.toLowerCase():null,E=E.toLowerCase()),O&&j&&(O=Na(O,j)||O);const L=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=A===E||!l&&A.startsWith(E)&&A.charAt(L)==="/",z=O!=null&&(O===E||!l&&O.startsWith(E)&&O.charAt(E.length)==="/"),I={isActive:D,isPending:z,isTransitioning:C},F=D?t:void 0,Y;typeof a=="function"?Y=a(I):Y=[a,D?"active":null,z?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let $=typeof o=="function"?o(I):o;return x.createElement(Zu,{...h,"aria-current":F,className:Y,ref:y,style:$,to:c,viewTransition:f},typeof m=="function"?m(I):m)});kk.displayName="NavLink";var QT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Pd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(ur),C=JT(),E=WT(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&wk.test(f),L=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let z=D.nativeEvent.submitter,I=(z==null?void 0:z.getAttribute("formmethod"))||c,F=()=>C(z||D.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>F()):F()};return x.createElement("form",{ref:k,method:A,action:E,onSubmit:a?m:L,...S,"data-discover":!O&&e==="render"?"true":void 0})});QT.displayName="Form";function GT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jk(e){let t=x.useContext(Ws);return At(t,GT(e)),t}function KT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=wn(),g=Dn(),b=Hu(e,{relative:c});return x.useCallback(S=>{if(ET(S,t)){S.preventDefault();let k=n!==void 0?n:Cu(g)===Cu(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 gf(e){Cr(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(hg(e)),n=x.useRef(!1),a=Dn(),l=x.useMemo(()=>NT(a.search,n.current?null:t.current),[a.search]),o=wn(),c=x.useCallback((f,m)=>{const h=hg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var YT=0,XT=()=>`__${String(++YT)}__`;function JT(){let{router:e}=jk("useSubmit"),{basename:t}=x.useContext(ur),n=gT(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=TT(o,t);if(c.navigate===!1){let b=c.fetcherKey||XT();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 WT(e,{relative:t}={}){let{basename:n}=x.useContext(ur),a=x.useContext(Er);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Hu(e||".",{relative:t})},c=Dn();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:Gr([n,o.pathname])),Cu(o)}function eR(e,{relative:t}={}){let n=x.useContext(fk);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=jk("useViewTransitionState"),l=Hu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Na(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Na(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Gd(l.pathname,c)!=null||Gd(l.pathname,o)!=null}const tR="/api/v1";async function nR(e,t){const n=await fetch(`${tR}/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 Ck="/api/v1",ay="first-tree-hub:tokens";function iy(){const e=localStorage.getItem(ay);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function mg(e){localStorage.setItem(ay,JSON.stringify(e))}function Ek(){localStorage.removeItem(ay)}class Vu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let iu=null;async function rR(e){return iu||(iu=(async()=>{try{const t=await fetch(`${Ck}/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 mg(a),a}catch{return null}finally{iu=null}})(),iu)}async function xd(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(`${Ck}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=iy();let c=await l(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await rR(o.refreshToken);f&&(c=await l(f.accessToken))}if(!c.ok){c.status===401&&(Ek(),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 ke={get:e=>xd(e),post:(e,t)=>xd(e,{method:"POST",body:t}),patch:(e,t)=>xd(e,{method:"PATCH",body:t}),delete:e=>xd(e,{method:"DELETE"})},Nk=x.createContext(null);function aR({children:e}){const[t,n]=x.useState(()=>!!iy()),[a,l]=x.useState(null),[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),[S,k]=x.useState(null),j=x.useCallback(()=>{Ek(),n(!1),l(null),c(null),m(null),y(null),b(null),k(null)},[]),C=x.useCallback(async()=>{var O;try{const L=await ke.get("/me");l(L.member.role),c(L.member.id),m(L.member.agentId),y(L.member.organizationId),b(L.user??null),k(((O=L.wizard)==null?void 0:O.step)??null)}catch{}},[]),E=x.useCallback(async(O,L)=>{const D=await nR(O,L);mg({accessToken:D.accessToken,refreshToken:D.refreshToken}),n(!0),await C()},[C]),A=x.useCallback(async O=>{mg(O),n(!0),await C()},[C]);return x.useEffect(()=>{t&&!a&&C()},[t,a,C]),x.useEffect(()=>{const O=()=>j();return window.addEventListener("auth:logout",O),()=>window.removeEventListener("auth:logout",O)},[j]),u.jsx(Nk.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,organizationId:h,user:g,wizardStep:S,login:E,adoptTokens:A,refreshMe:C,logout:j},children:e})}function ln(){const e=x.useContext(Nk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const iR="modulepreload",lR=function(e){return"/"+e},w1={},sR=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=lR(h),h in w1)return;w1[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":iR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((S,k)=>{b.addEventListener("load",S),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(()=>sR(()=>import("./index-BxQQDavm.js"),[]).then(e=>({default:e.LandingPage}))),uR=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function cR(){const{isAuthenticated:e}=ln(),t=Dn();return e?u.jsx(dg,{}):t.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(uR,{}),children:u.jsx(oR,{})}):u.jsx(mf,{to:"/login",replace:!0,state:{from:t}})}/**
|
|
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 _k=(...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 fR=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 k1=e=>{const t=fR(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 hR={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 mR=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,...hR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:_k("lucide",l),...!o&&!mR(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 rt=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(pR,{ref:o,iconNode:t,className:_k(`lucide-${dR(k1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=k1(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 gR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ly=rt("arrow-left",gR);/**
|
|
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 yR=[["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"}]],vR=rt("bell",yR);/**
|
|
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 bR=[["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"}]],xR=rt("bot",bR);/**
|
|
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 SR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_a=rt("check",SR);/**
|
|
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 wR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ak=rt("chevron-down",wR);/**
|
|
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:"m9 18 6-6-6-6",key:"mthhwq"}]],jR=rt("chevron-right",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 CR=[["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"}]],sy=rt("copy",CR);/**
|
|
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 ER=[["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"}]],NR=rt("eye-off",ER);/**
|
|
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 _R=[["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"}]],AR=rt("eye",_R);/**
|
|
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 TR=[["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"}]],Tk=rt("github",TR);/**
|
|
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 RR=[["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"}]],zR=rt("layout-dashboard",RR);/**
|
|
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 OR=[["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"}]],pg=rt("link-2",OR);/**
|
|
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 DR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],MR=rt("loader-circle",DR);/**
|
|
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 LR=[["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"}]],Rk=rt("lock",LR);/**
|
|
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 IR=[["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"}]],UR=rt("log-out",IR);/**
|
|
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 PR=[["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"}]],oy=rt("message-square",PR);/**
|
|
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 BR=[["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"}]],$R=rt("moon",BR);/**
|
|
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 FR=[["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"}]],qR=rt("paperclip",FR);/**
|
|
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 HR=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ZR=rt("pause",HR);/**
|
|
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 VR=[["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"}]],Qu=rt("pencil",VR);/**
|
|
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 QR=[["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"}]],zk=rt("play",QR);/**
|
|
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 GR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Aa=rt("plus",GR);/**
|
|
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 KR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yf=rt("search",KR);/**
|
|
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 YR=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],XR=rt("send",YR);/**
|
|
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 JR=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],WR=rt("settings",JR);/**
|
|
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 ez=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],tz=rt("sparkles",ez);/**
|
|
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 nz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],rz=rt("square",nz);/**
|
|
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 az=[["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"}]],iz=rt("sun",az);/**
|
|
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 lz=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],sz=rt("terminal",lz);/**
|
|
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 oz=[["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"}]],Hs=rt("trash-2",oz);/**
|
|
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 uz=[["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"}]],uy=rt("triangle-alert",uz);/**
|
|
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 cz=[["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"}]],dz=rt("undo-2",cz);/**
|
|
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 fz=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],hz=rt("unplug",fz);/**
|
|
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 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"}]],pz=rt("user-plus",mz);/**
|
|
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 gz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Eu=rt("x",gz);/**
|
|
276
|
+
* @license lucide-react v0.577.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const yz=[["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"}]],vz=rt("zap",yz);function Ok(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=Ok(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Dk(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Ok(e))&&(a&&(a+=" "),a+=t);return a}const bz=(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},xz=(e,t)=>({classGroupId:e,validator:t}),Mk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kd="-",j1=[],Sz="arbitrary..",wz=e=>{const t=jz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return kz(c);const f=c.split(Kd),m=f[0]===""&&f.length>1?1:0;return Lk(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?bz(h,m):m:h||j1}return n[c]||j1}}},Lk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Lk(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Kd):e.slice(t).join(Kd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},kz=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?Sz+a:void 0})(),jz=e=>{const{theme:t,classGroups:n}=e;return Cz(n,t)},Cz=(e,t)=>{const n=Mk();for(const a in e){const l=e[a];cy(l,n,a,t)}return n},cy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Ez(c,t,n,a)}},Ez=(e,t,n,a)=>{if(typeof e=="string"){Nz(e,t,n);return}if(typeof e=="function"){_z(e,t,n,a);return}Az(e,t,n,a)},Nz=(e,t,n)=>{const a=e===""?t:Ik(t,e);a.classGroupId=n},_z=(e,t,n,a)=>{if(Tz(e)){cy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(xz(n,e))},Az=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];cy(m,Ik(t,f),n,a)}},Ik=(e,t)=>{let n=e;const a=t.split(Kd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=Mk(),n.nextPart.set(c,f)),n=f}return n},Tz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Rz=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)}}},gg="!",C1=":",zz=[],E1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Oz=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 C=l[j];if(c===0&&f===0){if(C===C1){o.push(l.slice(m,j)),m=j+1;continue}if(C==="/"){h=j;continue}}C==="["?c++:C==="]"?c--:C==="("?f++:C===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,S=!1;g.endsWith(gg)?(b=g.slice(0,-1),S=!0):g.startsWith(gg)&&(b=g.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return E1(o,S,b,k)};if(t){const l=t+C1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):E1(zz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Dz=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}},Mz=e=>({cache:Rz(e.cacheSize),parseClassName:Oz(e),sortModifiers:Dz(e),...wz(e)}),Lz=/\s+/,Iz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(Lz);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let C=!!j,E=a(C?k.substring(0,j):k);if(!E){if(!C){m=y+(m.length>0?" "+m:m);continue}if(E=a(k),!E){m=y+(m.length>0?" "+m:m);continue}C=!1}const A=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=S?A+gg:A,L=O+E;if(c.indexOf(L)>-1)continue;c.push(L);const D=l(E,C);for(let z=0;z<D.length;++z){const I=D[z];c.push(O+I)}m=y+(m.length>0?" "+m:m)}return m},Uz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Uk(n))&&(l&&(l+=" "),l+=a);return l},Uk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Uk(e[a]))&&(n&&(n+=" "),n+=t);return n},Pz=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=Mz(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=Iz(m,n);return l(m,y),y};return o=c,(...m)=>o(Uz(...m))},Bz=[],nn=e=>{const t=n=>n[e]||Bz;return t.isThemeGetter=!0,t},Pk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$z=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Fz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qz=/\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$/,Hz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,si=e=>$z.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),oi=e=>!!e&&Number.isInteger(Number(e)),ip=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),ba=e=>Fz.test(e),$k=()=>!0,Qz=e=>qz.test(e)&&!Hz.test(e),dy=()=>!1,Gz=e=>Zz.test(e),Kz=e=>Vz.test(e),Yz=e=>!Ce(e)&&!Ee(e),Xz=e=>Ri(e,Hk,dy),Ce=e=>Pk.test(e),nl=e=>Ri(e,Zk,Qz),N1=e=>Ri(e,i3,Ke),Jz=e=>Ri(e,Qk,$k),Wz=e=>Ri(e,Vk,dy),_1=e=>Ri(e,Fk,dy),e3=e=>Ri(e,qk,Kz),Sd=e=>Ri(e,Gk,Gz),Ee=e=>Bk.test(e),lu=e=>kl(e,Zk),t3=e=>kl(e,Vk),A1=e=>kl(e,Fk),n3=e=>kl(e,Hk),r3=e=>kl(e,qk),wd=e=>kl(e,Gk,!0),a3=e=>kl(e,Qk,!0),Ri=(e,t,n)=>{const a=Pk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},kl=(e,t,n=!1)=>{const a=Bk.exec(e);return a?a[1]?t(a[1]):n:!1},Fk=e=>e==="position"||e==="percentage",qk=e=>e==="image"||e==="url",Hk=e=>e==="length"||e==="size"||e==="bg-size",Zk=e=>e==="length",i3=e=>e==="number",Vk=e=>e==="family-name",Qk=e=>e==="number"||e==="weight",Gk=e=>e==="shadow",l3=()=>{const e=nn("color"),t=nn("font"),n=nn("text"),a=nn("font-weight"),l=nn("tracking"),o=nn("leading"),c=nn("breakpoint"),f=nn("container"),m=nn("spacing"),h=nn("radius"),y=nn("shadow"),g=nn("inset-shadow"),b=nn("text-shadow"),S=nn("drop-shadow"),k=nn("blur"),j=nn("perspective"),C=nn("aspect"),E=nn("ease"),A=nn("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...L(),Ee,Ce],z=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],F=()=>[Ee,Ce,m],Y=()=>[si,"full","auto",...F()],$=()=>[oi,"none","subgrid",Ee,Ce],te=()=>["auto",{span:["full",oi,Ee,Ce]},oi,Ee,Ce],J=()=>[oi,"auto",Ee,Ce],be=()=>["auto","min","max","fr",Ee,Ce],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...F()],ae=()=>[si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],K=()=>[si,"screen","full","dvw","lvw","svw","min","max","fit",...F()],he=()=>[si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],T=()=>[e,Ee,Ce],P=()=>[...L(),A1,_1,{position:[Ee,Ce]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",n3,Xz,{size:[Ee,Ce]}],q=()=>[ip,lu,nl],W=()=>["","none","full",h,Ee,Ce],ue=()=>["",Ke,lu,nl],xe=()=>["solid","dashed","dotted","double"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Ke,ip,A1,_1],Ct=()=>["","none",k,Ee,Ce],ne=()=>["none",Ke,Ee,Ce],Te=()=>["none",Ke,Ee,Ce],Ue=()=>[Ke,Ee,Ce],Fe=()=>[si,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ba],breakpoint:[ba],color:[$k],container:[ba],"drop-shadow":[ba],ease:["in","out","in-out"],font:[Yz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ba],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ba],shadow:[ba],spacing:["px",Ke],text:[ba],"text-shadow":[ba],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",si,Ce,Ee,C]}],container:["container"],columns:[{columns:[Ke,Ce,Ee,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:D()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[oi,"auto",Ee,Ce]}],basis:[{basis:[si,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,si,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Ee,Ce]}],shrink:[{shrink:["",Ke,Ee,Ce]}],order:[{order:[oi,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[f,"screen",...ae()]}],"min-w":[{"min-w":[f,"screen","none",...ae()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,lu,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,a3,Jz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ip,Ce]}],"font-family":[{font:[t3,Wz,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,Ee,Ce]}],"line-clamp":[{"line-clamp":[Ke,"none",Ee,N1]}],leading:[{leading:[o,...F()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ee,nl]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,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",Ee,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:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oi,Ee,Ce],radial:["",Ee,Ce],conic:[oi,Ee,Ce]},r3,e3]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],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:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ee,Ce]}],"outline-w":[{outline:["",Ke,lu,nl]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",y,wd,Sd]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",g,wd,Sd]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Ke,nl]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",b,wd,Sd]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Ke,Ee,Ce]}],"mix-blend":[{"mix-blend":[...Le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Le()}],"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":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":L()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Ct()}],brightness:[{brightness:[Ke,Ee,Ce]}],contrast:[{contrast:[Ke,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",S,wd,Sd]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Ke,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Ee,Ce]}],invert:[{invert:["",Ke,Ee,Ce]}],saturate:[{saturate:[Ke,Ee,Ce]}],sepia:[{sepia:["",Ke,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Ct()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",E,Ee,Ce]}],delay:[{delay:[Ke,Ee,Ce]}],animate:[{animate:["none",A,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ee,Ce]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",Ee,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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ee,Ce]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Ke,lu,nl,N1]}],stroke:[{stroke:["none",...T()]}],"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"]}},s3=Pz(l3);function _e(...e){return s3(Dk(e))}function Ei(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 o3(e){return ke.delete(`/clients/${encodeURIComponent(e)}`)}function Gu(){return ke.get("/admin/agents/activity")}function Zs(){return ke.get("/clients")}function Kk(e){return ke.get(`/clients/${e}`)}function u3(e){return ke.post(`/clients/${e}/disconnect`)}function Yk(){return ke.post("/connect-tokens")}const Xk=(e,t)=>["session",e,t],Yd=e=>["agent-sessions",e];function c3(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 d3(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 f3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function to(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 ke.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function h3(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 ke.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function m3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function p3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var T1=1,g3=.9,y3=.8,v3=.17,lp=.1,sp=.999,b3=.9999,x3=.99,S3=/[\\\/_+.#"@\[\(\{&]/,w3=/[\\\/_+.#"@\[\(\{&]/g,k3=/[\s-]/,Jk=/[\s-]/g;function yg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?T1:x3;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,S,k;h>=0;)g=yg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=T1:S3.test(e.charAt(h-1))?(g*=y3,S=e.slice(l,h-1).match(w3),S&&l>0&&(g*=Math.pow(sp,S.length))):k3.test(e.charAt(h-1))?(g*=g3,k=e.slice(l,h-1).match(Jk),k&&l>0&&(g*=Math.pow(sp,k.length))):(g*=v3,l>0&&(g*=Math.pow(sp,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=b3)),(g<lp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=yg(e,t,n,a,h+1,o+2,c),b*lp>g&&(g=b*lp)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function R1(e){return e.toLowerCase().replace(Jk," ")}function j3(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,yg(e,t,R1(e),R1(t),0,0,{})}function Ci(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 z1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ni(...e){return t=>{let n=!1;const a=e.map(l=>{const o=z1(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():z1(e[l],null)}}}}function jl(...e){return x.useCallback(Ni(...e),e)}function C3(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 E3(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var E;const{scope:b,children:S,...k}=g,j=((E=b==null?void 0:b[e])==null?void 0:E[m])||f,C=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:C,children:S})};h.displayName=o+"Provider";function y(g,b){var j;const S=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(S);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,N3(l,...t)]}function N3(...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 Nu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},_3=Hg[" useId ".trim().toString()]||(()=>{}),A3=0;function Ca(e){const[t,n]=x.useState(_3());return Nu(()=>{n(a=>a??String(A3++))},[e]),t?`radix-${t}`:""}var T3=Hg[" useInsertionEffect ".trim().toString()]||Nu;function R3({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=z3({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=O3(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 z3({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return T3(()=>{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 O3(e){return typeof e=="function"}var fy=Fw();const D3=df(fy);function Wk(e){const t=M3(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(I3);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 M3(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=P3(l),f=U3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ni(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 L3=Symbol("radix.slottable");function I3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===L3}function U3(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 P3(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 B3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=B3.reduce((e,t)=>{const n=Wk(`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 $3(e,t){e&&fy.flushSync(()=>e.dispatchEvent(t))}function _u(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 F3(e,t=globalThis==null?void 0:globalThis.document){const n=_u(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 q3="DismissableLayer",vg="dismissableLayer.update",H3="dismissableLayer.pointerDownOutside",Z3="dismissableLayer.focusOutside",O1,ej=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(ej),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=jl(t,I=>g(I)),j=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(C),A=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,L=A>=E,D=G3(I=>{const F=I.target,Y=[...h.branches].some($=>$.contains(F));!L||Y||(l==null||l(I),c==null||c(I),I.defaultPrevented||f==null||f())},b),z=K3(I=>{const F=I.target;[...h.branches].some($=>$.contains(F))||(o==null||o(I),c==null||c(I),I.defaultPrevented||f==null||f())},b);return F3(I=>{A===h.layers.size-1&&(a==null||a(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(O1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),D1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=O1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),D1())},[y,h]),x.useEffect(()=>{const I=()=>S({});return document.addEventListener(vg,I),()=>document.removeEventListener(vg,I)},[]),u.jsx(Ta.div,{...m,ref:k,style:{pointerEvents:O?L?"auto":"none":void 0,...e.style},onFocusCapture:Ci(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Ci(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ci(e.onPointerDownCapture,D.onPointerDownCapture)})});tj.displayName=q3;var V3="DismissableLayerBranch",Q3=x.forwardRef((e,t)=>{const n=x.useContext(ej),a=x.useRef(null),l=jl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ta.div,{...e,ref:l})});Q3.displayName=V3;function G3(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){nj(H3,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 K3(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&nj(Z3,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 D1(){const e=new CustomEvent(vg);document.dispatchEvent(e)}function nj(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?$3(l,o):l.dispatchEvent(o)}var op="focusScope.autoFocusOnMount",up="focusScope.autoFocusOnUnmount",M1={bubbles:!1,cancelable:!0},Y3="FocusScope",rj=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=_u(l),y=_u(o),g=x.useRef(null),b=jl(t,j=>m(j)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(S.paused||!f)return;const L=O.target;f.contains(L)?g.current=L:di(g.current,{select:!0})},C=function(O){if(S.paused||!f)return;const L=O.relatedTarget;L!==null&&(f.contains(L)||di(g.current,{select:!0}))},E=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&di(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",C);const A=new MutationObserver(E);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",C),A.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){I1.add(S);const j=document.activeElement;if(!f.contains(j)){const E=new CustomEvent(op,M1);f.addEventListener(op,h),f.dispatchEvent(E),E.defaultPrevented||(X3(nO(aj(f)),{select:!0}),document.activeElement===j&&di(f))}return()=>{f.removeEventListener(op,h),setTimeout(()=>{const E=new CustomEvent(up,M1);f.addEventListener(up,y),f.dispatchEvent(E),E.defaultPrevented||di(j??document.body,{select:!0}),f.removeEventListener(up,y),I1.remove(S)},0)}}},[f,h,y,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const C=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(C&&E){const A=j.currentTarget,[O,L]=J3(A);O&&L?!j.shiftKey&&E===L?(j.preventDefault(),n&&di(O,{select:!0})):j.shiftKey&&E===O&&(j.preventDefault(),n&&di(L,{select:!0})):E===A&&j.preventDefault()}},[n,a,S.paused]);return u.jsx(Ta.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});rj.displayName=Y3;function X3(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(di(a,{select:t}),document.activeElement!==n)return}function J3(e){const t=aj(e),n=L1(t,e),a=L1(t.reverse(),e);return[n,a]}function aj(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 L1(e,t){for(const n of e)if(!W3(n,{upTo:t}))return n}function W3(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 eO(e){return e instanceof HTMLInputElement&&"select"in e}function di(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eO(e)&&t&&e.select()}}var I1=tO();function tO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=U1(e,t),e.unshift(t)},remove(t){var n;e=U1(e,t),(n=e[0])==null||n.resume()}}}function U1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function nO(e){return e.filter(t=>t.tagName!=="A")}var rO="Portal",ij=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Nu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?D3.createPortal(u.jsx(Ta.div,{...a,ref:t}),c):null});ij.displayName=rO;function aO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var vf=e=>{const{present:t,children:n}=e,a=iO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=jl(a.ref,lO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};vf.displayName="Presence";function iO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=aO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=kd(a.current);o.current=f==="mounted"?h:"none"},[f]),Nu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,S=kd(h);e?m("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Nu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=S=>{const j=kd(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=S=>{S.target===t&&(o.current=kd(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 kd(e){return(e==null?void 0:e.animationName)||"none"}function lO(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 cp=0;function sO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??P1()),document.body.insertAdjacentElement("beforeend",e[1]??P1()),cp++,()=>{cp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cp--}},[])}function P1(){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 Vr=function(){return Vr=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},Vr.apply(this,arguments)};function lj(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 oO(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 $d="right-scroll-bar-position",Fd="width-before-scroll-bar",uO="with-scroll-bars-hidden",cO="--removed-body-scroll-bar-size";function dp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dO(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 fO=typeof window<"u"?x.useLayoutEffect:x.useEffect,B1=new WeakMap;function hO(e,t){var n=dO(null,function(a){return e.forEach(function(l){return dp(l,a)})});return fO(function(){var a=B1.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||dp(f,null)}),o.forEach(function(f){l.has(f)||dp(f,c)})}B1.set(n,e)},[e]),n}function mO(e){return e}function pO(e,t){t===void 0&&(t=mO);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 gO(e){e===void 0&&(e={});var t=pO(null);return t.options=Vr({async:!0,ssr:!1},e),t}var sj=function(e){var t=e.sideCar,n=lj(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,Vr({},n))};sj.isSideCarExport=!0;function yO(e,t){return e.useMedium(t),sj}var oj=gO(),fp=function(){},bf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:fp,onWheelCapture:fp,onTouchMoveCapture:fp}),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,S=e.noRelative,k=e.noIsolation,j=e.inert,C=e.allowPinchZoom,E=e.as,A=E===void 0?"div":E,O=e.gapMode,L=lj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,z=hO([n,t]),I=Vr(Vr({},L),l);return x.createElement(x.Fragment,null,y&&x.createElement(D,{sideCar:oj,removeScrollBar:h,shards:g,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:O}),c?x.cloneElement(x.Children.only(f),Vr(Vr({},I),{ref:z})):x.createElement(A,Vr({},I,{className:m,ref:z}),f))});bf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bf.classNames={fullWidth:Fd,zeroRight:$d};var vO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vO();return t&&e.setAttribute("nonce",t),e}function xO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bO())&&(xO(t,n),SO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kO=function(){var e=wO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uj=function(){var e=kO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},jO={left:0,top:0,right:0,gap:0},hp=function(e){return parseInt(e||"",10)||0},CO=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[hp(n),hp(a),hp(l)]},EO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jO;var t=CO(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])}},NO=uj(),Es="data-scroll-locked",_O=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
281
|
+
.`.concat(uO,` {
|
|
282
|
+
overflow: hidden `).concat(a,`;
|
|
283
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
284
|
+
}
|
|
285
|
+
body[`).concat(Es,`] {
|
|
286
|
+
overflow: hidden `).concat(a,`;
|
|
287
|
+
overscroll-behavior: contain;
|
|
288
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
289
|
+
padding-left: `.concat(l,`px;
|
|
290
|
+
padding-top: `).concat(o,`px;
|
|
291
|
+
padding-right: `).concat(c,`px;
|
|
292
|
+
margin-left:0;
|
|
293
|
+
margin-top:0;
|
|
294
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
295
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.`).concat($d,` {
|
|
299
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.`).concat(Fd,` {
|
|
303
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.`).concat($d," .").concat($d,` {
|
|
307
|
+
right: 0 `).concat(a,`;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.`).concat(Fd," .").concat(Fd,` {
|
|
311
|
+
margin-right: 0 `).concat(a,`;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
body[`).concat(Es,`] {
|
|
315
|
+
`).concat(cO,": ").concat(f,`px;
|
|
316
|
+
}
|
|
317
|
+
`)},$1=function(){var e=parseInt(document.body.getAttribute(Es)||"0",10);return isFinite(e)?e:0},AO=function(){x.useEffect(function(){return document.body.setAttribute(Es,($1()+1).toString()),function(){var e=$1()-1;e<=0?document.body.removeAttribute(Es):document.body.setAttribute(Es,e.toString())}},[])},TO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;AO();var o=x.useMemo(function(){return EO(l)},[l]);return x.createElement(NO,{styles:_O(o,!t,l,n?"":"!important")})},bg=!1;if(typeof window<"u")try{var jd=Object.defineProperty({},"passive",{get:function(){return bg=!0,!0}});window.addEventListener("test",jd,jd),window.removeEventListener("test",jd,jd)}catch{bg=!1}var hs=bg?{passive:!1}:!1,RO=function(e){return e.tagName==="TEXTAREA"},cj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!RO(e)&&n[t]==="visible")},zO=function(e){return cj(e,"overflowY")},OO=function(e){return cj(e,"overflowX")},F1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=dj(e,a);if(l){var o=fj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},DO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},MO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},dj=function(e,t){return e==="v"?zO(t):OO(t)},fj=function(e,t){return e==="v"?DO(t):MO(t)},LO=function(e,t){return e==="h"&&t==="rtl"?-1:1},IO=function(e,t,n,a,l){var o=LO(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 S=fj(e,f),k=S[0],j=S[1],C=S[2],E=j-C-o*k;(k||E)&&dj(e,f)&&(g+=E,b+=k);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}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},Cd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},q1=function(e){return[e.deltaX,e.deltaY]},H1=function(e){return e&&"current"in e?e.current:e},UO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PO=function(e){return`
|
|
318
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
319
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
320
|
+
`)},BO=0,ms=[];function $O(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(BO++)[0],o=x.useState(uj)[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=oO([e.lockRef.current],(e.shards||[]).map(H1),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var E=Cd(j),A=n.current,O="deltaX"in j?j.deltaX:A[0]-E[0],L="deltaY"in j?j.deltaY:A[1]-E[1],D,z=j.target,I=Math.abs(O)>Math.abs(L)?"h":"v";if("touches"in j&&I==="h"&&z.type==="range")return!1;var F=window.getSelection(),Y=F&&F.anchorNode,$=Y?Y===z||Y.contains(z):!1;if($)return!1;var te=F1(I,z);if(!te)return!0;if(te?D=I:(D=I==="v"?"h":"v",te=F1(I,z)),!te)return!1;if(!a.current&&"changedTouches"in j&&(O||L)&&(a.current=D),!D)return!0;var J=a.current||D;return IO(J,C,j,J==="h"?O:L)},[]),m=x.useCallback(function(j){var C=j;if(!(!ms.length||ms[ms.length-1]!==o)){var E="deltaY"in C?q1(C):Cd(C),A=t.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&UO(D.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var O=(c.current.shards||[]).map(H1).filter(Boolean).filter(function(D){return D.contains(C.target)}),L=O.length>0?f(C,O[0]):!c.current.noIsolation;L&&C.cancelable&&C.preventDefault()}}},[]),h=x.useCallback(function(j,C,E,A){var O={name:j,delta:C,target:E,should:A,shadowParent:FO(E)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(L){return L!==O})},1)},[]),y=x.useCallback(function(j){n.current=Cd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,q1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,Cd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ms.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,hs),document.addEventListener("touchmove",m,hs),document.addEventListener("touchstart",y,hs),function(){ms=ms.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,hs),document.removeEventListener("touchmove",m,hs),document.removeEventListener("touchstart",y,hs)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:PO(l)}):null,S?x.createElement(TO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function FO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qO=yO(oj,$O);var hj=x.forwardRef(function(e,t){return x.createElement(bf,Vr({},e,{ref:t,sideCar:qO}))});hj.classNames=bf.classNames;var HO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ps=new WeakMap,Ed=new WeakMap,Nd={},mp=0,mj=function(e){return e&&(e.host||mj(e.parentNode))},ZO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=mj(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})},VO=function(e,t,n,a){var l=ZO(t,Array.isArray(e)?e:[e]);Nd[n]||(Nd[n]=new WeakMap);var o=Nd[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 S=b.getAttribute(a),k=S!==null&&S!=="false",j=(ps.get(b)||0)+1,C=(o.get(b)||0)+1;ps.set(b,j),o.set(b,C),c.push(b),j===1&&k&&Ed.set(b,!0),C===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return y(t),f.clear(),mp++,function(){c.forEach(function(g){var b=ps.get(g)-1,S=o.get(g)-1;ps.set(g,b),o.set(g,S),b||(Ed.has(g)||g.removeAttribute(a),Ed.delete(g)),S||g.removeAttribute(n)}),mp--,mp||(ps=new WeakMap,ps=new WeakMap,Ed=new WeakMap,Nd={})}},QO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=HO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),VO(a,l,n,"aria-hidden")):function(){return null}},xf="Dialog",[pj]=E3(xf),[GO,Lr]=pj(xf),gj=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]=R3({prop:a,defaultProp:l??!1,onChange:o,caller:xf});return u.jsx(GO,{scope:t,triggerRef:f,contentRef:m,contentId:Ca(),titleId:Ca(),descriptionId:Ca(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};gj.displayName=xf;var yj="DialogTrigger",vj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(yj,n),o=jl(t,l.triggerRef);return u.jsx(Ta.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":py(l.open),...a,ref:o,onClick:Ci(e.onClick,l.onOpenToggle)})});vj.displayName=yj;var hy="DialogPortal",[KO,bj]=pj(hy,{forceMount:void 0}),xj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Lr(hy,t);return u.jsx(KO,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(vf,{present:n||o.open,children:u.jsx(ij,{asChild:!0,container:l,children:c})}))})};xj.displayName=hy;var Xd="DialogOverlay",Sj=x.forwardRef((e,t)=>{const n=bj(Xd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(Xd,e.__scopeDialog);return o.modal?u.jsx(vf,{present:a||o.open,children:u.jsx(XO,{...l,ref:t})}):null});Sj.displayName=Xd;var YO=Wk("DialogOverlay.RemoveScroll"),XO=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Xd,n);return u.jsx(hj,{as:YO,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(Ta.div,{"data-state":py(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),pl="DialogContent",wj=x.forwardRef((e,t)=>{const n=bj(pl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(pl,e.__scopeDialog);return u.jsx(vf,{present:a||o.open,children:o.modal?u.jsx(JO,{...l,ref:t}):u.jsx(WO,{...l,ref:t})})});wj.displayName=pl;var JO=x.forwardRef((e,t)=>{const n=Lr(pl,e.__scopeDialog),a=x.useRef(null),l=jl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return QO(o)},[]),u.jsx(kj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ci(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ci(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ci(e.onFocusOutside,o=>o.preventDefault())})}),WO=x.forwardRef((e,t)=>{const n=Lr(pl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(kj,{...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()}})}),kj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Lr(pl,n),m=x.useRef(null),h=jl(t,m);return sO(),u.jsxs(u.Fragment,{children:[u.jsx(rj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(tj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":py(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(eD,{titleId:f.titleId}),u.jsx(nD,{contentRef:m,descriptionId:f.descriptionId})]})]})}),my="DialogTitle",jj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(my,n);return u.jsx(Ta.h2,{id:l.titleId,...a,ref:t})});jj.displayName=my;var Cj="DialogDescription",Ej=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Cj,n);return u.jsx(Ta.p,{id:l.descriptionId,...a,ref:t})});Ej.displayName=Cj;var Nj="DialogClose",_j=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Nj,n);return u.jsx(Ta.button,{type:"button",...a,ref:t,onClick:Ci(e.onClick,()=>l.onOpenChange(!1))})});_j.displayName=Nj;function py(e){return e?"open":"closed"}var Aj="DialogTitleWarning",[zH,Tj]=C3(Aj,{contentName:pl,titleName:my,docsSlug:"dialog"}),eD=({titleId:e})=>{const t=Tj(Aj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
321
|
+
|
|
322
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
323
|
+
|
|
324
|
+
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},tD="DialogDescriptionWarning",nD=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tj(tD).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},Rj=gj,rD=vj,zj=xj,Oj=Sj,Dj=wj,aD=jj,iD=Ej,lD=_j,sD=Symbol.for("react.lazy"),Jd=Hg[" use ".trim().toString()];function oD(e){return typeof e=="object"&&e!==null&&"then"in e}function Mj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===sD&&"_payload"in e&&oD(e._payload)}function Lj(e){const t=cD(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;Mj(o)&&typeof Jd=="function"&&(o=Jd(o._payload));const f=x.Children.toArray(o),m=f.find(fD);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 uD=Lj("Slot");function cD(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Mj(l)&&typeof Jd=="function"&&(l=Jd(l._payload)),x.isValidElement(l)){const c=mD(l),f=hD(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ni(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 dD=Symbol("radix.slottable");function fD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dD}function hD(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 mD(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 pD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ra=pD.reduce((e,t)=>{const n=Lj(`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}},{}),su='[cmdk-group=""]',pp='[cmdk-group-items=""]',gD='[cmdk-group-heading=""]',Ij='[cmdk-item=""]',Z1=`${Ij}:not([aria-disabled="true"])`,xg="cmdk-item-select",bs="data-value",yD=(e,t,n)=>j3(e,t,n),Uj=x.createContext(void 0),Ku=()=>x.useContext(Uj),Pj=x.createContext(void 0),gy=()=>x.useContext(Pj),Bj=x.createContext(void 0),$j=x.forwardRef((e,t)=>{let n=xs(()=>{var B,_;return{search:"",value:(_=(B=e.value)!=null?B:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=xs(()=>new Set),l=xs(()=>new Map),o=xs(()=>new Map),c=xs(()=>new Set),f=Fj(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:C=!0,...E}=e,A=Ca(),O=Ca(),L=Ca(),D=x.useRef(null),z=_D();gl(()=>{if(y!==void 0){let B=y.trim();n.current.value=B,I.emit()}},[y]),gl(()=>{z(6,be)},[]);let I=x.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,_,q)=>{var W,ue,xe,Le;if(!Object.is(n.current[B],_)){if(n.current[B]=_,B==="search")J(),$(),z(1,te);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Se=document.getElementById(L);Se?Se.focus():(W=document.getElementById(A))==null||W.focus()}if(z(7,()=>{var Se;n.current.selectedItemId=(Se=fe())==null?void 0:Se.id,I.emit()}),q||z(5,be),((ue=f.current)==null?void 0:ue.value)!==void 0){let Se=_??"";(Le=(xe=f.current).onValueChange)==null||Le.call(xe,Se);return}}I.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),F=x.useMemo(()=>({value:(B,_,q)=>{var W;_!==((W=o.current.get(B))==null?void 0:W.value)&&(o.current.set(B,{value:_,keywords:q}),n.current.filtered.items.set(B,Y(_,q)),z(2,()=>{$(),I.emit()}))},item:(B,_)=>(a.current.add(B),_&&(l.current.has(_)?l.current.get(_).add(B):l.current.set(_,new Set([B]))),z(3,()=>{J(),$(),n.current.value||te(),I.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let q=fe();z(4,()=>{J(),(q==null?void 0:q.getAttribute("id"))===B&&te(),I.emit()})}),group:B=>(l.current.has(B)||l.current.set(B,new Set),()=>{o.current.delete(B),l.current.delete(B)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:A,inputId:L,labelId:O,listInnerRef:D}),[]);function Y(B,_){var q,W;let ue=(W=(q=f.current)==null?void 0:q.filter)!=null?W:yD;return B?ue(B,n.current.search,_):0}function $(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(W=>{let ue=l.current.get(W),xe=0;ue.forEach(Le=>{let Se=B.get(Le);xe=Math.max(Se,xe)}),_.push([W,xe])});let q=D.current;ie().sort((W,ue)=>{var xe,Le;let Se=W.getAttribute("id"),Ct=ue.getAttribute("id");return((xe=B.get(Ct))!=null?xe:0)-((Le=B.get(Se))!=null?Le:0)}).forEach(W=>{let ue=W.closest(pp);ue?ue.appendChild(W.parentElement===ue?W:W.closest(`${pp} > *`)):q.appendChild(W.parentElement===q?W:W.closest(`${pp} > *`))}),_.sort((W,ue)=>ue[1]-W[1]).forEach(W=>{var ue;let xe=(ue=D.current)==null?void 0:ue.querySelector(`${su}[${bs}="${encodeURIComponent(W[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function te(){let B=ie().find(q=>q.getAttribute("aria-disabled")!=="true"),_=B==null?void 0:B.getAttribute(bs);I.setState("value",_||void 0)}function J(){var B,_,q,W;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let xe of a.current){let Le=(_=(B=o.current.get(xe))==null?void 0:B.value)!=null?_:"",Se=(W=(q=o.current.get(xe))==null?void 0:q.keywords)!=null?W:[],Ct=Y(Le,Se);n.current.filtered.items.set(xe,Ct),Ct>0&&ue++}for(let[xe,Le]of l.current)for(let Se of Le)if(n.current.filtered.items.get(Se)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=ue}function be(){var B,_,q;let W=fe();W&&(((B=W.parentElement)==null?void 0:B.firstChild)===W&&((q=(_=W.closest(su))==null?void 0:_.querySelector(gD))==null||q.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function fe(){var B;return(B=D.current)==null?void 0:B.querySelector(`${Ij}[aria-selected="true"]`)}function ie(){var B;return Array.from(((B=D.current)==null?void 0:B.querySelectorAll(Z1))||[])}function Z(B){let _=ie()[B];_&&I.setState("value",_.getAttribute(bs))}function ae(B){var _;let q=fe(),W=ie(),ue=W.findIndex(Le=>Le===q),xe=W[ue+B];(_=f.current)!=null&&_.loop&&(xe=ue+B<0?W[W.length-1]:ue+B===W.length?W[0]:W[ue+B]),xe&&I.setState("value",xe.getAttribute(bs))}function K(B){let _=fe(),q=_==null?void 0:_.closest(su),W;for(;q&&!W;)q=B>0?ED(q,su):ND(q,su),W=q==null?void 0:q.querySelector(Z1);W?I.setState("value",W.getAttribute(bs)):ae(B)}let he=()=>Z(ie().length-1),T=B=>{B.preventDefault(),B.metaKey?he():B.altKey?K(1):ae(1)},P=B=>{B.preventDefault(),B.metaKey?Z(0):B.altKey?K(-1):ae(-1)};return x.createElement(Ra.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:B=>{var _;(_=E.onKeyDown)==null||_.call(E,B);let q=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||q))switch(B.key){case"n":case"j":{C&&B.ctrlKey&&T(B);break}case"ArrowDown":{T(B);break}case"p":case"k":{C&&B.ctrlKey&&P(B);break}case"ArrowUp":{P(B);break}case"Home":{B.preventDefault(),Z(0);break}case"End":{B.preventDefault(),he();break}case"Enter":{B.preventDefault();let W=fe();if(W){let ue=new Event(xg);W.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:F.inputId,id:F.labelId,style:TD},m),Sf(e,B=>x.createElement(Pj.Provider,{value:I},x.createElement(Uj.Provider,{value:F},B))))}),vD=x.forwardRef((e,t)=>{var n,a;let l=Ca(),o=x.useRef(null),c=x.useContext(Bj),f=Ku(),m=Fj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;gl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=qj(l,o,[e.value,e.children,o],e.keywords),g=gy(),b=_i(z=>z.value&&z.value===y.current),S=_i(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(xg,k),()=>z.removeEventListener(xg,k)},[S,e.onSelect,e.disabled]);function k(){var z,I;j(),(I=(z=m.current).onSelect)==null||I.call(z,y.current)}function j(){g.setState("value",y.current,!0)}if(!S)return null;let{disabled:C,value:E,onSelect:A,forceMount:O,keywords:L,...D}=e;return x.createElement(Ra.div,{ref:Ni(o,t),...D,id:l,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!b,"data-disabled":!!C,"data-selected":!!b,onPointerMove:C||f.getDisablePointerSelection()?void 0:j,onClick:C?void 0:k},e.children)}),bD=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Ca(),f=x.useRef(null),m=x.useRef(null),h=Ca(),y=Ku(),g=_i(S=>l||y.filter()===!1?!0:S.search?S.filtered.groups.has(c):!0);gl(()=>y.group(c),[]),qj(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Ra.div,{ref:Ni(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),Sf(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Bj.Provider,{value:b},S))))}),xD=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=_i(c=>!c.search);return!n&&!o?null:x.createElement(Ra.div,{ref:Ni(l,t),...a,"cmdk-separator":"",role:"separator"})}),SD=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=gy(),c=_i(h=>h.search),f=_i(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Ra.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)}})}),wD=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=_i(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 S=h.offsetHeight;y.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Ra.div,{ref:Ni(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Sf(e,h=>x.createElement("div",{ref:Ni(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),kD=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Rj,{open:n,onOpenChange:a},x.createElement(zj,{container:c},x.createElement(Oj,{"cmdk-overlay":"",className:l}),x.createElement(Dj,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement($j,{ref:t,...f}))))}),jD=x.forwardRef((e,t)=>_i(n=>n.filtered.count===0)?x.createElement(Ra.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CD=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Ra.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Sf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Qn=Object.assign($j,{List:wD,Item:vD,Input:SD,Group:bD,Separator:xD,Dialog:kD,Empty:jD,Loading:CD});function ED(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ND(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Fj(e){let t=x.useRef(e);return gl(()=>{t.current=e}),t}var gl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function xs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function _i(e){let t=gy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function qj(e,t,n,a=[]){let l=x.useRef(),o=Ku();return gl(()=>{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(bs,f),l.current=f}),l}var _D=()=>{let[e,t]=x.useState(),n=xs(()=>new Map);return gl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function AD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Sf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(AD(t),{ref:t.ref},n(t.props.children)):n(t)}var TD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Pt=Rj,RD=rD,zD=zj,Hj=x.forwardRef(({className:e,...t},n)=>u.jsx(Oj,{ref:n,className:_e("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}));Hj.displayName="DialogOverlay";const Rt=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(zD,{children:[u.jsx(Hj,{}),u.jsxs(Dj,{ref:a,className:_e("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(lD,{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(Eu,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Rt.displayName="DialogContent";function Vt({className:e,...t}){return u.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Wt({className:e,...t}){return u.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Bt=x.forwardRef(({className:e,...t},n)=>u.jsx(aD,{ref:n,className:_e("text-subtitle leading-none tracking-tight",e),...t}));Bt.displayName="DialogTitle";const wf=x.forwardRef(({className:e,...t},n)=>u.jsx(iD,{ref:n,className:_e("text-body text-muted-foreground",e),...t}));wf.displayName="DialogDescription";const Zj=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Zj.displayName=Qn.displayName;function OD({open:e,onOpenChange:t,children:n}){return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsx(Rt,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(Zj,{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 Vj=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(yf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Qn.Input,{ref:n,className:_e("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})]}));Vj.displayName=Qn.Input.displayName;const Qj=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.List,{ref:n,className:_e("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Qj.displayName=Qn.List.displayName;const Gj=x.forwardRef((e,t)=>u.jsx(Qn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Gj.displayName=Qn.Empty.displayName;const qd=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Group,{ref:n,className:_e("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}));qd.displayName=Qn.Group.displayName;const Sg=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));Sg.displayName=Qn.Separator.displayName;const Hd=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Item,{ref:n,className:_e("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}));Hd.displayName=Qn.Item.displayName;function Yu(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 ke.get(`/admin/agents${n?`?${n}`:""}`)}function DD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return ke.get(`/admin/agents/all${n?`?${n}`:""}`)}function Kj(e){return ke.get(`/admin/agents/${encodeURIComponent(e)}`)}function MD(e){return ke.post("/admin/agents",e)}function LD(e){return ke.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function V1(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function ID(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function UD(e){return ke.delete(`/admin/agents/${encodeURIComponent(e)}`)}function PD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function BD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function $D(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Cl(){const{data:e}=He({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName);return n=>n?t.get(n)??n:"—"},[e])}function yy(){const{data:e}=He({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,{name:n.name,displayName:n.displayName});return n=>n?t.get(n)??null:null},[e])}const FD=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function qD({open:e,onOpenChange:t}){const n=wn(),a=Cl(),{data:l}=He({queryKey:["activity"],queryFn:Gu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=He({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await to(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(OD,{open:e,onOpenChange:t,children:[u.jsx(Vj,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(Qj,{children:[u.jsx(Gj,{children:"No results"}),o.length>0&&u.jsx(qd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(Hd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(xR,{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(Sg,{}),u.jsx(qd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(Hd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(oy,{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(Sg,{}),u.jsx(qd,{heading:"Pages",children:FD.map(h=>u.jsxs(Hd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(zR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function yl(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 wg(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 ke.get(`/admin/notifications${n?`?${n}`:""}`)}function Yj(e){return ke.post(`/admin/notifications/${e}/read`)}function HD(){return ke.post("/admin/notifications/read-all")}const ZD={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 VD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Xj({notification:e,onClick:t,clickable:n}){const a=(ZD[e.type]??e.type).toString(),l=VD(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:_e("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:Ei(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function QD(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=wn(),c=_n(),{data:f}=He({queryKey:["notifications","bell"],queryFn:()=>wg({limit:8}),refetchInterval:1e4}),{data:m}=He({queryKey:["notifications","unread-count"],queryFn:()=>wg({read:!1,limit:100}),refetchInterval:1e4}),h=((S=m==null?void 0:m.items)==null?void 0:S.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(Yj(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(vR,{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(Xj,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}const Jj="onboarding:joinPath",GD="onboarding:bannerDismissed";function Wj(e){typeof window>"u"||window.sessionStorage.setItem(Jj,e)}const Q1=Jj,gp=GD,eC=x.createContext(null);function KD({children:e}){const{wizardStep:t,isAuthenticated:n}=ln(),[a,l]=x.useState(!1),[o,c]=x.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(gp)==="1"),[f,m]=x.useState(()=>{const S=typeof window<"u"?window.sessionStorage.getItem(Q1):null;return S==="solo"||S==="invite"?S:null});x.useEffect(()=>{t==="completed"&&(l(!1),window.sessionStorage.removeItem(Q1),window.localStorage.removeItem(gp),m(null),c(!1))},[t]);const h=x.useCallback(()=>l(!0),[]),y=x.useCallback(()=>l(!1),[]),g=x.useCallback(()=>{window.localStorage.setItem(gp,"1"),c(!0)},[]),b=x.useMemo(()=>({modalOpen:a,openModal:h,closeModal:y,bannerVisible:n&&t!==null&&t!=="completed"&&!o,dismissBanner:g,joinPath:f,step:t}),[a,h,y,n,t,o,g,f]);return u.jsx(eC.Provider,{value:b,children:e})}function vy(){const e=x.useContext(eC);return e||{modalOpen:!1,openModal:()=>{},closeModal:()=>{},bannerVisible:!1,dismissBanner:()=>{},joinPath:null,step:null}}function YD(){const{bannerVisible:e,openModal:t,dismissBanner:n}=vy();return e?u.jsxs("aside",{role:"status","aria-label":"Onboarding tip",className:"shrink-0 flex items-center justify-between",style:{height:44,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:8},children:[u.jsx(tz,{className:"h-3.5 w-3.5",style:{color:"var(--primary)"}}),u.jsx("span",{className:"text-body",style:{color:"var(--fg)"},children:"Set up your first agent"})]}),u.jsxs("div",{className:"flex items-center",style:{gap:4},children:[u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center text-body font-medium transition-colors",style:{padding:"var(--sp-1) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--primary)",color:"var(--primary-foreground)"},onMouseEnter:a=>{a.currentTarget.style.opacity="0.9"},onMouseLeave:a=>{a.currentTarget.style.opacity="1"},children:"Get started"}),u.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"inline-flex items-center justify-center transition-colors",style:{width:28,height:28,borderRadius:"var(--radius-input)",color:"var(--fg-3)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--bg-hover)",a.currentTarget.style.color="var(--fg)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.color="var(--fg-3)"},children:u.jsx(Eu,{className:"h-3.5 w-3.5"})})]})]}):null}function XD(e){return ke.get(`/admin/chats/${encodeURIComponent(e)}`)}function JD(e,t){return ke.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function G1(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function WD(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function eM(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 tC(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function tM(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 ke.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const K1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Y1=Dk,nM=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return Y1(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=K1(y)||K1(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:b,...S}=y;return Object.entries(S).every(k=>{let[j,C]=k;return Array.isArray(C)?C.includes({...o,...f}[j]):{...o,...f}[j]===C})?[...h,g,b]:h},[]);return Y1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},rM=nM("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"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?uD:"button";return u.jsx(c,{className:_e(rM({variant:t,size:n,className:e})),ref:o,...l})});me.displayName="Button";const xt=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:_e("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}));xt.displayName="Input";var aM="Label",nC=x.forwardRef((e,t)=>u.jsx(Ra.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())}}));nC.displayName=aM;var iM=nC;const nt=x.forwardRef(({className:e,...t},n)=>u.jsx(iM,{ref:n,className:_e("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));nt.displayName="Label";function lM(){var F;const{modalOpen:e,closeModal:t,joinPath:n,step:a}=vy(),{refreshMe:l,organizationId:o}=ln(),c=wn(),[f,m]=x.useState([]),[h,y]=x.useState(""),[g,b]=x.useState("name"),[S,k]=x.useState(null),[j,C]=x.useState(null),[E,A]=x.useState(!1);x.useEffect(()=>{e&&(y(""),b("name"),k(null),C(null))},[e]),x.useEffect(()=>{e&&(async()=>{try{const Y=await ke.get("/me/organizations");m(Y)}catch{}})()},[e]);const O=((F=f.find(Y=>Y.id===o))==null?void 0:F.displayName)??"",L=n==="invite"&&O?`You've joined ${O}.`:"Set up your first agent",D=x.useCallback(async Y=>{b("creating"),C(null);try{const $=Y.trim(),te=await ke.post("/admin/agents",{name:$,type:"autonomous_agent",displayName:$}),J=await tC(te.uuid);await l(),t(),c(`/?a=${encodeURIComponent(te.uuid)}&c=${encodeURIComponent(J.id)}`,{replace:!0})}catch($){C($ instanceof Error?$.message:"Failed to create agent"),b("name")}},[l,t,c]),z=async Y=>{Y.preventDefault(),h.trim()&&(a==="connect"?b("connect"):await D(h))};x.useEffect(()=>{if(g!=="connect"||S)return;let Y=!1;return(async()=>{try{const $=await ke.post("/connect-tokens",{});Y||k($.token)}catch($){Y||C($ instanceof Error?$.message:"Failed to generate connect token")}})(),()=>{Y=!0}},[g,S]),x.useEffect(()=>{if(g!=="connect")return;let Y=!1;const te=setInterval(async()=>{Y||await l()},3e3);return()=>{Y=!0,clearInterval(te)}},[g,l]),x.useEffect(()=>{g==="connect"&&a==="create_agent"&&h.trim()&&D(h)},[g,a,h,D]);const I=S?`npm install -g @agent-team-foundation/first-tree-hub
|
|
325
|
+
first-tree-hub connect ${S}`:"Generating token…";return u.jsx(Pt,{open:e,onOpenChange:Y=>!Y&&t(),children:u.jsxs(Rt,{children:[u.jsxs(Vt,{children:[u.jsx(Bt,{children:L}),u.jsx(wf,{children:g==="name"?"What should we call your agent?":g==="connect"?`Connect a computer to run "${h.trim()}".`:"Setting things up…"})]}),j&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:j}),g==="name"&&u.jsxs("form",{className:"space-y-3",onSubmit:z,children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"onboarding-agent-name",children:"Agent name"}),u.jsx(xt,{id:"onboarding-agent-name",value:h,onChange:Y=>y(Y.target.value),placeholder:"my-first-agent",autoFocus:!0})]}),u.jsx(me,{type:"submit",className:"w-full",disabled:!h.trim(),children:"Continue"})]}),g==="connect"&&u.jsxs("div",{className:"space-y-3",style:{minWidth:0,maxWidth:"100%"},children:[u.jsx("div",{style:{width:"100%",overflow:"hidden",minWidth:0},children:u.jsx("pre",{className:"rounded-md bg-muted p-3 text-label font-mono",style:{whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",width:"100%",minWidth:0,boxSizing:"border-box",margin:0},children:I})}),u.jsx(me,{variant:"outline",size:"sm",disabled:!S,onClick:()=>{S&&(navigator.clipboard.writeText(I),A(!0),setTimeout(()=>A(!1),1500))},children:E?"Copied!":"Copy commands"}),u.jsx("p",{className:"text-label text-muted-foreground",children:"Waiting for your computer to check in…"})]}),g==="creating"&&u.jsx("p",{className:"text-body text-muted-foreground",children:"Creating your agent…"})]})})}function sM(){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 oM(){const[e,t]=x.useState(sM);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(iz,{className:"h-4 w-4"}):u.jsx($R,{className:"h-4 w-4"})})}function uM(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function X1({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:uM(t)})})}function cM({action:e,onClose:t}){const n=e!==null;return u.jsx(Pt,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(Rt,{children:[u.jsxs(Vt,{children:[u.jsx(Bt,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(wf,{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(fM,{onDone:t}),e==="join"&&u.jsx(hM,{onDone:t})]})})}function dM(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function fM({onDone:e}){const{adoptTokens:t}=ln(),n=wn(),[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 ke.post("/me/organizations",{name:dM(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(xt,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function hM({onDone:e}){const{adoptTokens:t}=ln(),n=wn(),[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),S=(b==null?void 0:b[1])??g,k=await ke.post("/me/organizations/join",{token:S});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(xt,{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(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function mM(){var A;const{organizationId:e,user:t,adoptTokens:n,logout:a}=ln(),l=wn(),[o,c]=x.useState([]),[f,m]=x.useState(!1),[h,y]=x.useState(null),g=x.useRef(null);x.useEffect(()=>{(async()=>{try{const O=await ke.get("/me/organizations");c(O)}catch{}})()},[]),x.useEffect(()=>{const O=D=>{f&&g.current&&!g.current.contains(D.target)&&m(!1)},L=D=>{f&&D.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",O),window.addEventListener("keydown",L),()=>{window.removeEventListener("mousedown",O),window.removeEventListener("keydown",L)}},[f]);const b=(t==null?void 0:t.displayName)??"User",S=(t==null?void 0:t.username)??"",k=(t==null?void 0:t.avatarUrl)??null,j=async O=>{if(O===e){m(!1);return}try{const L=await ke.post("/auth/switch-org",{organizationId:O});await n(L),m(!1),l("/",{replace:!0})}catch{}},C=()=>{m(!1),y("create")},E=()=>{m(!1),y("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:g,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${b}`,"aria-haspopup":"menu","aria-expanded":f,onClick:()=>m(O=>!O),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:f?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(X1,{src:k,name:b,size:28})}),f&&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(X1,{src:k,name:b,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:b}),S&&S!==b&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",S]})]})]}),o.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:"Team"}),o.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(_a,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"truncate",children:(A=o[0])==null?void 0:A.displayName})]}):u.jsx("div",{children:o.map(O=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void j(O.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:O.id===e?u.jsx(_a,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"truncate",children:O.displayName})]},O.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:C,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(Aa,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:E,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(pz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsxs("div",{className:"py-1",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),l("/settings")},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(WR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Settings"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),a()},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(UR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})]})]})]}),u.jsx(cM,{action:h,onClose:()=>y(null)})]})}const J1=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],pM={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function gM(){const{role:e}=ln(),t=e==="admin",[n,a]=x.useState(!1),l=t?[...J1,pM]:J1,o=Dn(),c=o.pathname==="/"||o.search.includes("a=");return x.useEffect(()=>{const f=m=>{(m.metaKey||m.ctrlKey)&&m.key.toLowerCase()==="k"&&(m.preventDefault(),a(h=>!h))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]),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:"auto 1fr auto",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:10},children:[u.jsx(yl,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",u.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),u.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:l.map(f=>u.jsx(kk,{to:f.to,end:f.end,style:{pointerEvents:"auto"},className:({isActive:m})=>_e("inline-flex items-center transition-colors",m?"":"hover:text-[var(--fg)]"),children:({isActive:m})=>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:m?"var(--fg)":"var(--fg-3)",background:m?"var(--bg-hover)":"transparent"},children:[f.label,m&&u.jsx("span",{className:"kbd",children:f.kbd})]})},f.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6},children:[u.jsxs("button",{type:"button",onClick:()=>a(!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:f=>{f.currentTarget.style.color="var(--fg)"},onMouseLeave:f=>{f.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(yf,{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(QD,{}),u.jsx(oM,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(mM,{})]})]}),u.jsx(YD,{}),u.jsx(qD,{open:n,onOpenChange:a}),u.jsx(lM,{}),c?u.jsx(dg,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(dg,{})})})]})}function se(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 Ns extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const aC={};function Ai(e){return aC}function iC(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 kg(e,t){return typeof t=="bigint"?t.toString():t}function kf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function by(e){return e==null}function xy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function yM(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 W1=Symbol("evaluating");function ft(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==W1)return a===void 0&&(a=W1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function El(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function eS(e){return JSON.stringify(e)}function vM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const lC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Au(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bM=kf(()=>{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 Vs(e){if(Au(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Au(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function sC(e){return Vs(e)?{...e}:Array.isArray(e)?[...e]:e}const xM=new Set(["string","number","symbol"]);function Qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(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 Ae(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 SM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wM={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 kM(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=zi(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 El(this,"shape",c),c},checks:[]});return Oi(e,o)}function jM(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=zi(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 El(this,"shape",c),c},checks:[]});return Oi(e,o)}function CM(e,t){if(!Vs(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=zi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return El(this,"shape",o),o}});return Oi(e,l)}function EM(e,t){if(!Vs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return El(this,"shape",a),a}});return Oi(e,n)}function NM(e,t){const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return El(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Oi(e,n)}function _M(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=zi(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 El(this,"shape",m),m},checks:[]});return Oi(t,c)}function AM(e,t,n){const a=zi(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 El(this,"shape",o),o}});return Oi(t,a)}function ws(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 ks(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function _d(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ti(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=_d((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??_d((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??_d((m=n.customError)==null?void 0:m.call(n,e))??_d((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 Sy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const oC=(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,kg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},uC=se("$ZodError",oC),cC=se("$ZodError",oC,{Parent:Error});function TM(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 RM(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 wy=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 Ns;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ti(m,o,Ai())));throw lC(f,l==null?void 0:l.callee),f}return c.value},ky=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=>Ti(m,o,Ai())));throw lC(f,l==null?void 0:l.callee),f}return c.value},jf=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 Ns;return o.issues.length?{success:!1,error:new(e??uC)(o.issues.map(c=>Ti(c,l,Ai())))}:{success:!0,data:o.value}},zM=jf(cC),Cf=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=>Ti(c,l,Ai())))}:{success:!0,data:o.value}},OM=Cf(cC),DM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wy(e)(t,n,l)},MM=e=>(t,n,a)=>wy(e)(t,n,a),LM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ky(e)(t,n,l)},IM=e=>async(t,n,a)=>ky(e)(t,n,a),UM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jf(e)(t,n,l)},PM=e=>(t,n,a)=>jf(e)(t,n,a),BM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cf(e)(t,n,l)},$M=e=>async(t,n,a)=>Cf(e)(t,n,a),FM=/^[cC][^\s-]{8,}$/,qM=/^[0-9a-z]+$/,HM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ZM=/^[0-9a-vA-V]{20}$/,VM=/^[A-Za-z0-9]{27}$/,QM=/^[a-zA-Z0-9_-]{21}$/,GM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,KM=/^([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})$/,tS=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)$/,YM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,XM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function JM(){return new RegExp(XM,"u")}const WM=/^(?:(?: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])$/,e4=/^(([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}|:))$/,t4=/^((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])$/,n4=/^(([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])$/,r4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dC=/^[A-Za-z0-9_-]*$/,a4=/^\+[1-9]\d{6,14}$/,fC="(?:(?:\\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])))",i4=new RegExp(`^${fC}$`);function hC(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 l4(e){return new RegExp(`^${hC(e)}$`)}function s4(e){const t=hC({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(`^${fC}T(?:${a})$`)}const o4=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}$`)},u4=/^-?\d+$/,mC=/^-?\d+(?:\.\d+)?$/,c4=/^(?:true|false)$/i,d4=/^[^A-Z]*$/,f4=/^[^a-z]*$/,Gn=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pC={number:"number",bigint:"bigint",object:"date"},gC=se("$ZodCheckLessThan",(e,t)=>{Gn.init(e,t);const n=pC[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})}}),yC=se("$ZodCheckGreaterThan",(e,t)=>{Gn.init(e,t);const n=pC[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})}}),h4=se("$ZodCheckMultipleOf",(e,t)=>{Gn.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):yM(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})}}),m4=se("$ZodCheckNumberFormat",(e,t)=>{var c;Gn.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]=wM[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=u4)}),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})}}),p4=se("$ZodCheckMaxLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(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=Sy(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),g4=se("$ZodCheckMinLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(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=Sy(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),y4=se("$ZodCheckLengthEquals",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(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=Sy(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})}}),Ef=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Gn.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=()=>{})}),v4=se("$ZodCheckRegex",(e,t)=>{Ef.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})}}),b4=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=d4),Ef.init(e,t)}),x4=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=f4),Ef.init(e,t)}),S4=se("$ZodCheckIncludes",(e,t)=>{Gn.init(e,t);const n=Qs(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})}}),w4=se("$ZodCheckStartsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`^${Qs(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})}}),k4=se("$ZodCheckEndsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`.*${Qs(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})}}),j4=se("$ZodCheckOverwrite",(e,t)=>{Gn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class C4{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(`
|
|
326
|
+
`).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(`
|
|
327
|
+
`))}}const E4={major:4,minor:3,patch:6},zt=se("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=E4;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=ws(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const S=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Ns;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(y||(y=ws(f,S)))});else{if(f.issues.length===S)continue;y||(y=ws(f,S))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(ws(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new Ns;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 Ns;return h.then(y=>o(y,a,m))}return o(h,a,m)}}ft(e,"~standard",()=>({validate:o=>{var c;try{const f=zM(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return OM(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}))}),jy=se("$ZodString",(e,t)=>{var n;zt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??o4(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}}),Tt=se("$ZodStringFormat",(e,t)=>{Ef.init(e,t),jy.init(e,t)}),N4=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=KM),Tt.init(e,t)}),_4=se("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tS(a))}else t.pattern??(t.pattern=tS());Tt.init(e,t)}),A4=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=YM),Tt.init(e,t)}),T4=se("$ZodURL",(e,t)=>{Tt.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})}}}),R4=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=JM()),Tt.init(e,t)}),z4=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=QM),Tt.init(e,t)}),O4=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=FM),Tt.init(e,t)}),D4=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=qM),Tt.init(e,t)}),M4=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=HM),Tt.init(e,t)}),L4=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ZM),Tt.init(e,t)}),I4=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=VM),Tt.init(e,t)}),U4=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=s4(t)),Tt.init(e,t)}),P4=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=i4),Tt.init(e,t)}),B4=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=l4(t)),Tt.init(e,t)}),$4=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=GM),Tt.init(e,t)}),F4=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=WM),Tt.init(e,t),e._zod.bag.format="ipv4"}),q4=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=e4),Tt.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})}}}),H4=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=t4),Tt.init(e,t)}),Z4=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=n4),Tt.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 vC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const V4=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=r4),Tt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{vC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Q4(e){if(!dC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return vC(n)}const G4=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dC),Tt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Q4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),K4=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=a4),Tt.init(e,t)});function Y4(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 X4=se("$ZodJWT",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{Y4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),bC=se("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??mC,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}}),J4=se("$ZodNumberFormat",(e,t)=>{m4.init(e,t),bC.init(e,t)}),W4=se("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=c4,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}}),e5=se("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),t5=se("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nS(e,t,n){e.issues.length&&t.issues.push(...ks(n,e.issues)),t.value[n]=e.value}const n5=se("$ZodArray",(e,t)=>{zt.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=>nS(h,n,c))):nS(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(...ks(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function xC(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=SM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function SC(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(S=>Wd(S,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 r5=se("$ZodObject",(e,t)=>{zt.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=kf(()=>xC(t));ft(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=Au,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 S=g[b],k=S._zod.optout==="optional",j=S._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(C=>Wd(C,f,b,h,k))):Wd(j,f,b,h,k)}return o?SC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),a5=se("$ZodObjectJIT",(e,t)=>{r5.init(e,t);const n=e._zod.parse,a=kf(()=>xC(t)),l=b=>{var O;const S=new C4(["shape","payload","ctx"]),k=a.value,j=L=>{const D=eS(L);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};S.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const L of k.keys)C[L]=`key_${E++}`;S.write("const newResult = {};");for(const L of k.keys){const D=C[L],z=eS(L),I=b[L],F=((O=I==null?void 0:I._zod)==null?void 0:O.optout)==="optional";S.write(`const ${D} = ${j(L)};`),F?S.write(`
|
|
328
|
+
if (${D}.issues.length) {
|
|
329
|
+
if (${z} in input) {
|
|
330
|
+
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
331
|
+
...iss,
|
|
332
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
333
|
+
})));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (${D}.value === undefined) {
|
|
338
|
+
if (${z} in input) {
|
|
339
|
+
newResult[${z}] = undefined;
|
|
340
|
+
}
|
|
341
|
+
} else {
|
|
342
|
+
newResult[${z}] = ${D}.value;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
`):S.write(`
|
|
346
|
+
if (${D}.issues.length) {
|
|
347
|
+
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
348
|
+
...iss,
|
|
349
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
350
|
+
})));
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (${D}.value === undefined) {
|
|
354
|
+
if (${z} in input) {
|
|
355
|
+
newResult[${z}] = undefined;
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
newResult[${z}] = ${D}.value;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
`)}S.write("payload.value = newResult;"),S.write("return payload;");const A=S.compile();return(L,D)=>A(b,L,D)};let o;const c=Au,f=!aC.jitless,h=f&&bM.value,y=t.catchall;let g;e._zod.parse=(b,S)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),y?SC([],k,b,S,g,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function rS(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=>!ws(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=>Ti(c,a,Ai())))}),t)}const wC=se("$ZodUnion",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ft(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ft(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ft(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=>xy(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=>rS(m,l,e,o)):rS(f,l,e,o)}}),i5=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,wC.init(e,t);const n=e._zod.parse;ft(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=kf(()=>{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(!Au(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)}}),l5=se("$ZodIntersection",(e,t)=>{zt.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])=>aS(n,m,h)):aS(n,o,c)}});function jg(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(Vs(e)&&Vs(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=jg(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=jg(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 aS(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}),ws(e))return e;const c=jg(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 s5=se("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Vs(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(...ks(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...ks(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"&&mC.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=>Ti(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(...ks(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...ks(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),o5=se("$ZodEnum",(e,t)=>{zt.init(e,t);const n=iC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>xM.has(typeof l)).map(l=>typeof l=="string"?Qs(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}}),u5=se("$ZodLiteral",(e,t)=>{if(zt.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"?Qs(a):a?Qs(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}}),c5=se("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new rC(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 Ns;return n.value=l,n}});function iS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const kC=se("$ZodOptional",(e,t)=>{zt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xy(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=>iS(o,n.value)):iS(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),d5=se("$ZodExactOptional",(e,t)=>{kC.init(e,t),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),f5=se("$ZodNullable",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xy(n.source)}|null)$`):void 0}),ft(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)}),h5=se("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ft(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=>lS(o,t)):lS(l,t)}});function lS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const m5=se("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ft(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))}),p5=se("$ZodNonOptional",(e,t)=>{zt.init(e,t),ft(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=>sS(o,e)):sS(l,e)}});function sS(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 g5=se("$ZodCatch",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(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=>Ti(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=>Ti(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),y5=se("$ZodPipe",(e,t)=>{zt.init(e,t),ft(e._zod,"values",()=>t.in._zod.values),ft(e._zod,"optin",()=>t.in._zod.optin),ft(e._zod,"optout",()=>t.out._zod.optout),ft(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 v5=se("$ZodReadonly",(e,t)=>{zt.init(e,t),ft(e._zod,"propValues",()=>t.innerType._zod.propValues),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ft(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(oS):oS(l)}});function oS(e){return e.value=Object.freeze(e.value),e}const b5=se("$ZodCustom",(e,t)=>{Gn.init(e,t),zt.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=>uS(o,n,a,e));uS(l,n,a,e)}});function uS(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(Tu(l))}}var cS;class x5{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 S5(){return new x5}(cS=globalThis).__zod_globalRegistry??(cS.__zod_globalRegistry=S5());const mu=globalThis.__zod_globalRegistry;function w5(e,t){return new e({type:"string",...Ae(t)})}function k5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(t)})}function dS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(t)})}function j5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(t)})}function C5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(t)})}function E5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(t)})}function N5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(t)})}function _5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(t)})}function A5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(t)})}function T5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(t)})}function R5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(t)})}function z5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(t)})}function O5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(t)})}function D5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(t)})}function M5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(t)})}function L5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(t)})}function I5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(t)})}function U5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(t)})}function P5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(t)})}function B5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(t)})}function $5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(t)})}function F5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(t)})}function q5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(t)})}function H5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(t)})}function Z5(e,t){return new e({type:"string",format:"date",check:"string_format",...Ae(t)})}function V5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(t)})}function Q5(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ae(t)})}function G5(e,t){return new e({type:"number",checks:[],...Ae(t)})}function K5(e,t){return new e({type:"number",coerce:!0,checks:[],...Ae(t)})}function Y5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(t)})}function X5(e,t){return new e({type:"boolean",...Ae(t)})}function J5(e){return new e({type:"unknown"})}function W5(e,t){return new e({type:"never",...Ae(t)})}function fS(e,t){return new gC({check:"less_than",...Ae(t),value:e,inclusive:!1})}function yp(e,t){return new gC({check:"less_than",...Ae(t),value:e,inclusive:!0})}function hS(e,t){return new yC({check:"greater_than",...Ae(t),value:e,inclusive:!1})}function vp(e,t){return new yC({check:"greater_than",...Ae(t),value:e,inclusive:!0})}function mS(e,t){return new h4({check:"multiple_of",...Ae(t),value:e})}function jC(e,t){return new p4({check:"max_length",...Ae(t),maximum:e})}function ef(e,t){return new g4({check:"min_length",...Ae(t),minimum:e})}function CC(e,t){return new y4({check:"length_equals",...Ae(t),length:e})}function eL(e,t){return new v4({check:"string_format",format:"regex",...Ae(t),pattern:e})}function tL(e){return new b4({check:"string_format",format:"lowercase",...Ae(e)})}function nL(e){return new x4({check:"string_format",format:"uppercase",...Ae(e)})}function rL(e,t){return new S4({check:"string_format",format:"includes",...Ae(t),includes:e})}function aL(e,t){return new w4({check:"string_format",format:"starts_with",...Ae(t),prefix:e})}function iL(e,t){return new k4({check:"string_format",format:"ends_with",...Ae(t),suffix:e})}function no(e){return new j4({check:"overwrite",tx:e})}function lL(e){return no(t=>t.normalize(e))}function sL(){return no(e=>e.trim())}function oL(){return no(e=>e.toLowerCase())}function uL(){return no(e=>e.toUpperCase())}function cL(){return no(e=>vM(e))}function dL(e,t,n){return new e({type:"array",element:t,...Ae(n)})}function fL(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ae(n)})}function hL(e){const t=mL(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Tu(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(Tu(l))}},e(n.value,n)));return t}function mL(e,t){const n=new Gn({check:"custom",...Ae(t)});return n._zod.check=e,n}function EC(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)??mu,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 Jt(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 S=e._zod.parent;S&&(c.ref||(c.ref=S),Jt(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&Rn(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 NC(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 C=(j=e.external.registry.get(y[0]))==null?void 0:j.id,E=e.external.uri??(O=>O);if(C)return{ref:E(C)};const A=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=A,{defId:A,ref:`${E("__shared")}#/${g}/${A}`}}if(y[1]===n)return{ref:"#"};const S=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:S+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:S}=l(y);g.def={...g.schema},S&&(g.defId=S);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>
|
|
362
|
+
|
|
363
|
+
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 S=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&S){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 _C(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},S=y.ref;if(y.ref=null,S){a(S);const j=e.seen.get(S),C=j.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,b),h._zod.parent===S)for(const A in g)A==="$ref"||A==="allOf"||A in b||delete g[A];if(C.$ref&&j.def)for(const A in g)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(g[A])===JSON.stringify(j.def[A])&&delete g[A]}const k=h._zod.parent;if(k&&k!==S){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const C in g)C==="$ref"||C==="allOf"||C in j.def&&JSON.stringify(g[C])===JSON.stringify(j.def[C])&&delete g[C]}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 Rn(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 Rn(a.element,n);if(a.type==="set")return Rn(a.valueType,n);if(a.type==="lazy")return Rn(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 Rn(a.innerType,n);if(a.type==="intersection")return Rn(a.left,n)||Rn(a.right,n);if(a.type==="record"||a.type==="map")return Rn(a.keyType,n)||Rn(a.valueType,n);if(a.type==="pipe")return Rn(a.in,n)||Rn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(Rn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(Rn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(Rn(l,n))return!0;return!!(a.rest&&Rn(a.rest,n))}return!1}const pL=(e,t={})=>n=>{const a=EC({...n,processors:t});return Jt(e,a),NC(a,e),_C(a,e)},tf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=EC({...l??{},target:o,io:t,processors:n});return Jt(e,c),NC(c,e),_C(c,e)},gL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yL=(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=gL[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}))])}},vL=(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)},bL=(e,t,n,a)=>{n.type="boolean"},xL=(e,t,n,a)=>{n.not={}},SL=(e,t,n,a)=>{},wL=(e,t,n,a)=>{const l=e._zod.def,o=iC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},kL=(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},jL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},CL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},EL=(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=Jt(o.element,t,{...a,path:[...a.path,"items"]})},NL=(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]=Jt(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=Jt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},_L=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>Jt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},AL=(e,t,n,a)=>{const l=e._zod.def,o=Jt(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=Jt(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},TL=(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=Jt(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=Jt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Jt(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)}},RL=(e,t,n,a)=>{const l=e._zod.def,o=Jt(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"}]},zL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},OL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},DL=(e,t,n,a)=>{const l=e._zod.def;Jt(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)))},ML=(e,t,n,a)=>{const l=e._zod.def;Jt(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},LL=(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;Jt(o,t,a);const c=t.seen.get(e);c.ref=o},IL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},AC=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},UL=se("ZodISODateTime",(e,t)=>{U4.init(e,t),Dt.init(e,t)});function PL(e){return H5(UL,e)}const BL=se("ZodISODate",(e,t)=>{P4.init(e,t),Dt.init(e,t)});function $L(e){return Z5(BL,e)}const FL=se("ZodISOTime",(e,t)=>{B4.init(e,t),Dt.init(e,t)});function qL(e){return V5(FL,e)}const HL=se("ZodISODuration",(e,t)=>{$4.init(e,t),Dt.init(e,t)});function ZL(e){return Q5(HL,e)}const VL=(e,t)=>{uC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>RM(e,n)},flatten:{value:n=>TM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Nr=se("ZodError",VL,{Parent:Error}),QL=wy(Nr),GL=ky(Nr),KL=jf(Nr),YL=Cf(Nr),XL=DM(Nr),JL=MM(Nr),WL=LM(Nr),eI=IM(Nr),tI=UM(Nr),nI=PM(Nr),rI=BM(Nr),aI=$M(Nr),Ot=se("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tf(e,"input"),output:tf(e,"output")}}),e.toJSONSchema=pL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(zi(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)=>Oi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>QL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>KL(e,n,a),e.parseAsync=async(n,a)=>GL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>YL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>XL(e,n,a),e.decode=(n,a)=>JL(e,n,a),e.encodeAsync=async(n,a)=>WL(e,n,a),e.decodeAsync=async(n,a)=>eI(e,n,a),e.safeEncode=(n,a)=>tI(e,n,a),e.safeDecode=(n,a)=>nI(e,n,a),e.safeEncodeAsync=async(n,a)=>rI(e,n,a),e.safeDecodeAsync=async(n,a)=>aI(e,n,a),e.refine=(n,a)=>e.check(YI(n,a)),e.superRefine=n=>e.check(XI(n)),e.overwrite=n=>e.check(no(n)),e.optional=()=>yS(e),e.exactOptional=()=>II(e),e.nullable=()=>vS(e),e.nullish=()=>yS(vS(e)),e.nonoptional=n=>qI(e,n),e.array=()=>Vn(e),e.or=n=>zC([e,n]),e.and=n=>zI(e,n),e.transform=n=>Eg(e,OC(n)),e.default=n=>BI(e,n),e.prefault=n=>FI(e,n),e.catch=n=>ZI(e,n),e.pipe=n=>Eg(e,n),e.readonly=()=>GI(e),e.describe=n=>{const a=e.clone();return mu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=mu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return mu.get(e);const a=e.clone();return mu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),TC=se("_ZodString",(e,t)=>{jy.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>yL(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(eL(...a)),e.includes=(...a)=>e.check(rL(...a)),e.startsWith=(...a)=>e.check(aL(...a)),e.endsWith=(...a)=>e.check(iL(...a)),e.min=(...a)=>e.check(ef(...a)),e.max=(...a)=>e.check(jC(...a)),e.length=(...a)=>e.check(CC(...a)),e.nonempty=(...a)=>e.check(ef(1,...a)),e.lowercase=a=>e.check(tL(a)),e.uppercase=a=>e.check(nL(a)),e.trim=()=>e.check(sL()),e.normalize=(...a)=>e.check(lL(...a)),e.toLowerCase=()=>e.check(oL()),e.toUpperCase=()=>e.check(uL()),e.slugify=()=>e.check(cL())}),iI=se("ZodString",(e,t)=>{jy.init(e,t),TC.init(e,t),e.email=n=>e.check(k5(lI,n)),e.url=n=>e.check(_5(sI,n)),e.jwt=n=>e.check(q5(wI,n)),e.emoji=n=>e.check(A5(oI,n)),e.guid=n=>e.check(dS(pS,n)),e.uuid=n=>e.check(j5(Td,n)),e.uuidv4=n=>e.check(C5(Td,n)),e.uuidv6=n=>e.check(E5(Td,n)),e.uuidv7=n=>e.check(N5(Td,n)),e.nanoid=n=>e.check(T5(uI,n)),e.guid=n=>e.check(dS(pS,n)),e.cuid=n=>e.check(R5(cI,n)),e.cuid2=n=>e.check(z5(dI,n)),e.ulid=n=>e.check(O5(fI,n)),e.base64=n=>e.check(B5(bI,n)),e.base64url=n=>e.check($5(xI,n)),e.xid=n=>e.check(D5(hI,n)),e.ksuid=n=>e.check(M5(mI,n)),e.ipv4=n=>e.check(L5(pI,n)),e.ipv6=n=>e.check(I5(gI,n)),e.cidrv4=n=>e.check(U5(yI,n)),e.cidrv6=n=>e.check(P5(vI,n)),e.e164=n=>e.check(F5(SI,n)),e.datetime=n=>e.check(PL(n)),e.date=n=>e.check($L(n)),e.time=n=>e.check(qL(n)),e.duration=n=>e.check(ZL(n))});function R(e){return w5(iI,e)}const Dt=se("ZodStringFormat",(e,t)=>{Tt.init(e,t),TC.init(e,t)}),lI=se("ZodEmail",(e,t)=>{A4.init(e,t),Dt.init(e,t)}),pS=se("ZodGUID",(e,t)=>{N4.init(e,t),Dt.init(e,t)}),Td=se("ZodUUID",(e,t)=>{_4.init(e,t),Dt.init(e,t)}),sI=se("ZodURL",(e,t)=>{T4.init(e,t),Dt.init(e,t)}),oI=se("ZodEmoji",(e,t)=>{R4.init(e,t),Dt.init(e,t)}),uI=se("ZodNanoID",(e,t)=>{z4.init(e,t),Dt.init(e,t)}),cI=se("ZodCUID",(e,t)=>{O4.init(e,t),Dt.init(e,t)}),dI=se("ZodCUID2",(e,t)=>{D4.init(e,t),Dt.init(e,t)}),fI=se("ZodULID",(e,t)=>{M4.init(e,t),Dt.init(e,t)}),hI=se("ZodXID",(e,t)=>{L4.init(e,t),Dt.init(e,t)}),mI=se("ZodKSUID",(e,t)=>{I4.init(e,t),Dt.init(e,t)}),pI=se("ZodIPv4",(e,t)=>{F4.init(e,t),Dt.init(e,t)}),gI=se("ZodIPv6",(e,t)=>{q4.init(e,t),Dt.init(e,t)}),yI=se("ZodCIDRv4",(e,t)=>{H4.init(e,t),Dt.init(e,t)}),vI=se("ZodCIDRv6",(e,t)=>{Z4.init(e,t),Dt.init(e,t)}),bI=se("ZodBase64",(e,t)=>{V4.init(e,t),Dt.init(e,t)}),xI=se("ZodBase64URL",(e,t)=>{G4.init(e,t),Dt.init(e,t)}),SI=se("ZodE164",(e,t)=>{K4.init(e,t),Dt.init(e,t)}),wI=se("ZodJWT",(e,t)=>{X4.init(e,t),Dt.init(e,t)}),Cy=se("ZodNumber",(e,t)=>{bC.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>vL(e,a,l),e.gt=(a,l)=>e.check(hS(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(fS(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(gS(a)),e.safe=a=>e.check(gS(a)),e.positive=a=>e.check(hS(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(fS(0,a)),e.nonpositive=a=>e.check(yp(0,a)),e.multipleOf=(a,l)=>e.check(mS(a,l)),e.step=(a,l)=>e.check(mS(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 Ge(e){return G5(Cy,e)}const kI=se("ZodNumberFormat",(e,t)=>{J4.init(e,t),Cy.init(e,t)});function gS(e){return Y5(kI,e)}const jI=se("ZodBoolean",(e,t)=>{W4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>bL(e,n,a)});function Yr(e){return X5(jI,e)}const CI=se("ZodUnknown",(e,t)=>{e5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>SL()});function St(){return J5(CI)}const EI=se("ZodNever",(e,t)=>{t5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xL(e,n,a)});function NI(e){return W5(EI,e)}const _I=se("ZodArray",(e,t)=>{n5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EL(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(jC(n,a)),e.length=(n,a)=>e.check(CC(n,a)),e.unwrap=()=>e.element});function Vn(e,t){return dL(_I,e,t)}const AI=se("ZodObject",(e,t)=>{a5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>NL(e,n,a,l),ft(e,"shape",()=>t.shape),e.keyof=()=>Qe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:NI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>CM(e,n),e.safeExtend=n=>EM(e,n),e.merge=n=>NM(e,n),e.pick=n=>kM(e,n),e.omit=n=>jM(e,n),e.partial=(...n)=>_M(DC,e,n[0]),e.required=(...n)=>AM(MC,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...Ae(t)};return new AI(n)}const RC=se("ZodUnion",(e,t)=>{wC.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>_L(e,n,a,l),e.options=t.options});function zC(e,t){return new RC({type:"union",options:e,...Ae(t)})}const TI=se("ZodDiscriminatedUnion",(e,t)=>{RC.init(e,t),i5.init(e,t)});function Ey(e,t,n){return new TI({type:"union",options:t,discriminator:e,...Ae(n)})}const RI=se("ZodIntersection",(e,t)=>{l5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AL(e,n,a,l)});function zI(e,t){return new RI({type:"intersection",left:e,right:t})}const OI=se("ZodRecord",(e,t)=>{s5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TL(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function $t(e,t,n){return new OI({type:"record",keyType:e,valueType:t,...Ae(n)})}const Cg=se("ZodEnum",(e,t)=>{o5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>wL(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 Cg({...t,checks:[],...Ae(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 Cg({...t,checks:[],...Ae(l),entries:o})}});function Qe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Cg({type:"enum",entries:n,...Ae(t)})}const DI=se("ZodLiteral",(e,t)=>{u5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kL(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 rn(e,t){return new DI({type:"literal",values:Array.isArray(e)?e:[e],...Ae(t)})}const MI=se("ZodTransform",(e,t)=>{c5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>CL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new rC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Tu(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(Tu(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function OC(e){return new MI({type:"transform",transform:e})}const DC=se("ZodOptional",(e,t)=>{kC.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function yS(e){return new DC({type:"optional",innerType:e})}const LI=se("ZodExactOptional",(e,t)=>{d5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function II(e){return new LI({type:"optional",innerType:e})}const UI=se("ZodNullable",(e,t)=>{f5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function vS(e){return new UI({type:"nullable",innerType:e})}const PI=se("ZodDefault",(e,t)=>{h5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>OL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function BI(e,t){return new PI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():sC(t)}})}const $I=se("ZodPrefault",(e,t)=>{m5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>DL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function FI(e,t){return new $I({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():sC(t)}})}const MC=se("ZodNonOptional",(e,t)=>{p5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>zL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function qI(e,t){return new MC({type:"nonoptional",innerType:e,...Ae(t)})}const HI=se("ZodCatch",(e,t)=>{g5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>ML(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ZI(e,t){return new HI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const VI=se("ZodPipe",(e,t)=>{y5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>LL(e,n,a,l),e.in=t.in,e.out=t.out});function Eg(e,t){return new VI({type:"pipe",in:e,out:t})}const QI=se("ZodReadonly",(e,t)=>{v5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>IL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function GI(e){return new QI({type:"readonly",innerType:e})}const KI=se("ZodCustom",(e,t)=>{b5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jL(e,n)});function YI(e,t={}){return fL(KI,e,t)}function XI(e){return hL(e)}function JI(e,t){return Eg(OC(e),t)}const bp={custom:"custom"};function Nf(e){return K5(Cy,e)}const WI=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function e6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function t6(e,t){const n=e6(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(WI)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const n6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,bS="/";function LC(e){return!e||typeof e!="string"||e.length>256||!n6.test(e)?"/":e}const r6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},IC=Qe(["feishu","slack","kael"]),UC=Qe(["active","inactive"]);de({platform:IC,agentId:R().min(1),credentials:$t(R(),St()),status:UC.default("active")});de({agentId:R().min(1).optional(),credentials:$t(R(),St()).optional(),status:UC.optional()});de({id:Ge(),platform:R(),agentId:R(),hasCredentials:Yr(),status:R(),createdAt:R(),updatedAt:R()});const a6=Qe(["code","reverse_token","oauth","manual"]);de({appId:R().min(1),appSecret:R().min(1)});de({platform:IC,externalUserId:R().min(1),agentId:R().min(1),boundVia:a6.default("manual"),displayName:R().max(200).optional()});de({id:Ge(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});de({feishuUserId:R().min(1),displayName:R().max(200).optional()});de({configId:Ge(),platform:R(),agentId:R(),appId:R(),connected:Yr(),lastActiveAt:R().nullable()});const PC=Qe(["online","offline"]),BC=Qe(["idle","working","blocked","error"]);Qe(["active","suspended","evicted"]);const i6=Qe(["active","suspended"]);de({chatId:R().min(1),state:i6});de({runtimeState:BC});de({agentId:R().min(1),runtimeType:R().max(50),runtimeVersion:R().max(50).optional()});Qe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);de({agentId:R(),status:PC,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:BC.nullable().optional(),activeSessions:Ge().int().nullable().optional(),totalSessions:Ge().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});de({total:Ge().int(),running:Ge().int(),byState:de({idle:Ge().int(),working:Ge().int(),blocked:Ge().int(),error:Ge().int()}),clients:Ge().int()});const nf={CLAUDE_CODE:"claude-code",CODEX:"codex"},_f=Qe(["claude-code","codex"]),l6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Af=Qe(["human","personal_assistant","autonomous_agent"]),xS={PRIVATE:"private",ORGANIZATION:"organization"},Ny=Qe(["private","organization"]),s6=Qe(["admin-api","portal"]);Qe(["active","suspended"]);const Ng=/^[a-z0-9][a-z0-9_-]{0,63}$/,js=64,o6=["admin","agent","first-tree","hub","me","null","system","undefined"],u6=new Set(o6);function _g(e){return u6.has(e)}de({name:R().min(1).max(64).regex(Ng,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!_g(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Af,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().max(100).optional(),source:s6.optional(),visibility:Ny.optional(),metadata:$t(R(),St()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional(),runtimeProvider:_f.optional()});de({type:Af.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Ny.optional(),metadata:$t(R(),St()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});de({clientId:R().min(1).max(100),runtimeProvider:_f,force:Yr().optional()});de({uuid:R(),name:R().nullable(),organizationId:R(),type:Af,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Ny,metadata:$t(R(),St()),managerId:R().nullable(),clientId:R().nullable(),runtimeProvider:_f,presenceStatus:PC.optional(),createdAt:R(),updatedAt:R()});de({repo:R().nullable(),branch:R().nullable()});de({type:rn("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:Af,runtimeProvider:_f});const c6=32e3,_y=/^[a-z0-9][a-z0-9_-]{0,63}$/i,d6=/^[A-Z][A-Z0-9_]*$/,f6=de({append:R().max(c6).default("")}),h6=de({name:R().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:rn("stdio"),command:R().min(1),args:Vn(R()).optional()}),m6=de({name:R().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:rn("http"),url:R().url(),headers:$t(R(),R()).optional()}),p6=de({name:R().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:rn("sse"),url:R().url(),headers:$t(R(),R()).optional()}),g6=Ey("transport",[h6,m6,p6]),y6=de({key:R().regex(d6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Yr().default(!1)}),v6=de({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),Tf=de({prompt:f6.default({append:""}),model:R().default("opus"),mcpServers:Vn(g6).default([]),env:Vn(y6).default([]),gitRepos:Vn(v6).default([])}),b6=Tf.extend({kind:rn("claude-code")}),x6=Tf.extend({kind:rn("codex")}),S6=Ey("kind",[b6,x6]),w6=(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))})},$C=JI(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,S6).superRefine((e,t)=>{w6(e,t)}),k6=de({agentId:R(),version:Ge().int().positive(),payload:$C,updatedAt:R(),updatedBy:R()});de({expectedVersion:Ge().int().positive(),payload:Tf.partial()});de({payload:Tf.partial()});de({current:k6,next:$C,diff:Vn(de({path:R(),op:Qe(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const rf="***";function af(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:R().min(1),password:R().min(1)});de({accessToken:R(),refreshToken:R()});de({refreshToken:R().min(1)});de({token:R().min(1)});de({token:R(),expiresIn:Ge(),command:R()});const j6=Qe(["direct","group","thread"]);de({type:j6,topic:R().max(500).optional(),participantIds:Vn(R()).min(1),metadata:$t(R(),St()).optional()});const FC=de({agentId:R(),role:R(),mode:R(),joinedAt:R()});FC.extend({name:R().nullable(),displayName:R(),type:R()});const C6=de({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:$t(R(),St()),createdAt:R(),updatedAt:R()});C6.extend({participants:Vn(FC)});de({topic:R().trim().max(500).nullable()});de({agentId:R().min(1),mode:Qe(["full","mention_only"]).default("full")});de({agentId:R().min(1)});const E6=Qe(["connected","disconnected"]);de({id:R(),userId:R().nullable(),status:E6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Ge().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:$t(R(),St()).nullable()});const N6=de({wsInboxDeliver:Yr().default(!1)}).partial();de({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional(),wireCapabilities:N6.optional()});const _6=Qe(["ok","missing","unauthenticated","error"]),A6=Qe(["api_key","oauth","auth_json","none"]),T6=de({state:_6,available:Yr(),authenticated:Yr(),sdkVersion:R().nullable().optional(),authMethod:A6,error:R().nullable().optional(),detectedAt:R()}),R6=$t(R(),T6);de({capabilities:R6});de({limit:Nf().int().min(1).max(100).default(20),cursor:R().optional()});const z6=["image/png","image/jpeg","image/gif","image/webp"],Ay=Qe(z6);de({data:R().min(1),mimeType:Ay,filename:R().min(1),size:Ge().int().nonnegative().optional(),imageId:R().uuid().optional()});de({imageId:R().uuid(),mimeType:Ay,filename:R().min(1),size:Ge().int().nonnegative().optional()});de({type:rn("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:Ay,filename:R().min(1),size:Ge().int().nonnegative().optional()});const Ty=Qe(["hub_ui","cli","feishu","github","api"]),qC=Qe(["text","markdown","card","reference","file","task"]);de({format:qC.default("text"),content:St(),metadata:$t(R(),St()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Ty.optional()});de({format:qC.default("text"),content:St(),metadata:$t(R(),St()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Ty.optional()});const O6=de({id:R(),chatId:R(),senderId:R(),format:R(),content:St(),metadata:$t(R(),St()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:Ty.nullable(),createdAt:R()}),D6=de({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),M6=Qe(["full","mention_only"]),L6=de({id:R(),senderId:R(),format:R(),content:St(),metadata:$t(R(),St()).default({}),createdAt:R()}),HC=O6.extend({configVersion:Ge().int().positive(),recipientMode:M6.default("full"),inReplyToSnapshot:D6.default(null),precedingMessages:Vn(L6).default([])});Qe(["pending","delivered","acked","failed"]);const I6=de({id:Ge(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Ge(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});I6.extend({message:HC});de({limit:Nf().int().min(1).max(50).default(10)});de({type:rn("inbox:deliver"),entryId:Ge().int().nonnegative(),inboxId:R().min(1),chatId:R().nullable(),message:HC}).passthrough();de({type:rn("inbox:ack"),entryId:Ge().int().nonnegative()});const U6=7;de({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R(),expiresAt:R().nullable()});de({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});de({token:R().min(1)});de({}).optional();Qe(["connect","create_agent","completed"]);de({id:R(),name:R(),displayName:R(),role:Qe(["admin","member"])});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});de({organizationId:R().min(1)});const P6={ADMIN:"admin",MEMBER:"member"},Ry=Qe(["admin","member"]),B6=de({id:R(),userId:R(),organizationId:R(),agentId:R(),role:Ry,createdAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),role:Ry.default("member")});de({role:Ry.optional(),displayName:R().min(1).max(200).optional()});B6.extend({username:R(),displayName:R(),password:R()});const $6=Qe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),ZC=Qe(["high","medium","low"]);de({id:R(),organizationId:R(),type:$6,severity:ZC,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Yr(),createdAt:R()});de({limit:Nf().int().min(1).max(100).default(20),cursor:R().optional(),severity:ZC.optional(),read:Qe(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});de({next:R().max(256).optional()});de({code:R().min(1),state:R().min(1)});de({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const VC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({name:R().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=>!VC.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Ge().int().min(0).default(0),maxMessagesPerMinute:Ge().int().min(0).default(0),features:$t(R(),St()).default({})});de({name:R().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=>!VC.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Ge().int().min(0).optional(),maxMessagesPerMinute:Ge().int().min(0).optional(),features:$t(R(),St()).optional()});de({id:R(),name:R(),displayName:R(),maxAgents:Ge(),maxMessagesPerMinute:Ge(),features:$t(R(),St()),createdAt:R(),updatedAt:R()});const F6=de({workingCount:Ge().int().nonnegative(),errorMask:Yr()}),q6=de({type:rn("pulse:tick"),organizationId:R(),agents:$t(R(),Vn(F6).length(32))}),H6=Qe(["tool_call","error","assistant_text","thinking","turn_end"]),QC=de({toolUseId:R(),name:R(),args:St(),status:Qe(["pending","ok","error"]),durationMs:Ge().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),GC=de({source:Qe(["sdk","runtime","tool"]),message:R().max(2e3)}),KC=de({text:R().max(8e3)}),YC=de({}),XC=de({status:Qe(["success","error"])}),Z6=Ey("kind",[de({kind:rn("tool_call"),payload:QC}),de({kind:rn("error"),payload:GC}),de({kind:rn("assistant_text"),payload:KC}),de({kind:rn("thinking"),payload:YC}),de({kind:rn("turn_end"),payload:XC})]);de({id:R(),agentId:R(),chatId:R(),seq:Ge().int().positive(),kind:H6,payload:zC([QC,GC,KC,YC,XC]),createdAt:R()});de({agentId:R(),chatId:R(),event:Z6});de({agentId:R(),chatId:R()});de({type:rn("session:reconcile"),agentId:R().min(1),chatIds:Vn(R().min(1)).max(500)});de({type:rn("session:reconcile:result"),agentId:R().min(1),staleChatIds:Vn(R().min(1))});const V6=de({organizationId:R(),agentCount:Ge(),chatCount:Ge(),messageCount:Ge()});de({totalAgents:Ge(),totalChats:Ge(),totalMessages:Ge(),byOrganization:Vn(V6)});de({key:R(),value:St(),updatedAt:R()});$t(R(),St());const ki={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Zd={[ki.INBOX_TIMEOUT_SECONDS]:300,[ki.MAX_RETRY_COUNT]:3,[ki.POLLING_INTERVAL_SECONDS]:5,[ki.PRESENCE_CLEANUP_SECONDS]:60},Ru=Qe(["pending","assigned","working","completed","failed","cancelled"]),SS=Qe(["agent","admin"]),Q6=Qe(["assigned","status_changed","cancelled"]);de({taskId:R(),event:Q6,title:R(),body:R().default(""),status:Ru,fromStatus:Ru.optional(),originRef:R().nullable().optional()});const G6=de({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:$t(R(),St()).optional()});G6.extend({organizationId:R().optional()});de({status:Qe(["working","completed","failed"]),result:R().optional()});de({assigneeAgentId:R().nullable().optional(),status:Ru.optional(),result:R().optional()});de({chatId:R().min(1)});const K6=de({id:R(),organizationId:R(),title:R(),body:R(),status:Ru,assigneeAgentId:R().nullable(),createdByType:SS,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:$t(R(),St()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:SS.nullable(),cancelledById:R().nullable()}),Y6=de({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});K6.extend({chats:Vn(Y6)});de({status:Ru.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:Nf().int().min(1).max(100).default(20),cursor:R().optional()});const X6=Qe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:R(),signal:X6,reason:R()});const J6=Qe(["active","suspended"]);de({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:J6,createdAt:R(),updatedAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});de({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});de({type:rn("auth"),token:R().min(1)});const W6=de({wsInboxDeliver:Yr().default(!1)}).partial();de({type:rn("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Ge().int().nonnegative(),capabilities:W6.optional()}).passthrough();const JC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function eU(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 tU=2e3,nU=3e4;let fi=null,lf=!1,xp=0,yu=null;const Ag=new Set;let pu=null,Cs=0;function rU(e){for(const t of Ag)try{t(e)}catch{}pu&&(e.type==="notification"?pu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(pu.invalidateQueries({queryKey:["activity"]}),pu.invalidateQueries({queryKey:["sessions"]})))}function WC(){const e=iy();if(!(e!=null&&e.accessToken))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,a=new WebSocket(n);fi=a,a.onmessage=l=>{if(a===fi)try{const o=JSON.parse(l.data);rU(o)}catch{}},a.onopen=()=>{a===fi&&(xp=0)},a.onclose=()=>{if(a!==fi||(fi=null,lf||Cs===0))return;xp++;const l=Math.min(tU*2**(xp-1),nU);yu=setTimeout(()=>{yu=null,!lf&&Cs>0&&WC()},l)}}function aU(){lf=!0,yu&&(clearTimeout(yu),yu=null),fi&&(fi.close(1e3,"unmount"),fi=null)}function eE(e){const{onMessage:t,enabled:n=!0}=e??{},a=_n(),l=x.useRef(t);l.current=t,x.useEffect(()=>{pu=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Ag.add(o),Cs++,Cs===1&&(lf=!1,WC()),()=>{Ag.delete(o),Cs--,Cs===0&&aU()}},[n])}const tE=x.createContext({aggregated:JC,agents:{},receivedAtMs:null,stale:!0});function iU({children:e}){const[t,n]=x.useState({aggregated:JC,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());eE({onMessage:c=>{const f=q6.safeParse(c);f.success&&n({aggregated:eU(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(tE.Provider,{value:o,children:e})}function lU(){return x.useContext(tE)}function Rf({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:_e("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-title",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]})}function nE({className:e,style:t,...n}){return u.jsx("div",{className:_e("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function rE({active:e,onClick:t,children:n}){return u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}const sU={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 xn({tone:e="neutral",className:t,style:n,...a}){const l=sU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:_e("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})}const vl=x.forwardRef(({className:e,...t},n)=>u.jsx("table",{ref:n,className:_e("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));vl.displayName="DenseTable";const bl=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));bl.displayName="DenseTableHeader";const xl=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));xl.displayName="DenseTableBody";const sr=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:_e("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}));sr.displayName="DenseTableRow";const $e=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:_e("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));$e.displayName="DenseTableHead";const Ie=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:_e("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ie.displayName="DenseTableCell";const an=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));an.displayName="Panel";const _r=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("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}));_r.displayName="PanelHeader";const Ar=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Ar.displayName="PanelTitle";const Xr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Xr.displayName="PanelBody";function Gs({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:_e("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 Xu({className:e,style:t,...n}){return u.jsx("span",{className:_e("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function zy(){return ke.get("/members")}function oU(e){return ke.post("/members",e)}function uU(e,t){return ke.patch(`/members/${encodeURIComponent(e)}`,t)}function cU(e){return ke.delete(`/members/${encodeURIComponent(e)}`)}function Oy(){const{data:e}=He({queryKey:["members","name-map"],queryFn:zy,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 dU(){const e=wn(),t=Oy(),{data:n,isLoading:a,error:l}=He({queryKey:["admin-all-agents"],queryFn:()=>DD({limit:100})});return u.jsxs("div",{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),u.jsxs(an,{children:[u.jsxs(Gs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Agent name"}),u.jsx($e,{children:"Type"}),u.jsx($e,{children:"Visibility"}),u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Created"})]})}),u.jsx(xl,{children:n.items.map(o=>u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"font-medium",children:o.displayName})}),u.jsx(Ie,{children:o.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),u.jsx(Ie,{children:u.jsx(xn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),u.jsx(Ie,{children:u.jsx(xn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),u.jsx(Ie,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),u.jsx(Ie,{children:u.jsx(xn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(o.createdAt)})]},o.uuid))})]})]})]})}const ro=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));ro.displayName="Card";const ao=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));ao.displayName="CardHeader";const Ju=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("text-subtitle leading-none",e),...t}));Ju.displayName="CardTitle";const aE=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("text-body text-muted-foreground",e),...t}));aE.displayName="CardDescription";const io=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));io.displayName="CardContent";const fU=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));fU.displayName="CardFooter";function hU(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 mU(){const{organizationId:e}=ln(),[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 ke.get(`/admin/organizations/${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 ke.post(`/admin/organizations/${e}/invitations/rotate`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(ro,{children:[u.jsxs(ao,{children:[u.jsx(Ju,{children:"Invite link"}),u.jsxs(aE,{children:["Anyone with this link can join your team as a member. Links expire after ",U6," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(io,{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(me,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(me,{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?` · ${hU(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const iE=Object.values(P6);function pU(e,t){const n=(e==null?void 0:e.trim())||t,a=n.split(/[\s._-]+/).filter(Boolean);if(a.length>=2){const l=a[0]??"",o=a[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function gU(){const e=_n(),{memberId:t}=ln(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[c,f]=x.useState(null),[m,h]=x.useState(null),{data:y,isLoading:g,error:b}=He({queryKey:["members"],queryFn:zy}),S=gt({mutationFn:()=>oU({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:A=>{e.invalidateQueries({queryKey:["members"]}),f(A.password)}}),k=gt({mutationFn:cU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function C(A){A.preventDefault(),S.mutate()}function E(A){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(A)}return u.jsxs(u.Fragment,{children:[u.jsxs(an,{children:[u.jsxs(Gs,{right:u.jsxs(Pt,{open:n,onOpenChange:A=>A?a(!0):j(),children:[u.jsx(RD,{asChild:!0,children:u.jsxs(me,{size:"xs",className:"normal-case tracking-normal",children:[u.jsx(Aa,{className:"h-3 w-3"}),"Add member"]})}),u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),u.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("code",{className:"flex-1 text-body mono",children:c}),u.jsx(me,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(sy,{className:"h-4 w-4"})})]}),u.jsx(Wt,{children:u.jsx(me,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"member-username",children:"Username"}),u.jsx(xt,{id:"member-username",type:"text",value:l.username,onChange:A=>o({...l,username:A.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"member-name",children:"Display Name"}),u.jsx(xt,{id:"member-name",value:l.displayName,onChange:A=>o({...l,displayName:A.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:l.role,onChange:A=>o({...l,role:A.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:iE.map(A=>u.jsx("option",{value:A,children:A},A))})]}),S.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),u.jsx(Wt,{children:u.jsx(me,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(y==null?void 0:y.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{style:{width:30}}),u.jsx($e,{children:"Username"}),u.jsx($e,{children:"Name"}),u.jsx($e,{children:"Role"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:1}})]})}),u.jsx(xl,{children:y==null?void 0:y.map(A=>{const O=t===A.id;return u.jsxs(sr,{children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:pU(A.displayName,A.username)})}),u.jsxs(Ie,{children:[u.jsx("span",{className:"mono font-medium",children:A.username}),O&&u.jsx(Xu,{style:{marginLeft:6},children:"you"})]}),u.jsx(Ie,{style:{color:"var(--fg-2)"},children:A.displayName}),u.jsx(Ie,{children:u.jsx(xn,{tone:A.role==="admin"?"accent":"neutral",children:A.role})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(A.createdAt)}),u.jsx(Ie,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:A.id,username:A.username,displayName:A.displayName,role:A.role}),title:"Edit",children:u.jsx(Qu,{className:"h-3.5 w-3.5"})}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>E(A.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})})]},A.id)})})]})]}),u.jsx(yU,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function yU({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=gt({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:uU(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(Pt,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Username"}),u.jsx(xt,{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(nt,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(xt,{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(nt,{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:iE.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(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function vU(){return ke.get("/admin/system/config")}function bU(e){return ke.patch("/admin/system/config",e)}function xU(e){return ke.get(`/admin/organizations/${encodeURIComponent(e)}`)}function SU(e,t){return ke.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function wU(){return ke.post("/me/organizations/leave")}function kU(){const{organizationId:e}=ln(),t=_n(),n=He({queryKey:["organization",e],queryFn:()=>e?xU(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=gt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},b=a.trim(),S=o.trim();return b&&b!==n.data.displayName&&(g.displayName=b),S&&S!==n.data.name&&(g.name=S),Object.keys(g).length===0?Promise.resolve(n.data):SU(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(an,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Team identity"}),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(me,{type:"submit",form:"team-identity-form",size:"xs",disabled:h.isPending||!n.data,children:[u.jsx(_a,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]})]}),u.jsx(Xr,{children:n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx(wS,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),u.jsx(wS,{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 wS({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) 0",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)"}})]})}const lE=[{key:ki.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ki.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ki.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ki.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],kS=lE.map(e=>e.key);function jU(){const e=_n(),{data:t,isLoading:n}=He({queryKey:["system-config"],queryFn:vU}),[a,l]=x.useState({}),[o,c]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of kS){const b=t[g]??Zd[g]??"";y[g]=String(b)}l(y)},[t]);const f=gt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const S=b.trim();if(S==="")y[g]=Zd[g]??0;else{const k=Number(S);y[g]=Number.isNaN(k)?S:k}}return bU(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}});function m(){const y={};for(const g of kS)y[g]=String(Zd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return u.jsxs("div",{className:"space-y-4",children:[u.jsx(kU,{}),u.jsx("form",{onSubmit:h,children:u.jsxs(an,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"System configuration"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsx(me,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),u.jsxs(me,{type:"submit",size:"xs",disabled:f.isPending,children:[u.jsx(_a,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),u.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?u.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):lE.map(y=>u.jsx(CU,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&u.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})]})}function CU({field:e,value:t,onChange:n}){const a=String(Zd[e.key]??"—");return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),u.jsxs(Xu,{style:{marginTop:4,display:"block"},children:["default"," ",u.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&u.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const jS=[{key:"members",label:"Members"},{key:"invite",label:"Invite link"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function EU(){const{role:e}=ln(),t=Dn(),n=wn();if(e===null)return u.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return u.jsx(mf,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=jS.some(c=>c.key===a)?a:"members",o=c=>{n({hash:c},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Admin",subtitle:"Organization-wide controls"}),u.jsx(nE,{children:jS.map(c=>u.jsx(rE,{active:l===c.key,onClick:()=>o(c.key),children:c.label},c.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&u.jsx(gU,{}),l==="invite"&&u.jsx(mU,{}),l==="all-agents"&&u.jsx(dU,{}),l==="settings"&&u.jsx(jU,{})]})]})}function NU(e){return ke.get(`/admin/agents/${e}/config`)}function _U(e,t){return ke.patch(`/admin/agents/${e}/config`,t)}function AU(e,t){return ke.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function TU(e){return ke.get(`/admin/agents/${e}/client-status`)}function RU({className:e,style:t,...n}){return u.jsx("div",{className:_e("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function zU({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 OU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function DU({children:e,mono:t}){return u.jsx("span",{className:_e("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Kr({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:_e("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:_e("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:_e("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:_e("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function MU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ks({state:e,className:t}){const n=e!==null&&MU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:_e("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(Kr,{state:n,size:7}),n]})}function Rd({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 LU({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 IU(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(uy,{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(Sp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(Sp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(Sp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(me,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(Hs,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(UU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(PU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function Sp(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 UU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsxs(Bt,{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(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function PU({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(Pt,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsxs(Bt,{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(xt,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const BU={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 Dy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=BU[e],f=e==="deleted";return u.jsxs("div",{className:_e("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:_e("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(me,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(dz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(Qu,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(Hs,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function $U(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(an,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Aa,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Xr,{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(Dy,{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(Rk,{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(NR,{className:"h-3.5 w-3.5"}):u.jsx(AR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(FU,{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 FU({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 S(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(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:S,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"env-key",children:"Key"}),u.jsx(xt,{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(nt,{htmlFor:"env-value",children:"Value"}),u.jsx(xt,{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(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function qU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(an,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Aa,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Xr,{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(Dy,{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(HU,{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 HU({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 S(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const C=h.trim()||af(j);if(C&&a.has(C)){b(`Another repo already occupies local path "${C}".`);return}const E={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(E)}return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:S,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"git-url",children:"URL"}),u.jsx(xt,{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(nt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(xt,{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(nt,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(xt,{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(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function sE({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:_e("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:_e("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:_e("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 ZU({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=yy(),o=Oy(),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(an,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Profile"}),e.status==="active"&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(Qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(Xr,{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(sE,{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(xn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(xn,{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(xn,{tone:"outline",children:b},b))})]})]})]}),u.jsx(VU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function VU({agent:e,open:t,onOpenChange:n,onSave:a}){var L;const{memberId:l,role:o}=ln(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,S]=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 C=e.type==="human",E=o==="admin"||e.managerId===l,A=He({queryKey:["agents-for-delegate"],queryFn:async()=>(await Yu({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&C});async function O(D){D.preventDefault(),j(null);const z=c.trim();if(!z){j("Display name is required.");return}S(!0);try{const I={displayName:z,delegateMention:m||null};y!==e.visibility&&(I.visibility=y),await a(I),n(!1)}catch(I){j(I instanceof Error?I.message:String(I))}finally{S(!1)}}return u.jsx(Pt,{open:t,onOpenChange:n,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:O,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Agent name"}),u.jsx(xt,{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(nt,{htmlFor:"id-display",children:"Display Name"}),u.jsx(xt,{id:"id-display",value:c,onChange:D=>f(D.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:y,onChange:D=>g(D.target.value),disabled:!E,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:xS.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:xS.ORGANIZATION,children:"Organization — all members"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:E?"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."})]}),C&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:m,onChange:D=>h(D.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"}),(L=A.data)==null?void 0:L.map(D=>u.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (@${D.name??D.uuid})`:D.name?`@${D.name}`:D.uuid},D.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(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function QU(e){return e==="working"?"accent":e==="error"?"error":"outline"}function GU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(an,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Aa,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Xr,{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(Dy,{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(xn,{tone:QU(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:KU(l.value)})]},l.key)})}),t&&u.jsx(YU,{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 KU(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 YU({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(" "):""),[S,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,C]=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:""),C(null))},[e,n]);function E(A){if(A.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){C("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){C(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){C("stdio transport requires a command.");return}const L=g.trim().split(/\s+/).filter(D=>D.length>0);O={name:f,transport:"stdio",command:h.trim(),...L.length?{args:L}:{}}}else{const L=S.trim();try{new URL(L)}catch{C("URL is not valid.");return}O={name:f,transport:o,url:L}}l(O)}return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:E,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:A=>c(A.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(nt,{htmlFor:"mcp-name",children:"Name"}),u.jsx(xt,{id:"mcp-name",value:f,onChange:A=>m(A.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-command",children:"Command"}),u.jsx(xt,{id:"mcp-command",value:h,onChange:A=>y(A.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(xt,{id:"mcp-args",value:g,onChange:A=>b(A.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-url",children:"URL"}),u.jsx(xt,{id:"mcp-url",value:S,onChange:A=>k(A.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const XU=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],JU=[{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"}],WU={"claude-code":XU,codex:JU},e9={"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."},t9={value:"",label:"(unset — inherits local)"};function n9({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=WU[o],m=x.useMemo(()=>{const h=[t9,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(an,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(_r,{children:[u.jsxs(Ar,{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(me,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(Xr,{className:"space-y-2",children:[u.jsx(r9,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:e9[o]})]})]})}function r9({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 S=b.getBoundingClientRect();f({top:S.bottom+4,left:S.left,width:S.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var E,A;const C=j.target;(E=m.current)!=null&&E.contains(C)||(A=h.current)!=null&&A.contains(C)||o(!1)},S=j=>{var C;j.key==="Escape"&&(o(!1),(C=m.current)==null||C.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",S),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",S),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(Ak,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&fy.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 S=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:S?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(_a,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:S?"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 a9(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const i9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s9={};function CS(e,t){return(s9.jsx?l9:i9).test(e)}const o9=/[ \t\n\f\r]/g;function u9(e){return typeof e=="object"?e.type==="text"?ES(e.value):!1:ES(e)}function ES(e){return e.replace(o9,"")===""}class Wu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Wu.prototype.normal={};Wu.prototype.property={};Wu.prototype.space=void 0;function oE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Wu(n,a,t)}function Tg(e){return e.toLowerCase()}class Kn{constructor(t,n){this.attribute=n,this.property=t}}Kn.prototype.attribute="";Kn.prototype.booleanish=!1;Kn.prototype.boolean=!1;Kn.prototype.commaOrSpaceSeparated=!1;Kn.prototype.commaSeparated=!1;Kn.prototype.defined=!1;Kn.prototype.mustUseProperty=!1;Kn.prototype.number=!1;Kn.prototype.overloadedBoolean=!1;Kn.prototype.property="";Kn.prototype.spaceSeparated=!1;Kn.prototype.space=void 0;let c9=0;const Ve=Nl(),Xt=Nl(),Rg=Nl(),pe=Nl(),jt=Nl(),_s=Nl(),ar=Nl();function Nl(){return 2**++c9}const zg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Xt,commaOrSpaceSeparated:ar,commaSeparated:_s,number:pe,overloadedBoolean:Rg,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),wp=Object.keys(zg);class My extends Kn{constructor(t,n,a,l){let o=-1;if(super(t,n),NS(this,"space",l),typeof a=="number")for(;++o<wp.length;){const c=wp[o];NS(this,wp[o],(a&zg[c])===zg[c])}}}My.prototype.defined=!0;function NS(e,t,n){n&&(e[t]=n)}function lo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new My(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Tg(a)]=a,n[Tg(o.attribute)]=a}return new Wu(t,n,e.space)}const uE=lo({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,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:pe,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:jt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Xt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cE(e,t){return t in e?e[t]:t}function dE(e,t){return cE(e,t.toLowerCase())}const d9=lo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:jt,autoFocus:Ve,autoPlay:Ve,blocking:jt,capture:null,charSet:null,checked:Ve,cite:null,className:jt,cols:pe,colSpan:null,content:null,contentEditable:Xt,controls:Ve,controlsList:jt,coords:pe|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Rg,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:jt,height:pe,hidden:Rg,high:pe,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ve,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:pe,pattern:null,ping:jt,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:jt,required:Ve,reversed:Ve,rows:pe,rowSpan:pe,sandbox:jt,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Xt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Xt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:dE}),f9=lo({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:ar,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:ar,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ar,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ar,rev:ar,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ar,requiredFeatures:ar,requiredFonts:ar,requiredFormats:ar,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:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:ar,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ar,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ar,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cE}),fE=lo({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()}}),hE=lo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dE}),mE=lo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),h9={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"},m9=/[A-Z]/g,_S=/-[a-z]/g,p9=/^data[-\w.:]+$/i;function g9(e,t){const n=Tg(t);let a=t,l=Kn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&p9.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_S,v9);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_S.test(o)){let c=o.replace(m9,y9);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=My}return new l(a,t)}function y9(e){return"-"+e.toLowerCase()}function v9(e){return e.charAt(1).toUpperCase()}const b9=oE([uE,d9,fE,hE,mE],"html"),Ly=oE([uE,f9,fE,hE,mE],"svg");function x9(e){return e.join(" ").trim()}var gs={},kp,AS;function S9(){if(AS)return kp;AS=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=`
|
|
364
|
+
`,h="/",y="*",g="",b="comment",S="declaration";function k(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var A=1,O=1;function L(fe){var ie=fe.match(t);ie&&(A+=ie.length);var Z=fe.lastIndexOf(m);O=~Z?fe.length-Z:O+fe.length}function D(){var fe={line:A,column:O};return function(ie){return ie.position=new z(fe),Y(),ie}}function z(fe){this.start=fe,this.end={line:A,column:O},this.source=E.source}z.prototype.content=C;function I(fe){var ie=new Error(E.source+":"+A+":"+O+": "+fe);if(ie.reason=fe,ie.filename=E.source,ie.line=A,ie.column=O,ie.source=C,!E.silent)throw ie}function F(fe){var ie=fe.exec(C);if(ie){var Z=ie[0];return L(Z),C=C.slice(Z.length),ie}}function Y(){F(n)}function $(fe){var ie;for(fe=fe||[];ie=te();)ie!==!1&&fe.push(ie);return fe}function te(){var fe=D();if(!(h!=C.charAt(0)||y!=C.charAt(1))){for(var ie=2;g!=C.charAt(ie)&&(y!=C.charAt(ie)||h!=C.charAt(ie+1));)++ie;if(ie+=2,g===C.charAt(ie-1))return I("End of comment missing");var Z=C.slice(2,ie-2);return O+=2,L(Z),C=C.slice(ie),O+=2,fe({type:b,comment:Z})}}function J(){var fe=D(),ie=F(a);if(ie){if(te(),!F(l))return I("property missing ':'");var Z=F(o),ae=fe({type:S,property:j(ie[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return F(c),ae}}function be(){var fe=[];$(fe);for(var ie;ie=J();)ie!==!1&&(fe.push(ie),$(fe));return fe}return Y(),be()}function j(C){return C?C.replace(f,g):g}return kp=k,kp}var TS;function w9(){if(TS)return gs;TS=1;var e=gs&&gs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=n;const t=e(S9());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 gs}var ou={},RS;function k9(){if(RS)return ou;RS=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.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 ou.camelCase=m,ou}var uu,zS;function j9(){if(zS)return uu;zS=1;var e=uu&&uu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(w9()),n=k9();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,uu=a,uu}var C9=j9();const E9=df(C9),pE=gE("end"),Iy=gE("start");function gE(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 N9(e){const t=Iy(e),n=pE(e);if(t&&n)return{start:t,end:n}}function vu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?OS(e.position):"start"in e||"end"in e?OS(e):"line"in e||"column"in e?Og(e):""}function Og(e){return DS(e&&e.line)+":"+DS(e&&e.column)}function OS(e){return Og(e&&e.start)+"-"+Og(e&&e.end)}function DS(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=vu(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 Uy={}.hasOwnProperty,_9=new Map,A9=/[A-Z]/g,T9=new Set(["table","tbody","thead","tfoot","tr"]),R9=new Set(["td","th"]),yE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function z9(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=B9(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=P9(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"?Ly:b9,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=vE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function vE(e,t,n){if(t.type==="element")return O9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return D9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return L9(e,t,n);if(t.type==="mdxjsEsm")return M9(e,t);if(t.type==="root")return I9(e,t,n);if(t.type==="text")return U9(e,t)}function O9(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Ly,e.schema=l),e.ancestors.push(t);const o=xE(e,t.tagName,!1),c=$9(e,t);let f=By(e,t);return T9.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!u9(m):!0})),bE(e,c,o,t),Py(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function D9(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 M9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zu(e,t.position)}function L9(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Ly,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:xE(e,t.name,!0),c=F9(e,t),f=By(e,t);return bE(e,c,o,t),Py(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function I9(e,t,n){const a={};return Py(a,By(e,t)),e.create(t,e.Fragment,a,n)}function U9(e,t){return t.value}function bE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Py(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function P9(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 B9(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=Iy(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 $9(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Uy.call(t.properties,l)){const o=q9(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&R9.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 F9(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 By(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:_9;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=vE(e,o,c);f!==void 0&&n.push(f)}return n}function q9(e,t,n){const a=g9(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?a9(n):x9(n)),a.property==="style"){let l=typeof n=="object"?n:H9(e,String(n));return e.stylePropertyNameCase==="css"&&(l=Z9(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?h9[a.property]||a.property:a.attribute,n]}}function H9(e,t){try{return E9(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=yE+"#cannot-parse-style-attribute",l}}function xE(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=CS(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=CS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Uy.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=yE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Z9(e){const t={};let n;for(n in e)Uy.call(e,n)&&(t[V9(n)]=e[n]);return t}function V9(e){let t=e.replace(A9,Q9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Q9(e){return"-"+e.toLowerCase()}const jp={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"]},G9={};function $y(e,t){const n=G9,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return SE(e,a,l)}function SE(e,t,n){if(K9(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 MS(e.children,t,n)}return Array.isArray(e)?MS(e,t,n):""}function MS(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=SE(e[l],t,n);return a.join("")}function K9(e){return!!(e&&typeof e=="object")}const LS=document.createElement("i");function Fy(e){const t="&"+e+";";LS.innerHTML=t;const n=LS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function or(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 jr(e,t){return e.length>0?(or(e,e.length,0,t),e):t}const IS={}.hasOwnProperty;function wE(e){const t={};let n=-1;for(;++n<e.length;)Y9(t,e[n]);return t}function Y9(e,t){let n;for(n in t){const l=(IS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){IS.call(l,c)||(l[c]=[]);const f=o[c];X9(l[c],Array.isArray(f)?f:f?[f]:[])}}}function X9(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);or(e,0,0,a)}function kE(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 Mr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const On=Di(/[A-Za-z]/),Nn=Di(/[\dA-Za-z]/),J9=Di(/[#-'*+\--9=?A-Z^-~]/);function sf(e){return e!==null&&(e<32||e===127)}const Dg=Di(/\d/),W9=Di(/[\dA-Fa-f]/),eP=Di(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const zf=Di(new RegExp("\\p{P}|\\p{S}","u")),Sl=Di(/\s/);function Di(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function so(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&Nn(e.charCodeAt(n+1))&&Nn(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 st(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return We(m)?(e.enter(n),f(m)):t(m)}function f(m){return We(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const tP={tokenize:nP};function nP(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"),st(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 ze(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const rP={tokenize:aP},US={tokenize:iP};function aP(e){const t=this,n=[];let a=0,l,o,c;return f;function f(O){if(a<n.length){const L=n[a];return t.containerState=L[1],e.attempt(L[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const L=t.events.length;let D=L,z;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){z=t.events[D][1].end;break}E(a);let I=L;for(;I<t.events.length;)t.events[I][1].end={...z},I++;return or(t.events,D+1,0,t.events.slice(L)),t.events.length=I,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(US,y,g)(O)}function y(O){return l&&A(),E(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(US,S,k)(O)}function S(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&A(),E(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){C(e.exit("chunkFlow"),!0),E(0),e.consume(O);return}return ze(O)?(e.consume(O),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function C(O,L){const D=t.sliceStream(O);if(L&&D.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(D),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 I=t.events.length;let F=I,Y,$;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(Y){$=t.events[F][1].end;break}Y=!0}for(E(a),z=I;z<t.events.length;)t.events[z][1].end={...$},z++;or(t.events,F+1,0,t.events.slice(I)),t.events.length=z}}function E(O){let L=n.length;for(;L-- >O;){const D=n[L];t.containerState=D[1],D[0].exit.call(t,e)}n.length=O}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function iP(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ys(e){if(e===null||kt(e)||Sl(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 Mg={name:"attention",resolveAll:lP,tokenize:sP};function lP(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};PS(g,-m),PS(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=jr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=jr(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=jr(h,Of(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=jr(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=jr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,or(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 sP(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Ys(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=Ys(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 PS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oP={name:"autolink",tokenize:uP};function uP(e,t,n){let a=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(S){return On(S)?(e.consume(S),c):S===64?n(S):h(S)}function c(S){return S===43||S===45||S===46||Nn(S)?(a=1,f(S)):h(S)}function f(S){return S===58?(e.consume(S),a=0,m):(S===43||S===45||S===46||Nn(S))&&a++<32?(e.consume(S),f):(a=0,h(S))}function m(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):S===null||S===32||S===60||sf(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),y):J9(S)?(e.consume(S),h):n(S)}function y(S){return Nn(S)?g(S):n(S)}function g(S){return S===46?(e.consume(S),a=0,y):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):b(S)}function b(S){if((S===45||Nn(S))&&a++<63){const k=S===45?b:g;return e.consume(S),k}return n(S)}}const ec={partial:!0,tokenize:cP};function cP(e,t,n){return a;function a(o){return We(o)?st(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||ze(o)?t(o):n(o)}}const jE={continuation:{tokenize:fP},exit:hP,name:"blockQuote",tokenize:dP};function dP(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 We(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function fP(e,t,n){const a=this;return l;function l(c){return We(c)?st(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(jE,t,n)(c)}}function hP(e){e.exit("blockQuote")}const CE={name:"characterEscape",tokenize:mP};function mP(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 eP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const EE={name:"characterReference",tokenize:pP};function pP(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=Nn,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=W9,y):(e.enter("characterReferenceValue"),o=7,c=Dg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===Nn&&!Fy(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 BS={partial:!0,tokenize:yP},$S={concrete:!0,name:"codeFenced",tokenize:gP};function gP(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,c=0,f;return m;function m(z){return h(z)}function h(z){const I=a.events[a.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[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"),We(z)?st(e,g,"whitespace")(z):g(z))}function g(z){return z===null||ze(z)?(e.exit("codeFencedFence"),a.interrupt?t(z):e.check(BS,j,L)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||ze(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(z)):We(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,S,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function S(z){return z===null||ze(z)?g(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||ze(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,L,C)(z)}function C(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),E}function E(z){return o>0&&We(z)?st(e,A,"linePrefix",o+1)(z):A(z)}function A(z){return z===null||ze(z)?e.check(BS,j,L)(z):(e.enter("codeFlowValue"),O(z))}function O(z){return z===null||ze(z)?(e.exit("codeFlowValue"),A(z)):(e.consume(z),O)}function L(z){return e.exit("codeFenced"),t(z)}function D(z,I,F){let Y=0;return $;function $(ie){return z.enter("lineEnding"),z.consume(ie),z.exit("lineEnding"),te}function te(ie){return z.enter("codeFencedFence"),We(ie)?st(z,J,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):J(ie)}function J(ie){return ie===f?(z.enter("codeFencedFenceSequence"),be(ie)):F(ie)}function be(ie){return ie===f?(Y++,z.consume(ie),be):Y>=c?(z.exit("codeFencedFenceSequence"),We(ie)?st(z,fe,"whitespace")(ie):fe(ie)):F(ie)}function fe(ie){return ie===null||ze(ie)?(z.exit("codeFencedFence"),I(ie)):F(ie)}}}function yP(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 Cp={name:"codeIndented",tokenize:bP},vP={partial:!0,tokenize:xP};function bP(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),st(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):ze(h)?e.attempt(vP,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||ze(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function xP(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):st(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):ze(c)?l(c):n(c)}}const SP={name:"codeText",previous:kP,resolve:wP,tokenize:jP};function wP(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 kP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jP(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)):ze(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||ze(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 CP{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&&cu(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),cu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cu(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);cu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cu(this.left,n.reverse())}}}function cu(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 NE(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new CP(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,EP(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 or(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function EP(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,S=n,k=0,j=0;const C=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(y=a.sliceStream(S),S.next||y.push(null),g&&c.defineSkip(S.start),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=S,S=S.next}for(S=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,C.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(c.events=[],S?(S._tokenizer=void 0,S.previous=void 0):C.pop(),b=C.length;b--;){const E=f.slice(C[b],C[b+1]),A=o.pop();m.push([A,A+E.length-1]),e.splice(A,2,E)}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 NP={resolve:AP,tokenize:TP},_P={partial:!0,tokenize:RP};function AP(e){return NE(e),e}function TP(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):ze(f)?e.check(_P,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 RP(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),st(e,o,"linePrefix")}function o(c){if(c===null||ze(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 _E(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(E),e.exit(o),b):E===null||E===32||E===41||sf(E)?n(E):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function b(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(E))}function S(E){return E===62?(e.exit("chunkString"),e.exit(f),b(E)):E===null||E===60||ze(E)?n(E):(e.consume(E),E===92?k:S)}function k(E){return E===60||E===62||E===92?(e.consume(E),S):S(E)}function j(E){return!y&&(E===null||E===41||kt(E))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(E)):y<h&&E===40?(e.consume(E),y++,j):E===41?(e.consume(E),y--,j):E===null||E===32||E===40||sf(E)?n(E):(e.consume(E),E===92?C:j)}function C(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function AE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(S){return e.enter(a),e.enter(l),e.consume(S),e.exit(l),e.enter(o),y}function y(S){return f>999||S===null||S===91||S===93&&!m||S===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):ze(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||S===91||S===93||ze(S)||f++>999?(e.exit("chunkString"),y(S)):(e.consume(S),m||(m=!We(S)),S===92?b:g)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,g):g(S)}}function TE(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):ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),st(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||ze(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 bu(e,t){let n;return a;function a(l){return ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):We(l)?st(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const zP={name:"definition",tokenize:DP},OP={partial:!0,tokenize:MP};function DP(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),c(S)}function c(S){return AE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=Mr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),m):n(S)}function m(S){return kt(S)?bu(e,h)(S):h(S)}function h(S){return _E(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function y(S){return e.attempt(OP,g,g)(S)}function g(S){return We(S)?st(e,b,"whitespace")(S):b(S)}function b(S){return S===null||ze(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function MP(e,t,n){return a;function a(f){return kt(f)?bu(e,l)(f):n(f)}function l(f){return TE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return We(f)?st(e,c,"whitespace")(f):c(f)}function c(f){return f===null||ze(f)?t(f):n(f)}}const LP={name:"hardBreakEscape",tokenize:IP};function IP(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const UP={name:"headingAtx",resolve:PP,tokenize:BP};function PP(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"},or(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function BP(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||ze(y)?(e.exit("atxHeading"),t(y)):We(y)?st(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 $P=["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"],FS=["pre","script","style","textarea"],FP={concrete:!0,name:"htmlFlow",resolveTo:ZP,tokenize:VP},qP={partial:!0,tokenize:GP},HP={partial:!0,tokenize:QP};function ZP(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 VP(e,t,n){const a=this;let l,o,c,f,m;return h;function h(_){return y(_)}function y(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),g}function g(_){return _===33?(e.consume(_),b):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),l=3,a.interrupt?t:T):On(_)?(e.consume(_),c=String.fromCharCode(_),C):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):On(_)?(e.consume(_),l=4,a.interrupt?t:T):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:T):n(_)}function k(_){const q="CDATA[";return _===q.charCodeAt(f++)?(e.consume(_),f===q.length?a.interrupt?t:J:k):n(_)}function j(_){return On(_)?(e.consume(_),c=String.fromCharCode(_),C):n(_)}function C(_){if(_===null||_===47||_===62||kt(_)){const q=_===47,W=c.toLowerCase();return!q&&!o&&FS.includes(W)?(l=1,a.interrupt?t(_):J(_)):$P.includes(c.toLowerCase())?(l=6,q?(e.consume(_),E):a.interrupt?t(_):J(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?A(_):O(_))}return _===45||Nn(_)?(e.consume(_),c+=String.fromCharCode(_),C):n(_)}function E(_){return _===62?(e.consume(_),a.interrupt?t:J):n(_)}function A(_){return We(_)?(e.consume(_),A):$(_)}function O(_){return _===47?(e.consume(_),$):_===58||_===95||On(_)?(e.consume(_),L):We(_)?(e.consume(_),O):$(_)}function L(_){return _===45||_===46||_===58||_===95||Nn(_)?(e.consume(_),L):D(_)}function D(_){return _===61?(e.consume(_),z):We(_)?(e.consume(_),D):O(_)}function z(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,I):We(_)?(e.consume(_),z):F(_)}function I(_){return _===m?(e.consume(_),m=null,Y):_===null||ze(_)?n(_):(e.consume(_),I)}function F(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||kt(_)?D(_):(e.consume(_),F)}function Y(_){return _===47||_===62||We(_)?O(_):n(_)}function $(_){return _===62?(e.consume(_),te):n(_)}function te(_){return _===null||ze(_)?J(_):We(_)?(e.consume(_),te):n(_)}function J(_){return _===45&&l===2?(e.consume(_),Z):_===60&&l===1?(e.consume(_),ae):_===62&&l===4?(e.consume(_),P):_===63&&l===3?(e.consume(_),T):_===93&&l===5?(e.consume(_),he):ze(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(qP,B,be)(_)):_===null||ze(_)?(e.exit("htmlFlowData"),be(_)):(e.consume(_),J)}function be(_){return e.check(HP,fe,B)(_)}function fe(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ie}function ie(_){return _===null||ze(_)?be(_):(e.enter("htmlFlowData"),J(_))}function Z(_){return _===45?(e.consume(_),T):J(_)}function ae(_){return _===47?(e.consume(_),c="",K):J(_)}function K(_){if(_===62){const q=c.toLowerCase();return FS.includes(q)?(e.consume(_),P):J(_)}return On(_)&&c.length<8?(e.consume(_),c+=String.fromCharCode(_),K):J(_)}function he(_){return _===93?(e.consume(_),T):J(_)}function T(_){return _===62?(e.consume(_),P):_===45&&l===2?(e.consume(_),T):J(_)}function P(_){return _===null||ze(_)?(e.exit("htmlFlowData"),B(_)):(e.consume(_),P)}function B(_){return e.exit("htmlFlow"),t(_)}}function QP(e,t,n){const a=this;return l;function l(c){return ze(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 GP(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(ec,t,n)}}const KP={name:"htmlText",tokenize:YP};function YP(e,t,n){const a=this;let l,o,c;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),D):T===63?(e.consume(T),O):On(T)?(e.consume(T),F):n(T)}function h(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),o=0,k):On(T)?(e.consume(T),A):n(T)}function y(T){return T===45?(e.consume(T),S):n(T)}function g(T){return T===null?n(T):T===45?(e.consume(T),b):ze(T)?(c=g,ae(T)):(e.consume(T),g)}function b(T){return T===45?(e.consume(T),S):g(T)}function S(T){return T===62?Z(T):T===45?b(T):g(T)}function k(T){const P="CDATA[";return T===P.charCodeAt(o++)?(e.consume(T),o===P.length?j:k):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),C):ze(T)?(c=j,ae(T)):(e.consume(T),j)}function C(T){return T===93?(e.consume(T),E):j(T)}function E(T){return T===62?Z(T):T===93?(e.consume(T),E):j(T)}function A(T){return T===null||T===62?Z(T):ze(T)?(c=A,ae(T)):(e.consume(T),A)}function O(T){return T===null?n(T):T===63?(e.consume(T),L):ze(T)?(c=O,ae(T)):(e.consume(T),O)}function L(T){return T===62?Z(T):O(T)}function D(T){return On(T)?(e.consume(T),z):n(T)}function z(T){return T===45||Nn(T)?(e.consume(T),z):I(T)}function I(T){return ze(T)?(c=I,ae(T)):We(T)?(e.consume(T),I):Z(T)}function F(T){return T===45||Nn(T)?(e.consume(T),F):T===47||T===62||kt(T)?Y(T):n(T)}function Y(T){return T===47?(e.consume(T),Z):T===58||T===95||On(T)?(e.consume(T),$):ze(T)?(c=Y,ae(T)):We(T)?(e.consume(T),Y):Z(T)}function $(T){return T===45||T===46||T===58||T===95||Nn(T)?(e.consume(T),$):te(T)}function te(T){return T===61?(e.consume(T),J):ze(T)?(c=te,ae(T)):We(T)?(e.consume(T),te):Y(T)}function J(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,be):ze(T)?(c=J,ae(T)):We(T)?(e.consume(T),J):(e.consume(T),fe)}function be(T){return T===l?(e.consume(T),l=void 0,ie):T===null?n(T):ze(T)?(c=be,ae(T)):(e.consume(T),be)}function fe(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||kt(T)?Y(T):(e.consume(T),fe)}function ie(T){return T===47||T===62||kt(T)?Y(T):n(T)}function Z(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function ae(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return We(T)?st(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):he(T)}function he(T){return e.enter("htmlTextData"),c(T)}}const qy={name:"labelEnd",resolveAll:e8,resolveTo:t8,tokenize:n8},XP={tokenize:r8},JP={tokenize:a8},WP={tokenize:i8};function e8(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&&or(e,0,e.length,n),e}function t8(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=jr(f,e.slice(o+1,o+a+3)),f=jr(f,[["enter",y,t]]),f=jr(f,Of(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=jr(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=jr(f,e.slice(c+1)),f=jr(f,[["exit",m,t]]),or(e,o,e.length,f),e}function n8(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(Mr(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(XP,y,c?y:g)(b):b===91?e.attempt(JP,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(WP,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function r8(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)?bu(e,o)(g):o(g)}function o(g){return g===41?y(g):_E(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return kt(g)?bu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?TE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return kt(g)?bu(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 a8(e,t,n){const a=this;return l;function l(f){return AE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Mr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function i8(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 l8={name:"labelStartImage",resolveAll:qy.resolveAll,tokenize:s8};function s8(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 o8={name:"labelStartLink",resolveAll:qy.resolveAll,tokenize:u8};function u8(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 Ep={name:"lineEnding",tokenize:c8};function c8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),st(e,t,"linePrefix")}}const Vd={name:"thematicBreak",tokenize:d8};function d8(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||ze(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),We(h)?st(e,f,"whitespace")(h):f(h))}}const qn={continuation:{tokenize:p8},exit:y8,name:"list",tokenize:m8},f8={partial:!0,tokenize:v8},h8={partial:!0,tokenize:g8};function m8(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(S){const k=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:Dg(S)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(Vd,n,h)(S):h(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(S)}return n(S)}function m(S){return Dg(S)&&++c<10?(e.consume(S),m):(!a.interrupt||c<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),h(S)):n(S)}function h(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(ec,a.interrupt?n:y,e.attempt(f8,b,g))}function y(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function g(S){return We(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):n(S)}function b(S){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(S)}}function p8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(ec,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,st(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!We(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(h8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,st(e,e.attempt(qn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function g8(e,t,n){const a=this;return st(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 y8(e){e.exit(this.containerState.type)}function v8(e,t,n){const a=this;return st(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!We(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const qS={name:"setextUnderline",resolveTo:b8,tokenize:x8};function b8(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 x8(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"),We(h)?st(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const S8={tokenize:w8};function w8(e){const t=this,n=e.attempt(ec,a,e.attempt(this.parser.constructs.flowInitial,l,st(e,e.attempt(this.parser.constructs.flow,l,e.attempt(NP,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 k8={resolveAll:zE()},j8=RE("string"),C8=RE("text");function RE(e){return{resolveAll:zE(e==="text"?E8: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 S=g[b];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function zE(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 E8(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 N8={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:jE},_8={91:zP},A8={[-2]:Cp,[-1]:Cp,32:Cp},T8={35:UP,42:Vd,45:[qS,Vd],60:FP,61:qS,95:Vd,96:$S,126:$S},R8={38:EE,92:CE},z8={[-5]:Ep,[-4]:Ep,[-3]:Ep,33:l8,38:EE,42:Mg,60:[oP,KP],91:o8,92:[LP,CE],93:qy,95:Mg,96:SP},O8={null:[Mg,k8]},D8={null:[42,95]},M8={null:[]},L8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:D8,contentInitial:_8,disable:M8,document:N8,flow:T8,flowInitial:A8,insideSpan:O8,string:R8,text:z8},Symbol.toStringTag,{value:"Module"}));function I8(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:I(D),check:I(z),consume:A,enter:O,exit:L,interrupt:I(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(te){return c=jr(c,te),C(),c[c.length-1]!==null?[]:(F(t,0),h.events=Of(o,h.events,h),h.events)}function b(te,J){return P8(S(te),J)}function S(te){return U8(c,te)}function k(){const{_bufferIndex:te,_index:J,line:be,column:fe,offset:ie}=a;return{_bufferIndex:te,_index:J,line:be,column:fe,offset:ie}}function j(te){l[te.line]=te.column,$()}function C(){let te;for(;a._index<c.length;){const J=c[a._index];if(typeof J=="string")for(te=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===te&&a._bufferIndex<J.length;)E(J.charCodeAt(a._bufferIndex));else E(J)}}function E(te){y=y(te)}function A(te){ze(te)?(a.line++,a.column=1,a.offset+=te===-3?2:1,$()):te!==-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=te}function O(te,J){const be=J||{};return be.type=te,be.start=k(),h.events.push(["enter",be,h]),f.push(be),be}function L(te){const J=f.pop();return J.end=k(),h.events.push(["exit",J,h]),J}function D(te,J){F(te,J.from)}function z(te,J){J.restore()}function I(te,J){return be;function be(fe,ie,Z){let ae,K,he,T;return Array.isArray(fe)?B(fe):"tokenize"in fe?B([fe]):P(fe);function P(ue){return xe;function xe(Le){const Se=Le!==null&&ue[Le],Ct=Le!==null&&ue.null,ne=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return B(ne)(Le)}}function B(ue){return ae=ue,K=0,ue.length===0?Z:_(ue[K])}function _(ue){return xe;function xe(Le){return T=Y(),he=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?W():ue.tokenize.call(J?Object.assign(Object.create(h),J):h,m,q,W)(Le)}}function q(ue){return te(he,T),ie}function W(ue){return T.restore(),++K<ae.length?_(ae[K]):Z}}}function F(te,J){te.resolveAll&&!o.includes(te)&&o.push(te),te.resolve&&or(h.events,J,h.events.length-J,te.resolve(h.events.slice(J),h)),te.resolveTo&&(h.events=te.resolveTo(h.events,h))}function Y(){const te=k(),J=h.previous,be=h.currentConstruct,fe=h.events.length,ie=Array.from(f);return{from:fe,restore:Z};function Z(){a=te,h.previous=J,h.currentConstruct=be,h.events.length=fe,f=ie,$()}}function $(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function U8(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 P8(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=`
|
|
365
|
+
`;break}case-3:{c=`\r
|
|
366
|
+
`;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 B8(e){const a={constructs:wE([L8,...(e||{}).extensions||[]]),content:l(tP),defined:[],document:l(rP),flow:l(S8),lazy:{},string:l(j8),text:l(C8)};return a;function l(o){return c;function c(f){return I8(a,o,f)}}}function $8(e){for(;!NE(e););return e}const HS=/[\0\t\n\r]/g;function F8(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,S;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(HS.lastIndex=g,h=HS.exec(o),b=h&&h.index!==void 0?h.index:o.length,S=o.charCodeAt(b),!h){t=o.slice(g);break}if(S===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),S){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 q8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function H8(e){return e.replace(q8,Z8)}function Z8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return kE(n.slice(o?2:1),o?16:10)}return Fy(n)||e}const OE={}.hasOwnProperty;function V8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Q8(n)($8(B8(n).document().write(F8()(e,t,!0))))}function Q8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Da),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:o(Ft),blockQuote:o(Ct),characterEscape:Y,characterReference:Y,codeFenced:o(ne),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(ne,c),codeText:o(Te,c),codeTextData:Y,data:Y,codeFlowValue:Y,definition:o(Ue),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Fe),hardBreakEscape:o(cn),hardBreakTrailing:o(cn),htmlFlow:o(Oa,c),htmlFlowData:Y,htmlText:o(Oa,c),htmlTextData:Y,image:o(_l),label:c,link:o(Da),listItem:o(Wr),listItemValue:b,listOrdered:o(Ma,g),listUnordered:o(Ma),paragraph:o(oo),reference:_,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Ft),strong:o(uo),thematicBreak:o(co)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:Se,autolinkProtocol:Le,blockQuote:m(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ue,characterReference:xe,codeFenced:m(C),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:$,codeIndented:m(E),codeText:m(ie),codeTextData:$,data:$,definition:m(),definitionDestinationString:L,definitionLabelString:A,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(J),hardBreakTrailing:m(J),htmlFlow:m(be),htmlFlowData:$,htmlText:m(fe),htmlTextData:$,image:m(ae),label:he,labelText:K,lineEnding:te,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:q,resourceDestinationString:T,resourceTitleString:P,resource:B,setextHeading:m(F),setextHeadingLineSequence:I,setextHeadingText:z,strong:m(),thematicBreak:m()}};DE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let ye={type:"root",children:[]};const Me={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},Pe=[];let at=-1;for(;++at<le.length;)if(le[at][1].type==="listOrdered"||le[at][1].type==="listUnordered")if(le[at][0]==="enter")Pe.push(at);else{const fn=Pe.pop();at=l(le,fn,at)}for(at=-1;++at<le.length;){const fn=t[le[at][0]];OE.call(fn,le[at][1].type)&&fn[le[at][1].type].call(Object.assign({sliceSerialize:le[at][2].sliceSerialize},Me),le[at][1])}if(Me.tokenStack.length>0){const fn=Me.tokenStack[Me.tokenStack.length-1];(fn[1]||ZS).call(Me,void 0,fn[0])}for(ye.position={start:ui(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:ui(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)ye=t.transforms[at](ye)||ye;return ye}function l(le,ye,Me){let Pe=ye-1,at=-1,fn=!1,cr,en,qt,hn;for(;++Pe<=Me;){const dt=le[Pe];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?at++:at--,hn=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(cr&&!hn&&!at&&!qt&&(qt=Pe),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!at&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||at===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(cr){let Tr=Pe;for(en=void 0;Tr--;){const Mn=le[Tr];if(Mn[1].type==="lineEnding"||Mn[1].type==="lineEndingBlank"){if(Mn[0]==="exit")continue;en&&(le[en][1].type="lineEndingBlank",fn=!0),Mn[1].type="lineEnding",en=Tr}else if(!(Mn[1].type==="linePrefix"||Mn[1].type==="blockQuotePrefix"||Mn[1].type==="blockQuotePrefixWhitespace"||Mn[1].type==="blockQuoteMarker"||Mn[1].type==="listItemIndent"))break}qt&&(!en||qt<en)&&(cr._spread=!0),cr.end=Object.assign({},en?le[en][1].start:dt[1].end),le.splice(en||Pe,0,["exit",cr,dt[2]]),Pe++,Me++}if(dt[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};cr=Tr,le.splice(Pe,0,["enter",Tr,dt[2]]),Pe++,Me++,qt=void 0,hn=!0}}}return le[ye][1]._spread=fn,Me}function o(le,ye){return Me;function Me(Pe){f.call(this,le(Pe),Pe),ye&&ye.call(this,Pe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(le,ye,Me){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Me||void 0]),le.position={start:ui(ye.start),end:void 0}}function m(le){return ye;function ye(Me){le&&le.call(this,Me),h.call(this,Me)}}function h(le,ye){const Me=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==le.type&&(ye?ye.call(this,le,Pe[0]):(Pe[1]||ZS).call(this,le,Pe[0]));else throw new Error("Cannot close `"+le.type+"` ("+vu({start:le.start,end:le.end})+"): it’s not open");Me.position.end=ui(le.end)}function y(){return $y(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(le){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function S(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=le}function k(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=le}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/(\r?\n|\r)$/g,"")}function A(le){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Mr(this.sliceSerialize(le)).toLowerCase()}function O(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function L(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function D(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Me=this.sliceSerialize(le).length;ye.depth=Me}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function I(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(le){const Me=this.stack[this.stack.length-1].children;let Pe=Me[Me.length-1];(!Pe||Pe.type!=="text")&&(Pe=dn(),Pe.position={start:ui(le.start),end:void 0},Me.push(Pe)),this.stack.push(Pe)}function $(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=ui(le.end)}function te(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ye.children[ye.children.length-1];Me.position.end=ui(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(Y.call(this,le),$.call(this,le))}function J(){this.data.atHardBreak=!0}function be(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function fe(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function ie(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function Z(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function ae(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function K(le){const ye=this.sliceSerialize(le),Me=this.stack[this.stack.length-2];Me.label=H8(ye),Me.identifier=Mr(ye).toLowerCase()}function he(){const le=this.stack[this.stack.length-1],ye=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Pe=le.children;Me.children=Pe}else Me.alt=ye}function T(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function P(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function B(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function q(le){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Mr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function W(le){this.data.characterReferenceType=le.type}function ue(le){const ye=this.sliceSerialize(le),Me=this.data.characterReferenceType;let Pe;Me?(Pe=kE(ye,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=Fy(ye);const at=this.stack[this.stack.length-1];at.value+=Pe}function xe(le){const ye=this.stack.pop();ye.position.end=ui(le.end)}function Le(le){$.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function Se(le){$.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function Ct(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function Ft(){return{type:"heading",depth:0,children:[]}}function cn(){return{type:"break"}}function Oa(){return{type:"html",value:""}}function _l(){return{type:"image",title:null,url:"",alt:null}}function Da(){return{type:"link",title:null,url:"",children:[]}}function Ma(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Wr(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function oo(){return{type:"paragraph",children:[]}}function uo(){return{type:"strong",children:[]}}function dn(){return{type:"text",value:""}}function co(){return{type:"thematicBreak"}}}function ui(e){return{line:e.line,column:e.column,offset:e.offset}}function DE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?DE(e,a):G8(e,a)}}function G8(e,t){let n;for(n in t)if(OE.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 ZS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is still open")}function K8(e){const t=this;t.parser=n;function n(a){return V8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Y8(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 X8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
367
|
+
`}]}function J8(e,t){const n=t.value?t.value+`
|
|
368
|
+
`:"",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 W8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=so(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 nB(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 rB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ME(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 aB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return ME(e,t);const l={src:so(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 iB(e,t){const n={src:so(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 lB(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 sB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return ME(e,t);const l={href:so(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 oB(e,t){const n={href:so(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 uB(e,t,n){const a=e.all(t),l=n?cB(n):LE(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:`
|
|
369
|
+
`}),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:`
|
|
370
|
+
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function cB(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=LE(n[a])}return t}function LE(e){const t=e.spread;return t??e.children.length>1}function dB(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 fB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pB(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=Iy(t.children[1]),m=pE(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 gB(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={},S=c?c[m]:void 0;S&&(b.align=S);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 yB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const VS=9,QS=32;function vB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(GS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(GS(t.slice(l),l>0,!1)),o.join("")}function GS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===VS||o===QS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===VS||o===QS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function bB(e,t){const n={type:"text",value:vB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const SB={blockquote:Y8,break:X8,code:J8,delete:W8,emphasis:eB,footnoteReference:tB,heading:nB,html:rB,imageReference:aB,image:iB,inlineCode:lB,linkReference:sB,link:oB,listItem:uB,list:dB,paragraph:fB,root:hB,strong:mB,table:pB,tableCell:yB,tableRow:gB,text:bB,thematicBreak:xB,toml:zd,yaml:zd,definition:zd,footnoteDefinition:zd};function zd(){}const IE=-1,Df=0,xu=1,of=2,Hy=3,Zy=4,Vy=5,Qy=6,UE=7,PE=8,KS=typeof self=="object"?self:globalThis,wB=(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 Df:case IE:return n(c,l);case xu:{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 Hy:return n(new Date(c),l);case Zy:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case Vy:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case Qy:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case UE:{const{name:f,message:m}=c;return n(new KS[f](m),l)}case PE: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 KS[o](c),l)};return a},YS=e=>wB(new Map,e)(0),ys="",{toString:kB}={},{keys:jB}=Object,du=e=>{const t=typeof e;if(t!=="object"||!e)return[Df,t];const n=kB.call(e).slice(8,-1);switch(n){case"Array":return[xu,ys];case"Object":return[of,ys];case"Date":return[Hy,ys];case"RegExp":return[Zy,ys];case"Map":return[Vy,ys];case"Set":return[Qy,ys];case"DataView":return[xu,n]}return n.includes("Array")?[xu,n]:n.includes("Error")?[UE,n]:[of,n]},Od=([e,t])=>e===Df&&(t==="function"||t==="symbol"),CB=(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]=du(c);switch(f){case Df:{let y=c;switch(m){case"bigint":f=PE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([IE],c)}return l([f,y],c)}case xu:{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 jB(c))(e||!Od(du(c[b])))&&y.push([o(b),o(c[b])]);return g}case Hy:return l([f,c.toISOString()],c);case Zy:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case Vy:{const y=[],g=l([f,y],c);for(const[b,S]of c)(e||!(Od(du(b))||Od(du(S))))&&y.push([o(b),o(S)]);return g}case Qy:{const y=[],g=l([f,y],c);for(const b of c)(e||!Od(du(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},XS=(e,{json:t,lossy:n}={})=>{const a=[];return CB(!(t||n),!!t,new Map,a)(e),a},uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?YS(XS(e,t)):structuredClone(e):(e,t)=>YS(XS(e,t));function EB(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 NB(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||EB,a=e.options.footnoteBackLabel||NB,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=so(g.toLowerCase());let S=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++S<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,S);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,S),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const A=C.children[C.children.length-1];A&&A.type==="text"?A.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,E),f.push(E)}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:`
|
|
371
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
372
|
+
`}]}}const Mf=(function(e){if(e==null)return zB;if(typeof e=="function")return Lf(e);if(typeof e=="object")return Array.isArray(e)?AB(e):TB(e);if(typeof e=="string")return RB(e);throw new Error("Expected function, string, or object as test")});function AB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mf(e[n]);return Lf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function TB(e){const t=e;return Lf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function RB(e){return Lf(t);function t(n){return n&&n.type===e}}function Lf(e){return t;function t(n,a,l){return!!(OB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function zB(){return!0}function OB(e){return e!==null&&typeof e=="object"&&"type"in e}const BE=[],DB=!0,Lg=!1,MB="skip";function $E(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Mf(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 S=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=BE,k,j,C;if((!t||o(m,h,y[y.length-1]||void 0))&&(S=LB(n(m,y)),S[0]===Lg))return S;if("children"in m&&m.children){const E=m;if(E.children&&S[0]!==MB)for(j=(a?E.children.length:-1)+c,C=y.concat(E);j>-1&&j<E.children.length;){const A=E.children[j];if(k=f(A,j,C)(),k[0]===Lg)return k;j=typeof k[1]=="number"?k[1]:j+c}}return S}}}function LB(e){return Array.isArray(e)?e:typeof e=="number"?[DB,e]:e==null?BE:[e]}function Gy(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),$E(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 Ig={}.hasOwnProperty,IB={};function UB(e,t){const n=t||IB,a=new Map,l=new Map,o=new Map,c={...SB,...n.handlers},f={all:h,applyData:BB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:PB,wrap:FB};return Gy(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,S=f.handlers[b];if(Ig.call(f.handlers,b)&&S)return S(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...C}=y,E=uf(C);return E.children=f.all(y),E}return uf(y)}return(f.options.unknownHandler||$B)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let S=-1;for(;++S<b.length;){const k=f.one(b[S],y);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=JS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=JS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function PB(e,t){e.position&&(t.position=N9(e))}function BB(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 $B(e,t){const n=t.data||{},a="value"in t&&!(Ig.call(n,"hProperties")||Ig.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 FB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
373
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
374
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
375
|
+
`}),n}function JS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function WS(e,t){const n=UB(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:`
|
|
376
|
+
`},l),o}function qB(e,t){return e&&"run"in e?async function(n,a){const l=WS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return WS(n,{file:a,...e||t})}}function ew(e){if(e)throw e}var Np,tw;function HB(){if(tw)return Np;tw=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 Np=function m(){var h,y,g,b,S,k,j=arguments[0],C=1,E=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},C=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});C<E;++C)if(h=arguments[C],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(A&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(A,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Np}var ZB=HB();const _p=df(ZB);function Ug(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 VB(){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?QB(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 QB(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 Fr={basename:GB,dirname:KB,extname:YB,join:XB,sep:"/"};function GB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');tc(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 KB(e){if(tc(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 YB(e){tc(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 XB(...e){let t=-1,n;for(;++t<e.length;)tc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":JB(n)}function JB(e){tc(e);const t=e.codePointAt(0)===47;let n=WB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function WB(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 tc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const e$={cwd:t$};function t$(){return"/"}function Pg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function n$(e){if(typeof e=="string")e=new URL(e);else if(!Pg(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 r$(e)}function r$(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 Ap=["history","path","basename","stem","extname","dirname"];class FE{constructor(t){let n;t?Pg(t)?n={path:t}:typeof t=="string"||a$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":e$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ap.length;){const o=Ap[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)Ap.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Fr.basename(this.path):void 0}set basename(t){Rp(t,"basename"),Tp(t,"basename"),this.path=Fr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Fr.dirname(this.path):void 0}set dirname(t){nw(this.basename,"dirname"),this.path=Fr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Fr.extname(this.path):void 0}set extname(t){if(Tp(t,"extname"),nw(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=Fr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pg(t)&&(t=n$(t)),Rp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Fr.basename(this.path,this.extname):void 0}set stem(t){Rp(t,"stem"),Tp(t,"stem"),this.path=Fr.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(Fr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Fr.sep+"`")}function Rp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function a$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const i$=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),l$={}.hasOwnProperty;class Ky extends i${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=VB()}copy(){const t=new Ky;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(_p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Dp("data",this.frozen),this.namespace[t]=n,this):l$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Dp("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 zp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zp("process",this.parser||this.Parser),Op("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 S=g,k=a.stringify(S,b);u$(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(),zp("processSync",this.parser||this.Parser),Op("processSync",this.compiler||this.Compiler),this.process(t,l),aw("processSync","process",n),a;function l(o,c){n=!0,ew(o),a=c}}run(t,n,a){rw(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 S=g||t;y?f(y):c?c(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),aw("runSync","run",a),l;function o(c,f){ew(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Dd(n),l=this.compiler||this.Compiler;return Op("stringify",l),rw(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Dp("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=_p(!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[S,...k]=y;const j=a[b][1];Ug(j)&&Ug(S)&&(S=_p(!0,j,S)),a[b]=[h,S,...k]}}}}const s$=new Ky().freeze();function zp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Op(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Dp(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 rw(e){if(!Ug(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dd(e){return o$(e)?e:new FE(e)}function o$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function u$(e){return typeof e=="string"||c$(e)}function c$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const d$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iw=[],lw={allowDangerousHtml:!0},f$=/^(https?|ircs?|mailto|xmpp)$/i,h$=[{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 m$(e){const t=p$(e),n=g$(e);return y$(t.runSync(t.parse(n),n),e)}function p$(e){const t=e.rehypePlugins||iw,n=e.remarkPlugins||iw,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lw}:lw;return s$().use(K8).use(n).use(qB,a).use(t)}function g$(e){const t=e.children||"",n=new FE;return typeof t=="string"&&(n.value=t),n}function y$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||v$;for(const y of h$)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+d$+y.id,void 0);return Gy(e,h),z9(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 S;for(S in jp)if(Object.hasOwn(jp,S)&&Object.hasOwn(y.properties,S)){const k=y.properties[S],j=jp[S];(j===null||j.includes(y.tagName))&&(y.properties[S]=m(String(k||""),S,y))}}if(y.type==="element"){let S=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!S&&a&&typeof g=="number"&&(S=!a(y,g,b)),S&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function v$(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||f$.test(e.slice(0,t))?e:""}function b$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qE(e,t,n){const l=Mf((n||{}).ignore||[]),o=x$(t);let c=-1;for(;++c<o.length;)$E(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const S=y[g],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],S=o[c][1];let k=0;const C=g.children.indexOf(h);let E=!1,A=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const L=O.index,D={index:O.index,input:O.input,stack:[...y,h]};let z=S(...O,D);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=L+1:(k!==L&&A.push({type:"text",value:h.value.slice(k,L)}),Array.isArray(z)?A.push(...z):z&&A.push(z),k=L+O[0].length,E=!0),!b.global)break;O=b.exec(h.value)}return E?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),g.children.splice(C,1,...A)):A=[h],C+A.length}}function x$(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([S$(l[0]),w$(l[1])])}return t}function S$(e){return typeof e=="string"?new RegExp(b$(e),"g"):e}function w$(e){return typeof e=="function"?e:function(){return e}}function k$(e){qE(e,[/\r?\n|\r/g,j$])}function j$(){return{type:"break"}}function C$(){return function(e){k$(e)}}function sw(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",Lp=["autolink","link","image","label"];function E$(){return{transforms:[O$],enter:{literalAutolink:_$,literalAutolinkEmail:Ip,literalAutolinkHttp:Ip,literalAutolinkWww:Ip},exit:{literalAutolink:z$,literalAutolinkEmail:R$,literalAutolinkHttp:A$,literalAutolinkWww:T$}}}function N$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:":",before:"[ps]",after:"\\/",inConstruct:Mp,notInConstruct:Lp}]}}function _$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ip(e){this.config.enter.autolinkProtocol.call(this,e)}function A$(e){this.config.exit.autolinkProtocol.call(this,e)}function T$(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 R$(e){this.config.exit.autolinkEmail.call(this,e)}function z$(e){this.exit(e)}function O$(e){qE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,D$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),M$]],{ignore:["link","linkReference"]})}function D$(e,t,n,a,l){let o="";if(!HE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!L$(n)))return!1;const c=I$(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 M$(e,t,n,a){return!HE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function L$(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 I$(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=sw(e,"(");let o=sw(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 HE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Sl(n)||zf(n))&&(!t||n!==47)}ZE.peek=V$;function U$(){this.buffer()}function P$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function B$(){this.buffer()}function $$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function F$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q$(e){this.exit(e)}function H$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Z$(e){this.exit(e)}function V$(){return"["}function ZE(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 Q$(){return{enter:{gfmFootnoteCallString:U$,gfmFootnoteCall:P$,gfmFootnoteDefinitionLabelString:B$,gfmFootnoteDefinition:$$},exit:{gfmFootnoteCallString:F$,gfmFootnoteCall:q$,gfmFootnoteDefinitionLabelString:H$,gfmFootnoteDefinition:Z$}}}function G$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ZE},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?`
|
|
377
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?VE:K$))),h(),m}}function K$(e,t,n){return t===0?e:VE(e,t,n)}function VE(e,t,n){return(n?"":" ")+e}const Y$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];QE.peek=tF;function X$(){return{canContainEols:["delete"],enter:{strikethrough:W$},exit:{strikethrough:eF}}}function J$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Y$}],handlers:{delete:QE}}}function W$(e){this.enter({type:"delete",children:[]},e)}function eF(e){this.exit(e)}function QE(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 tF(){return"~"}function nF(e){return e.length}function rF(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||nF,o=[],c=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],C=[];let E=-1;for(e[y].length>h&&(h=e[y].length);++E<e[y].length;){const A=aF(e[y][E]);if(n.alignDelimiters!==!1){const O=l(A);C[E]=O,(m[E]===void 0||O>m[E])&&(m[E]=O)}j.push(A)}c[y]=j,f[y]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=ow(a[g]);else{const j=ow(a);for(;++g<h;)o[g]=j}g=-1;const b=[],S=[];for(;++g<h;){const j=o[g];let C="",E="";j===99?(C=":",E=":"):j===108?C=":":j===114&&(E=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const O=C+"-".repeat(A)+E;n.alignDelimiters!==!1&&(A=C.length+A+E.length,A>m[g]&&(m[g]=A),S[g]=A),b[g]=O}c.splice(1,0,b),f.splice(1,0,S),y=-1;const k=[];for(;++y<c.length;){const j=c[y],C=f[y];g=-1;const E=[];for(;++g<h;){const A=j[g]||"";let O="",L="";if(n.alignDelimiters!==!1){const D=m[g]-(C[g]||0),z=o[g];z===114?O=" ".repeat(D):z===99?D%2?(O=" ".repeat(D/2+.5),L=" ".repeat(D/2-.5)):(O=" ".repeat(D/2),L=O):L=" ".repeat(D)}n.delimiterStart!==!1&&!g&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&E.push(" "),n.alignDelimiters!==!1&&E.push(O),E.push(A),n.alignDelimiters!==!1&&E.push(L),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
378
|
+
`)}function aF(e){return e==null?"":String(e)}function ow(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 iF(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()),lF);return l(),c}function lF(e,t,n){return">"+(n?"":" ")+e}function sF(e,t){return uw(e,t.inConstruct,!0)&&!uw(e,t.notInConstruct,!1)}function uw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function cw(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
379
|
+
`&&sF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
380
|
+
`}function oF(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 uF(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 cF(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 dF(e,t,n,a){const l=cF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(uF(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,fF);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(oF(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:`
|
|
381
|
+
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
382
|
+
`),o&&(y+=f.move(o+`
|
|
383
|
+
`)),y+=f.move(m),h(),y}function fF(e,t,n){return(n?"":" ")+e}function Yy(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 hF(e,t,n,a){const l=Yy(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?" ":`
|
|
384
|
+
`,...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 mF(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=Ys(e),l=Ys(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}}GE.peek=pF;function GE(e,t,n,a){const l=mF(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 S=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function pF(e,t,n){return n.options.emphasis||"*"}function gF(e,t){let n=!1;return Gy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Lg}),!!((!e.depth||e.depth<3)&&$y(e)&&(t.options.setext||n))}function yF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(gF(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
385
|
+
`,after:`
|
|
386
|
+
`});return g(),y(),b+`
|
|
387
|
+
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
388
|
+
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
389
|
+
`,...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}KE.peek=vF;function KE(e){return e.value||""}function vF(){return"<"}YE.peek=bF;function YE(e,t,n,a){const l=Yy(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 bF(){return"!"}XE.peek=xF;function XE(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 xF(){return"!"}JE.peek=SF;function JE(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 SF(){return"`"}function WE(e,t){const n=$y(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))}eN.peek=wF;function eN(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(WE(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 wF(e,t,n){return WE(e,n)?"<":"["}tN.peek=kF;function tN(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 kF(){return"["}function Xy(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 jF(e){const t=Xy(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 CF(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 nN(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 EF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?CF(n):Xy(n);const f=e.ordered?c==="."?")":".":jF(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),nN(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 NF(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=NF(n);let o=n.bulletCurrent||Xy(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,S){return b?(S?"":" ".repeat(c))+g:(S?o:o+" ".repeat(c-o.length))+g}}function AF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const TF=Mf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RF(e,t,n,a){return(e.children.some(function(c){return TF(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}rN.peek=OF;function rN(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 S=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function OF(e,t,n){return n.options.strong||"*"}function DF(e,t,n,a){return n.safe(e.value,a)}function MF(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 LF(e,t,n){const a=(nN(n)+(n.options.ruleSpaces?" ":"")).repeat(MF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const aN={blockquote:iF,break:cw,code:dF,definition:hF,emphasis:GE,hardBreak:cw,heading:yF,html:KE,image:YE,imageReference:XE,inlineCode:JE,link:eN,linkReference:tN,list:EF,listItem:_F,paragraph:AF,root:RF,strong:rN,text:DF,thematicBreak:LF};function IF(){return{enter:{table:UF,tableData:dw,tableHeader:dw,tableRow:BF},exit:{codeText:$F,table:PF,tableData:Up,tableHeader:Up,tableRow:Up}}}function UF(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 PF(e){this.exit(e),this.data.inTable=void 0}function BF(e){this.enter({type:"tableRow",children:[]},e)}function Up(e){this.exit(e)}function dw(e){this.enter({type:"tableCell",children:[]},e)}function $F(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FF(e,t){return t==="|"?t:e}function qF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
390
|
+
`,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(S,k,j,C){return h(y(S,j,C),S.align)}function f(S,k,j,C){const E=g(S,j,C),A=h([E]);return A.slice(0,A.indexOf(`
|
|
391
|
+
`))}function m(S,k,j,C){const E=j.enter("tableCell"),A=j.enter("phrasing"),O=j.containerPhrasing(S,{...C,before:o,after:o});return A(),E(),O}function h(S,k){return rF(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(S,k,j){const C=S.children;let E=-1;const A=[],O=k.enter("table");for(;++E<C.length;)A[E]=g(C[E],k,j);return O(),A}function g(S,k,j){const C=S.children;let E=-1;const A=[],O=k.enter("tableRow");for(;++E<C.length;)A[E]=m(C[E],S,k,j);return O(),A}function b(S,k,j){let C=aN.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function HF(){return{exit:{taskListCheckValueChecked:fw,taskListCheckValueUnchecked:fw,paragraph:VF}}}function ZF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:QF}}}function fw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function VF(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 QF(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=aN.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 GF(){return[E$(),Q$(),X$(),IF(),HF()]}function KF(e){return{extensions:[N$(),G$(e),J$(),qF(e),ZF()]}}const YF={tokenize:nq,partial:!0},iN={tokenize:rq,partial:!0},lN={tokenize:aq,partial:!0},sN={tokenize:iq,partial:!0},XF={tokenize:lq,partial:!0},oN={name:"wwwAutolink",tokenize:eq,previous:cN},uN={name:"protocolAutolink",tokenize:tq,previous:dN},za={name:"emailAutolink",tokenize:WF,previous:fN},Jr={};function JF(){return{text:Jr}}let rl=48;for(;rl<123;)Jr[rl]=za,rl++,rl===58?rl=65:rl===91&&(rl=97);Jr[43]=za;Jr[45]=za;Jr[46]=za;Jr[95]=za;Jr[72]=[za,uN];Jr[104]=[za,uN];Jr[87]=[za,oN];Jr[119]=[za,oN];function WF(e,t,n){const a=this;let l,o;return c;function c(g){return!Bg(g)||!fN.call(a,a.previous)||Jy(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Bg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(XF,y,h)(g):g===45||g===95||Nn(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&&On(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function eq(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!cN.call(a,a.previous)||Jy(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(YF,e.attempt(iN,e.attempt(lN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function tq(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&dN.call(a,a.previous)&&!Jy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(On(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)||Sl(g)||zf(g)?n(g):e.attempt(iN,e.attempt(lN,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function nq(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 rq(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(sN,m,f)(h):h===null||kt(h)||Sl(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 aq(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(sN,t,o)(c):c===null||kt(c)||Sl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function iq(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)||Sl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||kt(f)||Sl(f)?t(f):a(f)}function o(f){return On(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):On(f)?(e.consume(f),c):n(f)}}function lq(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Nn(o)?n(o):t(o)}}function cN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kt(e)}function dN(e){return!On(e)}function fN(e){return!(e===47||Bg(e))}function Bg(e){return e===43||e===45||e===46||e===95||Nn(e)}function Jy(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 sq={tokenize:pq,partial:!0};function oq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fq,continuation:{tokenize:hq},exit:mq}},text:{91:{name:"gfmFootnoteCall",tokenize:dq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uq,resolveTo:cq}}}}function uq(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=Mr(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 cq(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 dq(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(Mr(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 fq(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=Mr(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),st(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function hq(e,t,n){return e.check(ec,t,e.attempt(sq,t,n))}function mq(e){e.exit("gfmFootnoteDefinition")}function pq(e,t,n){const a=this;return st(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 gq(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]],S=f.parser.constructs.insideSpan.null;S&&or(b,b.length,0,Of(S,c.slice(h+1,m),f)),or(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),or(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"),S(k))}function S(k){const j=Ys(h);if(k===126)return g>1?m(k):(c.consume(k),g++,S);if(g<2&&!n)return m(k);const C=c.exit("strikethroughSequenceTemporary"),E=Ys(k);return C._open=!E||E===2&&!!j,C._close=!j||j===2&&!!E,f(k)}}}class yq{constructor(){this.map=[]}add(t,n,a){vq(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 vq(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 bq(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 xq(){return{flow:{null:{name:"table",tokenize:Sq,resolveAll:wq}}}}function Sq(e,t,n){const a=this;let l=0,o=0,c;return f;function f($){let te=a.events.length-1;for(;te>-1;){const fe=a.events[te][1].type;if(fe==="lineEnding"||fe==="linePrefix")te--;else break}const J=te>-1?a.events[te][1].type:null,be=J==="tableHead"||J==="tableRow"?z:m;return be===z&&a.parser.lazy[a.now().line]?n($):be($)}function m($){return e.enter("tableHead"),e.enter("tableRow"),h($)}function h($){return $===124||(c=!0,o+=1),y($)}function y($){return $===null?n($):ze($)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),S):n($):We($)?st(e,y,"whitespace")($):(o+=1,c&&(c=!1,l+=1),$===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g($)))}function g($){return $===null||$===124||kt($)?(e.exit("data"),y($)):(e.consume($),$===92?b:g)}function b($){return $===92||$===124?(e.consume($),g):g($)}function S($){return a.interrupt=!1,a.parser.lazy[a.now().line]?n($):(e.enter("tableDelimiterRow"),c=!1,We($)?st(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):k($))}function k($){return $===45||$===58?C($):$===124?(c=!0,e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),j):D($)}function j($){return We($)?st(e,C,"whitespace")($):C($)}function C($){return $===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),E):$===45?(o+=1,E($)):$===null||ze($)?L($):D($)}function E($){return $===45?(e.enter("tableDelimiterFiller"),A($)):D($)}function A($){return $===45?(e.consume($),A):$===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O($))}function O($){return We($)?st(e,L,"whitespace")($):L($)}function L($){return $===124?k($):$===null||ze($)?!c||l!==o?D($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):D($)}function D($){return n($)}function z($){return e.enter("tableRow"),I($)}function I($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),I):$===null||ze($)?(e.exit("tableRow"),t($)):We($)?st(e,I,"whitespace")($):(e.enter("data"),F($))}function F($){return $===null||$===124||kt($)?(e.exit("data"),I($)):(e.consume($),$===92?Y:F)}function Y($){return $===92||$===124?(e.consume($),F):F($)}}function wq(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 yq;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(hw(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=Md(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=Md(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=Md(b,t,o,l,n,g)):c[1]!==0&&(g=Md(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&hw(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const S=t.events[n];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=bq(t.events,n))}return e}function Md(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},Ss(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=Ss(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=Ss(t.events,n[2]),y=Ss(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]],S=t.events[n[3]];if(b[1].end=Object.assign({},S[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({},Ss(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function hw(e,t,n,a,l){const o=[],c=Ss(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 Ss(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const kq={name:"tasklistCheck",tokenize:Cq};function jq(){return{text:{91:kq}}}function Cq(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 ze(m)?t(m):We(m)?e.check({tokenize:Eq},t,n)(m):n(m)}}function Eq(e,t,n){return st(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function Nq(e){return wE([JF(),oq(),gq(e),xq(),jq()])}const _q={};function Aq(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(Nq(n)),o.push(GF()),c.push(KF(n))}function hN({children:e,className:t}){return u.jsx("div",{className:_e("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(m$,{remarkPlugins:[Aq,C$],children:e})})}function Tq({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(an,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["System prompt append",m&&u.jsx(Rq,{})]}),!o&&!l&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(Qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(Xr,{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(me,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(me,{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(hN,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function Rq(){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 mN={"claude-code":"Claude Code",codex:"Codex"},zq=[nf.CLAUDE_CODE,nf.CODEX];function Oq({open:e,onOpenChange:t,agent:n}){const a=_n(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),S=He({queryKey:["clients-rebind"],queryFn:Zs,enabled:e}).data??[],k=SA({queries:S.map(F=>({queryKey:["client-capabilities",F.id],queryFn:()=>Kk(F.id),enabled:e}))}),j=x.useMemo(()=>{const F=new Map;return k.forEach((Y,$)=>{const te=S[$];if(!te)return;const J=Y.data;J!=null&&J.capabilities&&F.set(te.id,J.capabilities)}),F},[k,S]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const C=c?j.get(c)??null:null,E=(C==null?void 0:C[m])??null,A=!E||E.state==="missing"||E.state==="error",O=!!c&&(c!==l||m!==o)&&(!A||y),L=m!==o,D=c!==l,z=gt({mutationFn:()=>{if(!c)throw new Error("clientId required");return ID(n.uuid,{clientId:c,runtimeProvider:m,force:A&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),I=z.error instanceof Vu||z.error instanceof Error?z.error.message:null;return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{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:Mq(l,S,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:F=>f(F.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:S.map(F=>u.jsx("option",{value:F.id,children:Dq(F)},F.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:zq.map(F=>{const Y=(C==null?void 0:C[F])??null,$=!!Y&&Y.state!=="missing",te=m===F;return u.jsxs("label",{className:te?"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":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:te,onChange:()=>h(F),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:mN[F]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:Iq(Y,F)})]})]},F)})})]}),(D||L)&&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."]}),L&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),A&&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:F=>g(F.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."})]}),I&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:I})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",onClick:()=>t(!1),disabled:z.isPending,children:"Cancel"}),u.jsx(me,{onClick:()=>z.mutate(),disabled:!O||z.isPending,children:z.isPending?"Re-binding…":"Re-bind"})]})]})})}function Dq(e){return`${e.hostname??e.id} · ${e.status}`}function Mq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${mN[n]}`}const Lq={"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 Iq(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. ${Lq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const Uq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function Pq(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(Kr,{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:Uq[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(_a,{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(me,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(me,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(me,{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(MR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function Su(e){return`agent-cfg-${e}`}function fu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:_e("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 Bq(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const $q={"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 Fq(e){const t=$q[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(qq,{name:t.name,caption:t.caption,locked:!0}),u.jsx(Hq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function qq({name:e,caption:t,locked:n}){return u.jsxs(an,{children:[u.jsx(_r,{children:u.jsxs(Ar,{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(Rk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(Xr,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(zk,{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 Hq(e){const t=!!e.computerLabel;return u.jsxs(an,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(pg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(pg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(Xr,{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 Zq(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 Vq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function Qq(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Pp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function mw(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:Qq(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Bp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=Vq(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:mw(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:mw(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 Gq(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Pp(e.payload.mcpServers,"mcp"),env:Pp(e.payload.env,"env"),git:Pp(e.payload.gitRepos,"git")}}function Kq(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(Gq(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=[],L=F=>F.reduce((Y,$)=>$.status==="unchanged"?Y:Y+1,0),D=L(a.mcp),z=L(a.env),I=L(a.git);return c&&O.push("prompt"),f&&O.push("model"),D>0&&O.push("mcp"),z>0&&O.push("env"),I>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:c?1:0,model:f?1:0,mcp:D,env:z,git:I}}},[a,c,f]),h=x.useCallback(O=>{n(L=>L&&O(L))},[]),y=x.useCallback(O=>h(L=>({...L,promptAppend:O})),[h]),g=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(L=>({...L,model:O})),[h]),S=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>Bp("mcp",h),[h]),j=x.useMemo(()=>Bp("env",h),[h]),C=x.useMemo(()=>Bp("git",h),[h]),E=x.useCallback(()=>{n(null)},[]),A=x.useCallback(()=>{if(!t||!e)return{};const O={};c&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const L=m.counts.mcp>0,D=m.counts.env>0,z=m.counts.git>0;return L&&(O.mcpServers=t.mcp.filter(I=>I.status!=="deleted").map(I=>I.value)),D&&(O.env=t.env.filter(I=>I.status!=="deleted").map(I=>{const F=I.value;return F.sensitive&&F.value===rf?{key:F.key,value:rf,sensitive:!0}:F})),z&&(O.gitRepos=t.git.filter(I=>I.status!=="deleted").map(I=>I.value)),O},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:S,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:C.add,updateGit:C.update,deleteGit:C.remove,undoDeleteGit:C.undo,resetAll:E,buildPayloadPatch:A}}const Cn={overview:"ad-overview",setup:"ad-setup",prompt:Su("prompt"),tools:Su("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function Yq(e){const t=[{key:"overview",label:"Profile",anchor:Cn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:Cn.setup},{key:"prompt",label:"Prompt",anchor:Cn.prompt},{key:"tools",label:"Tools",anchor:Cn.tools},{key:"advanced",label:"Advanced",anchor:Cn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:Cn.danger,divider:!0,danger:!0}),t}function Xq(){var hn,dt,Tr,Mn,nc,Mi,Li,Ii,Ir,Ui,La,rc;const t=gk().uuid??"",n=wn(),a=_n(),l=He({queryKey:["agent",t],queryFn:()=>Kj(t),enabled:!!t}),o=He({queryKey:["agent-config",t],queryFn:()=>NU(t),enabled:!!t&&((hn=l.data)==null?void 0:hn.type)!=="human"}),c=He({queryKey:["agent-client-status",t],queryFn:()=>TU(t),enabled:!!t&&((dt=l.data)==null?void 0:dt.type)!=="human"}),f=He({queryKey:["agent-sessions-active",t],queryFn:()=>to(t,{state:"active"}),enabled:!!t&&((Tr=l.data)==null?void 0:Tr.type)!=="human"}),m=He({queryKey:["clients"],queryFn:Zs,enabled:!!t&&((Mn=l.data)==null?void 0:Mn.type)!=="human",refetchInterval:3e4}),h=Kq(o.data),[y,g]=x.useState(null),[b,S]=x.useState(null),[k,j]=x.useState(!1),C=gt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const ve=h.buildPayloadPatch();return _U(t,{expectedVersion:o.data.version,payload:ve})},onSuccess:ve=>{a.setQueryData(["agent-config",t],ve),g(null),S(null),j(!0)},onError:ve=>{if(j(!1),ve instanceof Vu&&ve.status===409){S("Someone else saved a newer version while you were editing."),g(null);return}g(ve instanceof Error?ve.message:String(ve))}});x.useEffect(()=>{if(!k)return;const ve=setTimeout(()=>j(!1),2500);return()=>clearTimeout(ve)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const E=x.useCallback(()=>{S(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),A=x.useCallback(ve=>{const Ye=document.getElementById(ve);Ye&&Ye.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=gt({mutationFn:ve=>V1(t,ve),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),L=gt({mutationFn:()=>PD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),D=gt({mutationFn:()=>BD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),z=gt({mutationFn:()=>UD(t),onSuccess:()=>n("/agents")}),I=gt({mutationFn:()=>$D(t)}),[F,Y]=x.useState(!1),[$,te]=x.useState(""),[J,be]=x.useState(null),[fe,ie]=x.useState(!1),Z=He({queryKey:["clients"],queryFn:Zs,enabled:F}),ae=gt({mutationFn:ve=>V1(t,{clientId:ve}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),Y(!1),te(""),be(null)},onError:ve=>be(ve instanceof Error?ve.message:String(ve))}),[K,he]=x.useState(!1),[T,P]=x.useState(null),B=gt({mutationFn:()=>AU(t,h.buildPayloadPatch()),onSuccess:ve=>{const Ye=ve.diff.length?ve.diff.map(mn=>`${mn.op} ${mn.path}`).join(`
|
|
392
|
+
`):"(no changes)";P(Ye)},onError:ve=>P(`Dry run failed: ${ve instanceof Error?ve.message:String(ve)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const ve=Ye=>{Ye.preventDefault(),Ye.returnValue=""};return window.addEventListener("beforeunload",ve),()=>window.removeEventListener("beforeunload",ve)},[h.summary.anyDirty]);const _=((nc=l.data)==null?void 0:nc.type)==="human",q=x.useMemo(()=>Yq(_),[_]),W=x.useRef(null),[ue,xe]=x.useState(!1);x.useEffect(()=>{if(_)return;const ve=W.current;if(!ve||typeof IntersectionObserver>"u")return;const Ye=new IntersectionObserver(mn=>{const ea=mn[0];ea&&xe(!ea.isIntersecting&&ea.boundingClientRect.top<0)},{threshold:0});return Ye.observe(ve),()=>Ye.disconnect()},[_]);const[Le,Se]=x.useState(Cn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const ve=[];for(const Ye of q){const mn=document.getElementById(Ye.anchor);if(!mn)continue;const ea=new IntersectionObserver(fo=>{for(const ac of fo)ac.isIntersecting&&Se(Ye.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});ea.observe(mn),ve.push(ea)}return()=>{for(const Ye of ve)Ye.disconnect()}},[q]);const Ct=x.useMemo(()=>{const ve=new Set;for(const Ye of h.summary.dirtySections)Ye==="prompt"&&ve.add(Cn.prompt),Ye==="model"&&ve.add(Cn.setup),Ye==="mcp"&&ve.add(Cn.tools),(Ye==="env"||Ye==="git")&&ve.add(Cn.advanced);return ve},[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 ne=l.data;if(!ne)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Te=ne.type==="human",Ue=c.data,Fe=((Mi=f.data)==null?void 0:Mi.length)??0,Ft=!Te&&!(Ue!=null&&Ue.clientId),cn=!Te&&Ue?!Ue.online&&!!Ue.clientId:!1,Oa=ne,_l=Oa.runtimeState??null,Da=Oa.runtimeType??null,Ma=Oa.totalSessions??null,Wr=ne.uuid.slice(0,8),oo=Zq({activeSessions:Fe,isUnclaimed:Ft,isOffline:cn}),uo=h.draft.mcp.filter(ve=>ve.status!=="deleted"),dn=h.draft.env.filter(ve=>ve.status!=="deleted"),co=h.draft.git.filter(ve=>ve.status!=="deleted"),le=ve=>new Set(uo.filter(Ye=>Ye.key!==ve).map(Ye=>Ye.value.name.toLowerCase())),ye=ve=>new Set(dn.filter(Ye=>Ye.key!==ve).map(Ye=>Ye.value.key)),Me=ve=>new Set(co.filter(Ye=>Ye.key!==ve).map(Ye=>{const{value:mn}=Ye;return mn.localPath?mn.localPath:((mn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Pe={sessions:Ma??"—",active:Fe,runtime:Da??(Te?"human":"—"),model:((Ii=(Li=o.data)==null?void 0:Li.payload.model)==null?void 0:Ii.trim())||"—"},at=(Ue==null?void 0:Ue.clientId)??null,fn=at?((Ir=m.data)==null?void 0:Ir.find(ve=>ve.id===at))??null:null,cr=at?(fn==null?void 0:fn.hostname)??at:null,en=ne.runtimeProvider??"claude-code",qt=en==="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(Xu,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),q.map(ve=>u.jsxs("div",{children:[ve.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(Jq,{label:ve.label,active:Le===ve.anchor,danger:ve.danger??!1,dirty:Ct.has(ve.anchor),onClick:()=>A(ve.anchor)})]},ve.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(RU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(zU,{onClick:()=>n("/agents"),children:"Agents"}),u.jsx(OU,{}),u.jsx(DU,{mono:!0,children:ne.name??Wr})]}),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(yl,{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_${Wr}`,children:ne.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",ne.name??Wr]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(xn,{tone:ne.type==="autonomous_agent"?"accent":"neutral",children:ne.type}),ne.visibility&&u.jsx(xn,{tone:ne.visibility==="organization"?"accent":"outline",children:ne.visibility}),(Ue==null?void 0:Ue.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",Ei(Ue.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Ks,{state:_l}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${ne.uuid}`),children:[u.jsx(oy,{className:"h-3 w-3"})," Open chat"]}),!Te&&ne.status==="active"&&u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>{I.reset(),I.mutate()},disabled:I.isPending,children:[u.jsx(zk,{className:"h-3 w-3"}),I.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(Rd,{label:"sessions",value:Pe.sessions}),u.jsx(Rd,{label:"active",value:Pe.active,accent:typeof Pe.active=="number"&&Pe.active>0?"var(--accent)":void 0}),u.jsx(Rd,{label:"runtime",value:Pe.runtime}),u.jsx(Rd,{label:"model",value:Pe.model})]})]}),u.jsx("div",{ref:W,"aria-hidden":!0,style:{height:0}}),!Te&&u.jsx(LU,{runtimeLabel:qt,computerLabel:cr,visible:ue}),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:[(I.data||I.error)&&u.jsx(a7,{result:I.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>I.reset()}),u.jsx(fu,{anchorId:Cn.overview,title:"Profile",right:u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${ne.uuid}`),title:"Manage platform bindings in Settings",children:[u.jsx(pg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(ZU,{agent:ne,onSave:async ve=>{await O.mutateAsync(ve)}})}),!Te&&u.jsxs(u.Fragment,{children:[u.jsxs(fu,{anchorId:Cn.setup,title:"Setup",caption:((Ui=o.data)==null?void 0:Ui.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(Fq,{runtimeProvider:en,computerLabel:cr,canBindComputer:Ft&&ne.status==="active",bindComputerPending:ae.isPending,onBindComputer:()=>Y(!0),onRebind:ne.clientId?()=>ie(!0):void 0,modelSlot:u.jsx(n9,{value:h.draft.model,baseline:((La=o.data)==null?void 0:La.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:ne.status!=="active",provider:en})})]}),u.jsx(fu,{anchorId:Cn.prompt,title:"Prompt",children:o.data?u.jsx(Tq,{value:h.draft.promptAppend,baseline:((rc=o.data)==null?void 0:rc.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:ne.status!=="active"}):null}),u.jsx(fu,{anchorId:Cn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(GU,{items:h.draft.mcp,otherNames:le,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:ne.status!=="active"}):null}),u.jsx(fu,{anchorId:Cn.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:Su("env"),children:u.jsx($U,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:ne.status!=="active"})}),u.jsx("div",{id:Su("git"),children:u.jsx(qU,{items:h.draft.git,otherPaths:Me,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:ne.status!=="active"})}),T&&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:T}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.jsx("button",{type:"button",onClick:()=>B.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:B.isPending,children:B.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),u.jsx(Bq,{}),u.jsx(IU,{agent:ne,suspendPending:L.isPending,reactivatePending:D.isPending,deletePending:z.isPending,onSuspend:()=>L.mutate(),onReactivate:()=>D.mutate(),onDelete:()=>z.mutate()})]}),!Te&&u.jsx(Pq,{summary:h.summary,saveHint:oo,conflictMessage:b,errorMessage:y,saving:C.isPending,justSaved:k,onSave:()=>C.mutate(),onDiscard:()=>{h.summary.anyDirty&&he(!0)},onReloadRemote:E,onJumpTo:ve=>A(Su(ve))})]}),u.jsx(Wq,{open:K,onOpenChange:he,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),S(null),he(!1)}}),u.jsx(Pt,{open:F,onOpenChange:ve=>{Y(ve),ve||(te(""),be(null),ae.reset())},children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{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."}),Z.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):u.jsx(e7,{clients:Z.data??[],selected:$,onSelect:te}),J&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:J})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),u.jsx(me,{disabled:!$||ae.isPending,onClick:()=>{be(null),ae.mutate($)},children:ae.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Oq,{open:fe,onOpenChange:ie,agent:ne})]})}function Jq({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:_e("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 Wq(e){return u.jsx(Pt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function e7({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:_e("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:_e("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 t7={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},n7={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},r7={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function a7({result:e,onDismiss:t}){const n=n7[e.status],a=r7[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(xn,{tone:a,children:t7[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(me,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function i7(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function l7({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=x.useState(!1),c=He({queryKey:["connect-token",e.uuid],queryFn:()=>Yk(),enabled:t,staleTime:6e4}),f=He({queryKey:["agent-poll",e.uuid],queryFn:()=>Kj(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((g=c.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${i7(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return u.jsx(Pt,{open:t,onOpenChange:b=>!b&&n(),children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),u.jsx(me,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?u.jsx(_a,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(sy,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[u.jsx(Kr,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),u.jsx(Wt,{children:u.jsx(me,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const $p=200;function s7(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 pw(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,js)}function o7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,js)}function u7(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 c7({open:e,onOpenChange:t,onCreated:n}){const a=_n(),[l,o]=x.useState(""),[c,f]=x.useState(""),[m,h]=x.useState(!1),[y,g]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[C,E]=x.useState(null),[A,O]=x.useState(!1),[L,D]=x.useState({}),[z,I]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),g("claude-code"),S("form"),j([]),E(null),O(!1),D({}),I({status:"idle"}))},[e]),x.useEffect(()=>{m||f(pw(l))},[l,m]);const F=x.useRef(0);x.useEffect(()=>{if(!e||!c){I({status:"idle"});return}if(!Ng.test(c)){I({status:"bad",reason:"invalid"});return}if(_g(c)){I({status:"bad",reason:"reserved"});return}const K=++F.current;I({status:"checking"});const he=window.setTimeout(()=>{LD(c).then(T=>{K===F.current&&(T.available?I({status:"ok"}):I({status:"bad",reason:T.reason}))}).catch(()=>{K===F.current&&I({status:"idle"})})},300);return()=>window.clearTimeout(he)},[c,e]);const Y=gt({mutationFn:async K=>{const he=l.trim()||c.trim()||"Untitled assistant";return MD({name:c||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId,runtimeProvider:y})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,y)}}),$=x.useMemo(()=>{const K=Y.error;if(!K)return{};if(K instanceof Vu){const he=s7(K.issues);return Object.keys(he).length>0?he:K.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:K.message}}return K instanceof Error?{_root:K.message}:{}},[Y.error]),te=z.status==="bad"?u7(z.reason):void 0,J={...te?{name:te}:{},...$,...L};function be(){const K={};return c?c.length>js?K.name=`Agent name must be at most ${js} characters (got ${c.length}).`:Ng.test(c)?_g(c)&&(K.name="That agent name is reserved — pick a different one."):K.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":l.trim().length>0&&(K.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),l.length>$p&&(K.displayName=`Display name must be at most ${$p} characters (got ${l.length}).`),K}async function fe(K){var T,P;K.preventDefault();const he=be();if(D(he),!(Object.keys(he).length>0)&&z.status!=="bad"){O(!0);try{const _=(await Zs()).filter(W=>W.status==="connected");if(_.length===0){Y.mutate({clientId:void 0});return}if(_.length===1){Y.mutate({clientId:(T=_[0])==null?void 0:T.id});return}const q=[..._].sort((W,ue)=>ue.lastSeenAt.localeCompare(W.lastSeenAt));j(q),E(((P=q[0])==null?void 0:P.id)??null),S("pick-computer")}catch{Y.mutate({clientId:void 0})}finally{O(!1)}}}function ie(){C&&Y.mutate({clientId:C})}const Z=z.status==="bad",ae=l.trim().length>0&&!Z&&!Y.isPending&&!A;return b==="pick-computer"?u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{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:l||c})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=C===K.id;return u.jsxs("label",{className:he?"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:he,onChange:()=>E(K.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),J.clientId&&u.jsx("p",{className:"text-body text-destructive",children:J.clientId}),J._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:J._root})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",onClick:()=>S("form"),disabled:Y.isPending,children:"Back"}),u.jsx(me,{onClick:ie,disabled:!C||Y.isPending,children:Y.isPending?"Creating…":"Create"})]})]})}):u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"New Agent"})}),u.jsxs("form",{onSubmit:fe,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(xt,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),L.displayName&&D(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:$p,"aria-invalid":J.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."}),J.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:J.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{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(xt,{id:"new-agent-name",value:c,onChange:K=>{const he=o7(K.target.value);f(he),h(!0),L.name&&D(T=>({...T,name:void 0}))},onBlur:K=>{const he=pw(K.target.value);he!==c&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:js,"aria-invalid":J.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"," ",js," characters. Permanent after creation."]}),c&&!J.name&&z.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:z.status==="ok"?"var(--state-idle)":z.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[z.status==="checking"&&"Checking availability…",z.status==="ok"&&"Available."]}),J.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:J.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:y==="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:y==="claude-code",onChange:()=>g("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:y==="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:y==="codex",onChange:()=>g("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."]})]})]})]})]}),J._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:J._root}),u.jsx(Wt,{children:u.jsx(me,{type:"submit",disabled:!ae,children:A?"Checking computers…":Y.isPending?"Creating…":"Create"})})]})]})})}function gu({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:_e("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 d7=Object.values(l6);function gw(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function f7(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function vs(e,t,n){var l;let a=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&a++;return a}function h7(){const e=wn(),{memberId:t}=ln(),[n,a]=x.useState(),[l,o]=x.useState(""),[c,f]=x.useState(!1),[m,h]=x.useState(null),[y,g]=x.useState("all"),[b,S]=x.useState(""),k=Cl(),j=yy(),C=Oy(),{data:E,isLoading:A,error:O}=He({queryKey:["agents",n,l],queryFn:()=>Yu({limit:100,cursor:n,type:l||void 0})}),{data:L}=He({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),D=x.useMemo(()=>{const K=new Map;for(const he of(L==null?void 0:L.agents)??[])K.set(he.agentId,he);return K},[L==null?void 0:L.agents]),{myAgents:z,teamAgents:I}=x.useMemo(()=>{if(!(E!=null&&E.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const T of E.items)t&&T.managerId===t?K.push(T):he.push(T);return{myAgents:gw(K),teamAgents:gw(he)}},[E,t]),F=(E==null?void 0:E.items.length)??0,Y=z.length,$=I.length,te=x.useMemo(()=>((E==null?void 0:E.items)??[]).filter(K=>{var he;return((he=D.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[E==null?void 0:E.items,D]),J=x.useMemo(()=>((E==null?void 0:E.items)??[]).filter(K=>{var T;const he=(T=D.get(K.uuid))==null?void 0:T.runtimeState;return he==="blocked"||he==="error"}).length,[E==null?void 0:E.items,D]);function be(K){var T;const he=(T=D.get(K.uuid))==null?void 0:T.runtimeState;return y==="mine"?t!=null&&K.managerId===t:y==="running"?he==="working":y==="attn"?he==="blocked"||he==="error":!0}function fe(K){if(!b.trim())return!0;const he=b.toLowerCase(),T=K.delegateMention?k(K.delegateMention):"",P=C(K.managerId);return(K.name??"").toLowerCase().includes(he)||K.displayName.toLowerCase().includes(he)||T.toLowerCase().includes(he)||P.toLowerCase().includes(he)}const ie=z.filter(K=>be(K)&&fe(K)),Z=I.filter(K=>be(K)&&fe(K));function ae(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"||he==="codex"){h(K);return}e(`/?a=${K.uuid}`)}return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Agents",subtitle:F>0?u.jsxs(u.Fragment,{children:[F," total · ",Y," mine · ",$," team"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>f(!0),children:[u.jsx(Aa,{className:"h-3 w-3"}),"New agent"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("div",{className:"relative",style:{width:240},children:[u.jsx(yf,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),u.jsx("input",{value:b,onChange:K=>S(K.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(gu,{active:y==="all",count:F,onClick:()=>g("all"),children:"all"}),u.jsx(gu,{active:y==="mine",count:Y,onClick:()=>g("mine"),children:"mine"}),u.jsx(gu,{active:y==="running",count:te,onClick:()=>g("running"),children:"running"}),u.jsx(gu,{active:y==="attn",count:J,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),u.jsx("div",{style:{flex:1}}),u.jsxs("select",{value:l,onChange:K=>{o(K.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[u.jsx("option",{value:"",children:"all types"}),d7.map(K=>u.jsx("option",{value:K,children:K},K))]})]}),A?u.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):O?u.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",O instanceof Error?O.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsx(yw,{title:`My agents · ${ie.length}`,agents:ie,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:C,navigate:e,showOwner:!1,emptyLabel:z.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:u.jsx(vw,{items:[{state:"working",count:vs(z,D,"working")},{state:"blocked",count:vs(z,D,"blocked")},{state:"error",count:vs(z,D,"error")}]}),className:"mb-4"}),I.length>0&&u.jsx(yw,{title:`Team agents · ${Z.length}`,agents:Z,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:C,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:u.jsx(vw,{items:[{state:"working",count:vs(I,D,"working")},{state:"blocked",count:vs(I,D,"blocked")},{state:"error",count:vs(I,D,"error")}]})})]}),(E==null?void 0:E.nextCursor)&&u.jsx("div",{className:"flex justify-end mt-4",children:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>a(E.nextCursor??void 0),children:"Next page"})})]}),u.jsx(c7,{open:c,onOpenChange:f,onCreated:ae}),m&&u.jsx(l7,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function yw({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:c,breakdown:f,className:m,showOwner:h}){return u.jsxs(an,{className:m,children:[u.jsx(Gs,{right:f,children:e}),t.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:c}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Agent name"}),u.jsx($e,{children:"Type"}),u.jsx($e,{children:"Delegate"}),h&&u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"Runtime"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Created"})]})}),u.jsx(xl,{children:t.map(y=>u.jsx(m7,{agent:y,runtime:f7(y,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},y.uuid))})]})]})}function vw({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:u.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>u.jsxs("span",{className:"inline-flex items-center",children:[a>0&&u.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),u.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[u.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function m7({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:c}=t,f=c==="idle"||c==="working"||c==="blocked"||c==="error"||c==="offline",m=e.delegateMention?n(e.delegateMention):null;return u.jsxs(sr,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"font-medium",children:e.displayName})}),u.jsx(Ie,{children:e.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ie,{children:u.jsx(xn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),u.jsx(Ie,{children:e.delegateMention?u.jsx(sE,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):u.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&u.jsx(Ie,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),u.jsx(Ie,{children:c&&f?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(Kr,{state:c,size:7}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:c})]}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ie,{children:u.jsx(xn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(e.createdAt)})]})}function p7(){const{data:e}=He({queryKey:["members","user-name-map"],queryFn:zy,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function g7(){const[e,t]=x.useState(null),[n,a]=x.useState(!1),l=gt({mutationFn:Yk,onSuccess:c=>{t(c),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return u.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[u.jsx(sz,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?u.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",u.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),u.jsxs(me,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?u.jsx(_a,{className:"h-3 w-3"}):u.jsx(sy,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),u.jsx(me,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function y7(){const e=_n(),t=Cl(),n=p7(),{role:a}=ln(),l=a==="admin",[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),{data:S}=He({queryKey:["clients"],queryFn:Zs,refetchInterval:1e4}),{data:k}=He({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),j=gt({mutationFn:u3,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),C=gt({mutationFn:o3,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:D=>{D instanceof Vu?b(D.message):b(D instanceof Error?D.message:String(D))}}),E=x.useMemo(()=>{const D=new Map;for(const z of(k==null?void 0:k.agents)??[]){if(!z.clientId)continue;const I=D.get(z.clientId)??[];I.push(z),D.set(z.clientId,I)}return D},[k==null?void 0:k.agents]),A=D=>E.get(D)??[],O=(S??[]).filter(D=>D.status==="connected").length,L=(S??[]).reduce((D,z)=>D+z.agentCount,0);return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Computers",subtitle:S&&S.length>0?u.jsxs(u.Fragment,{children:[S.length," total · ",O," connected · ",L," agents bound"]}):null}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(g7,{}),h&&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:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),A(h.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:A(h.id).map(D=>u.jsx("li",{className:"font-medium",children:t(D.agentId)},D.agentId))})]}),g&&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:g}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>C.mutate(h.id),disabled:C.isPending,children:C.isPending?"Retiring…":"Retire"})]})]})}),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:"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:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:A(f.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):A(f.id).map(D=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:t(D.agentId)}),u.jsx(Ks,{state:D.runtimeState})]},D.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!S||S.length===0?u.jsx(an,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):u.jsxs(an,{children:[u.jsxs(Gs,{right:u.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",S.length]}),u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{style:{width:16}}),u.jsx($e,{children:"Hostname"}),l&&u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"OS"}),u.jsx($e,{children:"SDK"}),u.jsx($e,{children:"Agents"}),u.jsx($e,{children:"Connected"}),u.jsx($e,{children:"Status"}),u.jsx($e,{})]})}),u.jsx(xl,{children:S.map(D=>{const z=o===D.id,I=A(D.id);return u.jsx(k7,{client:D,boundAgents:I,isExpanded:z,agentName:t,showOwner:l,ownerName:n,onToggle:()=>c(z?null:D.id),onDisconnect:()=>m(D),onRetire:()=>{b(null),y(D)}},D.id)})})]})]})]})]})}const v7={"claude-code":"Claude Code",codex:"Codex"},b7=[nf.CLAUDE_CODE,nf.CODEX],bw={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},x7={"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 S7({clientId:e,enabled:t}){const{data:n,isLoading:a}=He({queryKey:["client-capabilities",e],queryFn:()=>Kk(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Xu,{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:b7.map(o=>u.jsx(w7,{provider:o,entry:l?l[o]??null:null},o))})]})}function w7({provider:e,entry:t}){const n=v7[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",bw[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},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:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",x7[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",bw[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function k7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:c,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(sr,{interactive:!0,selected:n,onClick:c,children:[u.jsx(Ie,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Ak,{className:"h-3.5 w-3.5"}):u.jsx(jR,{className:"h-3.5 w-3.5"})})}),u.jsx(Ie,{className:"font-medium",children:e.hostname??"—"}),l&&u.jsx(Ie,{style:{color:"var(--fg-2)"},children:o(e.userId)}),u.jsx(Ie,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(Ie,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(Ie,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Ei(e.connectedAt):"—"}),u.jsx(Ie,{children:u.jsx(Ks,{state:y})}),u.jsx(Ie,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-1 justify-end",children:[u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[u.jsx(hz,{className:"h-3 w-3"})," Disconnect"]}),u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[u.jsx(Hs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(Ie,{}),u.jsxs(Ie,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(S7,{clientId:e.id,enabled:n}),u.jsxs(Xu,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):u.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(g.agentId)}),u.jsx(Ks,{state:g.runtimeState}),g.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}function j7(){const{token:e}=gk(),t=wn(),{isAuthenticated:n,adoptTokens:a}=ln(),[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 C=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!C.ok){f("This invitation is no longer valid");return}o(await C.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const C=await ke.get("/me/organizations"),E=await ke.get("/me"),A=C.find(O=>O.id===E.member.organizationId);g((A==null?void 0:A.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(xw,{message:"Bad invitation URL"});if(c)return u.jsx(xw,{message:"This invitation is no longer valid"});if(!l)return u.jsx(C7,{});const b=async()=>{h(!0);try{const C=await ke.post("/me/organizations/join",{token:e});await a(C.tokens),Wj("invite"),t("/",{replace:!0})}catch(C){f(C instanceof Error?C.message:"Failed to join team")}finally{h(!1)}},S=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=E7(l.expiresAt);return u.jsx(Wy,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsx(ao,{className:"text-center",children:u.jsxs(Ju,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(io,{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(uy,{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(me,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:S,children:[u.jsx(Tk,{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 Wy({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(ly,{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 C7(){return u.jsx(Wy,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{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(io,{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 xw({message:e}){return u.jsx(Wy,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(uy,{className:"h-6 w-6"})}),u.jsx(Ju,{className:"text-title",children:e})]}),u.jsxs(io,{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(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Zu,{to:"/",children:[u.jsx(ly,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function E7(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 N7(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=LC(l);return o===bS&&l!==bS?null:o}function _7(){const{isAuthenticated:e}=ln(),t=Dn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=N7(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(mf,{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(ly,{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(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(yl,{width:28,height:32})}),u.jsxs(Ju,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Tk,{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(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(vz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function A7(){const e=wn(),{adoptTokens:t}=ln(),[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=LC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Wj(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…"})}function T7(){return ke.get("/admin/adapter-mappings")}function R7(e){return ke.post("/admin/adapter-mappings",e)}function z7(e){return ke.delete(`/admin/adapter-mappings/${e}`)}function O7(){return ke.get("/admin/adapters/status")}function D7(){return ke.get("/admin/adapters")}function M7(e){return ke.post("/admin/adapters",e)}function L7(e,t){return ke.patch(`/admin/adapters/${e}`,t)}function I7(e){return ke.delete(`/admin/adapters/${e}`)}const U7=Object.values(r6),Sw={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function ww(e){const[t,n]=x.useState(Sw),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...Sw,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=P7(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(Pt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{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:U7.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(nt,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(xt,{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(nt,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(xt,{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(nt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{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(nt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{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(nt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{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(nt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{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(nt,{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(nt,{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(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function P7(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 B7(){var _;const e=wn(),t=_n(),[n,a]=gf(),l=n.get("agent"),o=Cl(),c=He({queryKey:["adapters"],queryFn:D7}),f=He({queryKey:["adapter-mappings"],queryFn:T7}),m=He({queryKey:["adapter-statuses"],queryFn:O7,refetchInterval:15e3}),y=((_=He({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}).data)==null?void 0:_.items)??[],g=x.useMemo(()=>{const q=new Map;for(const W of m.data??[])q.set(W.configId,W);return q},[m.data]),b=x.useMemo(()=>{const q=c.data??[];return l?q.filter(W=>W.agentId===l):q},[c.data,l]),S=x.useMemo(()=>{const q=f.data??[];return l?q.filter(W=>W.agentId===l):q},[f.data,l]),k=b.reduce((q,W)=>{var ue;return q+((ue=g.get(W.id))!=null&&ue.connected?1:0)},0),j=b.length-k,C=c.isLoading||f.isLoading,[E,A]=x.useState(null),[O,L]=x.useState(""),[D,z]=x.useState(null),[I,F]=x.useState(null),[Y,$]=x.useState(null),[te,J]=x.useState(null),be=gt({mutationFn:q=>M7({platform:q.platform,agentId:q.agentId,credentials:q.credentials,status:q.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),fe=gt({mutationFn:q=>{const W={status:q.status};return q.credentials&&(W.credentials=q.credentials),L7(q.id,W)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),ie=gt({mutationFn:I7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=gt({mutationFn:q=>R7({platform:q.platform,externalUserId:q.externalUserId,agentId:q.agentId,boundVia:"manual",displayName:q.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),F(null)}}),ae=gt({mutationFn:z7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function K(q){if(l){q==="bot"?z({agentId:l,editingId:null}):F({agentId:l});return}L(""),A({kind:q})}function he(){!E||!O||(E.kind==="bot"?z({agentId:O,editingId:null}):F({agentId:O}),A(null))}function T(q){if(D){if(q.kind==="bot-create")be.mutate({agentId:D.agentId,platform:q.draft.platform,status:q.draft.status,credentials:q.draft.credentials});else if(q.kind==="bot-update"){if(!D.editingId)return;fe.mutate({id:D.editingId,status:q.status,credentials:q.credentials})}}}function P(q){!I||q.kind!=="user-create"||Z.mutate({agentId:I.agentId,platform:q.draft.platform,externalUserId:q.draft.externalUserId,displayName:q.draft.displayName})}const B=l?y.find(q=>q.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:[(B==null?void 0:B.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const q=new URLSearchParams(n);q.delete("agent"),a(q,{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(Eu,{className:"h-3 w-3"})})]})]}),u.jsxs(an,{className:"mb-3.5",children:[u.jsxs(Gs,{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(Kr,{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(Kr,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>K("bot"),children:[u.jsx(Aa,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),C?u.jsx(Ld,{children:"Loading…"}):b.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Agent"}),u.jsx($e,{children:"Platform"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Connection"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:96,textAlign:"right"}})]})}),u.jsx(xl,{children:b.map(q=>{var ue;const W=((ue=g.get(q.id))==null?void 0:ue.connected)??!1;return u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono font-medium",children:o(q.agentId)})}),u.jsx(Ie,{children:u.jsx(xn,{children:q.platform})}),u.jsx(Ie,{children:u.jsx(xn,{tone:q.status==="active"?"accent":"outline",children:q.status})}),u.jsx(Ie,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(Kr,{state:W?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:W?"Online":"Offline"})]})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(q.createdAt)}),u.jsxs(Ie,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[u.jsx(me,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>z({agentId:q.agentId,editingId:q.id,initialPlatform:$7(q.platform),initialStatus:F7(q.status)}),children:"Edit"}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>$(q.id),disabled:ie.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})]},q.id)})})]}):u.jsx(Ld,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(an,{children:[u.jsxs(Gs,{right:u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>K("user"),children:[u.jsx(Aa,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",S.length]}),C?u.jsx(Ld,{children:"Loading…"}):S.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Agent"}),u.jsx($e,{children:"Platform"}),u.jsx($e,{children:"External user ID"}),u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Bound via"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:32}})]})}),u.jsx(xl,{children:S.map(q=>u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(q.agentId)})}),u.jsx(Ie,{children:u.jsx(xn,{children:q.platform})}),u.jsx(Ie,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:q.externalUserId})}),u.jsx(Ie,{style:{color:"var(--fg-2)"},children:q.displayName??"—"}),u.jsx(Ie,{children:u.jsx(xn,{tone:"outline",children:q.boundVia??"—"})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(q.createdAt)}),u.jsx(Ie,{onClick:W=>W.stopPropagation(),children:u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>J(q.id),disabled:ae.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})})]},q.id))})]}):u.jsx(Ld,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(q7,{open:E!=null,kind:(E==null?void 0:E.kind)??"bot",agents:y,agentId:O,onAgentChange:L,onCancel:()=>A(null),onConfirm:he}),u.jsx(ww,{open:D!=null,kind:"bot",editingId:(D==null?void 0:D.editingId)??null,initialPlatform:D==null?void 0:D.initialPlatform,initialStatus:D==null?void 0:D.initialStatus,agentLabel:D?o(D.agentId):"",pending:be.isPending||fe.isPending,errorMessage:(be.error??fe.error)instanceof Error?(be.error??fe.error).message:null,onOpenChange:q=>{q||(z(null),be.reset(),fe.reset())},onSubmit:T}),u.jsx(ww,{open:I!=null,kind:"user",editingId:null,agentLabel:I?o(I.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:q=>{q||(F(null),Z.reset())},onSubmit:P}),u.jsx(kw,{open:Y!=null,onOpenChange:q=>!q&&$(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:ie.isPending,onConfirm:()=>{Y!=null&&(ie.mutate(Y),$(null))}}),u.jsx(kw,{open:te!=null,onOpenChange:q=>!q&&J(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:ae.isPending,onConfirm:()=>{te!=null&&(ae.mutate(te),J(null))}})]})}function $7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function F7(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 q7(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(Pt,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{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(Wt,{children:[u.jsx(me,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(me,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function kw(e){return u.jsx(Pt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function H7(){const{organizationId:e,adoptTokens:t,logout:n}=ln(),[a,l]=x.useState([]),[o,c]=x.useState(!1),[f,m]=x.useState(!1),[h,y]=x.useState(null);x.useEffect(()=>{(async()=>{try{const k=await ke.get("/me/organizations");l(k)}catch{}})()},[]);const g=a.find(k=>k.id===e),b=(g==null?void 0:g.displayName)??"this team",S=async()=>{m(!0),y(null);try{await wU();const j=(await ke.get("/me/organizations").catch(()=>[])).find(C=>C.id!==e);if(j){const C=await ke.post("/auth/switch-org",{organizationId:j.id});await t(C)}else n()}catch(k){y(k instanceof Error?k.message:"Failed to leave team"),m(!1)}};return u.jsxs(u.Fragment,{children:[u.jsxs(an,{children:[u.jsx(_r,{children:u.jsx(Ar,{children:"Membership"})}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-4) var(--sp-4)"},children:[u.jsxs("div",{className:"text-body",style:{color:"var(--fg)"},children:["You're a member of ",u.jsx("span",{className:"font-medium",children:b}),"."]}),u.jsx("div",{className:"text-label text-muted-foreground",style:{marginTop:4},children:"Leaving removes your access immediately. Your agents stay in the team for history; you can re-join later if an admin shares an invite link."}),u.jsx("div",{style:{marginTop:"var(--sp-3)"},children:u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>c(!0),disabled:f,children:f?"Leaving…":"Leave team"})}),h&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h})]})]}),u.jsx(Pt,{open:o,onOpenChange:k=>!f&&c(k),children:u.jsxs(Rt,{children:[u.jsxs(Vt,{children:[u.jsxs(Bt,{children:["Leave ",b,"?"]}),u.jsx(wf,{children:"You'll lose access to this team's agents and chats. Your historical messages stay, but you won't be able to read or send new ones until an admin re-invites you."})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:f,children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>void S(),disabled:f,children:f?"Leaving…":"Leave team"})]})]})})]})}const jw=[{key:"bindings",label:"Bindings"},{key:"membership",label:"Membership"}];function Z7(){const e=Dn(),t=wn(),n=e.hash.replace("#",""),a=jw.some(o=>o.key===n)?n:"bindings",l=o=>{t({hash:o},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Settings",subtitle:"Per-member controls"}),u.jsx(nE,{children:jw.map(o=>u.jsx(rE,{active:a===o.key,onClick:()=>l(o.key),children:o.label},o.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[a==="bindings"&&u.jsx(B7,{}),a==="membership"&&u.jsx(H7,{})]})]})}const V7="first-tree-hub-images",Q7=1,Xs="images";let Id=null;function pN(){return Id||(Id=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(V7,Q7);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Xs)||n.createObjectStore(Xs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Id)}async function G7(e){const t=await pN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Xs,"readwrite"),o=l.objectStore(Xs),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 K7(e){const t=await pN();return t?new Promise(n=>{const o=t.transaction(Xs,"readonly").objectStore(Xs).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 Y7(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 X7(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 J7(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 W7({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:Y7(e,t),[e,t,l]),y=x.useMemo(()=>h?X7(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,S=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(E){if(!h)return;const A=J7(e,h,t,E);A&&a(A)}return{trigger:S?h:null,results:S?y:[],highlightIndex:o,handleKey:E=>{if(!S||!h)return!1;if(E.key==="ArrowDown")return E.preventDefault(),c(A=>y.length===0?0:(A+1)%y.length),!0;if(E.key==="ArrowUp")return E.preventDefault(),c(A=>y.length===0?0:(A-1+y.length)%y.length),!0;if(E.key==="Enter"||E.key==="Tab"){const A=y[o]??y[0];return A?(E.preventDefault(),j(A),!0):!1}return E.key==="Escape"?(E.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function eH({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:_e("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,right:0,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return u.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:y=>{y.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--accent-dim)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function gN(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function tH(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=Cw(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=Cw(l.payload);return o?a.get(o)===l.seq:!0})}function Cw(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function If(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 yN(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function nH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Ew(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function rH({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 aH({agentId:e,chatId:t,session:n}){const a=_n(),[,l]=gf(),[o,c]=x.useState(!1),[f,m]=x.useState(null),h=Xk(e,t),y=Yd(e),g=C=>{a.setQueryData(h,E=>E&&{...E,state:C}),a.setQueryData(y,E=>E&&E.map(A=>A.chatId===t?{...A,state:C}:A))},b=gt({mutationFn:()=>m3(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const C=a.getQueryData(h),E=a.getQueryData(y);return g("suspended"),{previousSession:C,previousList:E}},onError:(C,E,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList)},onSuccess:C=>{g(C.state)}}),S=gt({mutationFn:()=>p3(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const C=a.getQueryData(h),E=a.getQueryData(y);return a.setQueryData(y,A=>A&&A.filter(O=>O.chatId!==t)),{previousSession:C,previousList:E}},onError:(C,E,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList),m(C instanceof Error?C.message:"Terminate failed")},onSuccess:(C,E,A)=>{if(C.state!=="evicted"){A!=null&&A.previousList&&a.setQueryData(y,A.previousList),g(C.state),m(`Session is ${C.state}; terminate only applies to suspended sessions.`);return}m(null),c(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&u.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:C=>C.currentTarget.style.background="var(--bg-hover)",onMouseLeave:C=>C.currentTarget.style.background="transparent",children:[u.jsx(ZR,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&u.jsxs("button",{type:"button",onClick:()=>{m(null),c(!0)},disabled:S.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:C=>C.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:C=>C.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[u.jsx(rz,{className:"h-3 w-3"})," Terminate"]})]}),u.jsx(iH,{open:o,onOpenChange:C=>{S.isPending||c(C),C||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function iH(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:c,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return u.jsx(Pt,{open:t,onOpenChange:n,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Terminate session?"})}),u.jsxs("form",{onSubmit:m,className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),u.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[u.jsxs("span",{children:["chat: ",u.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&u.jsxs("span",{children:["last activity: ",yN(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&u.jsxs("span",{children:["messages: ",a.messageCount]})]}),c&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:c}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function lH({event:e}){const t=c3(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?Ew(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:["(",Ew(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:["· ",nH(t.durationMs)]}):null]})]})}function sH({event:e,agentNameFn:t,agentId:n}){const a=f3(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(vN,{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:If(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 oH({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:If(e.createdAt)})]})}function uH({event:e}){const t=d3(e.payload),n=If(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 vN({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(yl,{width:9,height:10,style:{color:"var(--accent)"}})})}function cH({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(vN,{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:If(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(rH,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&dH(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"&&fH(e.content)?u.jsx(hH,{content:e.content}):e.format==="text"?u.jsx(hN,{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 dH(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 fH(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 hH({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return K7(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 mH({agentId:e,chatId:t}){var Ct;const n=_n(),a=Cl(),l=yy(),{agentId:o}=ln(),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),C=x.useRef(null),E=x.useRef(null),A=x.useRef(null),O=x.useRef(!1);x.useEffect(()=>{O.current=!1},[t]);const{data:L}=He({queryKey:["chat-messages",t],queryFn:()=>tM(t,{limit:50}),refetchInterval:5e3}),{data:D}=He({queryKey:["session-events",e,t],queryFn:()=>h3(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:z}=He({queryKey:Xk(e,t),queryFn:()=>to(e).then(ne=>ne.find(Te=>Te.chatId===t)??null),refetchInterval:5e3}),{data:I}=He({queryKey:["chat-detail",t],queryFn:()=>XD(t),enabled:!!t}),F=gt({mutationFn:ne=>G1(t,ne),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Yd(e)})}}),Y=x.useCallback(ne=>{const Ue=ne.filter(cn=>cn.type.startsWith("image/"));if(Ue.length===0)return;const Fe=Ue.find(cn=>cn.size>5242880);if(Fe){j(`Image too large (${(Fe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Ft=Ue.map(cn=>({id:crypto.randomUUID(),file:cn,previewUrl:URL.createObjectURL(cn)}));g(cn=>[...cn,...Ft]),j(null)},[]),$=x.useCallback(ne=>{g(Te=>{const Ue=Te.find(Fe=>Fe.id===ne);return Ue&&URL.revokeObjectURL(Ue.previewUrl),Te.filter(Fe=>Fe.id!==ne)})},[]),te=async()=>{const ne=c.trim(),Te=y;if(!(!ne&&Te.length===0)&&!b&&!(q&&W.length===0)){if(Te.length>0){S(!0),j(null);try{for(const Ue of Te){const Fe=await eM(Ue.file),Ft=crypto.randomUUID();await G7({imageId:Ft,base64:Fe,mimeType:Ue.file.type}),await WD(t,{data:Fe,mimeType:Ue.file.type,filename:Ue.file.name,size:Ue.file.size,imageId:Ft}),URL.revokeObjectURL(Ue.previewUrl)}g([]),ne&&await G1(t,ne),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Yd(e)})}catch(Ue){j(Ue instanceof Error?Ue.message:"Failed to send image")}finally{S(!1)}return}F.mutate(ne)}},[J,be]=x.useState(!1),[fe,ie]=x.useState(""),Z=x.useRef(null);x.useEffect(()=>{var ne;J&&((ne=Z.current)==null||ne.focus())},[J]);const ae=gt({mutationFn:ne=>JD(t,ne),onSuccess:()=>{be(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),K=()=>{const ne=fe.trim();ae.mutate(ne.length>0?ne:null)},he=x.useMemo(()=>{const ne=(L==null?void 0:L.items)??[],Te=tH((D==null?void 0:D.items)??[]),Ue=[...ne.map(Fe=>({kind:"message",at:Fe.createdAt,key:`m-${Fe.id}`,data:Fe})),...Te.map(Fe=>({kind:"event",at:Fe.createdAt,key:`e-${Fe.id}`,data:Fe}))];return Ue.sort((Fe,Ft)=>Fe.at.localeCompare(Ft.at)),Ue},[L,D]),T=he.length;x.useEffect(()=>{var ne;T>0&&((ne=A.current)==null||ne.scrollIntoView({behavior:"smooth"}))},[T]);const P=I!=null&&I.participants?I.participants.map(ne=>{const Te=a(ne.agentId);return`@${Te.length>20?`${Te.slice(0,17)}…`:Te}`}).join(" "):`@${a(e)}`,B=a(e),_=x.useMemo(()=>{var Ue;const ne=((Ue=I==null?void 0:I.participants)==null?void 0:Ue.map(Fe=>Fe.agentId))??[e],Te=[];for(const Fe of ne){if(Fe===o)continue;const Ft=l(Fe);!Ft||!Ft.name||Te.push({agentId:Fe,name:Ft.name,displayName:Ft.displayName})}return Te},[I==null?void 0:I.participants,e,l,o]),q=x.useMemo(()=>{if(!I)return!1;if(I.type==="group")return!0;const ne=I.participants.some(Te=>Te.agentId===o);return I.type==="direct"&&!ne&&I.participants.length>=2},[I,o]),W=x.useMemo(()=>{if(!q)return[];const ne=_.map(Te=>({agentId:Te.agentId,name:Te.name}));return t6(c,ne)},[c,_,q]),ue=W7({value:c,cursor:m,candidates:_,disabled:F.isPending||b,onSelect:ne=>{f(ne.text),h(ne.cursor),requestAnimationFrame(()=>{const Te=E.current;Te&&(Te.focus(),Te.setSelectionRange(ne.cursor,ne.cursor))})}}),xe=(z==null?void 0:z.runtimeState)??"idle",Le=gN((z==null?void 0:z.runtimeState)??null,e?"connected":null),Se=(z==null?void 0:z.messageCount)??((Ct=L==null?void 0:L.items)==null?void 0:Ct.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(Kr,{state:Le,size:8}),J?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:Z,value:fe,onChange:ne=>ie(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"?(ne.preventDefault(),K()):ne.key==="Escape"&&(ne.preventDefault(),be(!1))},disabled:ae.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),u.jsx("button",{type:"button",onClick:K,disabled:ae.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(_a,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>be(!1),disabled:ae.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(Eu,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(I==null?void 0:I.topic)||(z==null?void 0:z.summary)||`Chat · ${t.slice(0,8)}`}),u.jsx("button",{type:"button",onClick:()=>{ie((I==null?void 0:I.topic)??""),be(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:ne=>ne.currentTarget.style.color="var(--fg-2)",onMouseLeave:ne=>ne.currentTarget.style.color="var(--fg-4)",children:u.jsx(Qu,{className:"h-3 w-3"})})]}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),u.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:P}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",yN((z==null?void 0:z.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Se," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:Le==="error"?"var(--state-error)":"var(--fg-2)"},children:xe})]})]})]}),u.jsx(aH,{agentId:e,chatId:t,session:z??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[T===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(oy,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:he.map(ne=>{if(ne.kind==="event"){const Te=ne.data;switch(Te.kind){case"tool_call":return u.jsx(lH,{event:Te},ne.key);case"assistant_text":return u.jsx(sH,{event:Te,agentId:e,agentNameFn:a},ne.key);case"thinking":return u.jsx(oH,{event:Te},ne.key);case"error":return u.jsx(uH,{event:Te},ne.key);default:return null}}return u.jsx(cH,{msg:ne.data,myAgentId:o,agentNameFn:a},ne.key)})}),u.jsx("div",{ref:A})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ne=>ne.preventDefault(),onDrop:ne=>{ne.preventDefault(),Y(Array.from(ne.dataTransfer.files))},children:[y.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:y.map(ne=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:ne.previewUrl,alt:ne.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>$(ne.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(Eu,{className:"h-2 w-2"})})]},ne.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(eH,{trigger:ue.trigger,results:ue.results,highlightIndex:ue.highlightIndex,anchorRef:E,onPick:ue.pick}),u.jsx("textarea",{ref:E,value:c,onChange:ne=>{f(ne.target.value),h(ne.target.selectionStart??ne.target.value.length)},onSelect:ne=>{h(ne.currentTarget.selectionStart??c.length)},onFocus:()=>{q&&(O.current||c.length>0||_.length===0||(O.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ne=E.current;ne&&ne.setSelectionRange(1,1)})))},onPaste:ne=>{const Te=Array.from(ne.clipboardData.files);Te.length>0&&(ne.preventDefault(),Y(Te))},placeholder:q?"Type @ to pick a recipient, then your message":`Message @${B} · / for commands · @ to mention`,rows:2,onKeyDown:ne=>{ue.handleKey(ne)||ne.key==="Enter"&&!ne.shiftKey&&(ne.preventDefault(),te())},disabled:F.isPending||b,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:8},children:[u.jsx("button",{type:"button",onClick:()=>{var ne;return(ne=C.current)==null?void 0:ne.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(qR,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:C,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ne=>{ne.target.files&&(Y(Array.from(ne.target.files)),ne.target.value="")}}),u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:te,disabled:F.isPending||b||!c.trim()&&y.length===0||q&&W.length===0,title:q&&W.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:_e("inline-flex items-center transition-colors text-label font-semibold",(F.isPending||b||!c.trim()&&y.length===0||q&&W.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[u.jsx(XR,{className:"h-3 w-3"})," Send"]})]})]})]}),(F.isError||k)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(F.error instanceof Error?F.error.message:"Failed to send")})]})]})}function pH(){const{step:e,openModal:t}=vy();if(e!==null&&e!=="completed"){const a=e==="connect"?"Connect your computer to create your first agent.":e==="create_agent"?"Create your first agent to start collaborating.":"Finish setup to start collaborating.";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(yl,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"No agents yet"}),u.jsx("div",{className:"text-body text-muted-foreground mb-4",children:a}),u.jsx(me,{onClick:t,children:"Resume setup"})]})})}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(yl,{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."})]})})}function gH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(mH,{agentId:e,chatId:t}):u.jsx(pH,{})}function bN(){const{data:e}=He({queryKey:["clients"],queryFn:Zs,staleTime:1e4,refetchInterval:1e4});return x.useMemo(()=>{const t=e??[],n=new Map;for(const a of t)n.set(a.id,a);return{resolve:a=>a?n.get(a)??null:null,clients:t,connectedClients:t.filter(a=>a.status==="connected")}},[e])}function $g({children:e}){return u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function xN({children:e}){return u.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Qr({label:e,children:t}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function Nw(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function _w(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<24?`${a}h ${n%60}m`:`${Math.floor(a/24)}d ${a%24}h`}function Fp({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[u.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function yH({notifications:e,agentId:t}){const[,n]=gf(),a=_n(),l=gt({mutationFn:o=>Yj(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>u.jsx(Xj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function SN({agentId:e}){var h;const t=Cl(),{resolve:n}=bN(),{data:a}=He({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:c}=He({queryKey:["notifications","agent",e],queryFn:()=>wg({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(yl,{width:14,height:16,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),u.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),u.jsx(Ks,{state:m})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(Fp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(Fp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(Fp,{label:"uptime",value:_w((o==null?void 0:o.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx($g,{children:"Computer · runtime"}),u.jsxs(xN,{children:[u.jsx(Qr,{label:"host",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),u.jsx(Qr,{label:"os",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),u.jsx(Qr,{label:"runtime",children:u.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),u.jsx(Qr,{label:"sdk",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),u.jsx(Qr,{label:"connected",children:u.jsx("span",{className:"mono text-label",children:_w((o==null?void 0:o.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),u.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[u.jsx($g,{children:"Notifications"}),!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):u.jsx(yH,{notifications:c.items,agentId:e})]})]})}function vH({agentId:e,chatId:t}){const{data:n}=He({queryKey:["session",e,t],queryFn:()=>to(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx($g,{children:"Session"}),u.jsxs(xN,{children:[u.jsx(Qr,{label:"state",children:u.jsx(Ks,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),u.jsx(Qr,{label:"chat",children:u.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),u.jsx(Qr,{label:"started",children:Nw((n==null?void 0:n.startedAt)??null)}),u.jsx(Qr,{label:"last",children:Nw((n==null?void 0:n.lastActivityAt)??null)}),u.jsx(Qr,{label:"messages",children:u.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),u.jsx(SN,{agentId:e})]})}function bH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(vH,{agentId:e,chatId:t}):e?u.jsx(SN,{agentId:e}):null}const xH=32;function SH({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return u.jsx("div",{className:_e("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:xH}).map((l,o)=>{const c=e[o]??{workingCount:0,errorMask:!1},f=c.workingCount===0?.08:c.workingCount/a,m=.25+f*.7,h=c.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const wH={error:0,blocked:1,working:2,idle:3};function kH(e,t){return t?e?wH[e]??4:4:5}function jH(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function CH({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=Cl(),{resolve:o}=bN(),c=lU(),[f,m]=x.useState(""),[h,y]=x.useState("all"),{data:g}=He({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),{data:b}=He({queryKey:e?Yd(e):["agent-sessions",null],queryFn:()=>e?to(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),S=gt({mutationFn:D=>tC(D),onSuccess:(D,z)=>{a(z,D.id)}}),{humans:k,agents:j,totalAll:C}=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[],z=f.trim().toLowerCase(),I=D.filter(te=>{var fe;if(!jH(te,h))return!1;if(!z)return!0;const J=l(te.agentId).toLowerCase(),be=te.clientId?(((fe=o(te.clientId))==null?void 0:fe.hostname)??"").toLowerCase():"";return J.includes(z)||be.includes(z)||te.agentId.toLowerCase().includes(z)}),F=te=>kH(te.runtimeState,te.clientId),Y=[],$=[];for(const te of I)(te.type==="human"?Y:$).push(te);return Y.sort((te,J)=>F(te)-F(J)),$.sort((te,J)=>F(te)-F(J)),{humans:Y,agents:$,totalAll:D.length}},[g,f,h,l,o]),E=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[];return{working:D.filter(z=>z.runtimeState==="working").length,blocked:D.filter(z=>z.runtimeState==="blocked").length,error:D.filter(z=>z.runtimeState==="error").length}},[g]),A=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:E.working},{value:"attn",label:"attn",count:E.blocked+E.error,warn:E.blocked+E.error>0}],O=D=>{var te;const z=e===D.agentId,I=gN(D.runtimeState,D.clientId),F=D.clientId?((te=o(D.clientId))==null?void 0:te.hostname)??D.clientId.slice(0,8):null,Y=D.activeSessions??0,$=D.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>n(z?null:D.agentId),className:_e("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:z?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${z?"var(--accent)":"transparent"}`},children:[u.jsx(Kr,{state:I,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(D.agentId)}),D.type==="human"&&u.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),u.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:I==="offline"?"disconnected":F||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:$>0&&u.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[Y,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",$]})]})})]}),z&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),b==null?void 0:b.filter(J=>J.state!=="evicted").map(J=>{const be=J.state==="active"?"working":"idle";return u.jsxs("button",{type:"button",onClick:()=>a(D.agentId,J.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===J.chatId?"var(--bg-hover)":"transparent",color:J.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:fe=>{t!==J.chatId&&(fe.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:fe=>{t!==J.chatId&&(fe.currentTarget.style.background="transparent")},children:[u.jsx(Kr,{state:be,size:6}),u.jsx("span",{className:"truncate text-body",style:{color:J.topic||J.summary?"var(--fg-2)":"var(--fg-4)"},children:J.topic||J.summary||`Chat · ${J.chatId.slice(0,8)}`})]},J.chatId)}),u.jsxs("button",{type:"button",onClick:()=>S.mutate(D.agentId),disabled:S.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:J=>{J.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:J=>{J.currentTarget.style.background="transparent"},children:[u.jsx(Aa,{className:"h-3 w-3"}),"New chat"]})]})]},D.agentId)},L=k.length+j.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[C," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(yf,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:f,onChange:D=>m(D.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:A.map(D=>u.jsx(gu,{active:h===D.value,count:D.count,warn:D.warn,onClick:()=>y(D.value),children:D.label},D.value))})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[u.jsx(EH,{}),"5m"]}),u.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:c.stale?"stale":"live"})]}),u.jsx(SH,{aggregated:c.aggregated,stale:c.stale}),u.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[E.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[E.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[E.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[L===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:f||h!=="all"?"No matches":"No agents"}),j.length>0&&u.jsxs("div",{children:[u.jsx(Aw,{label:"Agents",count:j.length}),j.map(O)]}),k.length>0&&u.jsxs("div",{children:[u.jsx(Aw,{label:"Humans",count:k.length}),k.map(O)]})]})]})}function Aw({label:e,count:t}){return u.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function EH(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function NH(){const[e,t]=gf(),n=e.get("a"),a=e.get("c");eE();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:c}=He({queryKey:["agent-sessions",n],queryFn:()=>n?to(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!c||c.length===0)return;const f=[...c].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,c,t]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(CH,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(gH,{selectedAgentId:n,selectedChatId:a})}),n&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(bH,{selectedAgentId:n,selectedChatId:a})})]})}const _H=new gA({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function AH(){return u.jsx(yA,{client:_H,children:u.jsx(aR,{children:u.jsx(VT,{children:u.jsxs(ST,{children:[u.jsx(rr,{path:"/login",element:u.jsx(_7,{})}),u.jsx(rr,{path:"/signup",element:u.jsx(mf,{to:"/login",replace:!0})}),u.jsx(rr,{path:"/auth/github/complete",element:u.jsx(A7,{})}),u.jsx(rr,{path:"/invite/:token",element:u.jsx(j7,{})}),u.jsx(rr,{element:u.jsx(cR,{}),children:u.jsxs(rr,{element:u.jsx(iU,{children:u.jsx(KD,{children:u.jsx(gM,{})})}),children:[u.jsx(rr,{index:!0,element:u.jsx(NH,{})}),u.jsx(rr,{path:"agents",element:u.jsx(h7,{})}),u.jsx(rr,{path:"agents/:uuid",element:u.jsx(Xq,{})}),u.jsx(rr,{path:"clients",element:u.jsx(y7,{})}),u.jsx(rr,{path:"settings",element:u.jsx(Z7,{})}),u.jsx(rr,{path:"admin",element:u.jsx(EU,{})})]})})]})})})})}const wN=document.getElementById("root");if(!wN)throw new Error("Root element not found");H2.createRoot(wN).render(u.jsx(x.StrictMode,{children:u.jsx(AH,{})}));export{yl as F,Zu as L,rt as c,u as j,x as r};
|